/* ==========================================================================
   HEADER.CSS - Style nagłówka, nawigacji głównej i menu mobilnego (Hamburger)
   ========================================================================== */

/* =========================================
   1. GŁÓWNY KONTENER NAGŁÓWKA
   ========================================= */

.site-header {
    width: 100%;
    height: 80px;
    background-color: #ffffff;
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
}

.header-container {
    max-width: 1400px;
    margin: 0 auto;
    height: 100%;
    padding: 0 20px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between; 
}


/* =========================================
   2. LOGO I MENU GŁÓWNE (DESKTOP)
   ========================================= */

/* Logo + wordmark */
.brand-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.brand-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    flex-shrink: 0;
}

.brand-word {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.brand-name {
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: 0.06em;
    color: var(--textMain, #2b2b2b);
}

.brand-tag {
    font-size: 0.6rem;
    letter-spacing: 0.18em;
    color: var(--leadThemeDark);
    text-transform: uppercase;
    margin-top: 3px;
}

.main-nav .menu {
    display: flex;
    flex-direction: row;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.main-nav .menu > li > a {
    position: relative;
    padding: 8px 0;
    color: var(--textMain, #333);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease-in-out;
}

.main-nav .menu > li > a:hover,
.main-nav .menu > li.current-menu-item > a,
.main-nav .menu > li.current_page_item > a {
    color: var(--leadThemeDark);
}

/* Gradientowe podkreślenie aktywnej / najechanej pozycji */
.main-nav .menu > li > a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 3px;
    border-radius: 3px;
    background: linear-gradient(90deg, var(--leadTheme), var(--leadThemeDark));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.main-nav .menu > li > a:hover::after,
.main-nav .menu > li.current-menu-item > a::after,
.main-nav .menu > li.current_page_item > a::after {
    transform: scaleX(1);
}


/* =========================================
   3. PRAWA STRONA (KONTAKT I KOSZYK)
   ========================================= */

.header-actions {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Okrągłe przyciski-ikony (szukaj, konto) */
.header-icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--borderColor, #e6e6e6);
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--textMain, #2b2b2b);
    text-decoration: none;
    transition: border-color 0.2s, color 0.2s;
    flex-shrink: 0;
}

.header-icon-btn:hover {
    border-color: var(--leadTheme);
    color: var(--leadThemeDark);
}

.header-icon-btn svg {
    width: 19px;
    height: 19px;
}

/* Rozwijane pole wyszukiwania pod headerem */
.header-search-panel {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    box-sizing: border-box;
    background: #fff;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.07);
    border-top: 1px solid #f0f0f0;
    padding: 0 20px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.25s ease, padding 0.3s ease;
}

.site-header.search-open .header-search-panel {
    max-height: 90px;
    opacity: 1;
    padding: 16px 20px;
}

.header-search-form {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    border: 1px solid var(--borderColor, #e6e6e6);
    border-radius: 30px;
    padding: 4px 4px 4px 20px;
    background: #fcfcfc;
    transition: border-color 0.2s;
}

.header-search-form:focus-within {
    border-color: var(--leadTheme);
}

.header-search-input {
    flex-grow: 1;
    border: none;
    background: none;
    outline: none;
    padding: 10px 8px;
    font-size: 1rem;
    color: var(--textMain);
}

.header-search-submit {
    flex-shrink: 0;
    width: 42px;
    height: 42px;
    border: none;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--leadTheme) 0%, var(--leadThemeDark) 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.header-search-submit svg {
    width: 18px;
    height: 18px;
}

.custom-cart-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    background-color: #ffffff;
    color: var(--textMain, #222);
    padding: 10px 22px 10px 18px;
    border-radius: 50px;
    border: 1px solid var(--leadTheme);
    text-decoration: none !important;
    font-size: 0.95rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.custom-cart-btn svg {
    color: var(--leadTheme, #333); 
    margin-right: 8px;
    transition: transform 0.3s ease;
}

.custom-cart-btn:hover {
    border-color: var(--leadTheme, #333);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

.custom-cart-btn:hover svg {
    transform: scale(1.1) rotate(-5deg); 
}

.cart-label {
    color: #777;
    font-weight: 500;
    margin-right: 8px;
}

.cart-divider {
    display: none;
}

.cart-total-value {
    font-weight: 800;
    color: var(--textMain, #111);
    letter-spacing: 0.3px;
}

.cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #ff4757;
    color: #ffffff;
    font-size: 0.75rem;
    font-weight: 800;
    min-width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 3px 8px rgba(255, 71, 87, 0.4);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-cart-btn:hover .cart-count {
    transform: scale(1.15); 
}


/* =========================================
   4. HAMBURGER MENU (MOBILE TOGGLE)
   ========================================= */

.mobile-menu-toggle {
    display: none; 
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 10px;
    flex-direction: column;
    justify-content: space-around;
    width: 45px;
    height: 45px;
    z-index: 1000; 
}

.mobile-menu-toggle span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--textMain, #333);
    border-radius: 3px;
    transition: all 0.3s linear;
    transform-origin: 1px;
}


/* =========================================
   5. RESPONSYWNOŚĆ (MOBILE < 900px)
   ========================================= */

@media (max-width: 900px) {

    .custom-cart-btn .cart-label {
        display: none;
    }

    .custom-cart-btn {
        padding: 10px 16px 10px 14px;
    }

    /* Konto jest w menu (hamburger) - ikona zbędna na mobile */
    .header-account-btn {
        display: none;
    }

    .header-actions {
        gap: 10px;
    }

    /* Mniejszy odstęp logo, podpis schowany - oszczędzamy szerokość */
    .brand-link {
        gap: 9px;
    }

    .brand-badge {
        width: 42px;
        height: 42px;
    }

    .brand-tag {
        display: none;
    }

    /* --- HAMBURGER MENU --- */
    
    .mobile-menu-toggle {
        display: flex; 
        order: -1; 
    }

    .main-nav {
        position: absolute;
        top: 80px;
        left: 0;
        width: 100%;
        background-color: #ffffff;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.05);
        transform: translateY(-150%);
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease-in-out;
        z-index: 998;
    }

    .main-nav.menu-open {
        transform: translateY(0);
        opacity: 1;
        visibility: visible;
    }

    .main-nav .menu {
        flex-direction: column;
        padding: 20px;
        gap: 15px;
        text-align: center; 
    }

    .main-nav .menu > li > a {
        display: block;
        padding: 15px 0;
        font-size: 1.1rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .main-nav .menu > li:last-child > a {
        border-bottom: none;
    }

    /* --- ANIMACJA KRZYŻYKA (X) --- */
    .mobile-menu-toggle.is-active span:first-child {
        transform: rotate(45deg);
    }
    
    .mobile-menu-toggle.is-active span:nth-child(2) {
        opacity: 0; /* Środkowa kreska znika */
    }
    
    .mobile-menu-toggle.is-active span:last-child {
        transform: rotate(-45deg);
    }
}

/* Na telefonach (wąsko) chowamy wordmark - zostaje samo logo (jak dotąd),
   żeby zmieścić hamburger + logo + ikonę szukania + koszyk bez wychodzenia poza ekran. */
@media (max-width: 600px) {
    .brand-word {
        display: none;
    }
}
