/* ==========================================================================
   NASHIRA - CART DRAWER SKIN
   Restyles the stock cart drawer with heritage tokens. Pure presentation:
   the drawer's markup and cart logic are untouched, so Shopify updates to
   cart-drawer.liquid keep working. Uses the theme's exposed custom
   properties and shadow ::part() hooks.
   ========================================================================== */

body.ns-heritage cart-drawer.cart-drawer {
  --drawer-background: var(--ns-cream);
  --drawer-max-width: 460px;
  --drawer-header-padding-block: 22px;
  --drawer-header-padding-inline: 26px;
  --drawer-body-padding-block: 20px;
  --drawer-body-padding-inline: 26px;
  --drawer-footer-padding-block: 22px;
  --drawer-footer-padding-inline: 26px;
}

body.ns-heritage cart-drawer.cart-drawer::part(overlay) {
  background: rgba(40, 15, 12, 0.5);
}

body.ns-heritage cart-drawer.cart-drawer::part(close-button) {
  color: var(--ns-maroon);
}

/* ---------- header ---------- */
body.ns-heritage .cart-drawer > .h4[slot="header"],
body.ns-heritage .cart-drawer .h4 {
  font-family: var(--ns-display);
  font-size: 22px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ns-maroon);
  font-weight: 400;
}

body.ns-heritage .cart-drawer .h5 {
  font-family: var(--ns-serif);
  font-style: italic;
  font-size: 22px;
  color: var(--ns-ink-soft);
}

/* ---------- line items ---------- */
body.ns-heritage .cart-drawer__items {
  display: grid;
  gap: 0;
}

body.ns-heritage .cart-drawer__items .line-item {
  padding-block: 18px;
  border-bottom: 1px solid var(--ns-line);
}

body.ns-heritage .cart-drawer__items .line-item:last-child {
  border-bottom: 0;
}

body.ns-heritage .cart-drawer__items img {
  border: 1px solid var(--ns-line);
  border-radius: 0;
  background: var(--ns-ivory-deep);
}

body.ns-heritage .cart-drawer .line-item__title,
body.ns-heritage .cart-drawer .line-item a {
  font-family: var(--ns-serif);
  font-size: 19px;
  color: var(--ns-ink);
  line-height: 1.3;
}

body.ns-heritage .cart-drawer .text-subdued {
  font-family: var(--ns-body);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ns-ink-soft);
}

/* quantity stepper */
body.ns-heritage .cart-drawer quantity-selector,
body.ns-heritage .cart-drawer .quantity-selector {
  border: 1px solid var(--ns-line);
  border-radius: 0;
  background: var(--ns-ivory);
}

body.ns-heritage .cart-drawer quantity-selector button:hover {
  color: var(--ns-maroon);
}

/* ---------- free shipping bar ---------- */
body.ns-heritage .cart-drawer progress,
body.ns-heritage .cart-drawer .progress-bar {
  accent-color: var(--ns-gold);
}

body.ns-heritage .cart-drawer .free-shipping-bar {
  border: 1px dashed var(--ns-gold);
  background: rgba(191, 155, 72, 0.08);
  padding: 12px 14px;
  font-family: var(--ns-body);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ns-ink);
}

/* ---------- discounts ---------- */
body.ns-heritage .cart-drawer .discount-badge {
  background: var(--ns-maroon);
  color: var(--ns-gold-bright);
  border-radius: 0;
  font-family: var(--ns-body);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 9px;
}

/* ---------- note link ---------- */
body.ns-heritage .cart-drawer .link-faded-reverse {
  font-family: var(--ns-body);
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ns-gold-deep);
  border-bottom: 1px solid var(--ns-line);
  padding-bottom: 2px;
}

body.ns-heritage .cart-drawer .link-faded-reverse:hover {
  color: var(--ns-maroon);
  border-color: var(--ns-gold);
}

/* ---------- footer + buttons ---------- */
body.ns-heritage .cart-drawer__footer {
  border-top: 1px solid var(--ns-gold);
  background: var(--ns-cream);
}

body.ns-heritage .cart-drawer .button-group {
  display: grid;
  gap: 10px;
}

body.ns-heritage .cart-drawer .button {
  border-radius: 0;
  font-family: var(--ns-body);
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 500;
  padding-block: 15px;
  background: var(--ns-maroon);
  color: var(--ns-ivory);
  border: 1px solid var(--ns-maroon);
  transition: background 0.3s, color 0.3s, border-color 0.3s;
}

body.ns-heritage .cart-drawer .button:hover {
  background: var(--ns-maroon-2);
  border-color: var(--ns-gold);
}

/* secondary (view cart) reads as an outline button.
   The GoKwik checkout is excluded by name: its snippet renders the button div
   AND a <script> as siblings, so when "View cart" is hidden the checkout div
   is :first-child:not(:only-child) too - and this rule, at (0,6,1), would
   strip the primary checkout down to a transparent outline with its ivory
   label sitting on cream. */
body.ns-heritage .cart-drawer .button-group > *:first-child:not(:only-child):not(.gokwik-checkout) .button,
body.ns-heritage .cart-drawer .button--secondary {
  background: transparent;
  color: var(--ns-maroon);
  border-color: var(--ns-gold);
}

body.ns-heritage .cart-drawer .button-group > *:first-child:not(:only-child):not(.gokwik-checkout) .button:hover,
body.ns-heritage .cart-drawer .button--secondary:hover {
  background: var(--ns-ivory-deep);
  color: var(--ns-maroon);
}

body.ns-heritage .cart-drawer__button-price {
  font-family: var(--ns-body);
  letter-spacing: 0.12em;
}

/* ---------- empty state ---------- */
body.ns-heritage .cart-drawer.drawer--center-body {
  text-align: center;
}

/* --------------------------------------------------------------------------
   GOKWIK CHECKOUT BUTTON

   snippets/gokwik.liquid paints this button from the app's own colour
   settings, so it arrives as a 45px black slab with the text colour pinned on
   the inner .btn-text span rather than on the button. That span colour is the
   real trap: it survives the theme's own .button rules, so the moment the
   cart drawer styles the button as an outline variant the label turns white
   on cream and disappears. Pin the button and the span together here.

   ns-cart.css loads after the inline <style> gokwik.liquid puts in the head,
   and every selector below outweighs the app's - so these hold even if the
   colour settings are cleared again in the theme editor.
   -------------------------------------------------------------------------- */
body.ns-heritage .gokwik-checkout {
  margin-bottom: 0;
}

body.ns-heritage .gokwik-checkout button {
  height: auto;
  min-height: 52px;
  padding: 14px 20px;
  border-radius: 0;
  background: var(--ns-maroon);
  border: 1px solid var(--ns-maroon);
  font-family: var(--ns-body);
  transition: background 0.3s, border-color 0.3s;
}

body.ns-heritage .gokwik-checkout button:hover:not([disabled]) {
  background: var(--ns-maroon-2);
  border-color: var(--ns-gold);
}

body.ns-heritage .gokwik-checkout button > span.btn-text,
body.ns-heritage .gokwik-checkout button > span.btn-text > span {
  color: var(--ns-ivory);
}

body.ns-heritage .gokwik-checkout button > span.btn-text > span:first-child {
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}

/* the prepaid-discount line under the label */
body.ns-heritage .gokwik-checkout button > span.btn-text > span:last-child {
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: none;
  opacity: 0.85;
}

/* Same treatment for the GoKwik buy-now button on the legacy product
   templates, which is an id and so needs an id to beat it. */
body.ns-heritage #gokwik-buy-now {
  min-height: 52px;
  border-radius: 0;
  background: var(--ns-maroon);
  border: 1px solid var(--ns-maroon);
  color: var(--ns-ivory);
  font-family: var(--ns-body);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  font-weight: 600;
}

body.ns-heritage #gokwik-buy-now > span.btn-text > span {
  color: var(--ns-ivory);
}

/* the spinner that covers the button while GoKwik boots */
body.ns-heritage .gokwik-checkout #btn-loader,
body.ns-heritage #gokwik-buy-now #btn-loader {
  background: var(--ns-maroon);
}


/* --------------------------------------------------------------------------
   HITSY PROGRESS BAR - hidden

   The green "You have earned Free Shipping and 10% discount!" milestone bar is
   drawn by the Hitsy Progress Bar app embed as a <hitsy-container> custom
   element with its own shadow root, so nothing inside it can be styled from
   here - but the host element can. Hidden with CSS rather than by switching
   the app embed off, so the app's script keeps running and any reward logic it
   drives is untouched; only the bar stops showing. To bring it back, delete
   this rule.
   -------------------------------------------------------------------------- */
hitsy-container {
  display: none !important;
}
