/* ============================================
   LAYOUT.CSS - Header et Footer
   Dépendances : core.css
   ============================================ */

/* ============================================
   HEADER GLASSMORPHISM
   ============================================ */

.header {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
    height: var(--header-height);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}

.header__container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

/* Logo */
.header__logo {
    max-width: 70px;
    transition: opacity 0.3s ease;
}

.header__logo:hover {
    opacity: 0.8;
}

.header__logo img {
    display: block;
    width: 100%;
    height: auto;
}

/* Navigation desktop */
.header__nav {
    display: flex;
    gap: var(--spacing-md);
}

.header__nav-link {
    font-size: 15px;
    font-weight: 500;
    transition: all 0.3s ease;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.header__nav-link:hover {
    opacity: 0.7;
}

/* Actions (panier) */
.header__actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

/* Bouton panier glassmorphism */
.header__cart-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 15px;
    font-weight: 600;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 30px;
    color: #1a1a1a;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.header__cart-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 0.6);
    transform: translateY(-2px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.header__cart-count {
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #ffffff;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.header__cart-btn:hover .header__cart-count {
    background: rgba(0, 0, 0, 0.9);
}

/* Menu burger mobile */
.header__burger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: none;
}

.header__burger-icon {
    width: 24px;
    height: 24px;
    display: block;
}

/* ============================================
   FOOTER GLASSMORPHISM
   ============================================ */

.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(15px) saturate(150%);
    -webkit-backdrop-filter: blur(15px) saturate(150%);
    border-top: 1px solid rgba(200, 200, 200, 0.3);
    padding: var(--spacing-lg) 0 var(--spacing-md);
    margin-top: var(--spacing-xl);
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.05);
}

.footer__container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.footer__column h3 {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
    color: var(--color-text);
}

.footer__links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer__link {
    font-size: 14px;
    color: var(--color-text);
    transition: opacity 0.3s ease;
}

.footer__link:hover {
    opacity: 0.6;
}

.footer__bottom {
    text-align: center;
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(200, 200, 200, 0.3);
    font-size: 14px;
    opacity: 0.7;
    color: var(--color-text);
}

/* ============================================
   RESPONSIVE - TABLETTE
   ============================================ */

@media (max-width: 768px) {
    /* Cacher la nav desktop */
    .header__nav {
        display: none;
    }
    
    /* Afficher le burger */
    .header__burger {
        display: flex;
    }
    
    /* Layout mobile: burger | logo | panier */
    .header__container {
        display: grid;
        grid-template-columns: auto 1fr auto;
        gap: 1rem;
        align-items: center;
    }
    
    /* Burger à gauche */
    .header__burger {
        order: 1;
    }
    
    /* Logo centré */
    .header__logo {
        order: 2;
        justify-self: center;
        max-width: 60px;
    }
    
    /* Panier à droite */
    .header__actions {
        order: 3;
        justify-self: end;
    }
    
    /* Footer en 2 colonnes sur tablette */
    .footer__container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 480px) {
    .header__container {
        padding: 0 1rem;
    }
    
    .header__logo {
        max-width: 50px;
    }

    /* à garder au cas ou

    .header__cart-btn span:first-child {
        display: none; /* Cache le texte "Panier" sur mobile */
    
    /* Footer en 1 colonne sur mobile */
    .footer__container {
        grid-template-columns: 1fr;
        gap: var(--spacing-lg);
    }
}

/* ============================================
   RESPONSIVE - MENU MOBILE (GLASSMORPHISM)
   ============================================ */

/* Menu mobile overlay */
.mobile-menu {
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border-right: 1px solid rgba(200, 200, 200, 0.3);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 999;
    padding: var(--spacing-md);
    overflow-y: auto;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu__nav {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mobile-menu__link {
    font-size: 18px;
    font-weight: 500;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid rgba(200, 200, 200, 0.2);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.mobile-menu__link:hover,
.mobile-menu__link:active {
    background: rgba(255, 255, 255, 0.8);
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Désactiver le scroll quand menu ouvert */
body.menu-open {
    overflow: hidden;
}

@media (min-width: 769px) {
    .mobile-menu {
        display: none;
    }
}

/* ============================================
   RESPONSIVE - HEADER MOBILE (LOGO CENTRÉ)
   ============================================ */

@media (max-width: 768px) {
    .header__container {
        position: relative;
    }
    
    /* Logo centré absolument */
    .header__logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        z-index: 1;
    }
    
    /* Menu burger à gauche */
    .header__burger {
        position: relative;
        z-index: 2;
    }
    
    /* Panier à droite */
    .header__actions {
        position: relative;
        z-index: 2;
        margin-left: auto;
    }
}