/*!
 * KoScreen – KoAmazon header / navigation (drop-in)              v1.0.0
 * File:   /Themes/KoAmazon/Content/css/koamazon-header.css
 * Pairs:  /Themes/KoAmazon/Content/js/koamazon-header.js
 * All selectors are namespaced .kos-hdr-* (or scoped under html.kos-hdr-on,
 * a class the JS / Razor partial adds), so nothing changes until the new
 * header is actually active. Load AFTER the theme CSS bundle.
 * ======================================================================= */

/* ---------- colours (edit here) ---------- */
:root {
  --kos-util-bg: #1a1238;      /* utility bar               */
  --kos-util-fg: #cfc8f5;
  --kos-nav-bg: #24184a;       /* main nav                  */
  --kos-nav-fg: #ffffff;
  --kos-nav-hover: rgba(255,255,255,.10);
  --kos-yellow: #f5c518;       /* Find Your Screen pill     */
  --kos-yellow-h: #ffd43b;
  --kos-purple: #6c5cf5;       /* check icons, accents      */
  --kos-ink: #24184a;
  --kos-muted: #6b6880;
  --kos-line: #e2e2e8;
  --kos-lav: #d9d3fb;          /* dropdown column underline */
  --kos-link-accent: #1a5fd0;
}

/* ===================== 1. Utility bar ===================== */
.kos-hdr-util {
  background: var(--kos-util-bg);
  color: var(--kos-util-fg);
  font-size: 12.5px;
  line-height: 1.2;
  position: relative;
  z-index: 210;
}
.kos-hdr-util-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  padding: 0 16px;
  box-sizing: border-box;
}
.kos-hdr-util-text { margin: 0; padding: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--kos-util-fg); }
.kos-hdr-util-links { display: flex; margin: 0; padding: 0; list-style: none; flex: 0 0 auto; }
.kos-hdr-util-links li { margin: 0; padding: 0; list-style: none; }
.kos-hdr-util-links a,
.kos-hdr-util-links a:visited {
  display: block;
  padding: 4px 0 4px 26px;
  color: var(--kos-util-fg) !important;
  text-decoration: none !important;
  white-space: nowrap;
}
.kos-hdr-util-links a:hover,
.kos-hdr-util-links a:focus { color: #fff !important; text-decoration: underline !important; }

/* ===================== 2. Main nav ===================== */
/* the theme clips the bar (overflow:hidden, fixed height) – let panels out */
html.kos-hdr-on .nav-main {
  background: var(--kos-nav-bg) !important;
  overflow: visible !important;
  z-index: 190 !important;
}
html.kos-hdr-on .nav-main .nav-main-inner {
  overflow: visible !important;
  align-items: stretch !important;
  gap: 0 !important;
  padding: 0 16px 0 8px !important;
  position: relative;
}
html.kos-hdr-on .nav-main .nav-xshop.kos-hdr-hidden,
html.kos-hdr-on .nav-main .nav-xshop[aria-hidden="true"] { display: none !important; }
html.kos-hdr-on .nav-main .nav-all {
  height: auto !important;
  align-self: stretch;
  font-size: 15px !important;
  padding: 0 14px 0 10px !important;
  margin-right: 4px;
}

.kos-hdr-menu {
  display: flex;
  align-items: stretch;
  margin: 0;
  padding: 0;
  list-style: none;
  flex: 1 1 auto;
  min-width: 0;
}
.kos-hdr-item { position: static; display: flex; align-items: stretch; margin: 0; padding: 0; list-style: none; }
html.kos-hdr-on .nav-main a.kos-hdr-link,
a.kos-hdr-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  color: var(--kos-nav-fg) !important;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .01em;
  text-decoration: none !important;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  border-top: 3px solid transparent;
  box-sizing: border-box;
  transition: background-color .15s ease;
}
a.kos-hdr-link:hover,
a.kos-hdr-link:focus-visible,
.kos-hdr-open > a.kos-hdr-link { background: var(--kos-nav-hover); }
.kos-hdr-open > a.kos-hdr-link { border-bottom-color: var(--kos-yellow); }
a.kos-hdr-link.kos-hdr-current { border-bottom-color: rgba(245,197,24,.55); }
.kos-hdr-caret { font-size: 11px; opacity: .85; line-height: 1; }

/* visually-hidden keyboard toggle (becomes visible on focus) */
.kos-hdr-toggle {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); border: 0; background: transparent; color: #fff;
}
.kos-hdr-toggle:focus { position: static; width: auto; height: auto; margin: 0; clip: auto; padding: 0 6px; outline: 2px solid var(--kos-yellow); }

/* Find Your Screen pill */
html.kos-hdr-on .nav-main a.kos-hdr-cta,
a.kos-hdr-cta {
  align-self: center;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-left: auto;
  padding: 0 20px;
  height: 34px;
  border-radius: 999px;
  background: var(--kos-yellow);
  color: var(--kos-ink) !important;
  font-size: 14.5px;
  font-weight: 800;
  text-decoration: none !important;
  white-space: nowrap;
  box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
a.kos-hdr-cta:hover, a.kos-hdr-cta:focus { background: var(--kos-yellow-h); color: var(--kos-ink) !important; }

/* ---------- dropdown panels ---------- */
.kos-hdr-panel {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 400;
  background: #fff;
  color: #333;
  border: 1px solid #dcdbe4;
  border-top: 0;
  border-radius: 0 0 8px 8px;
  box-shadow: 0 14px 30px rgba(20,12,50,.22);
  padding: 20px 26px 16px;
  box-sizing: border-box;
  text-align: left;
  cursor: default;
}
.kos-hdr-has-panel { position: relative; }
.kos-hdr-has-panel .kos-hdr-panel { min-width: 260px; }
.kos-hdr-open > .kos-hdr-panel { display: block; }
@media (hover: hover) and (min-width: 769px) {
  .kos-hdr-has-panel:focus-within > .kos-hdr-panel { display: block; }
  /* no-JS fallback (Razor partial without the JS file) */
  html:not(.kos-hdr-js) .kos-hdr-has-panel:hover > .kos-hdr-panel { display: block; }
}
.kos-hdr-panel-grid { display: flex; gap: 34px; }
.kos-hdr-col { min-width: 150px; }
.kos-hdr-col--2 .kos-hdr-col-links { column-count: 3; column-gap: 26px; }
.kos-hdr-col--2 .kos-hdr-col-links li { break-inside: avoid; }
.kos-hdr-col-title {
  margin: 0 0 8px;
  padding: 0 0 7px;
  border-bottom: 2px solid var(--kos-lav);
  color: var(--kos-ink);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}
.kos-hdr-col-links { margin: 0; padding: 0; list-style: none; }
.kos-hdr-col-links li { margin: 0; padding: 0; list-style: none; line-height: 1.25; }
.kos-hdr-panel a,
html.kos-hdr-on .nav-main .kos-hdr-panel a {
  display: inline-block;
  padding: 5px 0;
  color: #4a4858 !important;
  font-size: 13.5px;
  font-weight: 400;
  text-decoration: none !important;
  white-space: nowrap;
}
.kos-hdr-panel a:hover,
.kos-hdr-panel a:focus,
html.kos-hdr-on .nav-main .kos-hdr-panel a:hover { color: var(--kos-purple) !important; text-decoration: underline !important; }
html.kos-hdr-on .nav-main .kos-hdr-panel .kos-hdr-accent a { color: var(--kos-link-accent) !important; font-weight: 600; }
.kos-hdr-sep { color: #9a98a8; font-size: 13px; }
html.kos-hdr-on .nav-main .kos-hdr-panel a.kos-hdr-panel-all {
  display: block;
  margin-top: 12px;
  padding: 10px 0 0;
  border-top: 1px solid var(--kos-line);
  color: var(--kos-ink) !important;
  font-weight: 700;
}

/* Laptop mega panel: wide, anchored to the nav bar's left edge */
.kos-hdr-has-panel .kos-hdr-panel--mega { min-width: 720px; }
.kos-hdr-panel--mega .kos-hdr-col { min-width: 140px; }

/* ===================== 3. Trust strip ===================== */
.kos-hdr-trust {
  background: #fff;
  border-bottom: 1px solid var(--kos-line);
  position: relative;
  z-index: 5;
}
.kos-hdr-trust-list {
  display: flex;
  margin: 0 auto;
  padding: 0;
  list-style: none;
  max-width: 1500px;
}
.kos-hdr-trust-item {
  flex: 1 1 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 50px;
  padding: 7px 12px;
  margin: 0;
  list-style: none;
  box-sizing: border-box;
}
.kos-hdr-trust-item + .kos-hdr-trust-item { border-left: 1px solid var(--kos-line); }
.kos-hdr-check {
  flex: 0 0 24px;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--kos-purple);
  display: inline-flex; align-items: center; justify-content: center;
}
.kos-hdr-trust-txt { display: flex; flex-direction: column; line-height: 1.2; }
.kos-hdr-trust-title { color: var(--kos-ink); font-size: 14.5px; font-weight: 800; }
.kos-hdr-trust-sub { color: #777; font-size: 12px; }

/* ===================== 4. Responsive ===================== */
@media (max-width: 1100px) {
  html.kos-hdr-on .nav-main a.kos-hdr-link { padding: 0 11px; font-size: 14px; }
  .kos-hdr-util-text { display: none; }
  .kos-hdr-util-inner { justify-content: center; }
  .kos-hdr-has-panel .kos-hdr-panel--mega { min-width: 640px; padding: 18px 20px 14px; }
  .kos-hdr-panel-grid { gap: 24px; }
}

@media (max-width: 768px) {
  /* utility bar: links only, horizontally scrollable */
  .kos-hdr-util { font-size: 11.5px; }
  .kos-hdr-util-inner { justify-content: flex-start; min-height: 28px; padding: 0 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .kos-hdr-util-inner::-webkit-scrollbar { display: none; }
  .kos-hdr-util-links a { padding: 5px 7px; font-size: 11px; }
  .kos-hdr-util-links { margin: 0 auto; }

  /* belt: the theme forces 76px height – let it wrap: logo + tools / search */
  html.kos-hdr-on .nav-belt {
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    flex-wrap: wrap !important;
    row-gap: 8px;
    padding: 8px 10px 10px !important;
  }
  html.kos-hdr-on .nav-belt .nav-left { order: 1; flex: 0 0 auto; }
  html.kos-hdr-on .nav-belt .nav-right { order: 2; margin-left: auto; flex: 0 1 auto; min-width: 0; }
  html.kos-hdr-on .nav-belt .nav-fill { order: 3; flex: 1 1 100% !important; width: 100%; }
  html.kos-hdr-on .nav-belt .nav-locale { display: none !important; }
  /* compact account / orders / cart labels so they fit beside the logo */
  html.kos-hdr-on .nav-belt .nav-tools-links .header-links a,
  html.kos-hdr-on .nav-belt .nav-tools-links .header-links a span { text-transform: none !important; }
  html.kos-hdr-on .nav-belt .nav-tools-links .nav-account .nav-line-1 { display: none !important; }
  html.kos-hdr-on .nav-belt .nav-tools-links .header-links a { padding: 4px 5px !important; font-size: 12px !important; }
  html.kos-hdr-on .nav-belt .nav-tools-links .nav-line-2 { font-size: 12.5px !important; white-space: nowrap; }
  html.kos-hdr-on .nav-belt .ko-lang-btn { min-height: 40px; padding: 4px 5px; }

  /* nav: ☰ All + Find Your Screen pill, all other items live in ☰ All */
  html.kos-hdr-on .nav-main,
  html.kos-hdr-on .nav-main .nav-main-inner { height: 46px !important; min-height: 46px !important; }
  html.kos-hdr-on .nav-main .nav-main-inner { padding: 0 10px 0 4px !important; }
  .kos-hdr-menu { display: none; }
  html.kos-hdr-on .nav-main a.kos-hdr-cta { height: 32px; padding: 0 16px; font-size: 14px; }

  /* trust strip: one row of 3 equal columns, titles only (3 items – no odd 2×2 gap) */
  .kos-hdr-trust-list { flex-wrap: nowrap; }
  .kos-hdr-trust-item { flex: 1 1 0; min-width: 0; max-width: none; justify-content: center; min-height: 38px; padding: 6px 6px; gap: 6px; }
  .kos-hdr-trust-item + .kos-hdr-trust-item { border-left: 1px solid var(--kos-line); }
  .kos-hdr-trust-txt { min-width: 0; }
  .kos-hdr-check { flex-basis: 18px; width: 18px; height: 18px; }
  .kos-hdr-check svg { width: 11px; height: 11px; }
  .kos-hdr-trust-title { font-size: 12px; line-height: 1.15; }
  .kos-hdr-trust-sub { display: none; }
}
@media (max-width: 420px) {
  .kos-hdr-trust-item { padding: 6px 3px; gap: 4px; }
  .kos-hdr-check { flex-basis: 16px; width: 16px; height: 16px; }
  .kos-hdr-check svg { width: 10px; height: 10px; }
  .kos-hdr-trust-title { font-size: 11.5px; letter-spacing: -0.1px; white-space: nowrap; }
}
@media (max-width: 360px) {
  .kos-hdr-trust-title { white-space: normal; }
  .kos-hdr-trust-item { flex-direction: column; gap: 3px; text-align: center; padding: 5px 4px; }
  .kos-hdr-trust-title { font-size: 11px; }
}

@media (max-width: 480px) {
  /* one row: logo | language · account · cart (Orders stays reachable in the Account flyout) */
  html.kos-hdr-on .nav-belt .nav-logo a.ko-logo img,
  html.kos-hdr-on .nav-belt .nav-logo img { width: 100px !important; max-width: 100px !important; min-width: 0 !important; height: auto !important; }
  html.kos-hdr-on .nav-belt .nav-logo a,
  html.kos-hdr-on .nav-belt .nav-logo a.ko-logo { padding: 2px 2px !important; margin: 0 !important; min-width: 0 !important; width: auto !important; }
  html.kos-hdr-on .nav-belt .nav-left,
  html.kos-hdr-on .nav-belt .nav-logo { min-width: 0 !important; width: auto !important; margin: 0 !important; }
  html.kos-hdr-on .nav-belt .nav-right { gap: 0 !important; }
  html.kos-hdr-on .nav-belt .nav-tools-links li.nav-orders { display: none !important; }
  html.kos-hdr-on .nav-belt #topcartlink .cart-label { display: none !important; }
  html.kos-hdr-on .nav-belt .ko-lang-caret { display: none !important; }
}

@media print {
  .kos-hdr-util, .kos-hdr-trust, .kos-hdr-panel { display: none !important; }
}
