@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap');

/* ============================================================
   Site chrome: topbar + dark header + search + category nav
   ============================================================ */
:root {
    --h-dark: #000000;
    --h-darker: #0B1120;
    --h-accent: #1504B2;
    --h-accent-hover: #086AC9;
    --h-accent-dark: #005A9E;
    --h-accent-light: #38A7E8;
    --h-line: #1E293B;
    --h-white: #FFFFFF;
    --h-dim: #94A3B8;
    --h-ink: #0F172A;
    --h-border: #E2E8F0;
    --h-muted: #475569;
    --h-badge: #DC2626;
    --h-ease: 150ms ease;
    --h-font: "Plus Jakarta Sans", system-ui, sans-serif;
}

/* ---------- Topbar (primary color) ---------- */
.topbar {
    background: var(--h-accent);
    color: #fff;
    font-size: 0.78rem;
}
.topbar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 34px;
    gap: 20px;
}
.topbar-left { display: flex; align-items: center; gap: 10px; white-space: nowrap; overflow: hidden; }
.topbar-item { color: rgba(255, 255, 255, .95); font-weight: 500; }
.topbar-item strong { font-weight: 700; }
.topbar-sep { color: rgba(255, 255, 255, .45); }
.topbar-right { display: flex; align-items: center; gap: 18px; flex-shrink: 0; }
.topbar-links { display: flex; align-items: center; gap: 18px; }
.topbar-links a {
    display: inline-flex; align-items: center; gap: 5px;
    color: rgba(255, 255, 255, .9); text-decoration: none; font-weight: 500;
    white-space: nowrap;
    transition: color var(--h-ease);
}
.topbar-links a:hover { color: #fff; }
.topbar-social { display: flex; align-items: center; gap: 10px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .3); }
.topbar-social a { color: rgba(255, 255, 255, .95); display: inline-flex; transition: color var(--h-ease); }
.topbar-social a:hover { color: #fff; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 100; }

.header-top { background: #fff; border-bottom: 1px solid var(--h-border); }

.header-inner {
    display: flex;
    align-items: center;
    gap: 24px;
    height: 100px;
}

.brand {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    text-decoration: none;
}
.brand-logo {
    display: block;
    width: 155px;
    height: auto;
    max-height: 75px;
}

/* ---------- All categories: button + mega menu ---------- */
.hcat { position: relative; flex-shrink: 0; }

.hcat-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 46px;
    padding: 0 16px 0 4px;
    background: none;
    color: #fff;
    border: none;
    font-family: var(--h-font);
    font-size: 0.88rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: color var(--h-ease);
}
.hcat-btn:hover { color: rgba(255, 255, 255, .85); }
.hcat-caret { transition: transform 150ms ease; }
.hcat-btn.is-open .hcat-caret { transform: rotate(180deg); }

.cat-divider { width: 1px; height: 20px; background: rgba(255, 255, 255, .3); flex-shrink: 0; }

/* Panel: fixed-width rail on the left, swapped detail panel on the right */
.mega {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 120;
    display: grid;
    grid-template-columns: 262px minmax(0, 1fr);
    width: min(1000px, calc(100vw - 48px));
    background: #fff;
    border: 1px solid var(--h-border);
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    overflow: hidden;
}
.mega-t { transition: opacity 150ms ease, transform 150ms ease; }
.mega-off { opacity: 0; transform: translateY(-6px); }
.mega-on { opacity: 1; transform: translateY(0); }

/* Left rail: tinted, with the selected row lifted to white and flagged red */
.mega-rail {
    display: flex;
    flex-direction: column;
    background: #F0F9FF;
    border-right: 1px solid var(--h-border);
    padding: 6px 0;
    max-height: min(520px, calc(100vh - 220px));
    overflow-y: auto;
}
.mega-rail-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 14px;
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--h-ink);
    text-decoration: none;
    transition: background-color var(--h-ease), color var(--h-ease);
}
.mega-rail-item .mega-rail-name {
    flex: 1;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mega-rail-ico {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: 4px;
    color: var(--h-accent);
    transition: background-color var(--h-ease), border-color var(--h-ease), color var(--h-ease);
}
.mega-rail-caret { color: #94A3B8; flex-shrink: 0; opacity: 0; transition: opacity var(--h-ease); }

.mega-rail-item:hover,
.mega-rail-item.is-active {
    background: #fff;
    color: var(--h-ink);
    font-weight: 700;
}
/* Red marker on the selected group, matching the search button and cart badge */
.mega-rail-item.is-active::before {
    content: "";
    position: absolute;
    left: 0;
    top: 4px;
    bottom: 4px;
    width: 3px;
    background: var(--h-badge);
    border-radius: 0 2px 2px 0;
}
.mega-rail-item.is-active .mega-rail-ico {
    background: #FEF2F2;
    border-color: #FECACA;
    color: var(--h-badge);
}
.mega-rail-item.is-active .mega-rail-caret { opacity: 1; color: var(--h-badge); }

.mega-rail-all {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: auto;
    padding: 12px 14px 8px;
    border-top: 1px solid var(--h-border);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--h-accent);
    text-decoration: none;
}
.mega-rail-all:hover { color: var(--h-accent-hover); text-decoration: underline; }

/* Right body */
.mega-body {
    max-height: min(520px, calc(100vh - 220px));
    overflow-y: auto;
}
.mega-panel { padding: 16px 22px 20px; min-height: 240px; }
.mega-panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 10px;
    margin-bottom: 14px;
    border-bottom: 1px solid var(--h-border);
}
.mega-panel-head h3 {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--h-ink);
}
/* Red tick tying the panel title to the selected rail row */
.mega-panel-head h3::before {
    content: "";
    width: 4px;
    height: 15px;
    flex-shrink: 0;
    background: var(--h-badge);
    border-radius: 2px;
}

/* Outlined red action, filled on hover */
.mega-panel-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border: 1px solid var(--h-badge);
    border-radius: 4px;
    white-space: nowrap;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--h-badge);
    text-decoration: none;
    transition: background-color var(--h-ease), color var(--h-ease);
}
.mega-panel-link:hover { background: var(--h-badge); color: #fff; }

.mega-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px 14px;
}
.mega-list a {
    display: block;
    padding: 7px 10px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: var(--h-muted);
    text-decoration: none;
    transition: background-color var(--h-ease), color var(--h-ease);
}
/* Colour/background only on hover: changing weight would reflow the columns */
.mega-list a:hover { background: #F0F9FF; color: var(--h-accent); }
.mega-empty { margin: 0; font-size: 0.85rem; color: var(--h-muted); }

@media (max-width: 1080px) {
    .mega { grid-template-columns: 232px minmax(0, 1fr); }
    .mega-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* Search (desktop) */
.search { position: relative; flex: 1 1 auto; max-width: none; }
.search-box {
    display: flex;
    align-items: center;
    gap: 0;
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: 4px;
    padding: 0 0 0 16px;
    height: 44px;
    overflow: hidden;
    transition: border-color var(--h-ease);
}
.search-box:focus-within { border-color: var(--h-accent); }
.search-icon { color: var(--h-muted); font-size: 20px; flex-shrink: 0; }
.search-input {
    flex: 1; min-width: 0;
    border: none; background: transparent;
    font-family: var(--h-font); font-size: 0.92rem; color: var(--h-ink);
    outline: none;
    height: 100%;
}
.search-input::placeholder { color: var(--h-muted); }
.search-clear { border: none; background: none; color: var(--h-muted); cursor: pointer; display: flex; font-size: 18px; margin-right: 8px; }
.search-clear:hover { color: var(--h-ink); }
.search-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 100%;
    flex-shrink: 0;
    background: var(--h-badge);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: background-color var(--h-ease);
}
.search-submit:hover { background: #C81E1E; }

.search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0; right: 0;
    background: #fff;
    border: 1px solid var(--h-border);
    border-radius: 6px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .18);
    overflow: hidden;
    z-index: 60;
    max-height: 440px;
    overflow-y: auto;
}
.search-item {
    display: flex; align-items: center; gap: 10px;
    padding: 11px 14px;
    text-decoration: none; color: inherit;
    border-bottom: 1px solid var(--h-border);
    transition: background-color var(--h-ease);
}
.search-item:last-child { border-bottom: none; }
.search-item:hover { background: #F1F5F9; }
.search-item-ico { color: var(--h-muted); flex-shrink: 0; }
.search-item-name { flex: 1; min-width: 0; font-weight: 600; color: var(--h-ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.search-item-price { font-weight: 700; color: var(--h-ink); font-variant-numeric: tabular-nums; white-space: nowrap; }
.search-empty { padding: 18px; text-align: center; color: var(--h-muted); font-size: 0.9rem; }

/* Nav actions */
.nav { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }

.nav-search-m {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: none; border: none; color: var(--h-ink); cursor: pointer;
    border-radius: 4px;
}
.nav-search-m:hover { background: #F1F5F9; }

.nav-action {
    position: relative;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 10px;
    border-radius: 4px;
    text-decoration: none;
    color: var(--h-ink);
    transition: color var(--h-ease), background-color var(--h-ease);
}
.nav-action:hover { color: var(--h-accent); background: #F1F5F9; }
.nav-action-icon { position: relative; display: inline-flex; }
.nav-action-label { font-size: 0.78rem; font-weight: 600; }
.nav-account .nav-action-label { font-size: 0.82rem; }

.icon-count {
    position: absolute;
    top: -6px; right: -8px;
    min-width: 17px; height: 17px;
    padding: 0 4px;
    display: flex; align-items: center; justify-content: center;
    background: var(--h-badge);
    color: #fff;
    font-family: var(--h-font);
    font-variant-numeric: tabular-nums;
    font-size: 0.66rem; font-weight: 700;
    border-radius: 9px;
    transform: scale(0);
    transition: transform var(--h-ease);
}
.icon-count.has-items { transform: scale(1); }

/* ---------- Category nav (blue bar) ---------- */
.header-cats { background: var(--h-accent); }
.cat-nav-wrap { display: flex; align-items: center; }
.cat-nav { display: flex; align-items: center; gap: 2px; height: 46px; overflow-x: auto; scrollbar-width: none; }
.cat-nav::-webkit-scrollbar { display: none; }
.cat-link {
    display: inline-flex; align-items: center; gap: 6px;
    height: 46px; padding: 0 16px;
    white-space: nowrap;
    font-family: var(--h-font); font-size: 0.85rem; font-weight: 700;
    letter-spacing: 0.01em;
    text-transform: uppercase;
    color: #fff; text-decoration: none;
    border-bottom: 2px solid transparent;
    transition: color var(--h-ease), border-color var(--h-ease), background-color var(--h-ease);
}
.cat-link:hover { color: #fff; background: rgba(255, 255, 255, .1); }
.cat-link.is-active { border-bottom-color: var(--h-badge); background: rgba(255, 255, 255, .08); }
.cat-link-offers { margin-left: auto; color: #FFE1A8; }
.cat-link-offers:hover { color: #fff; }

/* ---------- Mobile full-screen search ---------- */
.search-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: #fff;
    display: flex;
    flex-direction: column;
}
.search-overlay-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--h-accent);
}
.search-overlay-back {
    background: none; border: none; color: #fff; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex-shrink: 0;
}
.search-overlay .search-box { flex: 1; }
.search-overlay-body { flex: 1; overflow-y: auto; padding: 4px 0; }

.search-mitem {
    display: flex; align-items: center; gap: 12px;
    padding: 15px 16px;
    text-decoration: none; color: inherit;
    border-bottom: 1px dashed var(--h-border);
}
.search-mitem:active { background: #F1F5F9; }
.search-mitem-ico { color: var(--h-muted); flex-shrink: 0; }
.search-mitem-name { flex: 1; min-width: 0; font-weight: 600; color: var(--h-ink); }
.search-mitem-price { font-weight: 700; color: var(--h-ink); font-variant-numeric: tabular-nums; }
.search-overlay-msg { padding: 28px 20px; text-align: center; color: var(--h-muted); font-size: 0.9rem; }

/* ---------- Hamburger + drawer ---------- */
.nav-hamburger {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px; height: 40px;
    background: none; border: none; color: var(--h-ink); cursor: pointer;
    border-radius: 4px;
    flex-shrink: 0;
}
.nav-hamburger:hover { background: #F1F5F9; }

.drawer { position: fixed; inset: 0; z-index: 210; pointer-events: none; }
.drawer-scrim { position: absolute; inset: 0; background: rgba(15, 23, 42, .5); pointer-events: auto; }
.drawer-panel {
    position: absolute;
    top: 0; left: 0; bottom: 0;
    width: 100%;
    background: #fff;
    display: flex;
    flex-direction: column;
    pointer-events: auto;
}
.dr-t { transition: transform 220ms ease; }
.dr-off { transform: translateX(-100%); }
.dr-on { transform: translateX(0); }

.drawer-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 14px 18px;
    background: var(--h-accent);
    flex-shrink: 0;
}
.drawer-brand { display: inline-flex; align-items: center; text-decoration: none; }
/* White knockout logo sits straight on the blue head, so no white chip behind it */
.drawer-brand img { display: block; width: 148px; height: auto; max-height: 50px; }
.drawer-close { background: none; border: none; color: #fff; cursor: pointer; display: flex; }

.drawer-body { flex: 1; overflow-x: hidden; overflow-y: auto; padding: 0; }
.drawer-title {
    padding: 16px 18px 8px;
    font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--h-muted);
}
.drawer-link {
    display: flex; align-items: center; gap: 14px;
    padding: 13px 18px;
    color: var(--h-ink); text-decoration: none;
    font-size: 0.95rem; font-weight: 600;
    border-bottom: 1px solid #F1F5F9;
}
.drawer-link:active { background: #F1F5F9; }
.drawer-link iconify-icon { color: var(--h-muted); }
.drawer-link-deals { color: var(--h-badge); }
.drawer-link-deals iconify-icon { color: var(--h-badge); }

/* Drawer sliding two-level navigation */
.drawer-nav {
    display: flex;
    width: 200%;
    transform: translateX(0);
    transition: transform 260ms cubic-bezier(.4, 0, .2, 1);
}
.drawer-nav.is-sub { transform: translateX(-50%); }
.drawer-level {
    width: 50%;
    flex-shrink: 0;
    align-self: flex-start;
}
.drawer-level-root { padding: 8px 0 24px; }
.drawer-level-sub { padding: 0 0 24px; }
/* Keep the off-screen root out of the tab order without collapsing height */
.drawer-nav.is-sub .drawer-level-root { visibility: hidden; }
.drawer-nav:not(.is-sub) .drawer-level-sub { visibility: hidden; }

/* Parent row (opens sub-panel) */
.drawer-parent {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 13px 18px;
    background: none;
    border: none;
    border-bottom: 1px solid #F1F5F9;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--h-ink);
    text-align: left;
    cursor: pointer;
}
.drawer-parent:active { background: #F1F5F9; }
.drawer-parent iconify-icon { color: var(--h-muted); }
.drawer-parent-caret { margin-left: auto; }

/* Back button in sub-panel */
.drawer-back {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 18px;
    background: var(--h-accent);
    border: none;
    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    color: #fff;
    text-align: left;
    cursor: pointer;
}
.drawer-back iconify-icon { color: #fff; }

/* View-all row at top of a sub-panel */
.drawer-viewall {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    color: var(--h-accent);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 700;
    border-bottom: 1px solid #F1F5F9;
    background: #F8FBFE;
}
.drawer-viewall iconify-icon { color: var(--h-accent); }
.drawer-viewall:active { background: #EAF4FB; }

/* Leaf child links (no arrows, clean list) */
.drawer-sublink {
    display: block;
    padding: 13px 18px;
    color: var(--h-ink);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    border-bottom: 1px solid #F1F5F9;
}
.drawer-sublink:active { background: #F1F5F9; }

/* ---------- Bottom navigation (mobile) ---------- */
.bottom-nav {
    display: none;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 80;
    background: #fff;
    border-top: 1px solid var(--h-border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    grid-template-columns: repeat(5, 1fr);
}
.bottom-nav-item {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0;
    background: none; border: none; text-decoration: none;
    color: var(--h-muted);
    font-family: var(--h-font); font-size: 0.66rem; font-weight: 600;
    cursor: pointer;
}
.bottom-nav-item:hover, .bottom-nav-item:focus, .bottom-nav-item.is-active { color: var(--h-accent); }
.bottom-nav-icon { position: relative; display: inline-flex; }
.bottom-nav-icon .icon-count { top: -6px; right: -10px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .topbar { display: none; }
    .search { display: none; }
    .nav-search-m { display: inline-flex; }
    .nav-hamburger { display: inline-flex; }
    .header-cats { display: none; }
    .nav-action-label { display: none; }
    .nav-account,
    .nav-action[aria-label="Wishlist"] { display: none; }
    /* Taller bar so the logo can grow without crowding the icons */
    .header-inner { height: 74px; gap: 10px; }
    .brand { margin-right: auto; }
    /* Width-driven on mobile so the wordmark stays readable; max-height keeps it
       inside the bar whatever the logo file's ratio is. */
    .brand-logo { width: 140px; height: auto; max-height: 66px; }
    /* Bottom navigation removed on mobile */
    .bottom-nav { display: none !important; }
}

@media (min-width: 861px) {
    .search-overlay { display: none !important; }
}

/* ---------- Motion preference ---------- */
@media (prefers-reduced-motion: reduce) {
    .topbar *,
    .site-header * { transition: none !important; }
    .mega-t { transition: none !important; }
    .hcat-btn.is-open .hcat-caret { transform: none; }
}
