/* ============================================
   HEADER STYLES
   ============================================ */

/* CSS Variables */
:root {
    /* Header */
    --header-height: 70px;
    --header-bg: #ffffff;
    --header-text: #2E2E2E;
    --header-border: #e5e5e5;
    --primary-color: #6B8E23;
    /* Przykładowy zielony z designu - dostosuj! */
    --transition: 0.3s ease;
}

/* ============================================
   HEADER MAIN
   ============================================ */

.site-header {
    /* position: sticky; */
    top: var(--topbar-height, 0px);
    left: 0;
    right: 0;
    width: 100%;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    z-index: 1000;
    transition: box-shadow var(--transition);
}

.site-header.scrolled {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.header-container {
    max-width: 1490px;
    margin: 0 auto;
    padding: 9px 24px 0 0;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}

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

.header-logo {
    flex-shrink: 0;
}

.header-logo a {
    display: block;
    line-height: 1;
}

.logo-svg {
    height: 56px;
    width: auto;
    display: block;
}

/* ============================================
   DESKTOP NAVIGATION
   ============================================ */

.header-nav {
    flex: 1;
    display: flex;
    justify-content: center;
}

.main-menu {
    display: flex;
    list-style: none;
    margin: 0;
    align-items: center;
    padding: 0;
    gap: 32px;
}

.main-menu li {
    margin: 0;
}

.main-menu a {
    color: var(--header-text);
    text-decoration: none;
    font-size: 24px;
    font-weight: 600;
    font-family: var(--font-family-heading);
    letter-spacing: 0.3px;
    transition: color var(--transition);
    position: relative;
    padding: 4px 0;
}

.main-menu a:hover,
.main-menu .current-menu-item a {
    color: var(--primary-color);
}

.main-menu a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width var(--transition);
}

.main-menu a:hover::after,
.main-menu .current-menu-item a::after {
    width: 100%;
}

/* ============================================
   DROPDOWN SUBMENU
   ============================================ */

/* Parent item that has children — relative anchor for dropdown */
.main-menu li.menu-item-has-children {
    position: relative;
}

/* Arrow indicator on parent link — override the underline ::after */
.main-menu li.menu-item-has-children > a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.main-menu li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    /* reset underline styles */
    position: static;
    background: none;
    /* arrow rotation */
    transform: rotate(45deg);
    margin-bottom: 3px;
    flex-shrink: 0;
    transition: transform var(--transition), opacity var(--transition);
    opacity: 0.6;
}

/* Rotate arrow upward when submenu is open */
.main-menu li.menu-item-has-children:hover > a::after {
    transform: rotate(-135deg);
    margin-bottom: -2px;
    opacity: 1;
    width: 6px; /* prevent underline width:100% from kicking in */
}

/* The submenu itself */
.main-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-6px);
    min-width: 220px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(60, 64, 48, 0.13), 0 2px 8px rgba(60, 64, 48, 0.08);
    list-style: none;
    margin: 0;
    padding: 14px 0 8px; /* padding-top creates the visual gap while keeping hover area connected */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
    z-index: 1100;
    pointer-events: none;
}

/* Small triangle notch pointing up */
.main-menu .sub-menu::before {
    content: '';
    position: absolute;
    top: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 14px;
    height: 7px;
    background: #fff;
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    filter: drop-shadow(0 -2px 2px rgba(60, 64, 48, 0.08));
}

/* Show submenu on hover */
.main-menu li.menu-item-has-children:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Submenu links */
.main-menu .sub-menu li {
    margin: 0;
}

.main-menu .sub-menu a {
    display: block;
    padding: 10px 22px;
    font-size: 15px;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family-menu);
    color: var(--color-olive-dark, #3C4030);
    letter-spacing: 0.2px;
    white-space: nowrap;
    transition: background var(--transition), color var(--transition), padding-left var(--transition);
}

/* Submenu link — underline off, replaced by left-border accent */
.main-menu .sub-menu a::after {
    display: none;
}

.main-menu .sub-menu a::before {
    display: none;
}

.main-menu .sub-menu a:hover,
.main-menu .sub-menu .current-menu-item a {
    color: var(--color-olive, #666D52);
    background: #f7f5f0;
    padding-left: 28px;
}

/* Thin separator between items */
.main-menu .sub-menu li + li {
    border-top: 1px solid rgba(102, 109, 82, 0.1);
}

/* ============================================
   HEADER ICONS
   ============================================ */

.header-icons {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-icon,
.search-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--header-text);
    background: none;
    border: none;
    cursor: pointer;
    transition: color var(--transition);
    position: relative;
    padding: 0;
}

.header-icon:hover,
.search-toggle:hover {
    color: var(--primary-color);
}

.header-icon svg,
.search-toggle svg {
    width: 20px;
    height: 20px;
}

/* Icon Counter Badge */
.icon-count {
    position: absolute;
    top: 18px;
    right: 20px;
    width: 24px;
    height: 24px;
    padding: 0 5px;
    background: #5C2C00;
    color: #ffffff;
    font-size: 11px;
    font-weight: var(--font-weight-semibold);
    font-family: var(--font-family-text);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* ============================================
   SEARCH DROPDOWN
   ============================================ */

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--header-bg);
    border-bottom: 1px solid var(--header-border);
    padding: 20px 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height var(--transition), opacity var(--transition);
}

.search-dropdown.active {
    max-height: 100px;
    opacity: 1;
}

.search-dropdown-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

.search-form {
    display: flex;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.search-field {
    flex: 1;
    height: 48px;
    padding: 0 20px;
    border: 1px solid var(--header-border);
    border-radius: 4px;
    font-size: 15px;
    font-family: var(--font-family-text);
    transition: border-color var(--transition);
}

.search-field:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-submit {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-color);
    border: none;
    border-radius: 4px;
    color: #ffffff;
    cursor: pointer;
    transition: background var(--transition);
}

.search-submit:hover {
    background: #5a7a1d;
}

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

/* ============================================
   MOBILE MENU TOGGLE (HAMBURGER)
   ============================================ */

.mobile-menu-toggle {
    display: none;
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 24px;
    height: 24px;
}

.hamburger-line {
    width: 100%;
    height: 2px;
    background: var(--header-text);
    border-radius: 2px;
    transition: all var(--transition);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle[aria-expanded="true"] .hamburger-line:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ============================================
   MOBILE MENU OVERLAY
   ============================================ */

.mobile-menu-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition), visibility var(--transition);
}

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

.mobile-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 85%;
    max-width: 400px;
    height: 100%;
    background: var(--header-bg);
    transform: translateX(100%);
    transition: transform var(--transition);
    overflow-y: auto;
}

.mobile-menu-overlay.active .mobile-menu {
    transform: translateX(0);
}

.mobile-menu-header {
    padding: 20px;
    border-bottom: 1px solid var(--header-border);
    display: flex;
    justify-content: flex-end;
}

.mobile-menu-close {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--header-text);
}

.mobile-menu-nav {
    padding: 24px 0;
}

.mobile-menu-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.mobile-menu-list li {
    margin: 0;
    border-bottom: 1px solid var(--header-border);
}

.mobile-menu-list a {
    display: block;
    padding: 16px 24px;
    color: var(--header-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: var(--font-weight-medium);
    font-family: var(--font-family-menu);
    transition: background var(--transition), color var(--transition);
}

.mobile-menu-list a:hover,
.mobile-menu-list .current-menu-item a {
    background: #f5f5f5;
    color: var(--primary-color);
}

/* Sub-menu inside mobile drawer — always visible, indented */
.mobile-menu-list .sub-menu {
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f7f5f0;
}

.mobile-menu-list .sub-menu li {
    border-bottom: none;
    border-top: 1px solid rgba(102, 109, 82, 0.12);
}

.mobile-menu-list .sub-menu a {
    padding: 12px 24px 12px 40px;
    font-size: 14px;
    color: var(--color-olive-dark, #3C4030);
}

.mobile-menu-list .sub-menu a:hover,
.mobile-menu-list .sub-menu .current-menu-item a {
    background: #ede9df;
    color: var(--color-olive, #666D52);
}

/* ============================================
   UTILITY CLASSES
   ============================================ */

.desktop-only {
    display: flex;
}

.mobile-only {
    display: none;
}

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

@media (max-width: 768px) {
    :root {
        --header-height: 60px;
    }

    .header-container {
        padding: 0 16px;
        gap: 16px;
    }

    .logo-svg {
        height: 28px;
    }

    /* Hide desktop nav */
    .desktop-only {
        display: none;
    }

    /* Show mobile toggle */
    .mobile-only {
        display: flex;
    }

    /* Mobile icons spacing */
    .header-icons {
        gap: 12px;
    }

    .header-icon,
    .search-toggle {
        width: 36px;
        height: 36px;
    }

    /* Hide wishlist on mobile (optional) */
    .wishlist-icon {
        display: none;
    }

    /* Search dropdown mobile */
    .search-form {
        flex-direction: column;
    }

    .search-field,
    .search-submit {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header-icons {
        gap: 8px;
    }

    .header-icon svg,
    .search-toggle svg {
        width: 18px;
        height: 18px;
    }
}

/* ============================================
   BODY LOCK (gdy menu otwarte)
   ============================================ */

body.menu-open {
    overflow: hidden;
}

/* TOP BAR – wygląd jak na screenie */

:root {
    --topbar-bg: #c76f49;
    --topbar-text: #ffffff;
    --topbar-topline: #2ea3ff;
    /* niebieska kreska */
}

.topbar {
    /* position: sticky; */
    top: 0;
    z-index: 1100;
    background: var(--topbar-bg);
    color: var(--topbar-text);
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    pointer-events: none;
}

.topbar.is-ready {
    max-height: 100px;
    opacity: 1;
    pointer-events: auto;
}

.topbar.is-hidden {
    max-height: 0;
    opacity: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    pointer-events: none;
}

.topbar__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 12px 28px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 18px;
    position: relative;
}

.topbar__left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.topbar__social {
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--topbar-text);
    opacity: 0.95;
}

.topbar__social:hover {
    opacity: 1;
}

.topbar__social img {
    display: block;
    width: 25px;
    height: 25px;
}

.topbar__social svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.topbar__center {
    text-align: center;
    font-size: 15px;
    line-height: 1.2;
    position: relative;
    z-index: 1;
}

.topbar__center p {
    margin: 0;
}

.topbar__center a {
    color: inherit;
    text-decoration: none;
    border-bottom: 2px solid rgba(255, 255, 255, 0.85);
    padding-bottom: 2px;
    margin-left: 18px;
    white-space: nowrap;
}

.topbar__center a:first-of-type {
    margin-left: 0;
}

.topbar__center a:hover {
    border-bottom-color: rgba(255, 255, 255, 1);
}

.topbar__close {
    width: 34px;
    height: 34px;
    border: 0;
    background: transparent;
    color: var(--topbar-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.95;
    position: relative;
    z-index: 5;
    pointer-events: auto;
}

.topbar__close:hover {
    opacity: 1;
}

.topbar__close svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 767px) {
    .topbar {
        display: none !important;
    }

    :root {
        --topbar-height: 0px;
    }

    .topbar__inner {
        padding: 10px 16px;
        gap: 12px;
    }

    .topbar__center {
        font-size: 13px;
    }

    .topbar__center a {
        margin-left: 10px;
    }
}

.site-header {
    height: auto;
}

.header-row {
    width: 100%;
    background: var(--header-bg);
}

.header-container-top {
    min-height: 92px;
    display: grid;
    grid-template-columns: 320px 1fr 320px;
    align-items: center;
    gap: 24px;

}

.header-container-nav {
    min-height: 83px;
    padding: 28px 0;
}

.header-search {
    width: 100%;
}

.search-form-inline {
    max-width: none;
    margin: 0;
}

.search-form-inline .search-field {

  width: 100%;
  height: 48px;
  box-sizing: border-box;
  background-image: url("../images/magnifier-icon.svg");
  background-repeat: no-repeat;
  background-position: 12px center;
  background-size: 20px 20px;
  padding-left: 42px;
  margin-left: 22px;
  max-width: 142px;
}


.search-form-inline .search-submit {
    display: none;
}

.header-logo {
    justify-self: center;
    padding-top: 5px;
}

.header-icons {
    justify-self: end;
}

.header-nav {
    justify-content: center;
}

.header-row-nav .main-menu {
    width: 100%;
    justify-content: space-between;
}

@media (max-width: 1024px) {
    .header-container-top {
        grid-template-columns: 260px 1fr 260px;
    }
}

@media (max-width: 768px) {
    .header-container-top {
        display: flex;
        justify-content: space-between;
        gap: 16px;
    }
}
