@import url('https://fonts.googleapis.com/css2?family=Bungee+Spice&display=swap');

/* ========================================
   VARIABLES CSS
======================================== */
:root {
    --color-primary: #c5a387;
    --color-primary-dark: #9c6a40;
    --color-accent: #D05060;
    --color-text: #333;
    --color-text-light: #6b4423;
    --color-bg: #fff;
    --color-border: #e0e0e0;
    
    --navbar-height: 70px;
    --navbar-height-mobile: 80px;
    --transition-speed: 0.3s;
    --shadow-light: 0 2px 5px rgba(0, 0, 0, 0.1);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.15);

    --mix-champagne: #F6ECD8;
    --mix-cream: #FAF7F2;
    --mix-cocoa: #B08070;
    --mix-cocoa-dark: #9A6B58;
    --mix-gold: #CCA748;
    --mix-gold-light: #D9B857;
    --mix-rose: #FF6B8F;
    --mix-rose-soft: #FF8BA5;
    --mix-bg-main: #FAF6F3;
    --mix-bg-card: #FFF9F2;
    --mix-accent: #E6D8C8;
    --mix-text-main: #3F2A1F;
    --mix-text-secondary: #6E503D;
    --mix-text-muted: #988977;
    --mix-radius-lg: 18px;
    --mix-radius-md: 12px;
    --mix-radius-full: 9999px;
}

/* ========================================
   RESET & BASE
======================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
    max-width: 100%;
}

body {
    overflow-x: hidden;
    max-width: 100%;
}

/* ========================================
   1. BANDEAU PROMO
======================================== */
.promo-banner {
    background-color: #000;
    color: #ff0000;
    padding: 15px 0;
    overflow: hidden;
    width: 100%;
}

.promo-banner-content {
    display: inline-block;
    white-space: nowrap;
    animation: scroll-left 20s linear infinite;
    font-size: 16px;
    font-weight: bold;
}

.promo-banner-content span {
    margin: 0 50px;
}

@keyframes scroll-left {
    from { transform: translateX(0); }
    to { transform: translateX(-90%); }
}

/* ========================================
   2. LOGO SECTION
======================================== */
.logo-section {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
    background-color: var(--color-bg);
}

.logo-section img {
    height: 200px;
    width: auto;
    object-fit: contain;
}

.navbar-logo-mobile {
    display: none;
}

/* ========================================
   3. NAVBAR PRINCIPALE
======================================== */
.navbar {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 40px;
    background-color: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    position: relative;
    width: 100%;
    z-index: 100;
    box-shadow: var(--shadow-light);
    min-height: var(--navbar-height);
}

/* ========================================
   4. NAVIGATION LINKS
======================================== */
.nav-links {
    display: flex;
    gap: 50px;
    list-style: none;
    font-family: 'Bungee Spice', cursive;
    align-items: center;
    -webkit-overflow-scrolling: touch;
}

.nav-links li a {
    position: relative;
    text-decoration: none;
    color: var(--color-primary-dark);
    font-size: 16px;
    font-weight: 600;
    transition: color var(--transition-speed);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    left: 0;
    bottom: -5px;
    transition: width var(--transition-speed);
}

.nav-links li a:hover {
    color: var(--color-accent);
}

.nav-links li a:hover::after {
    width: 100%;
}

/* ========================================
   5. BOUTONS NAVBAR
======================================== */
.nav-buttons {
    display: flex;
    gap: 15px;
    align-items: center;
    position: absolute;
    right: 40px;
}

.btn-panier,
.btn-login,
.btn-user {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    border: none;
    background-color: var(--color-primary);
    color: var(--color-bg);
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--transition-speed);
    text-decoration: none;
    position: relative;
}

.btn-panier:hover,
.btn-login:hover,
.btn-user:hover {
    background-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: 0 7px 20px rgba(208, 80, 96, 0.3);
}

.btn-panier i,
.btn-login i,
.btn-user i {
    font-size: 16px;
    transition: transform var(--transition-speed);
}

.btn-panier:hover i,
.btn-login:hover i,
.btn-user:hover i {
    transform: rotate(15deg) scale(1.1);
}

/* ========================================
   6. BADGE PANIER
======================================== */
.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ff0000;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    opacity: 0;
    transform: scale(0);
    transition: all var(--transition-speed);
}

.cart-badge.show {
    opacity: 1;
    transform: scale(1);
}

/* ========================================
   7. MENU UTILISATEUR DROPDOWN
======================================== */
.user-menu {
    position: relative;
}

.btn-user .fa-chevron-down {
    font-size: 12px;
    transition: transform var(--transition-speed);
}

.user-menu.active .btn-user .fa-chevron-down {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: var(--color-bg);
    border-radius: 15px;
    box-shadow: var(--shadow-medium);
    min-width: 250px;
    overflow: hidden;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-speed);
}

.user-menu.active .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -8px;
    right: 20px;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-bottom: 8px solid var(--color-bg);
}

.dropdown-header {
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: white;
}

.dropdown-header .user-name {
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 3px;
}

.dropdown-header .user-email {
    font-size: 12px;
    opacity: 0.9;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--color-text);
    text-decoration: none;
    transition: all 0.2s;
    border-bottom: 1px solid var(--color-border);
    font-size: 14px;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item i {
    font-size: 16px;
    color: var(--color-primary-dark);
    width: 20px;
    text-align: center;
}

.dropdown-item:hover {
    background: #f8f8f8;
    padding-left: 25px;
}

.dropdown-item.logout {
    color: var(--color-accent);
    font-weight: 600;
}

.dropdown-item.logout i {
    color: var(--color-accent);
}

.dropdown-item.logout:hover {
    background: #fff5f5;
}

/* ========================================
   8. BURGER MENU
======================================== */
.burger-menu {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
    background: transparent;
    border: none;
    z-index: 101;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background-color: var(--color-primary-dark);
    transition: all var(--transition-speed);
    border-radius: 3px;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}



/* ========================================
   9. OVERLAY
======================================== */
.nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 98;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.nav-overlay.active {
    display: block;
    opacity: 1;
}

/* ========================================
   10. SECTION AUTH MOBILE (cachée par défaut)
======================================== */
.mobile-auth-section {
    display: none;
}

/* ========================================
   11. MEDIA QUERIES
======================================== */

/* TABLETTE PAYSAGE (769px - 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .navbar {
        padding: 15px 30px;
    }

    .nav-links {
        gap: 30px;
    }

    .nav-links li a {
        font-size: 14px;
    }

    .nav-buttons {
        right: 30px;
    }

    .logo-section img {
        height: 150px;
    }
}

/* TABLETTE PORTRAIT (481px - 768px) */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .logo-section img {
        height: 100px;
    }

    .navbar {
        padding: 12px 20px;
    }

    .burger-menu {
        display: flex;
        position: absolute;
        right: 20px;
        top: 50%;
        transform: translateY(-50%);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        height: 100vh;
        width: 200px;
        background: var(--color-bg);
        flex-direction: column;
        gap: 0;
        padding: 80px 0 0;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 99;
        overflow-y: auto;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid var(--color-border);
    }

    .nav-links li a {
        display: block;
        padding: 20px 10px;
        font-size: 13px;
        font-family: Arial, sans-serif;
        color: var(--color-text);
    }

    .nav-links li a::after {
        display: none;
    }

    .nav-links li a:hover {
        background: #f8f8f8;
        color: var(--color-accent);
        padding-left: 40px;
    }

    .mobile-auth-section {
        display: block;
        padding: 15px;
        background: #f5f5f5;
        border-top: 1px solid var(--color-border);
        margin-top: auto;
    }

    .nav-buttons {
        position: static;
        gap: 12px;
    }

    .navbar .btn-panier span:not(.cart-badge),
    .navbar .btn-login span,
    .navbar .btn-user span {
        display: none;
    }

    .btn-panier,
    .btn-login,
    .btn-user {
        padding: 12px;
        width: 40px;
        height: 45px;
        justify-content: center;
    }

    .btn-user .fa-chevron-down {
        display: none;
    }

    .cart-badge {
        top: -8px;
        right: -8px;
    }

    .dropdown-menu {
        min-width: 120px;
        right: -10px;
    }

    .promo-banner-content {
         display: inline-block;
    white-space: nowrap;
    animation: scroll-left 20s linear infinite;
    font-size: 16px;
    font-weight: bold;
    }

    .promo-banner-content span {
        margin: 0 30px;
    }
}

/* ========================================
   MOBILE (< 480px) — bloc UNIQUE et propre
======================================== */
@media screen and (max-width: 430px) {

    /* --- Logo --- */
    .logo-section.logo-desktop {
        display: none;
    }

    .navbar-logo-mobile {
        display: block;
        position: absolute;
        left: 15px;
    }

    .navbar-logo-mobile img {
        height: 55px;
        width: auto;
    }

    /* --- Navbar --- */
    .navbar {
        padding: 12px 15px 12px 90px;
        justify-content: flex-end;
        min-height: var(--navbar-height-mobile);
    }

    /* --- Burger --- */
    .burger-menu {
        display: flex;
        position: static;
        padding: 8px;
        width: 40px;
        height: 40px;
        order: 1;
    }

    .burger-menu span {
        width: 22px;
    }

    /* --- Bouton panier --- */
    .btn-panier {
        padding: 8px;
        width: 40px;
        height: 40px;
        background: transparent;
        box-shadow: none;
        order: 2;
    }

    .btn-panier:hover {
        background: transparent;
        transform: none;
    }

    .btn-panier i {
        font-size: 20px;
        color: var(--color-primary-dark);
    }

    .cart-badge {
        top: -4px;
        right: -4px;
        width: 18px;
        height: 18px;
        font-size: 10px;
    }

    /* Masquer login/user desktop dans la navbar */
    .navbar .btn-login,
    .navbar .user-menu {
        display: none;
    }

    /* --- Nav buttons --- */
    .nav-buttons {
        position: static;
        gap: 5px;
    }

    /* --- Menu mobile : pleine largeur --- */
   .nav-links {
    position: fixed;
    top: var(--navbar-height-mobile);
    right: -60%;
    width: 60%;
    height: auto;
    max-height: calc(100vh - var(--navbar-height-mobile));
    overflow-y: auto;
    padding: 0;
    background: var(--color-bg);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    z-index: 99;
    flex-direction: column;
    gap: 0;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: center;
}

.nav-links.active {
    right: 0;
}

    .nav-links li {
        width: 100%;
        border-bottom: 1px solid #e8e8e8;
    }

    .nav-links li a {
        display: block;
        padding: 18px 25px;
        font-family: Arial, sans-serif;
        font-size: 13px;
        font-weight: 600;
        color: var(--color-text);
    }

    .nav-links li a::after {
        display: none;
    }

    .nav-links li a:hover {
        background: rgba(197, 163, 135, 0.15);
        color: var(--color-accent);
        padding-left: 30px;
    }

    /* --- Section auth mobile --- */
    .mobile-auth-section {
    display: block;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    padding: 10px 12px;
    border-top: 3px solid var(--color-primary-dark);
}

    /* Bouton login (non connecté) */
    .mobile-login-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        width: 100%;
        padding: 14px;
        background: var(--color-bg);
        color: var(--color-primary-dark);
        border-radius: 8px;
        text-decoration: none;
        font-weight: 700;
        font-size: 14px;
        box-shadow: var(--shadow-light);
        transition: all var(--transition-speed);
    }

 .mobile-login-btn:hover {
    background: var(--color-bg) !important;
    color: var(--color-accent) !important;
    transform: translateY(-2px);
}

.mobile-login-btn:hover i,
.mobile-login-btn:hover span {
    color: var(--color-accent) !important;
}

    /* Bloc user connecté */
/* ========================================
   MOBILE USER SECTION (REMPLACEMENT)
======================================== */

.mobile-user-section {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-medium);
}

.mobile-user-header {
    background: var(--color-primary-dark);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 16px;
    border-bottom: none;
}

.mobile-user-avatar {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    border: 2px solid rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}

.mobile-user-info .user-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: #ffffff;
    text-align: left;
    margin-bottom: 2px;
}

.mobile-user-info .user-email {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.75);
    text-align: left;
}

/* GRID LINKS */
.mobile-user-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    background: #fff;
}

.mobile-user-links a {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    padding: 10px 8px !important;
    border-right: 1px solid #f0e8e0 !important;
    border-bottom: 1px solid #f0e8e0 !important;
    text-align: center !important;
}

.mobile-user-links a:nth-child(2n) {
    border-right: none !important;
}

.mobile-user-links a:nth-last-child(-n+2):not(.logout) {
    border-bottom: none !important;
}

/* ICON STYLE */
.mobile-user-links a i {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px !important;
    height: 32px !important;
    border-radius: 10px !important;
    background: #fdf6f0 !important;
    font-size: 14px !important;
    color: var(--color-primary-dark) !important;
    margin: 0 !important;
}

.mobile-user-links a span {
    font-size: 10px !important;
    font-weight: 600 !important;
    color: var(--color-primary-dark) !important;
    display: block !important;
}

.mobile-user-header span,
.mobile-user-header div {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.mobile-user-links a:hover {
    background: #fdf6f0;
}

/* LOGOUT */
.mobile-user-links a.logout {
    grid-column: 1 / -1;
    flex-direction: row !important;
    justify-content: center !important;
    background: #fff5f6;
    border-top: 1px solid #fddde1 !important;
    border-right: none !important;
    border-bottom: none !important;
    padding: 13px !important;
    gap: 8px !important;
    color: var(--color-accent) !important;
    font-size: 13px !important;
    font-weight: 700 !important;
}

.mobile-user-links a.logout i {
    width: auto !important;
    height: auto !important;
    background: transparent !important;
    font-size: 15px !important;
    color: var(--color-accent) !important;
}

.mobile-user-links a.logout span {
    color: var(--color-accent) !important;
    font-size: 13px !important;
}

    /* --- Bandeau promo --- */
    .promo-banner {
        padding: 10px 0;
    }

    .promo-banner-content {
        font-size: 11px;
    }

    .promo-banner-content span {
        margin: 0 15px;
    }
}



/* ========================================
   12. OPTIMISATIONS PERFORMANCE
======================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

@media (hover: none) and (pointer: coarse) {
    .btn-panier,
    .btn-login,
    .btn-user,
    .nav-links li a,
    .dropdown-item,
    .mobile-user-links a {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
}