/**
 * Homepage native V2 — styles maquette Habitat & Jardin
 */

.hj-home--v2 {
    --hj-orange: #FE4F22;
    --hj-title: #0D0D0D;
    --hj-btn: #3F3F3F;
    --hj-gray-band: #EDEDED;
    --hj-white: #FFFFFF;
    --hj-radius: 5px;
    --hj-gap: 2.5rem;
    --mag-border: #e5e7eb;
    --mag-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
    --mag-radius: 18px;
}

/* Neutralise la couleur lien globale IQIT/Bootstrap — carrousels produits */
body#index .hj-home--v2 .product-miniature a:link:not(.nav-link):not(.btn),
body#index .hj-home--v2 .product-miniature a:visited:not(.nav-link):not(.btn),
body#index .hj-home--v2 .product-miniature a:hover:not(.nav-link):not(.btn),
body#index .hj-home--v2 .product-miniature a:focus:not(.nav-link):not(.btn),
body#index .hj-home--v2 .product-miniature a:active:not(.nav-link):not(.btn),
body#index .hj-home--v2 .hj-products-carousel .product-title a,
body#index .hj-home--v2 .hj-products-carousel .product-title a:link,
body#index .hj-home--v2 .hj-products-carousel .product-title a:visited,
body#index .hj-home--v2 .hj-products-carousel .product-title a:hover,
body#index .hj-home--v2 .hj-products-carousel .product-title a:focus,
body#index .hj-home--v2 .hj-products-carousel .product-title a:active {
    color: inherit !important;
    font-weight: inherit;
    text-decoration: none;
    outline: none;
    -webkit-tap-highlight-color: transparent;
}

/* Désactive le rollover 2e image sur la home native (miniatures thème) */
body#index .hj-home--v2 .product-thumbnail-second,
body#index .hj-home--v2 .thumbnail-container .product-thumbnail-second {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

body#index .hj-home--v2 .thumbnail-container:hover .product-thumbnail-first,
body#index .hj-home--v2 .thumbnail-container:hover .product-thumbnail-second {
    opacity: 1 !important;
    transform: none !important;
}

body#index .hj-home--v2 .thumbnail-container:hover .product-thumbnail-second {
    display: none !important;
    opacity: 0 !important;
}

.hj-home--v2 .hj-home__section {
    margin-bottom: var(--hj-gap);
}

/* Titres */
.hj-home--v2 .hj-title,
.hj-home--v2 .hj-product-section__title,
.hj-home--v2 .hj-tendances__section-title,
.hj-home--v2 .hj-blog__section-title {
    color: var(--hj-title);
    font-weight: 700;
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
}

.hj-home--v2 .hj-title--left {
    text-align: left;
}

.hj-home--v2 .hj-title--center {
    text-align: center;
}

/* ── Hero (largeur contenu, aligné sur les carrousels) ── */
.hj-home--v2 .hj-hero {
    margin-bottom: var(--hj-gap);
    max-width: 100%;
    overflow: hidden;
}

.hj-home--v2 .hj-hero .container {
    max-width: 100%;
}

.hj-home--v2 .hj-hero__visual,
.hj-home--v2 .hj-hero__link,
.hj-home--v2 .hj-hero picture {
    display: block;
    line-height: 0;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
    border-radius: var(--hj-radius);
}

.hj-home--v2 .hj-hero__img {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover;
    /* XS 400×298 — réserve l’espace LCP mobile */
    aspect-ratio: 400 / 298;
}

@media (min-width: 768px) {
    .hj-home--v2 .hj-hero__img {
        /* XL 1500×380 */
        aspect-ratio: 1500 / 380;
    }
}

/* ── Carrousels produits (identiques à la home IQIT) ── */
.hj-home--v2 .hj-carousel-wrap {
    position: relative;
}

/*
 * Anti-CLS critique : le thème met .slick-products-carousel { height:0 } avant Slick,
 * ce qui fait exploser la hauteur à l’init et décale tout (cartes, etc.).
 * On réserve déjà la hauteur réelle tout en gardant visibility:hidden (anti-FOUC).
 */
body#index .hj-home--v2 .hj-products-carousel.slick-products-carousel:not(.slick-initialized),
body#index .hj-home--v2 .hj-products-carousel.slick-slider:not(.slick-initialized) {
    visibility: hidden;
    height: auto !important;
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    width: 100%;
}

body#index .hj-home--v2 .hj-products-carousel:not(.slick-initialized) > .product-carousel {
    flex: 0 0 16.666%;
    max-width: 16.666%;
    box-sizing: border-box;
}

@media (max-width: 991.98px) {
    body#index .hj-home--v2 .hj-products-carousel:not(.slick-initialized) > .product-carousel {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
}

@media (max-width: 767.98px) {
    body#index .hj-home--v2 .hj-products-carousel:not(.slick-initialized) > .product-carousel {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

body#index .hj-home--v2 .hj-products-carousel.slick-initialized {
    visibility: visible;
    height: auto !important;
}

body#index:has(.hj-home--v2) .hj-products-carousel .slick-prev {
    left: -18px;
}

body#index:has(.hj-home--v2) .hj-products-carousel .slick-next {
    right: -18px;
}

body#index:has(.hj-home--v2) .hj-products-carousel .slick-slide {
    padding-left: 5px;
    padding-right: 5px;
}

/*
 * Dots Slick thème = position:absolute; bottom:-25px → ils se collent sur le CTA.
 * On les remet dans le flux pour pousser le bouton en dessous.
 */
body#index .hj-home--v2 .hj-product-section .hj-products-carousel ul.slick-dots {
    position: static !important;
    bottom: auto !important;
    margin: 0.85rem 0 0.15rem !important;
    width: 100%;
}

.hj-home--v2 .hj-product-section__cta {
    text-align: center;
    margin-top: 12px;
}

.hj-home--v2 .hj-btn-seemore,
body#index .hj-home--v2 a.hj-btn-seemore:link:not(.nav-link):not(.btn),
body#index .hj-home--v2 a.hj-btn-seemore:visited:not(.nav-link):not(.btn),
body#index .hj-home--v2 a.hj-btn-seemore:hover:not(.nav-link):not(.btn) {
    display: inline-block;
    padding: 0.65rem 2rem;
    background: var(--hj-btn);
    color: var(--hj-white);
    border: none;
    border-radius: 999px;
    font-size: 0.9rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.hj-home--v2 .hj-btn-seemore:hover,
body#index .hj-home--v2 a.hj-btn-seemore:hover:not(.nav-link):not(.btn) {
    opacity: 0.9;
    color: var(--hj-white);
    text-decoration: none;
}

/* ── Cartes catégories photo (maquette : 4 visibles, portrait) ── */
.hj-home--v2 .hj-category-cards .hj-carousel-wrap {
    overflow: hidden;
}

/*
 * Anti-CLS : avant l’init Slick, mimiquer le layout final (2/3/4 colonnes)
 * pour éviter le saut quand le carrousel s’initialise.
 */
.hj-home--v2 .hj-category-cards__carousel:not(.slick-initialized) {
    display: flex;
    flex-wrap: nowrap;
    overflow: hidden;
    width: 100%;
}

.hj-home--v2 .hj-category-cards__carousel:not(.slick-initialized) .hj-category-cards__slide {
    flex: 0 0 25%;
    max-width: 25%;
    box-sizing: border-box;
}

@media (max-width: 991.98px) {
    .hj-home--v2 .hj-category-cards__carousel:not(.slick-initialized) .hj-category-cards__slide {
        flex: 0 0 33.333%;
        max-width: 33.333%;
    }
}

@media (max-width: 767.98px) {
    .hj-home--v2 .hj-category-cards__carousel:not(.slick-initialized) .hj-category-cards__slide {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

.hj-home--v2 .hj-category-cards__carousel {
    margin: 0 -0.5rem;
}

.hj-home--v2 .hj-category-cards__carousel.slick-initialized .slick-track {
    display: flex !important;
    align-items: stretch;
}

.hj-home--v2 .hj-category-cards__carousel .slick-slide {
    height: auto !important;
    float: none;
}

.hj-home--v2 .hj-category-cards__slide {
    padding: 0 0.5rem;
    height: 100%;
}

.hj-home--v2 .hj-category-card,
body#index .hj-home--v2 a.hj-category-card:link:not(.nav-link):not(.btn),
body#index .hj-home--v2 a.hj-category-card:visited:not(.nav-link):not(.btn) {
    position: relative;
    display: block;
    width: 100%;
    height: 0;
    padding-bottom: 133.333%; /* portrait 3:4 — stable avec Slick (pas d’aspect-ratio) */
    background-color: #d9d9d9;
    background-size: cover;
    background-position: center center;
    color: var(--hj-white);
    border-radius: 14px;
    text-decoration: none;
    text-align: center;
    overflow: hidden;
    contain: layout paint;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hj-home--v2 .hj-category-card--photo::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0, 0, 0, 0.55) 0%,
        rgba(0, 0, 0, 0.18) 38%,
        rgba(0, 0, 0, 0) 68%
    );
    z-index: 1;
    pointer-events: none;
}

.hj-home--v2 .hj-category-card__content {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
    padding: 1.5rem 0.85rem 1.35rem;
    box-sizing: border-box;
}

.hj-home--v2 .hj-category-card:hover,
body#index .hj-home--v2 a.hj-category-card:hover:not(.nav-link):not(.btn) {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
    color: var(--hj-white);
    text-decoration: none;
}

.hj-home--v2 .hj-category-card__title,
body#index .hj-home--v2 a.hj-category-card .hj-category-card__title {
    font-size: 1.05rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--hj-white);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.hj-home--v2 .hj-category-card__arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 32px;
    margin-top: 0.7rem;
    border: 2.5px solid rgba(255, 255, 255, 0.98);
    border-radius: 999px;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1;
    text-shadow: 0 0 1px rgba(255, 255, 255, 0.8);
}

@media (max-width: 991.98px) {
    .hj-home--v2 .hj-category-cards__carousel {
        margin: 0 -0.35rem;
    }

    .hj-home--v2 .hj-category-cards__slide {
        padding: 0 0.35rem;
    }

    .hj-home--v2 .hj-category-card__title,
    body#index .hj-home--v2 a.hj-category-card .hj-category-card__title {
        font-size: 0.95rem;
    }
}

@media (max-width: 575.98px) {
    .hj-home--v2 .hj-category-card__title,
    body#index .hj-home--v2 a.hj-category-card .hj-category-card__title {
        font-size: 0.9rem;
    }

    .hj-home--v2 .hj-category-card__content {
        padding: 1.1rem 0.65rem 1rem;
    }
}

body#index:has(.hj-home--v2) .hj-category-cards__carousel .slick-prev {
    left: -18px;
}

body#index:has(.hj-home--v2) .hj-category-cards__carousel .slick-next {
    right: -18px;
}

/* Flèches catégories : masquées hors mobile */
@media (min-width: 768px) {
    body#index:has(.hj-home--v2) .hj-category-cards__carousel .slick-arrow {
        display: none !important;
    }
}

/* Flèches catégories : superposées sur les images (mobile) */
@media (max-width: 767.98px) {
    .hj-home--v2 .hj-category-cards .hj-carousel-wrap {
        padding: 0;
    }

    body#index:has(.hj-home--v2) .hj-category-cards__carousel .slick-arrow {
        display: block !important;
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        background: #fff !important;
        color: #1a1a1a !important;
        opacity: 1 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
        z-index: 30;
        transform: translateY(-50%);
    }

    body#index:has(.hj-home--v2) .hj-category-cards__carousel .slick-arrow:before {
        font-size: 1.35rem;
        line-height: 36px;
        opacity: 1 !important;
        color: #1a1a1a !important;
    }

    body#index:has(.hj-home--v2) .hj-category-cards__carousel .slick-arrow.slick-disabled {
        opacity: 0.35 !important;
    }

    body#index:has(.hj-home--v2) .hj-category-cards__carousel .slick-prev {
        left: 8px;
    }

    body#index:has(.hj-home--v2) .hj-category-cards__carousel .slick-next {
        right: 8px;
    }
}

/* ── Tendances — 2 cartes catégorie plein cadre + overlay (maquette) ── */
.hj-home--v2 .hj-tendances {
    margin-bottom: 0;
}

/* Espace entre la bande tendances et Nouveautés */
.hj-home--v2 .hj-tendances + .hj-product-section {
    margin-top: var(--hj-gap);
}

.hj-home--v2 .hj-tendances__band {
    background: var(--hj-gray-band);
    padding: 2rem 0;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
}

.hj-home--v2 .hj-tendances__section-title {
    margin-bottom: 1.25rem;
}

.hj-home--v2 .hj-tendances__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.hj-home--v2 .hj-tendances__card {
    margin: 0;
    border-radius: 12px;
    overflow: hidden;
    background: #1a1a1a;
}

.hj-home--v2 .hj-tendances__link,
body#index .hj-home--v2 a.hj-tendances__link:link:not(.nav-link):not(.btn),
body#index .hj-home--v2 a.hj-tendances__link:visited:not(.nav-link):not(.btn) {
    position: relative;
    display: block;
    aspect-ratio: 21 / 9;
    text-decoration: none;
    color: #fff;
    overflow: hidden;
}

.hj-home--v2 .hj-tendances__link:hover,
body#index .hj-home--v2 a.hj-tendances__link:hover:not(.nav-link):not(.btn) {
    text-decoration: none;
    color: #fff;
}

.hj-home--v2 .hj-tendances__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}

.hj-home--v2 .hj-tendances__link:hover .hj-tendances__image {
    transform: scale(1.04);
}

.hj-home--v2 .hj-tendances__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.35rem 1.5rem;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.55) 0%, rgba(0, 0, 0, 0.2) 55%, transparent 100%);
    pointer-events: none;
}

.hj-home--v2 .hj-tendances__name {
    margin: 0;
    max-width: 65%;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.hj-home--v2 .hj-tendances__cta {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.25rem;
    border: 2px solid #fff;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1;
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.hj-home--v2 .hj-tendances__link:hover .hj-tendances__cta {
    background: #fff;
    color: #1a1a1a;
    box-shadow: none;
}

/* ── Blog — style mag (bord arrondi, contour gris, ombre) ── */
.hj-home--v2 .hj-blog .hj-carousel-wrap {
    overflow: visible;
    padding-bottom: 0.75rem;
    min-height: 0 !important; /* annule un éventuel lock JS erroné */
}

.hj-home--v2 .hj-blog__carousel {
    margin: 0;
}

.hj-home--v2 .hj-blog__carousel.slick-initialized .slick-list {
    height: auto !important;
    overflow: hidden;
    padding-bottom: 1.25rem;
    margin-bottom: -0.5rem;
}

.hj-home--v2 .hj-blog__slide {
    padding: 0 0.5rem 0.75rem;
    height: auto !important;
    box-sizing: border-box;
}

.hj-home--v2 .hj-blog__carousel .slick-track {
    display: flex !important;
    align-items: stretch;
    height: auto !important;
}

.hj-home--v2 .hj-blog__carousel .slick-slide {
    height: auto !important;
    float: none;
}

.hj-home--v2 .hj-blog__carousel .slick-slide > div {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.hj-home--v2 .hj-blog__carousel .slick-dots {
    display: none !important;
}

/* Flèches blog : mobile uniquement, superposées */
@media (min-width: 768px) {
    body#index:has(.hj-home--v2) .hj-blog__carousel .slick-arrow {
        display: none !important;
    }
}

@media (max-width: 767.98px) {
    .hj-home--v2 .hj-blog__carousel {
        margin: 0;
    }

    .hj-home--v2 .hj-blog__slide {
        padding: 0 0.25rem 1rem;
    }

    body#index:has(.hj-home--v2) .hj-blog__carousel .slick-arrow {
        display: block !important;
        width: 36px;
        height: 36px;
        padding: 0;
        border-radius: 50%;
        background: #fff !important;
        color: #1a1a1a !important;
        opacity: 1 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
        z-index: 30;
        /* Centré sur la zone image (aspect-ratio 4/3), pas sur toute la carte */
        top: 36%;
        transform: translateY(-50%);
    }

    body#index:has(.hj-home--v2) .hj-blog__carousel .slick-arrow:before {
        font-size: 1.35rem;
        line-height: 36px;
        opacity: 1 !important;
        color: #1a1a1a !important;
    }

    body#index:has(.hj-home--v2) .hj-blog__carousel .slick-arrow.slick-disabled {
        opacity: 0.35 !important;
    }

    body#index:has(.hj-home--v2) .hj-blog__carousel .slick-prev {
        left: 12px;
    }

    body#index:has(.hj-home--v2) .hj-blog__carousel .slick-next {
        right: 12px;
    }
}

.hj-home--v2 .hj-blog__card {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    flex: 1 1 auto;
    min-height: 100%;
    background: var(--hj-white);
    border: 1px solid var(--mag-border);
    border-radius: var(--mag-radius);
    box-shadow: var(--mag-shadow);
    overflow: hidden;
    transition: box-shadow 0.2s ease;
}

.hj-home--v2 .hj-blog__card:hover {
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.1);
}

.hj-home--v2 .hj-blog__link {
    display: block;
    overflow: hidden;
    border-radius: var(--mag-radius) var(--mag-radius) 0 0;
    text-decoration: none;
    flex-shrink: 0;
}

.hj-home--v2 .hj-blog__link img {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    display: block;
}

.hj-home--v2 .hj-blog__placeholder {
    width: 100%;
    aspect-ratio: 4 / 3;
    background: linear-gradient(135deg, #e0e0e0, #f0f0f0);
}

.hj-home--v2 .hj-blog__body {
    padding: 1rem 1rem 1.35rem;
    flex: 1 1 auto;
}

.hj-home--v2 .hj-blog__title {
    margin: 10px 0 8px;
    font-size: 1.15rem;
    line-height: 1.35;
    font-weight: 500;
}

.hj-home--v2 .hj-blog__title a,
body#index .hj-home--v2 a.hj-blog__title-link:link:not(.nav-link):not(.btn),
body#index .hj-home--v2 a.hj-blog__title-link:visited:not(.nav-link):not(.btn),
body#index .hj-home--v2 .hj-blog__title a:link:not(.nav-link):not(.btn),
body#index .hj-home--v2 .hj-blog__title a:visited:not(.nav-link):not(.btn) {
    color: var(--hj-title);
    text-decoration: none;
    font-weight: 500 !important;
}

.hj-home--v2 .hj-blog__title a:hover,
body#index .hj-home--v2 .hj-blog__title a:hover:not(.nav-link):not(.btn) {
    color: var(--hj-title);
    text-decoration: none;
    font-weight: 500 !important;
}

.hj-home--v2 .hj-blog__subtitle {
    margin: 0;
    color: #6b7280;
    font-size: 0.88rem;
    font-weight: normal;
}

/* ── Trust bar (natif = Elementor icon-box footer service) ── */
.hj-home--v2 .hj-trust {
    padding: 1.5rem 0 2rem;
    margin-top: var(--hj-gap);
    margin-bottom: 0;
}

.hj-home--v2 .hj-trust__grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 0;
    align-items: start;
}

.hj-home--v2 .hj-trust__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 5px;
    padding: 0 0.5rem;
}

.hj-home--v2 .hj-trust__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    color: #5a5a5a;
}

.hj-home--v2 .hj-trust__icon i {
    color: #5a5a5a;
    line-height: 1;
    -webkit-text-stroke-width: 1px;
}

.hj-home--v2 .hj-trust__title {
    display: block;
    margin: 0;
    font-size: 1rem;
    font-weight: normal;
    line-height: 1.35;
    color: #5a5a5a;
}

/* Masque l’ancien bloc Elementor footer sur home native (évite le double) */
body#index:has(.hj-home--v2) #footer .elementor-displayFooterBefore {
    display: none !important;
}

/* ── SEO ── */
.hj-home--v2 .hj-seo {
    background: var(--hj-gray-band);
    padding: 2rem 0;
}

.hj-home--v2 .hj-seo__title {
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    color: var(--hj-title);
}

.hj-home--v2 .hj-seo__content {
    font-size: 0.85rem;
    line-height: 1.7;
    color: #666;
    max-width: 900px;
}

/* ── Responsive ── */
@media (max-width: 991px) {
    .hj-home--v2 .hj-trust__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .hj-home--v2 .hj-tendances__grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .hj-home--v2 .hj-tendances__link,
    body#index .hj-home--v2 a.hj-tendances__link:link:not(.nav-link):not(.btn),
    body#index .hj-home--v2 a.hj-tendances__link:visited:not(.nav-link):not(.btn) {
        aspect-ratio: 2 / 1;
    }

    .hj-home--v2 .hj-tendances__overlay {
        padding: 1rem 1.1rem;
    }

    .hj-home--v2 .hj-tendances__name {
        font-size: 1.05rem;
        max-width: 58%;
    }

    .hj-home--v2 .hj-tendances__cta {
        padding: 0.45rem 1rem;
        font-size: 0.8rem;
    }

    .hj-home--v2 .hj-trust__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
