/* --- Global Resets --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Roboto, sans-serif;
}

/* Performances mobiles: animations/peintures plus legeres */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 768px) {
    /* Reduit les recalculs de layout/paint lourds sur mobile */
    .hero,
    .navbar,
    .offer-card {
        box-shadow: none;
    }

    /* Animations plus courtes pour une impression de fluidite */
    .reveal-left,
    .reveal-right {
        transition-duration: 0.4s;
    }
}

/* Optimise les animations de revelation */
.reveal-left,
.reveal-right {
    will-change: transform, opacity;
}

#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #ffffff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  /* Transition de 0.5s pour le fondu */
  transition: opacity 0.5s ease, visibility 0.5s ease;
}



/* --- Animation de glissement --- */



/* État initial : Eléments venant de la gauche */
.reveal-left {
    opacity: 0;
    transform: translateX(-80px);
    transition: all 0.8s ease-out;
}

/* État initial : Eléments venant de la droite */
.reveal-right {
    opacity: 0;
    transform: translateX(80px);
    transition: all 0.8s ease-out;
}

/* État final : L'élément reprend sa place d'origine */
.reveal-visible {
    opacity: 1;
    transform: translateX(0);
}

/* Classe qu'on ajoutera en JavaScript */
#preloader.hidden {
  opacity: 0;
  visibility: hidden;
}

/* Votre loader (le cercle qui tourne) */
.loader {
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

body {
    background-color: #fcfcfc;
}

/* --- Navigation Bar --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 5%;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* Conteneur parent pour positionner le menu par rapport à l'icône */
.profile-container {
    position: relative;
    display: inline-block;
}

/* Le menu déroulant (caché par défaut) */
.profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: 100%; /* Gardez-le à 100% pour coller au parent */
    background-color: white;
    min-width: 200px;
    box-shadow: 0 8px 16px rgba(0,0,0,0.1);
    border-radius: 8px;
    z-index: 1001;
    padding: 10px 0;
    margin-top: 0; /* Changez 10px à 0 pour supprimer l'espace vide */
}

/* Afficher le menu au survol du conteneur */
.profile-container:hover .profile-dropdown {
    display: block;
}

/* Style des liens dans le menu */
.dropdown-item {
    color: #2d3436;
    padding: 12px 16px;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.dropdown-item:hover {
    background-color: #f8f9fa;
    color: #ff4d6d;
}

.dropdown-header {
    padding: 5px 16px;
    font-weight: bold;
    color: #636e72;
}

hr {
    border: 0;
    border-top: 1px solid #eee;
    margin: 5px 0;
}

/* Logo Section */
.logo {
    display: flex;
    align-items: center;
    flex: 1;
}

.logo img {
    height: 45px;
    margin-right: 12px;
}

.logo-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: #2d3436;
    letter-spacing: -0.5px;
}

/* Centered Search Bar */
.search-container {
    flex: 2;
    display: flex;
    justify-content: center;
    padding: 0 20px;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 600px;
    display: flex;
    align-items: center;
}

.search-bar input {
    width: 100%;
    padding: 12px 25px;
    border-radius: 30px;
    border: 1px solid #e0e0e0;
    background: #f8f9fa;
    font-size: 0.95rem;
    outline: none;
    transition: all 0.3s ease;
}

.search-bar input:focus {
    border-color: #ff4d6d;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(255, 77, 109, 0.1);
}

.search-bar button {
    position: absolute;
    right: 5px;
    background: transparent;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    color: #636e72;
    font-size: 1.1rem;
}

/* Right Icons */
.nav-tools {
    flex: 1;
    display: flex;
    justify-content: flex-end;
}

.icons {
    display: flex;
    gap: 20px;
    align-items: center;
}

.icon-link {
    text-decoration: none;
    color: #2d3436;
    font-size: 1.4rem;
    position: relative;
    transition: transform 0.2s;
}

.icon-link:hover {
    transform: translateY(-2px);
    color: #ff4d6d;
}


.badge {
    position: absolute;
    top: -5px;
    right: -8px;
    background: #ff4d6d;
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 10px;
    border: 2px solid #fff;
}

/* --- Hero Banner Section --- */
.hero {
    position: relative;
    height: 80vh;
    min-height: 500px;
    /* ADD YOUR IMAGE FILENAME BELOW */
    background: url('photos/Mcm\ banner.png') no-repeat center center/cover;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Subtle overlay to make text pop */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(rgba(0,0,0,0.1), rgba(0,0,0,0.2));
}

.hero-content {
    position: relative;
    z-index: 10;
    text-align: center;
    color: #fff;
    padding: 0 20px;
}

.hero-content h1 {
    font-size: clamp(2rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.hero-content p {
    font-size: clamp(1rem, 2.5vw, 1.4rem);
    margin-bottom: 35px;
    font-weight: 300;
    opacity: 0.95;
}

.btn-explorer {
    display: inline-block;
    padding: 16px 45px;
    background: linear-gradient(135deg, #ff4d6d 0%, #ff7e5f 100%);
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    border-radius: 50px;
    box-shadow: 0 10px 25px rgba(255, 77, 109, 0.4);
    transition: all 0.3s ease;
}

.btn-explorer:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(255, 77, 109, 0.6);
}


/* --- Section Info & Offre Vendeurs --- */
.site-info {
    padding: 60px 5%;
    background-color: #ffffff;
}

.info-container {
    display: flex;
    gap: 40px;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.description-box {
    flex: 1;
}

.description-box h2 {
    font-size: 2rem;
    color: #2d3436;
    margin-bottom: 20px;
    position: relative;
}

.description-box h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 4px;
    background: #ff4d6d;
    margin-top: 10px;
    border-radius: 2px;
}

.description-box p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: #636e72;
}

.seller-offer {
    flex: 1;
}

.offer-card {
    background: linear-gradient(135deg, #2d3436 0%, #000000 100%);
    color: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
}

.offer-card h3 {
    color: #ff4d6d;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.offer-benefits {
    list-style: none;
    margin: 20px 0;
}

.offer-benefits li {
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.95rem;
}

.offer-benefits i {
    color: #00bcd4;
}

.btn-seller {
    display: inline-block;
    padding: 12px 25px;
    background-color: #ff4d6d;
    color: white;
    text-decoration: none;
    font-weight: bold;
    border-radius: 30px;
    transition: 0.3s;
    text-align: center;
    width: 100%;
}

.btn-seller:hover {
    background-color: #ff7e5f;
    transform: translateY(-2px);
}

.search-container { position: relative; }

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    z-index: 2000;
    max-height: 300px;
    overflow-y: auto;
    display: none; /* Caché par défaut */
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #eee;
}

.suggestion-item:hover { background: #f8f9fa; }

.suggestion-type {
    font-size: 0.75rem;
    color: #ff4d6d;
    text-transform: uppercase;
    font-weight: bold;
}

/* Style de la petite page blanche (Modale) */
.custom-modal {
    display: none; 
    position: fixed; 
    z-index: 9999; 
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.5); /* Fond sombre transparent */
    backdrop-filter: blur(3px);
}

.modal-content-white {
    background-color: #ffffff;
    margin: 10% auto;
    padding: 25px;
    border-radius: 15px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    position: relative;
    color: #333;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateY(-20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.close-modal {
    position: absolute;
    right: 20px; top: 15px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
}

.modal-header {
    text-align: center;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.modal-header i { font-size: 2rem; color: #00bcd4; margin-bottom: 10px; }
.modal-header h2 { font-size: 1.4rem; color: #222; }

.order-item-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px dashed #eee;
}

.btn-close-rect {
    width: 100%;
    margin-top: 20px;
    padding: 12px;
    background: #222;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
}


/* --- Footer Styling --- */
.main-footer {
    background-color: #2d3436; /* Couleur sombre pro */
    color: #ffffff;
    padding: 60px 5% 20px 5%;
    margin-top: 50px;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-col h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    color: #ff4d6d; /* Rappel de la couleur dominante */
}

.footer-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.footer-logo img { height: 40px; }
.footer-logo span { font-weight: 800; font-size: 1.3rem; }

.footer-col p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #b2bec3;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
}

.social-icons a {
    color: white;
    font-size: 1.5rem;
    transition: 0.3s;
}

.social-icons a:hover { color: #ff4d6d; transform: translateY(-3px); }

.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 12px; }

.footer-col ul li a {
    color: #b2bec3;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.3s;
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-col ul li a:hover { color: white; padding-left: 5px; }

.btn-feedback {
    background: #ff4d6d;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    margin-top: 15px;
    width: 100%;
    transition: 0.3s;
}

.btn-feedback:hover { background: #ff7e5f; }

.rating-display {
    margin-top: 15px;
    color: #f1c40f; /* Couleur Or pour les étoiles */
    display: flex;
    align-items: center;
    gap: 5px;
}

.rating-display span { color: #b2bec3; font-size: 0.85rem; margin-left: 5px; }

.footer-bottom {
    text-align: center;
    margin-top: 50px;
    padding-top: 20px;
    border-top: 1px solid #636e72;
    font-size: 0.85rem;
    color: #636e72;
}

/* Assure que le bouton d'envoi n'est pas coupé sur mobile */
#form-vendeur {
    display: flex;
    flex-direction: column;
    max-height: 65vh; /* Reduit légèrement pour laisser de la place au bouton */
    overflow-y: auto;
    padding-bottom: 80px; /* Espace crucial pour voir le bouton en scrollant */
    -webkit-overflow-scrolling: touch; /* Défilement fluide sur iOS */
}

/* Style spécifique pour le bouton d'envoi à l'intérieur du formulaire */
#form-vendeur .btn-seller {
    margin-top: 20px;
    margin-bottom: 10px;
    flex-shrink: 0; /* Empêche le bouton de s'écraser */
    width: 100%;
}

@media (max-width: 768px) {
    .modal-content-white {
        max-height: 90vh; /* Empêche la modale de dépasser l'écran */
        display: flex;
        flex-direction: column;
    }
    
    .modal-header {
        flex-shrink: 0; /* Garde l'entête fixe */
    }
}
#form-vendeur label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #2d3436;
}

/* Cartes choix categorie */
.category-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.category-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
    font-size: 0.9rem;
    line-height: 1.3;
}

.category-card input {
    accent-color: #ff4d6d;
}

.category-card:hover {
    border-color: #ff4d6d;
    box-shadow: 0 6px 14px rgba(255, 77, 109, 0.15);
    transform: translateY(-1px);
}

.category-card input:checked + span {
    font-weight: 700;
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: 1fr;
        max-height: 220px;
        overflow-y: auto;
        padding-right: 4px;
    }
}

/* (retrait des cartes catégories, retour au select) */

#form-vendeur input:focus, #form-vendeur select:focus, #form-vendeur textarea:focus {
    border-color: #ff4d6d;
    outline: none;
    box-shadow: 0 0 5px rgba(255, 77, 109, 0.2);
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff4d6d;
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    font-weight: bold;
    border: 2px solid white;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .footer-container { text-align: center; }
    .footer-logo, .social-icons, .rating-display { justify-content: center; }
    .footer-col ul li a { justify-content: center; }
}

/* Adaptabilité Mobile */
@media (max-width: 768px) {
    .info-container {
        flex-direction: column;
    }
}

/* --- Responsive Media Queries --- */
@media (max-width: 992px) {
    .logo-text { font-size: 1.2rem; }
    .search-bar { max-width: 400px; }
}

@media (max-width: 768px) {
    .navbar {
        flex-wrap: wrap;
        padding: 15px 3%;
    }
    
    .logo { order: 1; }
    .nav-tools { order: 2; }
    
    .search-container {
        order: 3;
        flex: 0 0 100%; /* Search takes full width on mobile */
        margin-top: 15px;
        padding: 0;
    }

    .hero { height: 60vh; }
}
@media (max-width: 768px) {
    /* ... vos autres styles (navbar, logo, etc.) ... */

    .hero { 
        height: 40vh; /* Reduit la hauteur pour les tablettes/mobiles */
        min-height: 300px; /* Assure que la bannière ne soit pas trop écrasée */
        background-attachment: scroll; /* Ameliore la performance sur mobile */
    }

    .hero-content h1 {
        font-size: 1.8rem; /* Reduit la taille du titre pour qu'il tienne sur l'image */
    }
}
@media (max-width: 480px) {
    .hero {
        height: 30vh; /* Hauteur encore plus petite pour les petits écrans */
        min-height: 250px;
    }
}
@media (max-width: 768px) {
    .logo-text { 
        display: block; /* Force l'affichage du texte */
        font-size: 1.1rem; /* Reduit un peu la taille pour gagner de la place */
        margin-left: 5px;
    }

    /* Optionnel : Ajuster la taille de l'image du logo pour libérer de l'espace */
    .logo img {
        height: 35px; 
    }
}

/* Intro Overlay Animation */

/* Intro Overlay Animation - Version Responsive */
#intro-overlay {
    position: fixed; 
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #00bcd4; 
    z-index: 9999; 
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px; /* Évite que le texte touche les bords sur mobile */
    opacity: 1;
    visibility: visible;
    transition: opacity 1s ease-out, visibility 1s ease-out;
}

.animation-content {
    width: 100%;
    max-width: 90%; /* Assure une marge sur les petits écrans */
    text-align: center;
}

.animation-content h1 {
    color: white;
    /* Utilisation de clamp pour une taille fluide : min 1.2rem, idéal 5vw, max 2rem */
    font-size: clamp(1.2rem, 5vw, 2rem); 
    line-height: 1.4; /* Ameliore la lisibilité si le texte passe sur deux lignes */
    margin: 0;
    white-space: normal; /* Autorise le retour à la ligne automatique */
    animation: zoomInFade 2s ease-in-out forwards;
}

@keyframes zoomInFade {
    0% { opacity: 0; transform: scale(0.8); }
    50% { opacity: 1; transform: scale(1.05); }
    100% { opacity: 1; transform: scale(1); }
}

.hidden {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none;
}

/* Ameliore le rendu des sections sous la ligne de flottaison */
.site-info,
.main-footer {
    content-visibility: auto;
    contain-intrinsic-size: 800px;
}




/* Style pour le contenu défilable de la modale panier */
#order-details-content {
    max-height: 400px; /* Hauteur maximale avant l'apparition du curseur */
    overflow-y: auto;  /* Active le défilement vertical */
    padding-right: 10px; /* Espace pour ne pas coller au curseur */
    margin-bottom: 15px;
}

/* Personnalisation du curseur (scrollbar) pour un look plus moderne */
#order-details-content::-webkit-scrollbar {
    width: 6px;
}

#order-details-content::-webkit-scrollbar-thumb {
    background-color: #ff4d6d;
    border-radius: 10px;
}

#order-details-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

/* --- Vendor Form Layout Overrides (Desktop + Mobile) --- */
#seller-modal .modal-content-white {
    max-width: 560px;
    width: 92%;
    margin: 6vh auto;
}

@media (min-width: 992px) {
    #seller-modal {
        overflow: auto;
    }

    #seller-modal .modal-content-white {
        margin: 6vh auto;
        max-height: calc(100vh - 12vh);
        overflow-y: auto;
    }
}

#form-vendeur {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

#form-vendeur > div {
    margin-bottom: 0;
}

#form-vendeur .btn-seller {
    margin-top: 10px;
    margin-bottom: 6px;
    width: 100%;
}

#form-vendeur .form-scroll-controls {
    border-top: none;
    box-shadow: none;
}

@media (max-width: 768px) {
    #seller-modal .modal-content-white {
        max-width: 92vw;
        padding: 18px;
        margin: 4vh auto;
    }

    #form-vendeur {
        max-height: 70vh;
        overflow-y: auto;
        padding-right: 6px;
        padding-bottom: 60px;
    }

    #form-vendeur .form-scroll-controls {
        position: sticky;
        bottom: 0;
        background: #fff;
        padding-top: 8px;
        display: flex;
        justify-content: flex-end;
        gap: 8px;
    }
}
