/* ============================================================
   ChemSmog Header — translucent + sticky (no scroll flicker)
   ============================================================ */

/* Header sticky at viewport top, ONE consistent translucent state */
body .cs-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 1px 0 rgba(11, 64, 84, 0.04);
}

/* Top promo bar — inherit parent glass, just add bottom divider */
body .cs-header .cs-header__promo {
    background: transparent !important;
    border-bottom: 1px solid rgba(217, 217, 217, 0.35) !important;
}

/* Main bar — transparent, lets the parent glass effect show */
body .cs-header .cs-header__main {
    background: transparent !important;
}

/* Hero must underlap the sticky header — adjust top padding so content clears it */
.cs-hero {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
.cs-hero__content {
    padding-top: 180px !important;
    padding-bottom: 140px !important;
}

/* Mobile: keep header same translucent + sticky */
@media (max-width: 991.98px) {
    body .cs-header-mobile {
        position: sticky !important;
        top: 0 !important;
        z-index: 100 !important;
        background: rgba(255, 255, 255, 0.78) !important;
        backdrop-filter: blur(12px);
        -webkit-backdrop-filter: blur(12px);
    }
}

/* ============================================================
   Top promo bar — ENG + social icons in Chem-Green (Figma)
   ============================================================ */
body .cs-header .cs-header__promo-right .cs-lang,
body .cs-header .cs-header__promo-right .cs-lang svg,
body .cs-header .cs-header__promo-right a {
    color: var(--cs-green) !important;
}
body .cs-header .cs-header__promo-right .cs-social,
body .cs-header .cs-header__promo-right .cs-social.linkedin,
body .cs-header .cs-header__promo-right .cs-social.instagram {
    color: var(--cs-green) !important;
}
body .cs-header .cs-header__promo-right a:hover {
    color: var(--cs-teal) !important;
}

/* ============================================================
   SHOP BY CATEGORY dropdown + flyout subcategories
   ============================================================ */
body .cs-header .cs-shop-category-wrap {
    position: relative;
}

/* Main dropdown panel */
body .cs-header .cs-shop-category-menu {
    position: absolute !important;
    top: calc(100% + 8px);
    left: 0;
    min-width: 320px;
    background: var(--cs-white);
    border-radius: 12px;
    border: 1px solid var(--cs-divider);
    box-shadow: 0 16px 40px rgba(11, 64, 84, 0.15);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 200;
    
}
body .cs-header .cs-shop-category-wrap:hover .cs-shop-category-menu,
body .cs-header .cs-shop-category-wrap:focus-within .cs-shop-category-menu,
body .cs-header .cs-shop-category-wrap.is-open .cs-shop-category-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Top-level item */
body .cs-header .cs-shop-category-menu > li {
    position: relative;
    list-style: none;
    margin: 0;
}
body .cs-header .cs-shop-category-menu > li > a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 20px;
    color: var(--cs-blue);
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    gap: 16px;
    transition: background .12s ease, color .12s ease;
    white-space: nowrap;
}
body .cs-header .cs-shop-category-menu > li > a > svg {
    flex: 0 0 auto;
    color: currentColor;
    opacity: 0.55;
}
body .cs-header .cs-shop-category-menu > li:hover > a,
body .cs-header .cs-shop-category-menu > li:focus-within > a {
    background: linear-gradient(90deg, rgba(134,195,139,0.15), rgba(89,205,194,0.15));
    color: var(--cs-blue);
}
body .cs-header .cs-shop-category-menu > li:hover > a > svg {
    opacity: 1;
    color: var(--cs-teal);
}

/* Submenu (flyout right) */
body .cs-header .cs-shop-category-sub {
    position: absolute;
    top: -8px;
    right: 100%;
    left: auto;
    min-width: 280px;
    background: var(--cs-white);
    border-radius: 12px;
    border: 1px solid var(--cs-divider);
    box-shadow: 0 16px 40px rgba(11, 64, 84, 0.15);
    padding: 8px 0;
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transform: translateX(0);
    transition: opacity .15s ease, transform .15s ease, visibility .15s ease;
    z-index: 201;
}
body .cs-header .cs-shop-category-menu > li.has-children:hover > .cs-shop-category-sub,
body .cs-header .cs-shop-category-menu > li.has-children:focus-within > .cs-shop-category-sub {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}
body .cs-header .cs-shop-category-sub > li {
    margin: 0;
    list-style: none;
}
body .cs-header .cs-shop-category-sub > li > a {
    display: block;
    padding: 10px 20px;
    color: var(--cs-navy);
    font-family: 'Fredoka', sans-serif;
    font-weight: 400;
    font-size: 13px;
    text-decoration: none;
    transition: background .12s ease, color .12s ease;
    white-space: nowrap;
}
body .cs-header .cs-shop-category-sub > li > a:hover {
    background: var(--cs-bg);
    color: var(--cs-blue);
}

/* Responsive: hide dropdown on narrow screens (mobile uses its own menu) */
@media (max-width: 991.98px) {
    body .cs-header .cs-shop-category-menu { display: none; }
}

/* Override: ensure dropdown does not clip flyout submenu */
body .cs-header .cs-shop-category-menu {
    overflow: visible !important;
}
/* Ensure submenu is visible (no transform offset that would create gap) */
body .cs-header .cs-shop-category-sub {
    margin: 0 !important;
    right: 100%; left: auto;   /* slight overlap so hover trail doesn't break */
}

/* Anchor SHOP BY CATEGORY menu to the RIGHT edge of the button so it does not overflow viewport */
body .cs-header .cs-shop-category-menu {
    left: auto !important;
    right: 0 !important;
}
