/* =============================================
   Wooden Sheds – Custom Site Header
   ============================================= */

.ws-header {
    position: relative;
    z-index: 9999;
    width: 100%;
}

.ws-header__inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Top Bar (Trust Bar) ── */

.ws-header__topbar {
    background: var(--ws-header-topbar-bg, #2E1B18);
    color: var(--ws-header-topbar-text, #fff);
    padding: 10px 24px;
    font-size: 13px;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.ws-header__topbar-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    max-width: 1400px;
    margin: 0 auto;
}

.ws-header__topbar-item {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 4px 12px;
    color: inherit;
    text-decoration: none;
    transition: opacity 0.15s;
}

.ws-header__topbar-item:hover {
    opacity: 0.85;
    color: inherit;
    text-decoration: none;
}

.ws-header__topbar-icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    opacity: 0.9;
}

.ws-header__topbar-icon--stars {
    gap: 1px;
}

.ws-header__topbar-icon--stars svg {
    width: 14px;
    height: 14px;
}

.ws-header__topbar-text {
    display: flex;
    flex-direction: column;
    line-height: 1.3;
}

.ws-header__topbar-text strong {
    font-size: 13px;
    font-weight: 600;
}

.ws-header__topbar-text span {
    font-size: 11px;
    opacity: 0.8;
    font-weight: 400;
}

/* Carousel arrows: hidden on desktop, shown on mobile */
.ws-header__topbar-arrow {
    display: none;
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.15s;
    align-items: center;
    flex-shrink: 0;
}

.ws-header__topbar-arrow:hover {
    opacity: 1;
}

/* ── Main Bar ── */

.ws-header__main {
    background: var(--ws-header-bg, #3E2723);
    color: var(--ws-header-text, #fff);
    padding: 12px 0;
}

.ws-header__main .ws-header__inner {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

/* Logo */
.ws-header__logo {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
}

.ws-header__logo img {
    height: var(--ws-header-logo-height, 40px);
    width: auto;
    display: block;
}

.ws-header__logo-text {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

/* Search (desktop) */
.ws-header__search {
    flex: 1;
    min-width: 0;
    max-width: 600px;
    margin: 0 auto;
}

/* FiboSearch overrides within our header */
.ws-header__search .dgwt-wcas-search-wrapp {
    max-width: 100% !important;
}

.ws-header__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp {
    display: flex !important;
    flex-direction: row !important;
}

.ws-header__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
    border-radius: 6px 0 0 6px !important;
    height: 55px !important;
    font-size: 15px !important;
    padding: 0 16px !important;
    border: none !important;
    background: #fff !important;
    color: #333 !important;
    flex: 1 !important;
    order: 1 !important;
}

.ws-header__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit {
    background: transparent !important;
    border-radius: 0 6px 6px 0 !important;
    border: none !important;
    width: 48px !important;
    min-width: 48px !important;
    order: 2 !important;
    position: relative !important;
    right: auto !important;
    left: auto !important;
}

/* Hide FiboSearch default icon and replace with matching header-style icon */
.ws-header__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit svg {
    display: none !important;
}

.ws-header__search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp .dgwt-wcas-search-submit {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%230f5233' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    background-size: 20px !important;
}

/* Standard WP search form fallback */
.ws-header__search .search-form {
    display: flex;
}

.ws-header__search .search-form .search-field {
    flex: 1;
    height: 55px;
    border: none;
    border-radius: 6px 0 0 6px;
    padding: 0 16px;
    font-size: 15px;
}

.ws-header__search .search-form .search-submit {
    height: 55px;
    padding: 0 20px;
    background: #F5C518;
    border: none;
    border-radius: 0 6px 6px 0;
    font-weight: 600;
    cursor: pointer;
}

/* Mobile search (hidden on desktop) */
.ws-header__mobile-search {
    display: none;
    width: 100%;
    padding: 0 0 4px;
}

.ws-header__search-toggle {
    display: none;
}

/* Reviews badge */
.ws-header__reviews-badge {
    flex-shrink: 0;
    position: relative;
    z-index: 10;
    overflow: visible;
}

/* Icons */
.ws-header__icons {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-shrink: 0;
}

.ws-header__icon {
    color: var(--ws-header-text, #fff);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: opacity 0.15s;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.ws-header__icon:hover {
    opacity: 0.8;
}

.ws-header__cart {
    position: relative;
}

.ws-header__cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #F5C518;
    color: #333;
    font-size: 10px;
    font-weight: 700;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.ws-header__cart-total {
    font-size: 14px;
    font-weight: 600;
    margin-left: 4px;
}

/* Hamburger (hidden on desktop) */
.ws-header__hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 28px;
    height: 28px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.ws-header__hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--ws-header-text, #fff);
    border-radius: 2px;
    transition: transform 0.3s, opacity 0.3s;
}

/* ── Navigation Bar (desktop) — sticky on scroll ── */

.ws-header__nav {
    background: var(--ws-header-bg, #3E2723);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    transition: box-shadow 0.2s ease;
}

.ws-header__nav.is-stuck {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 9998;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

/* Spacer element that prevents content jump when nav becomes fixed */
.ws-header__nav-spacer {
    display: none;
}

.ws-header__nav-spacer.is-active {
    display: block;
}

.ws-header__nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.ws-header__nav-inner::-webkit-scrollbar {
    display: none;
}

.ws-header__menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0;
    white-space: nowrap;
}

.ws-header__menu--left {
    margin-right: auto;
}

.ws-header__menu--right {
    margin-left: auto;
}

.ws-header__menu > li {
    position: relative;
}

.ws-header__menu > li > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 12px 16px;
    color: var(--ws-header-text, #fff);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.ws-header__menu > li > a:hover,
.ws-header__menu > li.current-menu-item > a,
.ws-header__menu > li.current-menu-ancestor > a {
    opacity: 0.85;
}

/* Dropdown indicator for items with children */
.ws-header__menu > li.menu-item-has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 4px;
    opacity: 0.6;
}

/* Sub-menus (dropdowns) */
.ws-header__menu > li > .sub-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: #fff;
    min-width: 220px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    z-index: 100;
}

.ws-header__menu > li:hover > .sub-menu {
    display: block;
}

.ws-header__menu > li > .sub-menu > li > a {
    display: block;
    padding: 8px 20px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

.ws-header__menu > li > .sub-menu > li > a:hover {
    background: #f5f5f5;
}

/* ── Mega menu within our header nav ── */

.ws-header__menu > li.ws-has-mega-menu > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 4px solid currentColor;
    margin-left: 4px;
    opacity: 0.6;
}

.ws-header__menu > li.ws-has-mega-menu > .sub-menu {
    display: none !important;
}

/* ── Mobile Nav Drawer ── */

.ws-header__mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
}

.ws-header__mobile-overlay.is-open {
    display: block;
}

.ws-header__mobile-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    max-width: 85vw;
    height: 100vh;
    background: #fff;
    z-index: 99999;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
}

.ws-header__mobile-nav.is-open {
    right: 0;
}

.ws-header__mobile-nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
    font-weight: 700;
    font-size: 16px;
}

.ws-header__mobile-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Mobile menu list */
.ws-header__mobile-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ws-header__mobile-menu > li {
    border-bottom: 1px solid #f0f0f0;
}

.ws-header__mobile-menu > li > a {
    display: block;
    padding: 14px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
}

.ws-header__mobile-menu > li > a:hover {
    background: #f8f8f8;
}

/* Mobile sub-menus */
.ws-header__mobile-menu > li > .sub-menu,
.ws-header__mobile-menu > li > .ws-mega-menu {
    display: none;
}

.ws-header__mobile-menu > li.mobile-submenu-open > .sub-menu {
    display: block;
    list-style: none;
    margin: 0;
    padding: 0;
    background: #f8f8f8;
}

.ws-header__mobile-menu > li > .sub-menu > li > a {
    display: block;
    padding: 10px 20px 10px 36px;
    color: #555;
    text-decoration: none;
    font-size: 14px;
    border-top: 1px solid #eee;
}

.ws-header__mobile-menu > li > .sub-menu > li > a:hover {
    background: #f0f0f0;
}

/* Bottom links in mobile drawer */
.ws-header__mobile-links {
    padding: 16px 20px;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ws-header__mobile-links a {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Responsive ── */

@media (max-width: 768px) {
    .ws-header__inner {
        padding: 0 16px;
    }

    /* Top bar: carousel on mobile */
    .ws-header__topbar {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 8px 16px;
        font-size: 12px;
    }

    .ws-header__topbar-grid {
        display: block;
        position: relative;
        min-height: 2.8em;
        flex: 1;
        overflow: hidden;
    }

    .ws-header__topbar-item {
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        opacity: 0;
        transition: opacity 0.4s ease;
        justify-content: center;
        pointer-events: none;
    }

    .ws-header__topbar-item.is-active {
        position: relative;
        opacity: 1;
        pointer-events: auto;
    }

    .ws-header__topbar-arrow {
        display: flex;
    }

    /* Main bar compact */
    .ws-header__main {
        padding: 10px 0;
    }

    .ws-header__main .ws-header__inner {
        gap: 12px;
        justify-content: space-between;
    }

    .ws-header__icons {
        margin-left: auto;
    }

    /* Logo uses mobile height */
    .ws-header__logo img {
        height: var(--ws-header-logo-height-mobile, 28px);
    }

    .ws-header__logo-text {
        font-size: 18px;
    }

    /* Hide desktop search + reviews badge, show mobile search toggle */
    .ws-header__search,
    .ws-header__reviews-badge {
        display: none;
    }

    .ws-header__search-toggle {
        display: flex;
    }

    /* Mobile search bar (full width below logo row) */
    .ws-header__mobile-search {
        order: 10;
    }

    .ws-header__mobile-search.is-open {
        display: block;
    }

    .ws-header__mobile-search .dgwt-wcas-search-wrapp .dgwt-wcas-sf-wrapp input[type="search"].dgwt-wcas-search-input {
        height: 40px !important;
        font-size: 14px !important;
    }

    /* Hide cart total on mobile */
    .ws-header__cart-total {
        display: none;
    }

    /* Show hamburger */
    .ws-header__hamburger {
        display: flex;
    }

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

/* ── Push content below header ── */
.ws-header + #Wrapper,
.ws-header + .mfn-main-slider,
.ws-header + main,
.ws-header + .content-wrapper {
    margin-top: 0;
}
