/* ==========================================================================
   Shop + marketing layer — cart drawer, toast, sticky buy bar, offer pop-up,
   cookie consent. Storyteller palette: charcoal panels, cream text,
   orange #df5828 actions, Termina buttons, DM Sans body.
   ========================================================================== */

:root {
  --sh-orange: #df5828;
  --sh-orange-dark: #c44a1f;
  --sh-panel: #171412;
  --sh-panel-2: #221d19;
  --sh-cream: #f1ebd4;
  --sh-line: rgba(241, 235, 212, 0.14);
  --sh-dim: rgba(241, 235, 212, 0.66);
}

html.is-locked,
html.is-locked body { overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Buttons ---------- */
.shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 17px 30px;
  border: 0;
  border-radius: 16px;
  background: var(--sh-orange);
  color: #fff;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}

.shop-btn:hover { background: var(--sh-orange-dark); color: #fff; }
.shop-btn:active { transform: scale(0.98); }
.shop-btn--block { width: 100%; }
.shop-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

/* ==========================================================================
   Cart drawer
   ========================================================================== */
.drawer { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
.drawer.is-open { pointer-events: auto; }

.drawer__scrim,
.promo__scrim,
.consent__scrim {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  opacity: 0;
  transition: opacity 0.4s ease;
  -webkit-backdrop-filter: blur(3px);
          backdrop-filter: blur(3px);
}

.drawer.is-open .drawer__scrim { opacity: 1; }

.drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  width: min(460px, 100%);
  background: var(--sh-panel);
  color: var(--sh-cream);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.5);
  transform: translateX(100%);
  transition: transform 0.5s var(--ease-out);
}

.drawer.is-open .drawer__panel { transform: none; }

.drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--sh-line);
}

.drawer__title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
  font-family: var(--font-head);
  font-size: 18px;
  font-weight: 900;
  text-transform: uppercase;
}

.drawer__title span {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  border-radius: 12px;
  background: var(--sh-orange);
  font-family: var(--font-body);
  font-size: 12px;
  color: #fff;
}

.drawer__close,
.promo__close {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--sh-line);
  border-radius: 50%;
  background: transparent;
  color: var(--sh-cream);
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.drawer__close:hover,
.promo__close:hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.35); }

.drawer__close svg,
.promo__close svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }

.drawer__ship {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 24px;
  background: rgba(223, 88, 40, 0.14);
  font-size: 14px;
  line-height: 1.4;
}

.drawer__ship svg { flex: none; width: 24px; height: 24px; fill: none; stroke: var(--sh-orange); stroke-width: 1.6; stroke-linejoin: round; }
.drawer__ship strong { color: #fff; }

.drawer__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 8px 24px 24px; }

.cart-lines { margin: 0; padding: 0; list-style: none; }

.cart-line {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--sh-line);
}

.cart-line__img {
  display: block;
  aspect-ratio: 1;
  overflow: hidden;
  border-radius: 8px;
  background: linear-gradient(160deg, #3a322b, #1d1915);
}

.cart-line__img img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }

.cart-line__name { margin: 0 0 4px; font-weight: 700; font-size: 15px; line-height: 1.3; color: #fff; }
.cart-line__variant { margin: 0 0 12px; font-size: 13px; line-height: 1.4; color: var(--sh-dim); }
.cart-line__row { display: flex; align-items: center; gap: 16px; }

.cart-line__remove {
  padding: 0;
  border: 0;
  background: none;
  color: var(--sh-dim);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.cart-line__remove:hover { color: #fff; }

.cart-line__price { text-align: right; }
.cart-line__price strong { display: block; font-size: 16px; color: #fff; }
.cart-line__price s { font-size: 13px; color: var(--sh-dim); }

.qty {
  display: inline-grid;
  grid-template-columns: 34px 30px 34px;
  align-items: center;
  height: 36px;
  border: 1px solid var(--sh-line);
  border-radius: 18px;
}

.qty button {
  height: 100%;
  border: 0;
  background: none;
  color: var(--sh-cream);
  font-size: 18px;
  cursor: pointer;
}

.qty button:hover { color: var(--sh-orange); }
.qty output { font-weight: 700; text-align: center; }

.cart-empty { padding: 28px 0 8px; text-align: center; }
.cart-empty__title { margin: 0 0 8px; font-family: var(--font-head); font-size: 17px; font-weight: 900; text-transform: uppercase; color: #fff; }
.cart-empty p { margin: 0 0 20px; font-size: 15px; line-height: 1.55; color: var(--sh-dim); }
.cart-empty__kits { display: grid; gap: 10px; }

.cart-kit {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border: 1px solid var(--sh-line);
  border-radius: 12px;
  background: var(--sh-panel-2);
  color: var(--sh-cream);
  font: inherit;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.cart-kit:hover { border-color: var(--sh-orange); background: rgba(223, 88, 40, 0.1); }
.cart-kit strong { font-size: 15px; color: #fff; }
.cart-kit span { font-size: 14px; color: var(--sh-dim); }

.cart-kit em {
  position: absolute;
  top: -9px;
  left: 16px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--sh-orange);
  font-family: var(--font-head);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}

/* A quieter, product-first cart using the site's existing palette and type. */
.drawer__panel { width: min(440px, 100%); background: #1a1715; }
.drawer__head { padding: 24px 28px; }
.drawer__title { font-family: var(--font-head); font-size: 16px; letter-spacing: .035em; }
.drawer__ship { padding: 13px 28px; border-bottom: 1px solid var(--sh-line); background: transparent; font-family: var(--font-body); font-size: 13px; }
.drawer__ship svg { width: 20px; height: 20px; }
.drawer__body { padding: 8px 28px 28px; }
.cart-empty { padding: 35px 0 12px; text-align: left; }
.cart-empty__title { margin-bottom: 8px; font-size: 17px; }
.cart-empty > p:not(.cart-empty__title) { max-width: 34ch; margin-bottom: 26px; font-size: 14px; }
.cart-empty__kits { gap: 0; border-top: 1px solid var(--sh-line); }
.cart-kit {
  min-height: 66px;
  padding: 14px 2px;
  border: 0;
  border-bottom: 1px solid var(--sh-line);
  border-radius: 0;
  background: transparent;
  text-align: left;
}
.cart-kit:hover { padding-right: 8px; padding-left: 8px; background: rgba(255,255,255,.035); }
.cart-kit strong { font-family: var(--font-body); font-size: 15px; font-weight: 700; }
.cart-kit span { font-family: var(--font-body); font-size: 13px; }
.cart-kit em { position: static; margin-left: auto; padding: 0; background: none; font-family: var(--font-label); font-size: 10px; letter-spacing: .08em; color: var(--sh-orange); }
.drawer__foot { padding: 20px 28px calc(20px + env(safe-area-inset-bottom)); }
.drawer__foot .shop-btn { min-height: 54px; border-radius: 4px; }

.cart-upsell {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 6px 14px;
  align-items: center;
  margin-top: 24px;
  padding: 14px;
  border-radius: 12px;
  background: var(--sh-panel-2);
}

.cart-upsell img { grid-row: span 2; width: 72px; height: 72px; object-fit: cover; border-radius: 8px; }
.cart-upsell p { margin: 0; font-size: 13px; line-height: 1.45; color: var(--sh-dim); }
.cart-upsell__kicker { font-family: var(--font-label); font-size: 11px !important; font-weight: 700; letter-spacing: 1.4px; text-transform: uppercase; color: var(--sh-orange) !important; }
.cart-upsell__title { font-weight: 700; font-size: 15px !important; color: #fff !important; }
.cart-upsell__btn { grid-column: 2; justify-self: start; font-weight: 700; font-size: 13px; color: var(--sh-orange); text-decoration: underline; }

.drawer__foot {
  padding: 18px 24px calc(18px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--sh-line);
  background: #120f0d;
}

.cart-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 15px; }
.cart-row strong { font-size: 18px; color: #fff; }
.cart-row--save { color: #8fd17b; }
.drawer__foot .shop-btn { margin-top: 10px; }

.trust-mini {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--sh-dim);
}

.trust-mini li::before { content: "✓ "; color: var(--sh-orange); font-weight: 700; }

/* ==========================================================================
   Toast
   ========================================================================== */
.shop-toast {
  position: fixed;
  left: 50%;
  top: calc(var(--header-h) + 14px);
  z-index: 450;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 30px;
  background: #fff;
  color: #1b1b1b;
  font-weight: 700;
  font-size: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -12px);
  transition: opacity 0.3s, transform 0.3s var(--ease-out);
}

.shop-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.shop-toast svg { flex: none; width: 20px; height: 20px; padding: 3px; border-radius: 50%; background: #3d9a2e; fill: none; stroke: #fff; stroke-width: 3; }

/* ==========================================================================
   Sticky buy bar (tablet / mobile)
   ========================================================================== */
.buy-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 95;
  display: none;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 10px 10px 18px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  background: rgba(23, 20, 18, 0.94);
  color: var(--sh-cream);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  -webkit-backdrop-filter: blur(10px);
          backdrop-filter: blur(10px);
  transform: translateY(140%);
  transition: transform 0.45s var(--ease-out);
}

.buy-bar.is-on { transform: none; }
.buy-bar__info { display: flex; flex-direction: column; line-height: 1.25; }
.buy-bar__info strong { font-family: var(--font-head); font-size: 14px; text-transform: uppercase; color: #fff; }
.buy-bar__info span { font-size: 13px; color: var(--sh-dim); }
.buy-bar .shop-btn { padding: 14px 20px; font-size: 12px; border-radius: 12px; }

body.menu-open .buy-bar { transform: translateY(140%); }

@media (max-width: 991px) {
  .buy-bar { display: flex; }
}

/* Keep back-to-top clear of the bar, cookie banner and drawers */
.back-to-top { transition: opacity 0.3s ease, transform 0.4s var(--ease-out); }
html.is-locked .back-to-top { opacity: 0; pointer-events: none; }

@media (max-width: 991px) {
  .back-to-top { right: 16px; bottom: 16px; width: 44px; height: 44px; border-radius: 50%; border-color: rgba(255, 255, 255, 0.5); background: rgba(23, 20, 18, 0.85); }
  body.has-buy-bar .back-to-top { transform: translateY(-78px); }
}

/* ==========================================================================
   Offer pop-up
   ========================================================================== */
.promo,
.consent { position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; padding: 16px; pointer-events: none; }
.promo.is-open,
.consent.is-open { pointer-events: auto; }
.promo.is-open .promo__scrim,
.consent.is-open .consent__scrim { opacity: 1; }

.promo__card {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  width: min(860px, 100%);
  max-height: calc(100dvh - 32px);
  overflow: hidden;
  border-radius: 20px;
  background: var(--sh-panel) url("../images/storyteller/bg/GXV-Hilt-Exterior-BG.avif") center / cover;
  color: var(--sh-cream);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(24px) scale(0.97);
  transition: opacity 0.4s, transform 0.5s var(--ease-out);
}

.promo.is-open .promo__card,
.consent.is-open .consent__card { opacity: 1; transform: none; }

.promo__close { position: absolute; top: 14px; right: 14px; z-index: 2; background: rgba(0, 0, 0, 0.45); }

.promo__media { position: relative; min-height: 100%; background: #2a211a; }
.promo__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }

.promo__badge {
  position: absolute;
  left: 16px;
  bottom: 16px;
  padding: 7px 12px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.7);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  color: #fff;
}

.promo__body { padding: 44px 40px 32px; overflow-y: auto; }

.promo__kicker {
  margin: 0 0 10px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--sh-orange);
}

.promo__title {
  margin: 0 0 14px;
  font-family: var(--font-head);
  font-size: clamp(22px, 2.6vw, 30px);
  font-weight: 900;
  line-height: 1.05;
  text-transform: uppercase;
  color: #fff;
}

.promo__text { margin: 0 0 16px; font-size: 15px; line-height: 1.6; color: var(--sh-dim); }
.promo__text strong { color: #fff; }

.promo__list { display: grid; gap: 6px; margin: 0 0 22px; padding: 0; list-style: none; font-size: 14px; }
.promo__list li::before { content: "✓"; display: inline-block; width: 22px; font-weight: 900; color: var(--sh-orange); }

.promo__form {
  display: flex;
  margin-top: 14px;
  border: 1px solid var(--sh-line);
  border-radius: 14px;
  overflow: hidden;
}

.promo__form input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 0;
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font: inherit;
  font-size: 15px;
}

.promo__form input::placeholder { color: var(--sh-dim); }
.promo__form input.is-invalid { box-shadow: inset 0 0 0 1px #ff6b5b; }

.promo__form button {
  padding: 0 20px;
  border: 0;
  background: #fff;
  color: #1b1b1b;
  font-family: var(--font-head);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  cursor: pointer;
}

.promo__fine { margin: 10px 0 0; font-size: 12px; color: var(--sh-dim); }
.promo__fine.is-ok { color: #8fd17b; }

@media (max-width: 720px) {
  .promo { align-items: end; padding: 0; }
  .promo__card { grid-template-columns: 1fr; border-radius: 20px 20px 0 0; max-height: 92dvh; transform: translateY(100%); }
  .promo__media { min-height: 170px; }
  .promo__body { padding: 24px 20px calc(24px + env(safe-area-inset-bottom)); }
}

/* ==========================================================================
   Cookie consent
   ========================================================================== */
.cookie {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: 480;
  width: min(420px, calc(100% - 32px));
  padding: 22px 22px 18px;
  border: 1px solid var(--sh-line);
  border-radius: 16px;
  background: rgba(23, 20, 18, 0.97);
  color: var(--sh-cream);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
  animation: cookie-in 0.6s var(--ease-out) both;
}

@keyframes cookie-in { from { opacity: 0; transform: translateY(20px); } }

.cookie__title { margin: 0 0 6px; font-family: var(--font-head); font-size: 14px; font-weight: 900; text-transform: uppercase; color: #fff; }
.cookie__text { margin: 0 0 16px; font-size: 14px; line-height: 1.55; color: var(--sh-dim); }
.cookie__text a { color: var(--sh-orange); text-decoration: underline; }

.cookie__btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }

.cookie__btn {
  flex: 1;
  padding: 13px 16px;
  border: 1px solid rgba(241, 235, 212, 0.35);
  border-radius: 12px;
  background: transparent;
  color: var(--sh-cream);
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.cookie__btn:hover { background: rgba(255, 255, 255, 0.08); }
.cookie__btn--solid { border-color: var(--sh-orange); background: var(--sh-orange); color: #fff; }
.cookie__btn--solid:hover { background: var(--sh-orange-dark); }

.cookie__link {
  padding: 4px 0;
  border: 0;
  background: none;
  color: var(--sh-dim);
  font: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}

.cookie__link:hover { color: #fff; }

@media (max-width: 600px) {
  .cookie { left: 0; right: 0; bottom: 0; width: 100%; border-radius: 16px 16px 0 0; padding-bottom: calc(18px + env(safe-area-inset-bottom)); }
  body.has-cookie .buy-bar,
  body.has-cookie .back-to-top { opacity: 0; pointer-events: none; }
}

.consent__card {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 30px 28px 26px;
  border-radius: 18px;
  background: var(--sh-panel);
  color: var(--sh-cream);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.35s, transform 0.45s var(--ease-out);
}

.consent__card .promo__close { position: absolute; top: 14px; right: 14px; }
.consent__title { margin: 0 0 8px; font-family: var(--font-head); font-size: 20px; font-weight: 900; text-transform: uppercase; color: #fff; }
.consent__intro { margin: 0 0 18px; padding-right: 36px; font-size: 14px; line-height: 1.55; color: var(--sh-dim); }

.consent__opt {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-top: 1px solid var(--sh-line);
}

.consent__opt strong { color: #fff; }
.consent__opt p { margin: 4px 0 0; font-size: 13px; line-height: 1.5; color: var(--sh-dim); }
.consent__card .cookie__btns { margin-top: 18px; }

.toggle { position: relative; flex: none; width: 48px; height: 28px; cursor: pointer; }
.toggle input { position: absolute; inset: 0; opacity: 0; cursor: inherit; }

.toggle i {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  transition: background 0.25s;
  pointer-events: none;
}

.toggle i::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.25s var(--ease-out);
}

.toggle input:checked + i { background: var(--sh-orange); }
.toggle input:checked + i::after { transform: translateX(20px); }
.toggle input:focus-visible + i { outline: 2px solid #fff; outline-offset: 2px; }
.toggle.is-locked { opacity: 0.55; cursor: not-allowed; }

@media (prefers-reduced-motion: reduce) {
  .drawer__panel,
  .promo__card,
  .consent__card,
  .buy-bar,
  .shop-toast { transition: none; }
  .cookie { animation: none; }
}

/* ==========================================================================
   VS table on small screens — sticky feature column + swipe hint
   ========================================================================== */
.vs__hint { display: none; }

@media (max-width: 991px) {
  .vs__hint {
    display: block;
    margin: -12px 0 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sh-orange);
    animation: hint-nudge 1.6s ease-in-out infinite;
  }

  .vs__table th[scope="row"],
  .vs__table thead th:first-child {
    position: sticky;
    left: 0;
    z-index: 2;
    background: #2b231d;
    box-shadow: 6px 0 10px -6px rgba(0, 0, 0, 0.6);
  }
}

@keyframes hint-nudge { 50% { transform: translateX(6px); } }
@media (prefers-reduced-motion: reduce) { .vs__hint { animation: none; } }
