/* Modern Header styling for Taimelamp.ee */

:root {
    --tl-header-bg: rgba(7, 19, 12, 0.96);
    --tl-header-top-bg: linear-gradient(120deg, #103a1e 0%, #155534 100%);
    --tl-header-border: rgba(255, 255, 255, 0.08);
    --tl-header-text: #f8fafc;
    --tl-header-muted: rgba(241, 245, 249, 0.72);
    --tl-header-accent: #54B435;
    --tl-header-accent-soft: rgba(84, 180, 53, 0.2);
    --tl-header-h: 72px; /* default header height for offsets */

    /* Absolute icon URLs to avoid relative-path issues when CSS is moved/inlined */
    --tl-icon-menu: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/menu.svg');
    --tl-icon-search: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/search.svg');
    --tl-icon-account: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/account.svg');
    --tl-icon-cart: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/cart.svg');
    --tl-icon-close: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/close.svg');
    --tl-icon-nav-home: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-home.svg');
    --tl-icon-nav-lights: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-lights.svg');
    --tl-icon-nav-shelves: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-shelves.svg');
    --tl-icon-nav-tent: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-tent.svg');
    --tl-icon-nav-ventilation: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-ventilation.svg');
    --tl-icon-nav-kits: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-kits.svg');
    --tl-icon-nav-hydroponics: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-hydroponics.svg');
    --tl-icon-nav-irrigation: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-irrigation.svg');
    --tl-icon-nav-humidifier: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-humidifier.svg');
    --tl-icon-nav-smart: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-smart.svg');
    --tl-icon-nav-tools: url('https://taimelamp.ee/wp-content/themes/taimelamp-astra-child-v101/assets/icons/nav-tools.svg');
    /* UI chip defaults for dark header */
    --tl-header-chip-bg: rgba(255, 255, 255, 0.08);
    --tl-header-chip-border: rgba(255, 255, 255, 0.12);
    --tl-header-chip-hover: rgba(255, 255, 255, 0.16);
}

/* Homepage: adapt header to homepage green scheme with readable dark text */
body.home {
    --tl-header-bg: linear-gradient(135deg, #8fbc8f 0%, #98d982 50%, #a8e6a3 100%);
    --tl-header-top-bg: linear-gradient(120deg, #7fb77a 0%, #79d28f 100%);
    --tl-header-border: rgba(5, 46, 18, 0.12);
    --tl-header-text: #052e12;
    --tl-header-muted: rgba(5, 46, 18, 0.72);
    --tl-header-accent: #2fb865;
    --tl-header-accent-soft: rgba(47, 184, 101, 0.16);
    --tl-header-chip-bg: rgba(5, 46, 18, 0.06);
    --tl-header-chip-border: rgba(5, 46, 18, 0.12);
    --tl-header-chip-hover: rgba(5, 46, 18, 0.12);
}

.tl-header {
    position: sticky;
    top: 0;
    z-index: 1400;
    color: var(--tl-header-text);
    background: var(--tl-header-bg);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--tl-header-border);
    box-shadow: 0 16px 40px rgba(7, 16, 10, 0.25);
}

/* Eliminate unexpected gap above the sticky header
   Some themes/plugins inject margins on body or first container. */
html, body { margin-top: 0 !important; }
body.admin-bar { margin-top: 0 !important; }
body.home #content, body.home .site-content { padding-top: 0 !important; margin-top: 0 !important; }
/* Remove side gutters around custom homepage sections on mobile/desktop */
body.home .tl-hero-ultra__container,
body.home .tl-fibosearch,
body.home .tl-section .container,
body.home .tl-section { margin-left: 0 !important; margin-right: 0 !important; }
body.home .tl-section .container { max-width: min(1320px, 96vw); padding-left: clamp(12px, 2vw, 20px); padding-right: clamp(12px, 2vw, 20px); }
/* Ensure the very first child after header has no artificial top gap */
#content > .ast-container:first-child { margin-top: 0 !important; padding-top: 0 !important; }

body.admin-bar .tl-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .tl-header {
        top: 46px;
    }
}

.tl-header__top {
    background: var(--tl-header-top-bg);
    font-size: 0.85rem;
    line-height: 1.5;
}

.tl-header__top .tl-header__container {
    justify-content: space-between;
    gap: 1.5rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
}

.tl-header__promo {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.85rem;
    color: rgba(241, 245, 249, 0.9);
}

.tl-header__promo span {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.tl-header__promo svg {
    width: 15px;
    height: 15px;
}

.tl-header__top-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.tl-header__top-link {
    color: var(--tl-header-text);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.tl-header__top-link:hover,
.tl-header__top-link:focus {
    opacity: 0.8;
}

.tl-header__bar {
    position: relative;
}

.tl-header__container {
    width: 100%;
    max-width: min(1680px, 90vw);
    margin: 0 auto;
    padding-left: clamp(1rem, 3vw, 3.5rem);
    padding-right: clamp(1rem, 3vw, 3.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1.2rem, 3vw, 2.6rem);
}

.tl-header__bar .tl-header__container {
    padding-top: 1.1rem;
    padding-bottom: 1.1rem;
}

/* Remove any gap directly under the header on homepage and sitewide */
body.home .site-content,
body.home #content,
body.home #primary,
body.home .ast-container { margin-top: 0 !important; padding-top: 0 !important; }

/* Full-bleed homepage: remove side gutters and center content */
body.home #content .ast-container,
body.home .site-main,
body.home .tl-section > .container,
body.home .tl-smart-filters > .container,
body.home .tl-categories > .container,
body.home .tl-partners > .container,
body.home .tl-final-cta > .container {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

/* Astra sometimes adds a top margin to the first section; neutralize it */
.site-content > .ast-container:first-child,
#content > .ast-container:first-child,
.entry-content > .wp-block-group:first-child { margin-top: 0 !important; padding-top: 0 !important; }

.tl-header__branding {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex: 1 1 auto;
    min-width: 0;
}

.tl-header__branding .custom-logo-link,
.tl-header__branding .site-logo-img {
    display: inline-flex;
    align-items: center;
}

.tl-header__branding img {
    max-height: 76px;
    height: auto;
    width: auto;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.tl-header__branding img:hover,
.tl-header__branding img:focus {
    transform: scale(1.015);
}

.tl-header__brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    color: var(--tl-header-text);
}

.tl-header__brand-title {
    font-size: clamp(1.1rem, 1.4vw, 1.4rem);
    font-weight: 700;
    margin: 0;
}

.tl-header__brand-tagline {
    font-size: 0.85rem;
    color: var(--tl-header-muted);
    margin: 0;
}

.tl-header__menu-toggle {
    display: none;
    background: var(--tl-header-chip-bg);
    border: 1px solid var(--tl-header-chip-border);
    border-radius: 999px;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    color: var(--tl-header-text);
    transition: background 0.2s ease, transform 0.2s ease;
}

/* Replace inline SVGs with robust CSS mask icons */
.tl-icon {
    display: inline-block;
    width: 26px;
    height: 26px;
    background-color: currentColor; /* color follows text */
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    mask-size: contain;
}

/* Allow explicit opt-out of CSS masking when needed */
.tl-no-mask {
    -webkit-mask-image: none !important;
            mask-image: none !important;
    -webkit-mask: none !important;
            mask: none !important;
    background: none !important;
}

.tl-no-mask svg { display: block; width: 100%; height: 100%; }


/* Use external SVGs for CSP-compatibility (data: URIs may be blocked) */
.tl-icon--menu {
    -webkit-mask-image: var(--tl-icon-menu);
            mask-image: var(--tl-icon-menu);
}

.tl-icon--search {
    -webkit-mask-image: var(--tl-icon-search);
            mask-image: var(--tl-icon-search);
}

.tl-icon--account {
    -webkit-mask-image: var(--tl-icon-account);
            mask-image: var(--tl-icon-account);
}

.tl-icon--cart {
    -webkit-mask-image: var(--tl-icon-cart);
            mask-image: var(--tl-icon-cart);
}

.tl-icon--close {
    -webkit-mask-image: var(--tl-icon-close);
            mask-image: var(--tl-icon-close);
}

.tl-icon--nav-home { -webkit-mask-image: var(--tl-icon-nav-home); mask-image: var(--tl-icon-nav-home); }
.tl-icon--nav-lights { -webkit-mask-image: var(--tl-icon-nav-lights); mask-image: var(--tl-icon-nav-lights); }
.tl-icon--nav-shelves { -webkit-mask-image: var(--tl-icon-nav-shelves); mask-image: var(--tl-icon-nav-shelves); }
.tl-icon--nav-tent { -webkit-mask-image: var(--tl-icon-nav-tent); mask-image: var(--tl-icon-nav-tent); }
.tl-icon--nav-ventilation { -webkit-mask-image: var(--tl-icon-nav-ventilation); mask-image: var(--tl-icon-nav-ventilation); }
.tl-icon--nav-kits { -webkit-mask-image: var(--tl-icon-nav-kits); mask-image: var(--tl-icon-nav-kits); }
.tl-icon--nav-hydroponics { -webkit-mask-image: var(--tl-icon-nav-hydroponics); mask-image: var(--tl-icon-nav-hydroponics); }
.tl-icon--nav-irrigation { -webkit-mask-image: var(--tl-icon-nav-irrigation); mask-image: var(--tl-icon-nav-irrigation); }
.tl-icon--nav-humidifier { -webkit-mask-image: var(--tl-icon-nav-humidifier); mask-image: var(--tl-icon-nav-humidifier); }
.tl-icon--nav-smart { -webkit-mask-image: var(--tl-icon-nav-smart); mask-image: var(--tl-icon-nav-smart); }
.tl-icon--nav-tools { -webkit-mask-image: var(--tl-icon-nav-tools); mask-image: var(--tl-icon-nav-tools); }

/* Hide legacy pseudo-element icon for menu toggle to avoid double icons */
.tl-header__menu-toggle::before { display: none; }
/* Enforce visible strokes for header icons (fixes “dot-only” icons on some setups) */
/* No global overrides for SVG strokes/fills; icons use CSS masks above */

.tl-header__menu-toggle:hover,
.tl-header__menu-toggle:focus {
    background: var(--tl-header-chip-hover);
    transform: translateY(-1px);
}

.tl-header__nav--desktop {
    flex: 2 1 auto;
    display: flex;
    justify-content: center;
}

.tl-header__nav-list {
    list-style: none;
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.75rem);
    margin: 0;
    padding: 0;
}

.tl-header__nav-list a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--tl-header-text);
    text-decoration: none;
    font-weight: 600;
    letter-spacing: -0.01em;
    padding: 0.45rem 0;
    transition: color 0.2s ease;
}

.tl-header__nav-list a::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 2px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--tl-header-accent), #22d3ee);
    transition: width 0.25s ease;
}

.tl-header__nav-list a:focus::after,
.tl-header__nav-list a:hover::after,
.tl-header__nav-list .current-menu-item > a::after,
.tl-header__nav-list .current-menu-ancestor > a::after {
    width: 100%;
}

.tl-header__nav-list .current-menu-item > a,
.tl-header__nav-list .current-menu-ancestor > a {
    color: #a3f9c6;
}

.tl-header__actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.tl-header__action {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 999px;
    background: var(--tl-header-chip-bg);
    color: var(--tl-header-text);
    border: 1px solid var(--tl-header-chip-border);
    transition: background 0.25s ease, transform 0.2s ease, color 0.25s ease;
}

.tl-header__action .tl-icon,
.tl-header__menu-toggle .tl-icon,
.tl-header__drawer-close .tl-icon,
.tl-header__drawer-search .tl-icon,
.tl-header__action svg,
.tl-header__menu-toggle svg,
.tl-header__drawer-close svg,
.tl-header__drawer-search svg { width: 26px; height: 26px; }

/* Enforce icon visibility regardless of global resets */
.tl-header__action svg,
.tl-header__menu-toggle svg,
.tl-header__drawer-close svg,
.tl-header__drawer-search svg {
    color: var(--tl-header-text) !important;
}
.tl-header__action svg path,
.tl-header__action svg circle,
.tl-header__menu-toggle svg path,
.tl-header__drawer-close svg path,
.tl-header__drawer-search svg path,
.tl-header__drawer-search svg circle {
    stroke: currentColor !important;
}

/* Smaller icon in drawer search button */
.tl-header__drawer-search .tl-icon,
.tl-header__drawer-search svg { width: 18px; height: 18px; }

.tl-header__action:hover,
.tl-header__action:focus {
    background: var(--tl-header-accent);
    color: #052e12;
    transform: translateY(-1px);
}

.tl-header__cart-count {
    position: absolute;
    top: -4px;
    right: -2px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    background: #d9f99d;
    color: #063113;
    font-size: 0.68rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.35rem;
    border: 2px solid var(--tl-header-bg);
}

/* Drawer (mobile navigation) – deprecated dark variant removed. See "Light Header v2" drawer styles below. */
/* Normalize drawer stacking so search can overlay it */
.tl-header__drawer { position: fixed; inset: 0; z-index: 1800; }
.tl-header__drawer-overlay { position: absolute; inset: 0; z-index: 1810; }
.tl-header__drawer-panel { position: absolute; z-index: 1820; }

/* Search overlay */
.tl-header-search {
    position: fixed;
    inset: 0;
    z-index: 4000; /* Above mobile drawer */
    isolation: isolate; /* create top stacking context */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 6rem 1.5rem 2rem;
    background: rgba(5, 12, 8, 0.78);
    backdrop-filter: blur(12px);
}

.tl-header-search[hidden] {
    display: none;
}

.tl-header-search__panel {
    width: min(680px, 100%);
    background: rgba(7, 19, 12, 0.96);
    border-radius: 18px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.35);
    padding: clamp(1.5rem, 4vw, 2.25rem);
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.tl-header-search__close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--tl-header-chip-bg);
    border: 1px solid var(--tl-header-chip-border);
    border-radius: 999px;
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--tl-header-text);
}

.tl-header-search__close:hover,
.tl-header-search__close:focus {
    background: var(--tl-header-accent);
    color: #052e12;
}

/* Search close icon handled by .tl-icon */

.tl-header-search__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin: 0 0 1.5rem;
    color: var(--tl-header-text);
}

.tl-header-search .dgwt-wcas-search-wrapp,
.tl-header-search .search-form {
    background: rgba(255, 255, 255, 0.98);
    border-radius: 14px;
    padding: 0.25rem;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
}

.tl-header-search .dgwt-wcas-search-input,
.tl-header-search .search-form input[type="search"] {
    border: none;
    outline: none;
    font-size: 1rem;
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    width: 100%;
}

.tl-header-search .dgwt-wcas-search-submit,
.tl-header-search .search-form button,
.tl-header-search .search-form input[type="submit"] {
    border-radius: 12px;
    background: linear-gradient(135deg, var(--tl-header-accent), #2dd4bf);
    color: #052e12;
    font-weight: 600;
    border: none;
    padding: 0.65rem 1.25rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tl-header-search .dgwt-wcas-search-submit:hover,
.tl-header-search .search-form button:hover,
.tl-header-search .search-form input[type="submit"]:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 24px rgba(84, 180, 53, 0.25);
}

/* Responsive adjustments */
@media (max-width: 1024px) {
    .tl-header__nav--desktop {
        display: none;
    }

    .tl-header__menu-toggle {
        display: inline-flex;
    }

    .tl-header__branding {
        flex: 0 1 auto;
    }

    .tl-header__actions {
        gap: 0.5rem;
    }
}

/* When search is open, hide drawer panel/overlay to avoid overlap */
body.tl-search-open .tl-header__drawer,
body.tl-search-open .tl-header__drawer-overlay,
body.tl-search-open .tl-header__drawer-panel { display: none !important; }

/* Switch to hamburger earlier to avoid logo/menu collisions on mid-desktop widths */
@media (max-width: 1280px) {
    .tl-header__nav--desktop { display: none; }
    .tl-header__menu-toggle { display: inline-flex; }
}

@media (max-width: 768px) {
    :root { --tl-header-h: 64px; }
    .tl-header__top {
        display: none;
    }

    .tl-header__branding img {
        max-height: 62px;
    }

    .tl-header__action,
    .tl-header__menu-toggle {
        width: 40px;
        height: 40px;
    }

    .tl-header__action .tl-icon,
    .tl-header__menu-toggle .tl-icon,
    .tl-header__action svg,
    .tl-header__menu-toggle svg {
        width: 24px;
        height: 24px;
    }

    .tl-header-search {
        padding-top: 5rem;
    }
}

@media (max-width: 520px) {
    .tl-header__actions {
        gap: 0.35rem;
    }

    .tl-header__cart-count {
        min-width: 18px;
        height: 18px;
        font-size: 0.65rem;
    }
}

body.tl-menu-open,
body.tl-search-open {
    overflow: hidden;
}

/* Utility: hide Gutenberg skip links when overriding header */
.skip-link {
    position: absolute;
    left: -999px;
}

.skip-link:focus {
    left: 1rem;
    top: 1rem;
    background: #fff;
    color: #000;
    padding: 0.75rem 1.25rem;
    border-radius: 8px;
    z-index: 2000;
}

/* Safety: if Astra's default header outputs for any reason, hide it */
#masthead.site-header { display: none !important; }

/* =============================================================
   Light Header v2 (2025-09-22): fresh, bright redesign
   Overrides previous dark styles and variables.
   ============================================================= */

:root {
    --tl-header-bg: #ffffff;
    --tl-header-border: #e5e7eb;
    --tl-header-text: #111827; /* slate-900 */
    --tl-header-muted: #6b7280; /* gray-500 */
    --tl-header-accent: #22c55e; /* green-500 */
    --tl-header-accent-soft: rgba(34, 197, 94, 0.12);
}

/* Hide legacy top strip for a cleaner header */
.tl-header__top { display: none !important; }

.tl-header {
    position: sticky;
    top: 0;
    z-index: 1400;
    color: var(--tl-header-text);
    background: var(--tl-header-bg);
    border-bottom: 0; /* remove thin white line under header */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.tl-header__bar { position: relative; }

.tl-header__container {
    width: 100%;
    max-width: var(--tl-container-max-width, 1240px);
    margin: 0 auto;
    padding: 0.65rem clamp(1rem, 4vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.tl-header__branding { display: flex; align-items: center; gap: 0.75rem; }
.tl-header__branding img { max-height: 56px; height: auto; width: auto; object-fit: contain; }

/* Desktop nav */
.tl-header__nav--desktop { flex: 1 1 auto; display: flex; justify-content: center; }
.tl-header__nav-list { list-style: none; display: flex; align-items: center; gap: 1.25rem; margin: 0; padding: 0; }
.tl-header__nav-list a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--tl-header-text);
    text-decoration: none;
    font-weight: 600;
    padding: 0.35rem 0.1rem;
}
.tl-header__nav-list a::after {
    content: '';
    position: absolute; left: 0; right: 0; bottom: 0;
    height: 2px; border-radius: 999px;
    background: var(--tl-header-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 180ms ease;
}
.tl-header__nav-list a:hover::after,
.tl-header__nav-list a:focus::after,
.tl-header__nav-list .current-menu-item > a::after,
.tl-header__nav-list .current-menu-ancestor > a::after { transform: scaleX(1); }
.tl-header__nav-list .current-menu-item > a,
.tl-header__nav-list .current-menu-ancestor > a { color: #065f46; }

/* Actions */
.tl-header__actions { display: flex; align-items: center; gap: 0.5rem; }
.tl-header__action,
.tl-header__menu-toggle {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; border-radius: 10px;
    background: #f3f4f6; /* gray-100 */
    color: var(--tl-header-text);
    border: 1px solid #e5e7eb;
    transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.tl-header__action:hover,
.tl-header__action:focus,
.tl-header__menu-toggle:hover,
.tl-header__menu-toggle:focus {
    background: #eefbf3; /* subtle green tint */
    border-color: var(--tl-header-accent);
    transform: translateY(-1px);
}

/* Icon sizing (inline SVG + optional .tl-icon) */
.tl-header__action svg,
.tl-header__menu-toggle svg,
.tl-header__drawer-close svg,
.tl-header__drawer-search svg,
.tl-header__action .tl-icon,
.tl-header__menu-toggle .tl-icon,
.tl-header__drawer-close .tl-icon,
.tl-header__drawer-search .tl-icon { width: 22px; height: 22px; }

.tl-header__cart-count {
    position: absolute; top: -6px; right: -6px;
    min-width: 18px; height: 18px;
    border-radius: 999px; background: var(--tl-header-accent);
    color: #fff; font-size: 0.68rem; font-weight: 700;
    display: inline-flex; align-items: center; justify-content: center;
    border: 2px solid #fff;
}

/* Drawer (mobile) */
.tl-header__drawer { position: fixed; inset: 0; z-index: 99999; pointer-events: none; visibility: hidden; }
.tl-header__drawer-overlay { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.7); opacity: 0; transition: opacity 180ms ease; }
.tl-header__drawer-panel {
    position: absolute; top: 0; left: 0; height: 100svh; max-height: 100svh; width: min(90vw, 400px);
    background: #ffffff !important; /* solid, no transparency */
    color: #111827; /* force dark text on white panel */
    border-right: 1px solid var(--tl-header-border);
    box-shadow: 12px 0 24px rgba(0,0,0,0.08);
    backdrop-filter: none !important;
    transform: translateX(-100%);
    transition: transform 200ms ease;
    display: flex; flex-direction: column;
    overflow: hidden;
    padding: 0 0 1.5rem;
}
.tl-header__drawer[aria-hidden="false"] { pointer-events: auto; visibility: visible; }
.tl-header__drawer[aria-hidden="false"] .tl-header__drawer-overlay { opacity: 1; }
.tl-header__drawer[aria-hidden="false"] .tl-header__drawer-panel { transform: translateX(0); }

.tl-header__drawer-top { display: flex; align-items: center; justify-content: space-between; padding: 1rem; border-bottom: 1px solid var(--tl-header-border); background: #ffffff; }
.tl-header__drawer-top h2 { font-size: 1rem; margin: 0; color: #111827; }
.tl-header__drawer-nav {
    padding: 1rem 1.1rem 0.75rem;
    background: #ffffff;
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
}

.tl-mobile-nav { width: 100%; }
.tl-mobile-nav__list {
    list-style: none;
    margin: 0;
    padding: 0 0 1rem;
}

.tl-mobile-nav__item { margin-bottom: 0.85rem; }

.tl-mobile-nav__link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    padding: 1.1rem 1.25rem;
    border-radius: 16px;
    background: #f5f7fb;
    color: #0f172a;
    font-size: 1.05rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 160ms ease, color 160ms ease;
}

.tl-mobile-nav__link .tl-menu-icon {
    width: 22px;
    height: 22px;
}

.tl-mobile-nav__link:hover,
.tl-mobile-nav__link:focus { background: #ecfdf5; color: #065f46; }

.tl-mobile-nav__sublist {
    list-style: none;
    margin: 0.35rem 0 0;
    padding: 0 0 0 2.75rem;
    display: grid;
    gap: 0.35rem;
}

.tl-mobile-nav__sublink {
    font-size: 0.95rem;
    color: #1f2937;
    text-decoration: none;
}

.tl-mobile-nav__sublink:hover,
.tl-mobile-nav__sublink:focus { color: #047857; }
.tl-header__drawer-meta {
    padding: 1rem 1.1rem;
    display: grid;
    gap: 0.6rem;
    border-top: 1px solid var(--tl-header-border);
    background: #ffffff;
    color: #374151;
    flex-shrink: 0;
}
.tl-header__drawer-search { justify-content: flex-start; gap: 0.5rem; width: 100%; background: #f9fafb; }

/* Search overlay */
.tl-header-search { position: fixed !important; top: 0; left: 0; right: 0; bottom: 0; width: 100vw; height: 100vh; z-index: 2147483647 !important; display: grid; place-items: start center; padding-top: 6rem; background: rgba(255, 255, 255, 0.92); backdrop-filter: blur(6px); }
.tl-header-search[aria-hidden="true"] { display: none; }
.tl-header-search__panel { background: #ffffff; border: 1px solid var(--tl-header-border); border-radius: 14px; width: min(860px, calc(100% - 2rem)); padding: 1.25rem; box-shadow: 0 10px 30px rgba(0,0,0,0.08); position: relative; }
.tl-header-search__close { position: absolute; top: 0.75rem; right: 0.75rem; }
.tl-header-search__title { margin: 0 0 1rem; color: var(--tl-header-text); font-size: 1.25rem; }
.tl-header-search .search-form, .tl-header-search .dgwt-wcas-search-wrapp { background: #ffffff; border-radius: 12px; padding: 0.25rem; border: 1px solid var(--tl-header-border); }
.tl-header-search .search-form input[type="search"],
.tl-header-search .dgwt-wcas-search-input { border: none; outline: none; font-size: 1rem; padding: 0.85rem 1rem; border-radius: 10px; width: 100%; color: #111827; }
.tl-header-search .search-form button,
.tl-header-search .dgwt-wcas-search-submit { border-radius: 10px; background: var(--tl-header-accent); color: white; font-weight: 600; border: none; padding: 0.65rem 1rem; cursor: pointer; transition: transform 140ms ease, box-shadow 140ms ease; }
.tl-header-search .search-form button:hover,
.tl-header-search .dgwt-wcas-search-submit:hover { transform: translateY(-1px); box-shadow: 0 8px 18px rgba(34,197,94,0.25); }

/* Responsive */
/* Ensure we switch to hamburger before layout collision on mid-desktop widths. */
@media (max-width: 1280px) {
    .tl-header__nav--desktop { display: none !important; }
    .tl-header__menu-toggle { display: inline-flex !important; }
}

@media (max-width: 1024px) {
    .tl-header__nav--desktop { display: none; }
    .tl-header__menu-toggle { display: inline-flex; }
    .tl-header__branding img { max-height: 48px; }
}

/* Ensure search modal close button is clearly visible on light theme */
.tl-header-search__close {
    width: 36px;
    height: 36px;
    border-radius: 999px;
    background: #f3f4f6; /* light gray pill */
    border: 1px solid #e5e7eb;
    color: #111827; /* dark icon */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.tl-header-search__close:hover,
.tl-header-search__close:focus {
    background: #e9f8ef; /* subtle green tint */
    border-color: var(--tl-header-accent);
    color: #052e12;
}

.tl-header-search__close .tl-icon,
.tl-header-search__close svg { width: 18px; height: 18px; }

/* Final safety: remove any residual border/gap under header */
header.tl-header { border-bottom: 0 !important; }
header.tl-header + #content { margin-top: 0 !important; }

/* Lock page scroll when menu is open */
body.tl-menu-open { overflow: hidden; touch-action: none; }

@media (max-width: 640px) {
    .tl-header__action,
    .tl-header__menu-toggle { width: 38px; height: 38px; border-radius: 8px; }
    .tl-header__action svg,
    .tl-header__menu-toggle svg { width: 20px; height: 20px; }
}

/* === Modern header refresh (2025-09-24) === */
:root {
    --tl-header-bg: linear-gradient(125deg, #9ce88a 0%, #63d1c3 40%, #132f54 100%);
    --tl-header-border: rgba(255, 255, 255, 0.18);
    --tl-header-text: #10243a;
    --tl-header-muted: rgba(16, 36, 58, 0.75);
    --tl-header-accent: #22c55e;
    --tl-header-accent-soft: rgba(34, 197, 94, 0.18);
}

.tl-header {
    background: var(--tl-header-bg);
    color: var(--tl-header-text);
    box-shadow: 0 28px 80px rgba(19, 50, 73, 0.22);
}

.tl-header__top {
    display: block !important;
    background: linear-gradient(120deg, rgba(255,255,255,0.26) 0%, rgba(255,255,255,0.08) 100%);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255,255,255,0.22);
    color: var(--tl-header-muted);
}

.tl-header__top .tl-header__container {
    width: 100%;
    max-width: min(1480px, 96vw);
    margin: 0 auto;
    padding: 0.9rem clamp(1rem, 4vw, 2.8rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: clamp(1rem, 4vw, 2.4rem);
}

.tl-header__promo {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: clamp(0.75rem, 2vw, 1.25rem);
}

.tl-header__badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.15rem;
    border-radius: 18px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 20px 45px rgba(15, 30, 46, 0.18);
    min-width: 220px;
}

.tl-header__badge-icon {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(140deg, rgba(34,197,94,0.18) 0%, rgba(79,190,255,0.22) 100%);
    color: var(--tl-header-text);
}

.tl-header__badge-icon svg { width: 22px; height: 22px; }

.tl-header__badge-copy { display: flex; flex-direction: column; gap: 0.1rem; }
.tl-header__badge-copy strong { font-size: 0.92rem; color: var(--tl-header-text); }
.tl-header__badge-copy span { font-size: 0.78rem; color: var(--tl-header-muted); }
.tl-header__badge-link { color: inherit; text-decoration: none; font-weight: 600; }
.tl-header__badge-link:hover { text-decoration: underline; }

.tl-header__top-links {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 1.5rem);
    flex-wrap: wrap;
    justify-content: flex-end;
}

.tl-header__top-link {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--tl-header-text);
    text-decoration: none;
    padding: 0.55rem 0.9rem;
    border-radius: 999px;
    background: rgba(255,255,255,0.9);
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 10px 30px rgba(16, 36, 58, 0.14);
    transition: transform 180ms ease, box-shadow 180ms ease;
}

.tl-header__top-link:hover,
.tl-header__top-link:focus {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(16, 36, 58, 0.2);
}

.tl-header__bar .tl-header__container {
    width: 100%;
    max-width: min(1480px, 96vw);
    margin: clamp(0.4rem, 1vw, 0.9rem) auto clamp(0.4rem, 2vw, 1.6rem);
    padding: clamp(0.85rem, 2vw, 1.4rem) clamp(1.6rem, 4.5vw, 2.6rem);
    /* Grid ensures logo/menu/actions stay on one row while allowing nav to shrink */
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: clamp(0.9rem, 2.8vw, 2.2rem);
    box-sizing: border-box;
}

.tl-header__identity { display: flex; align-items: center; gap: 1rem; flex: 0 0 auto; justify-self: start; min-width: 0; }
.tl-header__identity > * { flex-shrink: 0; }
.tl-header__branding { display: flex; align-items: center; gap: 0.75rem; }
.tl-header__branding img { max-height: 58px; height: auto; width: auto; object-fit: contain; }

.tl-header__navigation { flex: 1 1 auto; display: flex; justify-content: center; min-width: 0; justify-self: center; width: 100%; }

.tl-header__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,0.94);
    border-radius: 999px;
    padding: 0.65rem clamp(1.2rem, 3vw, 2.4rem);
    box-shadow: 0 28px 60px rgba(13, 38, 56, 0.22);
    border: 1px solid rgba(255,255,255,0.55);
    backdrop-filter: blur(16px);
    max-width: 100%;
    width: min(100%, 1080px);
}

.tl-header__nav-list { list-style: none; display: flex; align-items: center; gap: clamp(0.8rem, 2vw, 1.6rem); margin: 0; padding: 0; flex-wrap: wrap; justify-content: center; }
.tl-header__nav-list a {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--tl-header-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.94rem;
    padding: 0.35rem 0.1rem;
    transition: color 0.2s ease;
}

.tl-menu-icon {
    width: 18px;
    height: 18px;
    display: inline-flex;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
    flex-shrink: 0;
}

.tl-menu-label {
    display: inline-flex;
    align-items: center;
    white-space: nowrap;
}



.tl-header__nav-list a::after {
    content: '';
    position: absolute; left: 0; right: 0; bottom: -0.35rem;
    height: 3px; border-radius: 999px;
    background: linear-gradient(90deg, var(--tl-header-accent) 0%, #0ea5e9 100%);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 200ms ease;
}
.tl-header__nav-list a:hover::after,
.tl-header__nav-list a:focus::after,
.tl-header__nav-list .current-menu-item > a::after,
.tl-header__nav-list .current-menu-ancestor > a::after { transform: scaleX(1); }
.tl-header__nav-list .current-menu-item > a,
.tl-header__nav-list .current-menu-ancestor > a { color: #065f46; }

.tl-header__actions { display: flex; align-items: center; gap: 0.65rem; justify-self: end; }
.tl-header__action,
.tl-header__menu-toggle {
    position: relative;
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; border-radius: 15px;
    background: rgba(255,255,255,0.94);
    color: var(--tl-header-text);
    border: 1px solid rgba(255,255,255,0.55);
    box-shadow: 0 20px 40px rgba(19, 41, 58, 0.2);
    transition: transform 150ms ease, box-shadow 150ms ease, border-color 150ms ease;
}

.tl-header__menu-toggle:hover,
.tl-header__menu-toggle:focus,
.tl-header__action:hover,
.tl-header__action:focus {
    transform: translateY(-2px);
    border-color: rgba(34,197,94,0.4);
    box-shadow: 0 24px 50px rgba(19, 41, 58, 0.24);
}

.tl-header__cart-count { background: var(--tl-header-accent); color: #fff; }

.tl-header__drawer-overlay { background: rgba(10, 25, 38, 0.72); backdrop-filter: blur(6px); }
.tl-header__drawer-panel { box-shadow: 24px 0 48px rgba(15,23,42,0.18); }

@media (max-width: 1024px) {
    .tl-header__navigation { display: none; }
}

@media (max-width: 900px) {
    .tl-header__top .tl-header__container { flex-direction: column; align-items: stretch; }
    .tl-header__promo { width: 100%; }
    .tl-header__badge { flex: 1 1 auto; min-width: unset; }
    .tl-header__top-links { justify-content: center; }
}

@media (max-width: 640px) {
    .tl-header__actions {
        gap: 0.35rem;
        flex: 0 0 auto;
    }
    .tl-header__action,
    .tl-header__menu-toggle {
        width: 36px;
        height: 36px;
        border-radius: 11px;
    }
    .tl-header__action svg,
    .tl-header__menu-toggle svg,
    .tl-header__action .tl-icon,
    .tl-header__menu-toggle .tl-icon { width: 18px; height: 18px; }
    .tl-header__cart-count {
        right: -4px;
        top: -4px;
    }
    .tl-header__badge { padding: 0.6rem 0.85rem; }
}
