/*
 * replica-cart.css - Area E (cart-checkout): cart page, cart drawer fallbacks, demo checkout and thank-you page.
 *
 * The Horizon cart markup (cart-items-component, .cart-items__table-row, .cart-summary, .cart-totals, .cart-drawer__*, .ub-why,
 * quantity selector, cart bubble) is fully styled by the theme CSS already loaded (base.css + styles.css). The live cart page
 * (raw/live/cart.html) carries no extra per-section <style> for the cart section: its instance settings are inline --vars copied
 * into templates/pages/cart.html. So part 1 only fills gaps. Parts 2 and 3 are the replica's own (the live checkout runs on
 * checkout.shopify.com and was not captured; the layout follows the standard Shopify checkout).
 *
 * Note (live store): --cart-font-size--sm/--xl and --font-weight-bold are NOT defined by the theme, so the "Estimated total"
 * value inherits the body size and weight. Do not define them here or the page stops matching the live one.
 */

/* ============================================================ 1. cart page */
#shopify-section-cart .cart-page__items { min-width: 0; }
#shopify-section-cart .cart__page-error { margin-block-start: var(--margin-lg); }
#shopify-section-cart .cart-items__remove svg { width: var(--icon-size-sm); height: var(--icon-size-sm); }
#shopify-section-cart .cart-items__title { text-decoration: none; }
/* the live cart section has no bottom padding: the recommendations section provides the spacing */
#shopify-section-cart .cart-page--empty .cart-items__wrapper p { margin: 0; }
#shopify-section-cart .cart-page--empty .cart-items__wrapper p a { color: inherit; }
/* rows being removed (component-cart-items.js adds .removing; the keyframes live in styles.css) */
.cart-items__table-row.removing { pointer-events: none; }
/* discount accordion: the replica has no discounts; the live error text is shown by cart.js */
.cart-discount__error:not(.hidden) { display: flex; }
.cart-discount__input[aria-invalid="true"] { border-color: var(--color-error); }

/* Phone: the summary inherits the page scheme (white), like the live cart at 390 (QA round 3). The theme rule
   `@media (max-width:749px){.inherit-parent-scheme--mobile{--color-background:inherit;...}}` of styles.css loses to the
   .color-scheme-2 variables of theme-inline.css, which templates/layout.html loads AFTER styles.css (on the live page the
   scheme CSS comes first). Restated here with a higher specificity for the two summary elements that carry the class; the
   absolutely positioned .section-background keeps covering the whole section, as on live, but now paints white on white. */
@media screen and (max-width: 749px) {
  #shopify-section-cart .cart-page__summary .inherit-parent-scheme--mobile {
    --color-background: inherit;
    --color-background-rgb: inherit;
    --color-foreground: inherit;
    --color-foreground-rgb: inherit;
    --color-primary: inherit;
    --color-primary-rgb: inherit;
    --color-primary-hover: inherit;
    --color-primary-hover-rgb: inherit;
    --color-border: inherit;
    --color-border-rgb: inherit;
    --color-shadow: inherit;
    --color-shadow-rgb: inherit;
    --color-foreground-heading: inherit;
    --color-primary-button-text: inherit;
    --color-primary-button-background: inherit;
    --color-primary-button-border: inherit;
    --color-primary-button-hover-text: inherit;
    --color-primary-button-hover-background: inherit;
    --color-primary-button-hover-border: inherit;
    --color-secondary-button-text: inherit;
    --color-secondary-button-background: inherit;
    --color-secondary-button-border: inherit;
    --color-secondary-button-hover-text: inherit;
    --color-secondary-button-hover-background: inherit;
    --color-secondary-button-hover-border: inherit;
    --color-input-text: inherit;
    --color-input-text-rgb: inherit;
    --color-input-background: inherit;
  }
}

/* "You may also like" (product-list section of templates/cart.json). Per-instance text block / button classes. */
#shopify-section-cart-recommendations .text-block--cart-recommendations-heading {
  width: var(--width, fit-content);
  max-width: var(--max-width, none);
  color: var(--color, var(--color-foreground));
  text-align: left;
  font-family: var(--font-body--family);
  font-style: var(--font-body--style);
  text-wrap: pretty;
}
#shopify-section-cart-recommendations .text-block--cart-recommendations-heading h3 { margin: 0; }
#shopify-section-cart-recommendations .link--cart-recommendations-button { color: var(--color-foreground); }

/* ============================================================ 2. cart drawer */
/* Everything for <dialog class="cart-drawer__dialog dialog-modal dialog-drawer"> is in styles.css/base.css. The rules below
   only cover a plain element drawer (aside#cart-drawer) should the layout partial not use a <dialog>. */
#cart-drawer:not(dialog)[data-cart-drawer] {
  position: fixed;
  inset: 0 0 0 auto;
  z-index: var(--layer-temporary, 20);
  width: var(--sidebar-width, 25rem);
  max-width: 95vw;
  height: 100dvh;
  margin: 0;
  display: flex;
  flex-direction: column;
  background-color: var(--color-background);
  box-shadow: var(--shadow-drawer);
  transform: translateX(100%);
  transition: transform var(--animation-speed, .125s) var(--animation-easing, ease-in-out);
  overflow: hidden;
}
#cart-drawer:not(dialog)[data-cart-drawer][hidden] { display: none; }
#cart-drawer:not(dialog)[data-cart-drawer].is-open { transform: none; }
#cart-drawer:not(dialog)[data-cart-drawer] .cart-drawer__content { height: calc(100% - var(--header-height, 60px)); }
#cart-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--layer-overlay, 16);
  background: rgb(var(--backdrop-color-rgb, var(--color-shadow-rgb, 0 0 0)) / var(--backdrop-opacity, .15));
}
#cart-drawer-overlay[hidden] { display: none; }
body.cart-drawer-open { overflow: hidden; }
@media screen and (max-width: 749px) {
  #cart-drawer:not(dialog)[data-cart-drawer] { width: 100%; max-width: 100%; }
}
/* cart rows rendered client side inside the drawer: same table markup as the page (styles.css covers .cart-drawer .cart-items__*) */
[data-cart-drawer-items] .cart-items__wrapper { width: 100%; }
[data-cart-drawer-items] .cart-items { --cart-items-gap: var(--gap-xl); }

/* add-to-cart button while the request runs (the theme's checkmark burst needs the .add-to-cart__added markup; this is the
   fallback for a plain button) */
.add-to-cart-button.is-loading,
[data-add-to-cart-button].is-loading { cursor: progress; }
[data-add-to-cart-button].is-loading:not(.add-to-cart-button) { opacity: .75; }
.cart__checkout-button.is-loading { cursor: progress; }

/* ============================================================ 3. demo checkout + thank-you (.ub-checkout) */
/* The store chrome of layout.html (announcement, header, collection links, footer, drawer) is not part of a Shopify checkout.
   layout.html marks the template on <body data-template="..."> (the older skeleton used a template-* class: both are covered). */
:is(body[data-template="checkout"], body[data-template="thank-you"], body.template-checkout, body.template-thank-you) :is(
  [data-announcement-bar],
  [data-header],
  [data-collection-links],
  [data-footer],
  #header-group,
  .shopify-section-group-header-group,
  .shopify-section-group-footer-group,
  .header-section,
  .footer-section,
  #cart-drawer,
  [data-cart-drawer],
  [data-cart-drawer-component],
  #cart-drawer-overlay
) { display: none !important; }
:is(body[data-template="checkout"], body[data-template="thank-you"], body.template-checkout, body.template-thank-you) { background: #fff; }
:is(body[data-template="checkout"], body[data-template="thank-you"], body.template-checkout, body.template-thank-you) .content-for-layout { padding: 0; margin: 0; }

.ub-checkout {
  --co-border: #dedede;
  --co-text: #333333;
  --co-muted: #707070;
  --co-accent: #1773b0;
  --co-button: #000000;
  --co-button-text: #ffffff;
  --co-aside-bg: #f5f5f5;
  --co-radius: 5px;
  --co-max: 1100px;
  --co-pad: 38px;
  font-family: var(--font-body--family, Inter, sans-serif);
  font-size: 14px;
  line-height: 1.4;
  color: var(--co-text);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.ub-checkout * { box-sizing: border-box; }
.ub-checkout a { color: var(--co-accent); text-decoration: none; }
.ub-checkout a:hover { text-decoration: underline; }
.ub-checkout p { margin: 0; }
.ub-checkout img { max-width: 100%; display: block; }

.ub-checkout__demo-banner {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  padding: 10px 16px;
  background: #fff4ce;
  color: #3d2e00;
  border-bottom: 1px solid #f0d87a;
  font-size: 13px;
  text-align: center;
}
.ub-checkout__demo-banner strong { font-weight: 700; }

.ub-checkout__header { border-bottom: 1px solid var(--co-border); background: #fff; }
.ub-checkout__header-inner {
  max-width: var(--co-max);
  margin: 0 auto;
  padding: 21px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.ub-checkout__logo { display: inline-flex; align-items: center; color: var(--co-text); }
.ub-checkout__logo img { height: 28px; width: auto; }
.ub-checkout__logo-text { font-weight: 700; font-size: 22px; letter-spacing: .04em; }
.ub-checkout__cart-link { display: inline-flex; color: var(--co-accent); }
.ub-checkout__cart-link svg { width: 22px; height: 22px; }

.ub-checkout__h1 {
  margin: 0;
  font-family: inherit;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--co-text);
  text-transform: none;
}
.ub-checkout__h2 {
  margin: 0 0 14px;
  font-family: inherit;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: 0;
  color: var(--co-text);
  text-transform: none;
}
.ub-checkout__hint { color: var(--co-muted); font-size: 14px; margin: 0 0 14px; }
.ub-checkout__link { font-size: 14px; }

.ub-checkout__layout { display: flex; flex-direction: column; flex: 1 1 auto; }
.ub-checkout__main { padding: 21px 16px 28px; display: flex; flex-direction: column; }
.ub-checkout__main > * { width: 100%; max-width: 572px; }
.ub-checkout__aside { background: var(--co-aside-bg); border-bottom: 1px solid var(--co-border); padding: 21px 16px; }
.ub-checkout__aside-inner { width: 100%; max-width: 436px; }

.ub-checkout__section { margin-top: 28px; }
.ub-checkout__section:first-child { margin-top: 0; }
.ub-checkout__section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ub-checkout__section-head .ub-checkout__h2 { margin-bottom: 0; }
.ub-checkout__section-head + .ub-field { margin-top: 14px; }

/* floating label fields (placeholder=" " drives :placeholder-shown) */
.ub-field { position: relative; margin-top: 14px; }
.ub-field__input {
  width: 100%;
  height: 52px;
  margin: 0;
  padding: 20px 12px 6px;
  border: 1px solid var(--co-border);
  border-radius: var(--co-radius);
  background: #fff;
  box-shadow: none;
  font: inherit;
  font-size: 14px;
  line-height: 1.3;
  color: var(--co-text);
  appearance: none;
  -webkit-appearance: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.ub-field__input:hover { border-color: #c0c0c0; }
.ub-field__input:focus { outline: none; border-color: var(--co-accent); box-shadow: 0 0 0 1px var(--co-accent); }
.ub-field__input[aria-invalid="true"] { border-color: #d72c0d; box-shadow: 0 0 0 1px #d72c0d; }
.ub-field__label {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  margin: 0;
  color: var(--co-muted);
  font-size: 14px;
  line-height: 1;
  pointer-events: none;
  transition: top .15s ease, transform .15s ease, font-size .15s ease;
}
.ub-field__input:focus ~ .ub-field__label,
.ub-field__input:not(:placeholder-shown) ~ .ub-field__label,
.ub-field--select .ub-field__label { top: 9px; transform: none; font-size: 12px; }
.ub-field--select .ub-field__input { padding-right: 36px; cursor: pointer; }
.ub-field__chevron { position: absolute; right: 14px; top: 50%; transform: translateY(-50%); color: var(--co-muted); pointer-events: none; }
.ub-field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.ub-field--inline { flex: 1 1 auto; margin-top: 0; }

.ub-checkbox { display: flex; align-items: center; gap: 11px; margin-top: 14px; font-size: 14px; color: var(--co-text); cursor: pointer; }
.ub-checkbox input { width: 18px; height: 18px; margin: 0; accent-color: var(--co-accent); }

.ub-checkout__options { border: 1px solid var(--co-border); border-radius: var(--co-radius); overflow: hidden; }
.ub-checkout__option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 17px 14px;
  cursor: pointer;
  background: #fff;
}
.ub-checkout__option + .ub-checkout__option { border-top: 1px solid var(--co-border); }
.ub-checkout__option:has(input:checked) { background: #f0f5fa; outline: 1px solid var(--co-accent); outline-offset: -1px; }
.ub-checkout__option input { width: 18px; height: 18px; margin: 0; accent-color: var(--co-accent); }
.ub-checkout__option-label { flex: 1 1 auto; font-size: 14px; }
.ub-checkout__option-price { font-weight: 600; font-size: 14px; }

.ub-checkout__payment-box { border: 1px solid var(--co-border); border-radius: var(--co-radius); overflow: hidden; }
.ub-checkout__payment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 11px;
  padding: 17px 14px;
  background: #f0f5fa;
  border-bottom: 1px solid var(--co-border);
  outline: 1px solid var(--co-accent);
  outline-offset: -1px;
}
.ub-checkout__payment-icons { display: inline-flex; gap: 4px; }
.ub-checkout__payment-icon { width: 38px; height: 24px; border-radius: 3px; background: #e6e6e6; border: 1px solid #d9d9d9; }
.ub-checkout__payment-note {
  padding: 30px 18px;
  background: #fafafa;
  color: var(--co-muted);
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}

.ub-checkout__actions { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; align-items: center; }
.ub-checkout__button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 0 24px;
  border: 1px solid var(--co-button);
  border-radius: var(--co-radius);
  background: var(--co-button);
  color: var(--co-button-text);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease, opacity .15s ease;
}
.ub-checkout__button:hover { background: #333; border-color: #333; color: var(--co-button-text); text-decoration: none; }
.ub-checkout__button:focus-visible { outline: 2px solid var(--co-accent); outline-offset: 2px; }
.ub-checkout__button.is-loading { opacity: .7; cursor: progress; }
.ub-checkout__button--secondary {
  width: auto;
  min-height: 52px;
  background: #e6e6e6;
  border-color: #e6e6e6;
  color: #8a8a8a;
  font-weight: 500;
}
.ub-checkout__button--secondary:not([disabled]) { background: var(--co-button); border-color: var(--co-button); color: var(--co-button-text); }
.ub-checkout__button--secondary:hover { background: #d9d9d9; border-color: #d9d9d9; color: #666; }
.ub-checkout__button--secondary:not([disabled]):hover { background: #333; border-color: #333; color: #fff; }
.ub-checkout__button[disabled] { cursor: not-allowed; }
.ub-checkout__return { display: inline-flex; align-items: center; gap: 6px; }

.ub-checkout__errors {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 21px;
  padding: 14px;
  border: 1px solid #d72c0d;
  border-radius: var(--co-radius);
  background: #fff4f4;
  color: #d72c0d;
}
.ub-checkout__errors svg { flex: 0 0 16px; margin-top: 2px; }
.ub-checkout__errors ul { margin: 0; padding: 0; list-style: none; }

.ub-checkout__footer {
  margin-top: 36px;
  padding-top: 14px;
  border-top: 1px solid var(--co-border);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 12px;
}
.ub-checkout__footer a { color: var(--co-accent); }

/* order summary */
.ub-checkout__items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.ub-checkout__item { display: flex; align-items: center; gap: 14px; }
.ub-checkout__thumb {
  position: relative;
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  border: 1px solid var(--co-border);
  border-radius: 8px;
  background: #fff;
  overflow: visible;
}
.ub-checkout__thumb img { width: 100%; height: 100%; object-fit: cover; border-radius: 7px; }
.ub-checkout__qty {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 11px;
  background: #666666;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  line-height: 22px;
  text-align: center;
}
.ub-checkout__item-info { flex: 1 1 auto; min-width: 0; }
.ub-checkout__item-title { font-size: 14px; font-weight: 500; color: var(--co-text); }
.ub-checkout__item-variant { font-size: 12px; color: var(--co-muted); margin-top: 2px; }
.ub-checkout__item-price { font-size: 14px; font-weight: 500; white-space: nowrap; }

.ub-checkout__discount { display: flex; gap: 11px; margin-top: 21px; flex-wrap: wrap; }
.ub-checkout__discount .ub-field__input { background: #fff; }
.ub-checkout__discount-error { width: 100%; font-size: 12px; color: #d72c0d; margin-top: -4px; }

.ub-checkout__totals { margin: 21px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ub-checkout__total-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 14px; }
.ub-checkout__total-row dt, .ub-checkout__total-row dd { margin: 0; }
.ub-checkout__total-row--total { margin-top: 8px; padding-top: 14px; border-top: 1px solid var(--co-border); }
.ub-checkout__total-row--total dt { font-size: 18px; font-weight: 600; }
.ub-checkout__total-row--total strong { font-size: 18px; font-weight: 600; }
.ub-checkout__currency { font-size: 12px; color: var(--co-muted); margin-right: 4px; }

/* mobile summary toggle bar (Shopify: "Show order summary  v   $xx.xx") */
.ub-checkout__summary-toggle { background: var(--co-aside-bg); border-bottom: 1px solid var(--co-border); }
.ub-checkout__summary-toggle summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 17px 16px;
  cursor: pointer;
  list-style: none;
}
.ub-checkout__summary-toggle summary::-webkit-details-marker { display: none; }
.ub-checkout__summary-toggle summary::marker { content: ''; }
.ub-checkout__summary-toggle-label { display: inline-flex; align-items: center; gap: 8px; color: var(--co-accent); font-size: 14px; }
.ub-checkout__summary-toggle-label svg { flex: 0 0 auto; }
.ub-checkout__chevron { transition: transform .15s ease; }
.ub-checkout__summary-toggle[open] .ub-checkout__chevron { transform: rotate(180deg); }
.ub-checkout__summary-toggle-total { font-size: 18px; font-weight: 600; }

/* empty checkout */
.ub-checkout__empty { max-width: 572px; margin: 0 auto; padding: 48px 16px; display: flex; flex-direction: column; gap: 21px; align-items: flex-start; }
.ub-checkout__empty .ub-checkout__button { width: auto; }

/* thank-you */
.ub-thank-you__heading { display: flex; align-items: center; gap: 16px; }
.ub-thank-you__check { color: var(--co-accent); display: inline-flex; }
.ub-thank-you__confirmation { font-size: 14px; color: var(--co-muted); margin-bottom: 4px; }
.ub-thank-you__card { margin-top: 21px; padding: 17px; border: 1px solid var(--co-border); border-radius: var(--co-radius); }
.ub-thank-you__card .ub-checkout__h2 { font-size: 18px; margin-bottom: 8px; }
.ub-thank-you__card .ub-checkout__hint { margin-bottom: 0; }
.ub-thank-you__details { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 14px 21px; }
.ub-thank-you__details dt { font-size: 14px; font-weight: 600; margin: 0 0 4px; }
.ub-thank-you__details dd { margin: 0; color: var(--co-muted); font-size: 14px; }
.ub-thank-you__actions { margin-top: 28px; display: flex; flex-direction: column-reverse; gap: 18px; }
.ub-thank-you__actions .ub-checkout__hint { margin: 0; }
.ub-thank-you__actions .ub-checkout__button { width: auto; align-self: flex-start; }

/* phone: summary comes first (under the toggle bar) and is hidden until the bar is opened; thank-you shows it at the end */
@media screen and (max-width: 999px) {
  .ub-checkout__aside { order: -1; display: none; }
  .ub-checkout:has(.ub-checkout__summary-toggle[open]) .ub-checkout__aside { display: block; }
  .ub-thank-you .ub-checkout__aside { display: block; order: 1; border-top: 1px solid var(--co-border); border-bottom: 0; }
  .ub-checkout__aside-inner { max-width: none; }
  .ub-field-row { grid-template-columns: 1fr 1fr; }
}
@media screen and (max-width: 499px) {
  .ub-thank-you__details { grid-template-columns: 1fr; }
}

/* desktop: two columns, white form on the left, grey sticky summary on the right (standard Shopify checkout) */
@media screen and (min-width: 1000px) {
  .ub-checkout__header-inner { padding: 21px var(--co-pad); }
  .ub-checkout__summary-toggle { display: none; }
  .ub-checkout__layout {
    flex-direction: row;
    align-items: stretch;
    flex: 1 1 auto;
  }
  .ub-checkout__main {
    flex: 1 1 50%;
    align-items: flex-end;
    padding: var(--co-pad) var(--co-pad) var(--co-pad) 16px;
  }
  .ub-checkout__main > * { max-width: 572px; }
  .ub-checkout__aside {
    flex: 1 1 50%;
    border-bottom: 0;
    border-left: 1px solid var(--co-border);
    padding: var(--co-pad) 16px var(--co-pad) var(--co-pad);
  }
  .ub-checkout__aside-inner { position: sticky; top: var(--co-pad); max-width: 436px; }
  .ub-checkout__actions { flex-direction: row; justify-content: space-between; align-items: center; }
  .ub-checkout__actions .ub-checkout__button { width: auto; min-width: 180px; order: 2; }
  .ub-checkout__return { order: 1; }
}
@media screen and (min-width: 1200px) {
  .ub-checkout__main { padding-left: calc((100vw - var(--co-max)) / 2); }
  .ub-checkout__aside { padding-right: calc((100vw - var(--co-max)) / 2); }
}

/* owner request (04/10): the cart summary column is white in this store, not the grey color-scheme-2 of the theme */
#shopify-section-cart .cart-page__summary .section-background.color-scheme-2,
#shopify-section-cart .cart-page__summary .cart-summary.color-scheme-2,
#shopify-section-cart .cart-page__summary .color-scheme-2 {
  --color-background: rgb(255 255 255 / 1.0);
  --color-background-rgb: 255 255 255;
  background-color: #fff;
}
