/*
 * Header Styles - OUI PNEU
 * Styles pour le header et la navigation
 */

/* ===========================
   HEADER PRINCIPAL
   =========================== */

.site-header {
    background-color: #000;
    padding: 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: relative;
    z-index: 1000;
}

.mobile-only {
    display: none !important;
}

@media (max-width: 950px) {
    .mobile-only {
        display: flex !important;
    }
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 2fr 1fr;
    align-items: center;
    gap: 30px;
    padding: 20px;
}

/* ===========================
   LOGO
   =========================== */

.site-logo {
    display: flex;
    align-items: center;
    gap: 15px;
    justify-self: start;
}

.logo-icon img {
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: #000;
    letter-spacing: 2px;
}

/* ===========================
   NAVIGATION PRINCIPALE
   =========================== */

.header-center {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-self: center;
    width: 130%;
}

.main-navigation {
    display: flex;
    gap: 30px;
    align-items: center;
    justify-content: center;
}

.main-navigation a {
    color: #FFDD03;
    text-decoration: none;
    font-weight: 500;
    font-size: 16px;
    position: relative;
    transition: color 0.3s ease;
}

.main-navigation a:hover,
.main-navigation a.active {
    color: #FFDD03;
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background-color: #FFDD03;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.main-navigation a:hover::after {
    transform: scaleX(1);
}

.main-navigation a.active::after {
    transform: scaleX(1);
}

/* ===========================
   BARRE DE RECHERCHE
   =========================== */

.header-search {
    display: flex;
    align-items: center;
    background-color: #f5f5f5;
    border-radius: 25px;
    padding: 10px 15px;
    min-width: 250px;
    max-width: 350px;
    gap: 10px;
    height: 42px;
    font-size: 16px;
}

.header-search input {
    border: none;
    background: transparent;
    outline: none;
    flex: 1;
    padding: 0;
    font-size: 15px;
    color: #333;
    min-width: 0;
}

.header-search input::placeholder {
    color: #999;
}

.header-search-icon {
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.header-search-icon svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ===========================
   ACTIONS HEADER (Compte, Panier)
   =========================== */

.header-actions {
    display: flex;
    gap: 15px;
    align-items: center;
    justify-self: end;
}

.header-action {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    text-decoration: none;
    position: relative;
    transition: background-color 0.3s ease;
    border: none;
    cursor: pointer;
}

#connexion-btn img {
    color: white;
    width: 100px;
    border-radius: 10px;
    height: 30px;
}

.header-action:hover {
    background-color: #333;
}

/* Mobile Search Button */
.header-search-btn {
    background-color: #FFDD03;
    color: #000;
}

.header-search-btn:hover {
    background-color: #FFC700;
}

.header-search-btn svg {
    width: 20px;
    height: 20px;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #FFDD03;
    color: #000;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}

/* ===========================
   BANNIÈRE PROMOTION
   =========================== */

.promotion-banner {
    background-color: #FFDD03;
    padding: 15px 0;
    text-align: center;
    position: relative;
}

.promotion-banner::before,
.promotion-banner::after {
    content: '🔥';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
}

.promotion-banner::before {
    left: 50px;
}

.promotion-banner::after {
    right: 50px;
}

.promotion-text {
    font-weight: 600;
    font-size: 16px;
    color: #000;
    padding: 0 20px;
}

/* ===========================
   MENU HAMBURGER (Mobile)
   =========================== */

.hamburger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1001;
}

.hamburger-menu span {
    width: 100%;
    height: 3px;
    background-color: #FFDD03;
    border-radius: 3px;
    transition: all 0.3s ease;
    display: block;
}

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

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

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

body.menu-open {
    overflow: hidden;
}

.menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* ===========================
   MOBILE SEARCH BAR (sous header)
   =========================== */

.mobile-search-bar {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: #000;
    border-bottom: 1px solid #333;
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease, padding 0.3s ease;
    z-index: 999;
    display: none;
}

.mobile-search-bar.active {
    max-height: 100px;
    opacity: 1;
    padding: 10px;
}

.mobile-search-bar .header-search {
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 10px;
    transition: all 0.2s ease;
    max-width: 500px;
    margin: 0 auto;
    padding: 12px 18px;
    font-size: 16px;
    height: 35px;
}

.mobile-search-bar .header-search input {
    color: #fff;
    font-size: 16px;
}

.mobile-search-bar .header-search input::placeholder {
    color: #666;
}

.mobile-search-bar .header-search:focus-within {
    border-color: #FFDD03;
    background-color: #222;
}

.mobile-search-bar .header-search-icon {
    color: #999;
    cursor: pointer;
    transition: all 0.2s ease;
    background: none;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-search-bar .header-search-icon:hover {
    color: #FFDD03;
    transform: scale(1.1);
}

.mobile-search-bar .header-search-icon:active {
    transform: scale(0.95);
}

/* Show on mobile only */
@media (max-width: 950px) {
    .mobile-search-bar {
        display: block;
    }
}

/* ===========================
   RESPONSIVE DESIGN
   =========================== */

/* Tablettes - 1024px */
@media (max-width: 1024px) {
    .header-content {
        gap: 20px;
    }
    
    .header-search {
        min-width: 200px;
        max-width: 250px;
    }
    
    .promotion-banner::before {
        left: 30px;
    }
    
    .promotion-banner::after {
        right: 30px;
    }
}

/* Mobile - 950px */
@media (max-width: 950px) {
    .mobile-only {
        display: block;
    }
    
    .header-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        position: relative;
    }
    
    .hamburger-menu {
        display: flex;
        order: 1;
        z-index: 1002;
    }
    
    .site-logo {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        order: 2;
        z-index: 1001;
    }
    
    .header-actions {
        order: 3;
        gap: 10px;
        z-index: 1002;
        margin-left: auto;
    }
    
    .header-action {
        width: 35px;
        height: 35px;
    }
    
    /* Menu coulissant */
    .header-center {
        position: fixed;
        top: 0;
        left: -100%;
        width: 280px;
        height: 100vh;
        background-color: #000;
        flex-direction: column;
        padding: 80px 30px 30px;
        gap: 30px;
        transition: left 0.3s ease;
        z-index: 1000;
        overflow-y: auto;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.5);
        margin-top: 20px;
    }
    
    .header-center.active {
        left: 0;
    }
    
    .main-navigation {
        flex-direction: column;
        gap: 20px;
        width: 100%;
        align-items: flex-start;
    }
    
    .main-navigation a {
        font-size: 18px;
        width: 100%;
        padding: 12px 0;
        border-bottom: 1px solid #333;
    }
    
    .main-navigation a::after {
        bottom: 0;
    }
    
    /* Hide search bar in hamburger menu on mobile */
    .header-center .header-search {
        display: none;
    }
}

/* Petit Mobile - 480px */
@media (max-width: 480px) {
    .header-content {
        padding: 10px 15px;
    }
    
    .header-center {
        width: 100%;
    }
    
    .logo-icon img {
        height: 40px;
    }
    
    .main-navigation a {
        font-size: 16px;
    }
    
    .header-search {
        padding: 8px 12px;
        height: 38px;
    }
    
    .header-actions {
        gap: 4px;
    }
    
    .header-action {
        width: 32px;
        height: 32px;
    }
    
    .hamburger-menu {
        width: 26px;
        height: 20px;
    }
    
    .hamburger-menu span {
        height: 2px;
    }
    
    .promotion-banner {
        padding: 10px 0;
    }
    
    .promotion-banner::before,
    .promotion-banner::after {
        font-size: 14px;
    }
    
    .promotion-banner::before {
        left: 20px;
    }
    
    .promotion-banner::after {
        right: 20px;
    }
    
    .promotion-text {
        font-size: 14px;
        padding: 0 15px;
    }
}

/* Très Petit Mobile - 360px */
@media (max-width: 360px) {
    .promotion-banner {
        padding: 8px 0;
    }
    
    .promotion-banner::before,
    .promotion-banner::after {
        display: none;
    }
    
    .promotion-text {
        font-size: 13px;
        padding: 0 10px;
        line-height: 1.3;
    }
}

