/* =====================
HERO PRODUITS
===================== */

.products-hero {
    position: relative;
    min-height: 420px;
    background: url("../images/hero.png") center/cover no-repeat;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    padding: 80px 20px;
}

.products-hero .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, .55);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
    margin: auto;
}

.hero-content h1 {
    font-size: clamp(1.8rem, 4vw, 3rem);
    margin-bottom: 12px;
    font-weight: 700;
}

.hero-content p {
    font-size: clamp(.95rem, 2vw, 1.2rem);
    line-height: 1.6;
    opacity: .95;
}


/* =====================
SECTION PRODUITS
===================== */

.produits-section {
    padding: clamp(50px, 6vw, 90px) 0;
    background: #f5f7fa;
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.section-title {
    text-align: center;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin-bottom: 60px;
    font-weight: 700;
    color: #111;
}

.section-title::after {
    content: "";
    display: block;
    width: 80px;
    height: 4px;
    background: #f97316;
    margin: 15px auto;
    border-radius: 3px;
}


/* =====================
FAMILLE PRODUITS
===================== */

.produit-famille {
    margin-bottom: clamp(50px, 5vw, 80px);
    width: 100%;
    padding: 0 2%;
    box-sizing: border-box;
}

.produit-famille h3 {
    font-size: clamp(1.5rem, 3.5vw, 2rem);
    margin-bottom: 35px;
    border-left: 8px solid var(--orange-action);
    /* Changé en Orange pour plus de visibilité */
    padding-left: 20px;
    color: #1e293b;
    text-transform: uppercase;
    letter-spacing: 1px;
}


/* =====================
GRID PRODUITS
===================== */

.produit-cards {
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(20px, 3vw, 35px);
    width: 100%;
}


/* =====================
CARTE PRODUIT
===================== */

.produit-card {
    background: #fff;
    border: 2px solid #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: all 0.35s ease;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    min-height: 400px;
    position: relative;
}

/* Bordure tracée animée — 4 pseudo-segments via outline SVG simulé avec gradient */
.produit-card::before,
.produit-card::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    pointer-events: none;
    z-index: 2;
}

/* Segment haut + droite */
.produit-card::before {
    border-top: 3px solid transparent;
    border-right: 3px solid transparent;
    background: transparent;
    transition: border-color 0s;
}

/* Segment bas + gauche */
.produit-card::after {
    border-bottom: 3px solid transparent;
    border-left: 3px solid transparent;
    background: transparent;
    transition: border-color 0s;
}

.produit-card:hover::before {
    border-top-color: var(--orange-action);
    border-right-color: var(--orange-action);
    animation: border-trace-top 0.4s linear forwards;
}

.produit-card:hover::after {
    border-bottom-color: var(--orange-action);
    border-left-color: var(--orange-action);
    animation: border-trace-bottom 0.4s linear 0.4s forwards;
}

@keyframes border-trace-top {
    0%   { clip-path: inset(0 100% 0 0 round 16px); }
    100% { clip-path: inset(0 0% 0 0 round 16px); }
}

@keyframes border-trace-bottom {
    0%   { clip-path: inset(0 0 0 100% round 16px); }
    100% { clip-path: inset(0 0 0 0% round 16px); }
}

.produit-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 40px rgba(240, 90, 34, 0.25);
}


/* =====================
IMAGE PRODUIT
===================== */

.img-container {
    display: block;
    width: 100%;
    height: 500px;
    overflow: hidden;
    flex-shrink: 0;
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform .4s;
}

.produit-card:hover img {
    transform: scale(1.05);
}



/* =====================
CONTENU
===================== */

.card-content {
    padding: clamp(20px, 3vw, 40px);
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    width: 100%;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 60%, #0c2340 100%);
    color: #ffffff;
}

.card-content h4 {
    font-size: clamp(1.1rem, 2vw, 1.4rem);
    margin-bottom: 10px;
    color: #ffffff;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.card-content p {
    font-size: clamp(1rem, 1.8vw, 1.2rem);
    color: #94a3b8;
    margin-bottom: 25px;
    line-height: 1.6;
}


/* =====================
BOUTON DEVIS
===================== */

.btn-devis {
    display: inline-block;
    padding: 14px 32px;
    background: var(--orange-action);
    /* Utilisation de la variable de marque */
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    border-radius: 50px;
    /* Plus arrondi pour un look premium */
    font-size: 1rem;
    transition: all .3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(240, 90, 34, 0.3);
}

.btn-devis:hover {
    background: #f97316;
    transform: translateY(-2px);
}


/* =====================
ANIMATIONS APPARITION SCROLL
===================== */

.produit-famille {
    opacity: 0;
    transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 1, 0.36, 1);
}

.produit-famille.from-left {
    transform: translateX(-80px);
}

.produit-famille.from-right {
    transform: translateX(80px);
}

.produit-famille.visible {
    opacity: 1;
    transform: translateX(0);
}

/* Contenu : état initial caché */
.card-content h4,
.card-content p,
.card-content .btn-devis {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

/* Cascade au moment où la famille devient visible — Latence augmentée selon demande */
.produit-famille.visible .card-content h4 {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.2s; /* Commencement après 1.2s */
}

.produit-famille.visible .card-content p {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 1.8s; /* Apparition après 1.8s */
}

.produit-famille.visible .card-content .btn-devis {
    opacity: 1;
    transform: translateY(0);
    transition-delay: 2.4s; /* Finalisation après 2.4s */
}

/* =====================
MODAL CAROUSEL
===================== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
    animation: modalFadeIn 0.35s ease forwards;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-box {
    background: linear-gradient(135deg, #0f172a, #1e293b);
    border-radius: 20px;
    border: 1px solid rgba(240, 90, 34, 0.3);
    box-shadow: 0 0 60px rgba(240, 90, 34, 0.2);
    width: 100%;
    max-width: 900px;
    padding: 40px 30px 30px;
    position: relative;
    animation: modalSlideUp 0.4s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

@keyframes modalSlideUp {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 20px;
    background: rgba(240, 90, 34, 0.15);
    border: 1px solid var(--orange-action);
    color: #fff;
    font-size: 1.6rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
}

.modal-close:hover {
    background: var(--orange-action);
    transform: rotate(90deg);
}

.modal-titre {
    color: #fff;
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--orange-action);
}

.carousel-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.carousel-track-wrapper {
    flex: 1;
    overflow: hidden;
    border-radius: 12px;
}

.carousel-track {
    display: flex;
    transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.carousel-track img {
    min-width: 100%;
    width: 100%;
    height: 460px;
    object-fit: contain;
    background: #0a0f1a;
    border-radius: 12px;
    flex-shrink: 0;
}

.carousel-btn {
    background: rgba(240, 90, 34, 0.15);
    border: 2px solid var(--orange-action);
    color: #fff;
    font-size: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
}

.carousel-btn:hover {
    background: var(--orange-action);
    transform: scale(1.1);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: default;
    transform: none;
}

/* Légende slide */
.carousel-legende {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-top: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(240, 90, 34, 0.2);
    border-radius: 12px;
    padding: 16px 20px;
    min-height: 72px;
    animation: legendeFadeIn 0.35s ease forwards;
}

@keyframes legendeFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.legende-icon {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    background: rgba(240, 90, 34, 0.15);
    border: 1px solid var(--orange-action);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--orange-action);
}

.legende-texte {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.legende-titre {
    color: #ffffff;
    font-weight: 700;
    font-size: 1rem;
    letter-spacing: 0.3px;
}

.legende-desc {
    color: #94a3b8;
    font-size: 0.88rem;
    line-height: 1.5;
}

.carousel-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
}

.carousel-dots {
    display: flex;
    gap: 8px;
}

.carousel-dots .dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    cursor: pointer;
    transition: background 0.25s, transform 0.25s;
}

.carousel-dots .dot.active {
    background: var(--orange-action);
    transform: scale(1.3);
}

.carousel-counter {
    text-align: center;
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 10px;
}

/* Curseur pointer sur les cartes */
.produit-card {
    cursor: pointer;
}

/* =====================
TABLETTES & MOBILE
===================== */

@media (max-width: 900px) {
    .img-container {
        height: 260px;
    }

    .card-content {
        text-align: center;
        padding: 20px;
    }
}

@media (max-width: 600px) {
    .products-hero {
        padding: 60px 20px;
    }
}