/* ===== Reset et base ===== */
html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    font-family: "Segoe UI", sans-serif;
    box-sizing: border-box;
}

/* ===== Hero section (page d'accueil) ===== */
.hero {
    position: relative;
    height: 100vh;  
    background-image: url("images/002.jpg");
    background-size: cover;          
    background-position: 25% center;     
    background-repeat: no-repeat;
    display: flex;
    justify-content: center;
    align-items: center;
}

.overlay {
    position: absolute;  
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);  
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;  
}

.overlay p {
    font-size: clamp(0.95rem, 1.5vw, 1.2rem); /* texte blanc, responsive */
    line-height: 1.6;
    margin-bottom: 30px;
    max-width: 700px;
    color: white;
}

.overlay h1 {
    font-size: 2em;   /* toujours 2x la taille du texte p, ratio fixe */
    line-height: 1.2;
    margin-bottom: 20px;
    color: white;
}

.btn {
    text-decoration: none;
    color: white;
    border: 2px solid white;
    padding: 12px 30px;
    border-radius: 30px;
    transition: all 0.3s ease;
}

.btn:hover {
    background: white;
    color: black;
}

/* ===== Responsive ===== */

/* Tablettes et petits écrans */
@media screen and (max-width: 1024px) {
    .overlay h1 { font-size: 3rem; }
    .overlay p { font-size: 1.1rem; margin-bottom: 25px; }
}

/* Smartphones */
@media screen and (max-width: 768px) {
    .overlay h1 { font-size: 2rem; margin-bottom: 15px; }
    .overlay p { font-size: 1rem; margin-bottom: 20px; }
    .btn { padding: 10px 25px; }
}

/* Petits téléphones */
@media screen and (max-width: 480px) {
    .overlay h1 { font-size: 1.5rem; margin-bottom: 10px; }
    .overlay p { font-size: 0.95rem; margin-bottom: 15px; }
    .btn { padding: 8px 20px; font-size: 0.9rem; }
}

/* ===== Produits - cartes ===== */
/* --- Fond et overlay pour produits --- */
/* --- Fond et overlay --- */
body.produits {
    position: relative;
    min-height: 100vh;
    background-image: url("images/ferme.jpg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;  /* suit le scrolling */
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: 60px;
}

/* Overlay gris pour titre */
body.produits::before {
    content: "";
    position: fixed;  /* overlay suit tout le fond */
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.45);
    z-index: 0;
}

/* Titre h1 blanc, centré, ratio fixe avec texte */
body.produits h1 {
    position: relative;
    color: white;
    text-align: center;
    z-index: 1;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 40px;
}

/* --- Cartes --- */
.cards {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 20px;
    margin: 0 auto; /* centre globalement */
    padding: 0;      /* plus de padding horizontal */
    width: 100%;
}

.card {
    position: relative;
    flex: 0 1 300px;   /* largeur flexible mais max 300px */
    max-width: 300px;
    aspect-ratio: 4 / 3; /* largeur / hauteur -> même taille pour toutes les cartes */
    background-color: rgba(255,255,255,0.85);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
    text-align: center;
    padding: 15px;
    text-decoration: none;
    color: white;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    color: white;
}

.card-bg::before {
    content: "";
    position: absolute;
    top:0; left:0; right:0; bottom:0;
    background: rgba(0,0,0,0.35);
    z-index: 0;
    border-radius: 15px;
}

.card-bg h2,
.card-bg p {
    position: relative;
    z-index: 1;
    color: white;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

/* Texte responsive pour cartes */
.card h2 {
    font-size: clamp(1.2rem, 3vw, 1.5rem);
    margin-bottom: 10px;
}

.card p {
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    line-height: 1.5;
}

/* --- Responsive --- */

/* Tablette */
@media screen and (max-width: 1024px) {
    body.produits h1 { font-size: clamp(2rem, 5vw, 2.8rem); }
}

/* Smartphone */
@media screen and (max-width: 768px) {
    body.produits h1 { font-size: clamp(1.8rem, 5vw, 2.5rem); }
    .cards {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }
    .card {
        width: 66vw;        /* 2/3 de l’écran */
        max-width: 300px;
        aspect-ratio: auto;  /* supprime l’espace vide */
        padding: 15px;
        flex: none;          /* hauteur adaptative */
        height: auto;        /* hauteur s’adapte au contenu */
    }
}

/* Petits téléphones */
@media screen and (max-width: 480px) {
    body.produits h1 { font-size: clamp(1.5rem, 6vw, 2rem); margin-bottom: 20px; }
    .card {
        width: 66vw;
        max-width: 220px;
        aspect-ratio: auto;  /* hauteur adaptative au contenu */
        padding: 12px;
        flex: none;          /* hauteur adaptative */
        height: auto;        /* hauteur s’adapte au contenu */
    }
    .card p {
        font-size: clamp(0.85rem, 3vw, 1rem);
    }
}


/* =========================
   Pages produits (détails)
   ========================= */

.page-produit {
    min-height: 100vh;
    background: #1c1c1c;
    color: white;
}

/* Section principale */
.produit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 60px;
    padding: 80px 8vw;
}

/* Section pleine largeur et hauteur */
.produit-full {
    display: flex;
    min-height: 100vh;        /* plein écran */
    width: 100%;
}

/* Texte à gauche */
.produit-texte {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 80px;
    color: white;
}

.produit-texte h1 {
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 20px;
}

.produit-texte p {
    font-size: clamp(1rem, 1.2vw, 1.1rem);
    line-height: 1.6;
    margin-bottom: 15px;
}

/* Image à droite */
.produit-image {
    flex: 1;
    min-height: 100vh;
}

.produit-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;           /* couvre entièrement la colonne */
    object-position: center right; /* priorité droite sur desktop */
}

/* =========================
   Responsive
   ========================= */

@media screen and (max-width: 768px) {
    .produit-full {
        flex-direction: column;  /* empile verticalement */
    }

    /* Inverse l’ordre : image en haut, texte en dessous */
    .produit-image {
        order: -1;
        min-height: 300px;
        width: 100%;
    }

    .produit-image img {
        object-position: center; /* recentre l’image */
    }

    .produit-texte {
        padding: 40px 20px;
        text-align: center;
    }

    .produit-texte h1 {
        font-size: clamp(1.5rem, 6vw, 2rem);
    }

    .produit-texte p {
        font-size: clamp(0.9rem, 3vw, 1rem);
    }
}


/* --- Section Contact Produits --- */
/* --- Section Contact Produits --- */
body.produits {
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* pousse la section en bas */
}

.contact {
    margin-top: auto;        
    padding: 20px 40px;
    color: #ffffff !important;   /* texte blanc pur */
    font-size: clamp(0.9rem, 1.2vw, 1rem);
    display: flex;
    justify-content: flex-start;  /* aligné à gauche sur desktop */
    gap: 40px;

    /* Ajout pour être sûr que le texte soit au-dessus de l'overlay */
    position: relative;
    z-index: 10;

    /* Supprimer le fond et le border-radius */
    /* background: rgba(0,0,0,0.2); */
    /* border-radius: 5px; */
}

/* Chaque élément de contact */
.contact-item {
    margin: 0;
    white-space: nowrap;
    color: #ffffff !important;   /* texte blanc pur */
}

/* Mobile / smartphone */
@media screen and (max-width: 768px) {
    .contact {
        flex-direction: column;
        justify-content: flex-end; /* reste en bas */
        align-items: center;       /* centré horizontalement */
        gap: 15px;
        padding: 15px 20px;
        text-align: center;
        color: #ffffff !important; /* texte blanc pur */
        position: relative;
        z-index: 10;

        /* Supprimer le fond et border-radius */
        /* background: rgba(0,0,0,0.2); */
        /* border-radius: 5px; */
    }

    .contact-item {
        white-space: normal;
        font-size: clamp(0.85rem, 3vw, 0.95rem);
        color: #ffffff !important; /* texte blanc pur */
    }
}

/* --- Contact Page --- */
.contact-page .contact-hero {
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center; /* centrage vertical */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.contact-page .overlay-contact {
    text-align: center;
    background: rgba(0,0,0,0.3); /* léger overlay pour lisibilité */
    padding: 40px 20px;
    border-radius: 10px;
    color: #ffffff; /* texte blanc pur */
}

/* Titre et texte adaptatif */
.contact-page .overlay-contact h1 {
    font-size: clamp(2rem, 5vw, 3rem); /* titre adaptatif */
    margin-bottom: 20px;
}

.contact-page .overlay-contact p.contact-item {
    font-size: clamp(1rem, 3vw, 1.5rem); /* texte adaptatif */
    margin: 5px 0;
}

/* Mobile / smartphone */
@media screen and (max-width: 768px) {
    .contact-page .overlay-contact {
        padding: 30px 15px;
    }

    .contact-page .overlay-contact h1 {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
    }

    .contact-page .overlay-contact p.contact-item {
        font-size: clamp(0.85rem, 4vw, 1.2rem);
    }
}


/* --- Hamburger Menu --- */
.hamburger-menu {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    font-family: "Segoe UI", sans-serif;
}

/* Icône hamburger */
.hamburger-icon {
    width: clamp(25px, 8vw, 35px);   /* largeur adaptative */
    height: clamp(20px, 6vw, 25px);  /* hauteur adaptative */
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
    background: url('images/NOUVEAU-LOGO-MATRASmodif.jpeg') center/cover no-repeat; /* image de fond semi-transparente */
    padding: clamp(5px, 1.5vw, 8px); /* padding adaptatif */
    border-radius: 5px;
    position: relative; /* pour s'assurer que les spans restent au-dessus */
}

.hamburger-icon span {
    display: block;
    height: clamp(2px, 0.5vw, 3px);   /* hauteur des traits responsive */
    background: #555;                  /* traits visibles sur l'image */
    border-radius: 2px;
    z-index: 2;                        /* s'assure que les traits restent au-dessus */
}

/* Menu principal */
.menu-items {
    display: none; /* caché par défaut */
    position: absolute;
    top: 50px;
    right: 0;
    background: rgba(255,255,255,0.9);
    border-radius: 5px;
    list-style: none;
    padding: 10px 0;
    min-width: 180px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Affichage du menu principal si la classe show est active (mobile) */
.menu-items.show {
    display: block;
}

/* Liens principaux */
.menu-items > li {
    position: relative;
}

.menu-items a {
    display: block;
    text-decoration: none;
    color: #333;
    padding: 10px 20px;
    font-size: 1rem;
}

.menu-items a:hover {
    background: rgba(0,0,0,0.05);
}

/* Sous-menu (desktop) */
.submenu-items {
    display: none;
    position: absolute;
    top: 0;
    left: -180px; /* alignement sous-menu à gauche du parent */
    background: rgba(255,255,255,0.95);
    list-style: none;
    padding: 10px 0;
    border-radius: 5px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    min-width: 180px;
}

.submenu-items li a {
    padding: 10px 15px;
    font-size: 0.95rem;
}

/* Affichage au survol du parent (desktop) */
.submenu:hover .submenu-items {
    display: block;
}

/* Mobile / tablette */
@media screen and (max-width: 768px) {

    /* --- Menu principal mobile --- */
    .menu-items {
        position: absolute;   /* reste hors du flux */
        top: 100%;
        right: 0;
        width: 95%;           /* prend presque toute la largeur */
        max-width: 400px;     /* limite pour grands écrans */
        margin: 0 auto;       /* centré horizontalement */
    }

    /* --- Sous-menu intégré sous "Nos produits" --- */
    /* Sous-menu intégré sous le choix principal */
    .submenu-items {
        display: none;            /* caché par défaut */
        position: static;         /* reste dans le flux du menu Nos produits */
        margin-top: 6px;
        padding: 8px;
        background: rgba(0,0,0,0.04);
        border-radius: 6px;
        box-shadow: inset 0 0 0 1px rgba(0,0,0,0.05);
        flex-direction: column;
        align-items: center;      /* centre les cases horizontalement */
        gap: 6px;
    }

    .submenu.open .submenu-items {
        display: flex;
    }

    /* Chaque sous-choix */
    .submenu-items li a {
        width: 140px;             /* largeur fixe */
        max-width: 80%;           /* ne dépasse pas l’écran */
        padding: 8px 10px;
        background: white;
        border-radius: 5px;
        font-size: 0.95rem;
        text-align: left;         /* texte aligné à gauche */
        display: block;           /* chaque case reste sur sa ligne */
    }

    .submenu-items li a:hover {
        background: rgba(255,255,255,0.95);
    }

    /* Chevron */
    .submenu > a {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .chevron {
        font-size: 0.8rem;
        transition: transform 0.3s ease;
    }

    .submenu.open .chevron {
        transform: rotate(180deg);
    }
}
