/* Definima Home — front styles */
.def-home { display: block; }
.def-home-section { margin: 2.5rem 0; clear: both; }
.def-home-section::after { content: ''; display: table; clear: both; }
.def-home-section__header { text-align: center; margin-bottom: 1.5rem; }
.def-home-section__title { font-size: 1.6rem; margin: 0 0 .25rem; }
.def-home-section__subtitle { color: #666; margin: 0; }
.def-home-section__more { text-align: center; margin-top: 1.5rem; }

/* Categories — N par ligne, paramétrable */
.def-home-cats {
    display: grid;
    grid-template-columns: repeat(var(--def-home-cats-cols, 2), 1fr);
    gap: 1.25rem;
}
@media (max-width: 1200px) {
    .def-home-cats { grid-template-columns: repeat(min(var(--def-home-cats-cols, 2), 3), 1fr); }
}
@media (max-width: 768px) {
    .def-home-cats { grid-template-columns: repeat(min(var(--def-home-cats-cols, 2), 2), 1fr); }
}
@media (max-width: 600px) {
    .def-home-cats { grid-template-columns: 1fr; }
}
.def-home-cat { position: relative; display: flex; flex-direction: column; gap: .75rem; }
.def-home-cat__media {
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 4px;
}
.def-home-cat__media img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform .4s ease;
}
.def-home-cat__media:hover img { transform: scale(1.04); }
.def-home-cat__caption {
    position: absolute;
    left: 1rem;
    bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: .15rem;
    max-width: calc(100% - 2rem);
}
.def-home-cat__subtitle {
    background: rgba(0,0,0,.55);
    color: #fff;
    padding: .15rem .5rem;
    border-radius: 2px;
    font-size: .85rem;
    align-self: flex-start;
}
.def-home-cat__name {
    color: #fff;
    border-radius: 2px;
    font-weight: 600;
    font-size: 1.1rem;
    line-height: 1.2;
    align-self: flex-start;
}
.def-home-cat__text {
    background: rgba(0,0,0,.55);
    color: #fff;
    padding: .25rem .6rem;
    border-radius: 2px;
    font-size: .9rem;
    line-height: 1.35;
    align-self: flex-start;
}
.def-home-cat__btn { align-self: flex-start; }

/* Products — N par ligne (N = nombre de produits configuré, capé sur grands écrans) */
.def-home-products.products {
    display: grid;
    grid-template-columns: repeat(var(--def-home-products-cols, 4), 1fr);
    gap: 1rem;
}
/* Pas de palier intermediaire a 3 colonnes : la home passe de 4 a 2.
   Les caps 1200px et 992px valaient tous deux 4, ils sont fusionnes ici. */
@media (max-width: 1200px) {
    .def-home-products.products { grid-template-columns: repeat(min(var(--def-home-products-cols, 4), 4), 1fr); }
}
@media (max-width: 768px) {
    .def-home-products.products { grid-template-columns: repeat(min(var(--def-home-products-cols, 4), 2), 1fr); }
}
@media (max-width: 600px) {
    .def-home-products.products { grid-template-columns: 1fr; }
}

/* Gallery */
.def-home-gallery {
    display: grid;
    grid-template-columns: repeat(20, 1fr);
    gap: .5rem;
    margin-bottom: 1.5rem;
}
.def-home-gallery__item {
    display: block;
    overflow: hidden;
    grid-column: span 3;
}
.def-home-gallery__item--main { grid-column: 1 / -1; }
.def-home-gallery--has-content .def-home-gallery__item--main { grid-column: span 9; }
.def-home-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    aspect-ratio: 1 / 1;
    transition: transform .3s ease;
}
.def-home-gallery__item--main img { aspect-ratio: 16 / 9; }
.def-home-gallery__item:hover img { transform: scale(1.05); }
.def-home-gallery__content {
    grid-column: span 11;
    align-self: center;
    line-height: 1.6;
    padding: 1rem 2rem;
}
.def-home-gallery__title { margin-top: 0; }
.def-home-gallery__content--only { grid-column: 1 / -1; }
@media (max-width: 992px) {
    .def-home-gallery { grid-template-columns: repeat(4, 1fr); }
    .def-home-gallery__item { grid-column: span 1; }
    .def-home-gallery--has-content .def-home-gallery__item--main,
    .def-home-gallery__content { grid-column: 1 / -1; }
    .def-home-gallery__content { padding: 1rem 0; }
}
@media (max-width: 600px) {
    .def-home-gallery { grid-template-columns: repeat(2, 1fr); }
}

/* Carousel — basé sur ps_imageslider (ResponsiveSlides) */
.def-home-slider-container { position: relative; width: 100%; margin-bottom: 50px; }
.def-home-slider {
    position: relative;
    list-style: none;
    overflow: hidden;
    width: 100%;
    max-height: 100vh;
    padding: 0;
    margin: 0;
}
.def-home-slider li {
    position: absolute;
    width: 100%;
    max-height: 100vh;
    left: 0;
    top: 0;
    margin: 0;
    padding: 0;
}
.def-home-slider li:first-child { position: relative; display: block; float: left; }
.def-home-slider picture {
    display: block;
}
.def-home-slider img {
    display: block;
    position: relative;
    z-index: 1;
    width: 100%;
    height: calc(100vh - 75px);
    max-height: 100vh;
    object-fit: cover;
    border: 0;
}
@media (min-width: 992px) {
    .def-home-slider img { 
        height: 100vh;
    }
}
.def-home-slider .caption {
    display: block;
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    color: #fff;
    background: rgba(0, 0, 0, .55);
    padding: 16px 24px;
    margin: 0;
}
.def-home-slider .caption-subtitle {
    font-size: .95rem;
    margin: 0 0 .25rem;
    opacity: .85;
    letter-spacing: .04em;
    text-transform: uppercase;
}
.def-home-slider .caption-title {
    font-size: 1.6rem;
    margin: 0 0 .35rem;
    color: #fff;
    line-height: 1.2;
}
.def-home-slider .caption-desc { font-size: 1rem; line-height: 1.45; }
.def-home-slider .caption-desc p:last-child { margin-bottom: 0; }

/* Conteneur en position relative pour ancrer les flèches dessus */
.def-home-slider-container { position: relative; }

/* ResponsiveSlides — flèches navigation */
.def-home-slider_nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .45);
    color: transparent;       /* masque le text node "Next"/"Previous" */
    font-size: 0;             /* idem, sécurise le rendu */
    text-decoration: none;
    text-indent: -9999px;     /* fallback : pousse le texte hors écran */
    overflow: hidden;
    opacity: .85;
    transition: opacity .2s ease, background .2s ease;
}
.def-home-slider_nav:hover {
    opacity: 1;
    background: rgba(0, 0, 0, .7);
    color: transparent;
    text-decoration: none;
}
.def-home-slider_nav.prev { left: 20px; }
.def-home-slider_nav.next { right: 20px; }
.def-home-slider_nav::before {
    position: absolute;
    inset: 0;
    text-indent: 0;           /* annule l'indent pour le chevron */
    color: #fff;
    font-size: 26px;
    line-height: 44px;
    text-align: center;
    font-family: Arial, sans-serif;
}
.def-home-slider_nav.prev::before { content: '‹'; }
.def-home-slider_nav.next::before { content: '›'; }
/* Au cas où ResponsiveSlides imbriquerait un span */
.def-home-slider_nav * { display: none !important; }

.def-home-slider_tabs {
    position: absolute;
    z-index: 3;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 8px;
}
.def-home-slider_tabs li { margin: 0; }
.def-home-slider_tabs a {
    display: block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255,255,255,.5);
    text-indent: -9999px;
    overflow: hidden;
    transition: background .2s ease;
}
.def-home-slider_tabs .def-home-slider_here a,
.def-home-slider_tabs a:hover { background: #fff; }

/* Animation d'entrée du caption (au changement de slide) */
.def-home-slider li {
    /* ResponsiveSlides gère opacity/visibility. On anime le caption à l'apparition. */
}
.def-home-slider li .caption-subtitle,
.def-home-slider li .caption-title,
.def-home-slider li .caption-desc {
    opacity: 0;
    transform: translateY(15px);
    transition: opacity .6s ease, transform .6s ease;
}
.def-home-slider li[style*="display: block"] .caption-subtitle,
.def-home-slider li[style*="display: block"] .caption-title,
.def-home-slider li[style*="display: block"] .caption-desc,
.def-home-slider li:first-child .caption-subtitle,
.def-home-slider li:first-child .caption-title,
.def-home-slider li:first-child .caption-desc { opacity: 1; transform: none; }
.def-home-slider li[style*="display: block"] .caption-title { transition-delay: .1s; }
.def-home-slider li[style*="display: block"] .caption-desc  { transition-delay: .2s; }

/* Bloc texte */
.def-home-text {
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Reassurance */
.def-home-reassurance {
    display: grid;
    grid-template-columns: repeat(var(--def-home-reassurance-cols, 4), 1fr);
    gap: 1.5rem;
    text-align: center;
}
@media (max-width: 768px) { .def-home-reassurance { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .def-home-reassurance { grid-template-columns: 1fr; } }
.def-home-reassurance__item {
    display: block;
    color: inherit;
    text-decoration: none;
    padding: 1rem;
}
.def-home-reassurance__item:hover { text-decoration: none; }
.def-home-reassurance__img { max-width: 64px; height: auto; margin: 0 auto .75rem; display: block; }
.def-home-reassurance__title { font-size: 1.05rem; margin: 0 0 .25rem; }
.def-home-reassurance__text { color: #666; margin: 0; font-size: .95rem; }
