/* === BODY === */
body {
    margin: 0;
    font-family: 'Segoe UI', sans-serif;
    color: antiquewhite;
    background-color: antiquewhite;
    background-image: url('images/background-image.png');
    background-size: contain;
    background-position: center center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    overflow-x: hidden;
    overflow-y: auto;
}

/* === HEADER === */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 1rem;
    background-color: #361801;
    border: 2px solid antiquewhite;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left,
.header-center,
.header-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-left {
    justify-content: flex-start;
}
.header-right {
    justify-content: flex-end;
    gap: 10px;
}

.logo {
    font-size: 1.5em; /* Taille réduite pour les petits écrans */
    font-weight: bold;
    white-space: nowrap; /* Empêche le texte de se couper */
    flex-shrink: 0; /* Empêche le logo de rétrécir */
    text-align: left; /* Aligne le logo à gauche */
    margin-right: auto; /* Pousse les autres éléments vers la droite */
}

.nav-center {
    position: relative;
    flex: 1 1 auto;
    text-align: center;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1 1 auto;
    justify-content: flex-end;
}

.lang-switch {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0; /* Empêche les drapeaux de rétrécir */
}

.lang-switch img {
    max-width: 24px; /* Taille réduite pour les petits écrans */
    object-fit: contain;
    object-position: center;
    margin-left: 8px;
    cursor: pointer;
    border: 1px solid #ccc;
    border-radius: 4px;
    transition: transform 0.2s ease;
}

.lang-switch img:hover {
    transform: scale(1.1);
}

/* === DROPDOWN CONTACT === */
.dropdown-container {
    display: flex;
    justify-content: center;
    flex: 1;
}

.dropdown {
    position: relative;
}

.dropbtn {
    background-color: #361801; /* Couleur de fond du bouton */
    color: antiquewhite; /* Couleur du texte */
    padding: 10px 15px;
    font-size: 1em;
    border: 1px solid #ccc;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.2s ease; /* Animation pour le survol */
}

.dropbtn:hover {
    background-color: antiquewhite; /* Couleur de fond au survol */
    color : #361801; /* Couleur du texte au survol */
}

.dropdown-content {
    display: none; /* Par défaut, le menu est caché */
    position: absolute;
    top: 100%; /* Place le menu juste en dessous du bouton */
    left: 50%;
    transform: translateX(-50%);
    background-color:#361801; /* Couleur de fond du menu */
    color: antiquewhite;
    white-space: nowrap;
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.1); /* Ombre pour le menu */
    border-radius: 8px;
    z-index: 9999; /* Assure que le menu est au premier plan */
    padding: 10px 0;
    border: 1px solid #ccc;
}

.dropdown-content a {
    color: antiquewhite; /* Couleur du texte des liens */
    padding: 10px 20px;
    text-decoration: none;
    display: block;
    transition: background-color 0.2s ease; /* Animation pour le survol */
}

.dropdown-content a:hover {
    background-color: antiquewhite; /* Couleur de fond au survol */
    color: #361801; /* Couleur du texte au survol */
}

.dropdown:hover .dropdown-content {
    display: block; /* Le menu reste visible tant que la souris est dessus */
}

.dropdown:hover .dropdown-content,
.dropdown-content:hover {
    display: block;
}


main {
    background-color: transparent;
}
/* === PRODUITS === */
.product-details .detail-box {
    display: none;
    padding: 20px;
    background: #fff;
    color: #333;
    border: 1px solid #ddd;
    margin-top: 20px;
    width: 100%;
    animation: fadeIn 0.3s ease-in-out;
}

/* Animation d'apparition (optionnelle) */
@keyframes fadeIn {
    from { opacity: 0; transform: translateX(10px); }
    to { opacity: 1; transform: translateX(0); }
}

/* === PRODUCT SECTION === */
.product-section {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    padding: 2rem;
    gap: 2rem;
    margin-left: 3rem;
}

.product-list {
    display: flex;
    flex-direction: column;
    width: 200px;
    gap: 1rem;
}

.product-item {
    background-color: #361801;
    border: 2px solid antiquewhite;
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.product-item img {
    width: 100%;
    height: auto;
    border-radius: 5px;
}

.product-item h3 {
    color: antiquewhite;
    margin-top: 0.5rem;
}

.product-item:hover {
    background-color: antiquewhite;
}

.product-item:hover h3 {
    color: #361801;
}

.product-details {
    display: none; /* Cache le conteneur global */
  }



/* detail-box: Affiche la section des détails */
.detail-box {
    display: none; /* Cachée par défaut */
    position: fixed; /* Fixée par rapport à la fenêtre */
    top: 50%; /* Centre verticalement */
    left: 50%; /* Centre horizontalement */
    transform: translate(-50%, -50%); /* Ajuste pour centrer parfaitement */
    max-width: 90%; /* Limite la largeur à 90% de l'écran */
    max-height: 80%; /* Limite la hauteur à 80% de l'écran */
    overflow-y: auto; /* Ajoute un défilement si le contenu dépasse */
    z-index: 9999; /* Assure que la boîte est au premier plan */
    background-color: #361801; /* Couleur de fond */
    color: antiquewhite; /* Couleur du texte */
    padding: 20px; /* Ajoute de l'espace intérieur */
    border-radius: 12px; /* Coins arrondis */
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5); /* Ombre */
}

.detail-box.visible {
    background-color: #361801;
    color: antiquewhite;
    display: block; /* Affiche la boîte lorsqu'elle est visible */
    max-width: 50%; /* Limite la largeur à 90% de l'écran */
    max-height: 50%;
}

/* Pour assombrir le fond */
.detail-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 100vw;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
  }

  .detail-overlay.visible {
    display: block; /* Affiche le fond assombri */
}

.detail-box p {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 8px 0;
    padding: 1rem 3rem;
}

.detail-box button {
    background-color: #0f0d0d;
    color: #361801;
    border: none;
    padding: 6px 10px;
    border-radius: 1rem;
    cursor: pointer;
    font-weight: bold;
    margin-left: 15px;
    transition: 0.3s ease;
}

.detail-box button:hover {
    background-color: antiquewhite;
    color: #361801;
  }
 
  /* Bouton de fermeture */
  .detail-box .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: antiquewhite; /* Fond constant */
    color: #361801; /* Couleur de la croix */
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    z-index: 1001; /* Assure que la croix est au-dessus */
    border-radius: 50%; /* Ajoute un effet arrondi */
    padding: 5px; /* Ajoute un peu d'espace autour de la croix */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); /* Ajoute une ombre légère */
    transition: transform 0.2s ease; /* Animation au survol */
}
.detail-box .close-btn:hover {
    transform: scale(1.1); /* Agrandit légèrement la croix au survol */
    background-color: #361801; /* Change le fond au survol */
    color: antiquewhite; /* Change la couleur de la croix au survol */
}

 

/* Animation d'apparition */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -60%);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%);
    }
}

/* === PANIER === */
#cart-section {
    display: none;
    position: absolute;
    top: calc(100% + 1rem);
    right: 5rem;
    background-color: #361801;
    color: antiquewhite;
    border: 2px solid antiquewhite;
    text-align: center;
    padding: 1rem;
    width: 250px;
    z-index: 1000;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 10px;  
}

#cart-section.hidden {
    display: none;
  }

#cart-icon {
    position: fixed;
    bottom: 1rem;
    right: 1rem;
    background-color: #0ff1ed;
    color: #000;
    border: 2px solid #361801;
    padding: 10px;
    border-radius: 50%;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 1000;
    font-size: 1.5rem;
    text-align: center;
}

#cart-items li {
    text-align: center;
    margin: 0.5em 0;
}

#cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #e74c3c;
    color: #fff;
    font-size: 0.8em;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: bold;
}

#cart-section.hidden {
    display: none;
  }

  #cart-section button {
    margin: 0.5rem 0; /* Ajoute une marge verticale entre les boutons */
    width: 50%; /* Optionnel : rend les boutons de la même largeur */
    padding: 10px; /* Ajoute un peu d'espace intérieur */
    font-size: 1rem; /* Taille du texte */
    border-radius: 8px; /* Coins arrondis */
    background-color: antiquewhite;
    color: #361801;
}

#cart-section button:first-child {
    margin-bottom: 1rem; /* Ajoute une marge spécifique entre les deux boutons */
}
/* === MODAL === */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #361801;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.modal-content {
    background-color: #fff;
    padding: 20px;
    border-radius: 5px;
    width: 300px;
    text-align: center;
}

input[type="email"] {
    width: 80%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.hidden {
    display: none;
}

.fade-in {
    opacity: 0;
    animation: fadeInAnimation ease 1s forwards;
    animation-delay: 0.3s;
  }
  
  @keyframes fadeInAnimation {
    0% {
      opacity: 0;
      transform: translateY(10px);
    }
    100% {
      opacity: 1;
      transform: translateY(0);
    }
  }
  
/* === MEDIA QUERIES === */

@media (max-width: 480px) {
    .logo {
        font-size: 1em;
    }

    .products {
        grid-template-columns: 1fr;
    }

    .product {
        padding: 0.5em;
    }
}

@media (max-width: 600px) {
    .header-left, .header-center, .header-right {
        flex: 100%;
        justify-content: center;
        margin: 5px 0;
    }

    .lang-switch {
        justify-content: center;
    }

    .product-section {
        flex-direction: column;
        align-items: center;
        margin-left: 0;
    }

    .product-list {
        width: 100%;
        flex-direction: row;
        overflow-x: scroll;
    }

    .detail-box.visible {
        max-width: 90%;
        max-height: 90%;
    }
}


@media (max-width: 768px) {
    /* Header et logo en responsive */
    .header-left, .header-center, .header-right {
        flex: 1 1 100%;
        justify-content: center;
        margin: 5px 0;
    }

    .header-left {
        justify-content: center;
    }

    .logo {
        font-size: 1.2em;
        text-align: center;
    }

    .dropdown {
        justify-content: center;
        margin-top: 10px;
    }

    header {
        flex-direction: column;
        align-items: center;
    }

    .products {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    /* Panier responsive */
    #cart-section {
        position: static !important; /* ← Retire le fixed pour qu'il suive le flux */
        margin: 1rem auto 2rem auto;
        width: 90%;
        max-width: 400px;
        z-index: auto;
        display: none; /* Doit rester caché par défaut, le JS l'affiche */
        border: 2px solid antiquewhite;
        padding: 1rem;
        border-radius: 10px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    }

    #cart-icon {
        right: 50%;
        transform: translateX(50%);
        bottom: 1rem;
    }
}
/* === MENU AVEC SOUS-MENU (DROPDOWN HORIZONTAL) === */
nav ul li {
    position: relative;
}

nav ul li ul.submenu {
    display: none;
    position: absolute;
    top: 0;
    left: 100%;
    background-color: #361801;
    border: 1px solid antiquewhite;
    padding: 0;
    margin: 0;
    z-index: 1000;
    white-space: nowrap;
    border-radius: 8px;
}

nav ul li:hover > ul.submenu {
    display: block;
}

nav ul li ul.submenu li {
    list-style: none;
}

nav ul li ul.submenu li a {
    display: block;
    padding: 10px 15px;
    color: antiquewhite;
    text-decoration: none;
}

nav ul li ul.submenu li a:hover {
    background-color: antiquewhite;
    color: #361801;
}
