/* ============================================================
   Stepace — Commerce surface polish
   Shop archive + the BLOCK cart/checkout.

   Why this file exists: the cart and checkout are WooCommerce
   *block* pages, so none of the bespoke store templates apply to
   them. Before this file there was not a single `wc-block` rule
   in the theme, so everything below the page title was stock
   WooCommerce chrome sitting inside a Futura/black/orange site.

   Shape rule followed throughout (matches the rest of the site):
     buttons  -> pill        (--radius-pill)
     inputs   -> 2px         (--radius-xs, sharp/editorial)
     panels   -> square, hairline rules instead of cards
   ============================================================ */

:root {
  --sp-c-ink:        #0B0B0B;
  --sp-c-ink-soft:   #262626;
  --sp-c-muted:      #6B6B6B;   /* 4.9:1 on white - AA body */
  --sp-c-line:       rgba(11, 11, 11, 0.14);
  --sp-c-line-solid: #DADADA;
  --sp-c-paper:      #FFFFFF;
  --sp-c-sunken:     #F0F0F0;
  --sp-c-orange:     #E7511F;
  --sp-c-orange-dp:  #C33F13;
}

/* The block cart/checkout render outside .sp-root's font scope in a
   few places (portalled notices, selects), and <body> itself has no
   family set, so those fall back to Times. Anchor it once. */
body.woocommerce-cart,
body.woocommerce-checkout {
  font-family: "Futura Cyrillic", "Helvetica Neue", Arial, sans-serif;
}

/* ------------------------------------------------------------
   1. SHOP ARCHIVE
   ---------------------------------------------------------- */

/* The grid shipped with row-gap 6px against column-gap 24px, so
   product meta collided with the next row's image and the whole
   grid read as ragged. Rows need MORE air than columns here,
   because each row ends in text. */
.sa-grid {
  row-gap: 48px;
  column-gap: 24px;
  align-items: start;
}

@media (max-width: 767px) {
  .sa-grid { row-gap: 32px; }
}

/* Stock WooCommerce pagination: light 1px boxes, system font.
   Rebuilt as brand numerals on a hairline rule. */
.woocommerce-pagination { margin: 56px 0 0; }

.woocommerce-pagination ul.page-numbers {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  border: 0;
  list-style: none;
}

.woocommerce-pagination ul.page-numbers li {
  border: 0;
  margin: 0;
}

.woocommerce-pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--sp-c-line);
  border-radius: 999px;
  background: transparent;
  color: var(--sp-c-ink);
  font-family: "Futura Cyrillic", Arial, sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background-color 160ms cubic-bezier(0.2, 0.7, 0.25, 1),
              color 160ms cubic-bezier(0.2, 0.7, 0.25, 1),
              border-color 160ms cubic-bezier(0.2, 0.7, 0.25, 1);
}

.woocommerce-pagination .page-numbers:hover,
.woocommerce-pagination .page-numbers:focus-visible {
  border-color: var(--sp-c-ink);
  background: var(--sp-c-ink);
  color: #FFFFFF;
}

.woocommerce-pagination .page-numbers.current {
  border-color: var(--sp-c-ink);
  background: var(--sp-c-ink);
  color: #FFFFFF;
}

.woocommerce-pagination .page-numbers.dots {
  border-color: transparent;
  min-width: 20px;
  padding: 0;
}

/* Catalog ordering <select> was raw browser chrome next to an
   otherwise typeset toolbar. */
.woocommerce-ordering select,
select.orderby {
  appearance: none;
  -webkit-appearance: none;
  padding: 10px 40px 10px 16px;
  border: 1px solid var(--sp-c-line);
  border-radius: 999px;
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%230B0B0B' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  color: var(--sp-c-ink);
  font-family: "Futura Cyrillic", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.woocommerce-ordering select:focus-visible,
select.orderby:focus-visible {
  outline: 2px solid var(--sp-c-orange);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   2. CART + CHECKOUT - page shell
   ---------------------------------------------------------- */

/* NOTE ON THE PAGE SHELL: cart and checkout render as a 900px white
   sheet on the site's black background, with dark gutters either
   side. That is the theme's standard page-template layout, shared
   with every other non-archive page, so it is deliberately left
   alone here. Going full-bleed white means overriding --nav-bg too,
   because the sticky nav is translucent (rgba(11,11,11,.72) over
   blur) and turns grey the moment the surface behind it goes white. */

/* Both columns were stretching to equal height, which left a tall
   empty white void under a short cart. */
.wc-block-components-sidebar-layout {
  align-items: start;
}

/* Keep the running total in view while the form is filled. */
@media (min-width: 1000px) {
  .wc-block-components-sidebar {
    position: sticky;
    top: 96px;
  }
}

/* ------------------------------------------------------------
   3. CART + CHECKOUT - typography
   ---------------------------------------------------------- */

.wc-block-components-title,
.wc-block-components-checkout-step__title,
.wc-block-cart__totals-title,
.wc-block-components-checkout-order-summary__title-text,
.wc-block-components-order-summary__title {
  font-family: "Futura Cyrillic", Arial, sans-serif !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--sp-c-ink);
}

.wc-block-components-checkout-step__title {
  font-size: 13px;
}

.wc-block-components-checkout-step__heading {
  margin-bottom: 12px;
}

/* Woo's default 13px muted grey is under-contrast for the copy that
   explains cost. Lift to a token that passes AA. */
.wc-block-components-totals-item__label,
.wc-block-components-totals-item__value,
.wc-block-components-product-name,
.wc-block-components-radio-control__label {
  color: var(--sp-c-ink-soft);
  font-size: 13px;
  letter-spacing: 0.04em;
}

.wc-block-components-totals-item__description,
.wc-block-components-checkout-step__description,
.wc-block-components-radio-control__secondary-label {
  color: var(--sp-c-muted);
}

/* The grand total is the one number that should carry weight. */
.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--sp-c-ink);
}

/* Product long-description was being dumped into the line item and
   truncated mid-sentence ("...THIS MATCHING SET PAIRS A..."). It is
   noise at the point of payment; the name and price carry the job. */
.wc-block-components-product-metadata__description {
  display: none;
}

/* ------------------------------------------------------------
   4. CART + CHECKOUT - primary actions
   Black pill + white text = 19.7:1. The brand's own orange on
   white is 3.75:1, which fails AA for label-sized text, so orange
   is used as the accent edge and focus ring, never as the fill
   behind small white type.
   ---------------------------------------------------------- */

.wc-block-components-checkout-place-order-button,
.wc-block-cart__submit-button,
.wc-block-components-button.contained {
  border-radius: 999px !important;
  background-color: var(--sp-c-ink) !important;
  color: #FFFFFF !important;
  font-family: "Futura Cyrillic", Arial, sans-serif !important;
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0.14em !important;
  text-transform: uppercase;
  min-height: 56px;
  box-shadow: inset 0 -3px 0 var(--sp-c-orange);
  transition: background-color 160ms cubic-bezier(0.2, 0.7, 0.25, 1),
              box-shadow 160ms cubic-bezier(0.2, 0.7, 0.25, 1),
              transform 120ms cubic-bezier(0.2, 0.7, 0.25, 1);
}

.wc-block-components-checkout-place-order-button:hover,
.wc-block-cart__submit-button:hover,
.wc-block-components-button.contained:hover {
  background-color: var(--sp-c-ink-soft) !important;
  box-shadow: inset 0 -6px 0 var(--sp-c-orange);
}

/* Physical press. */
.wc-block-components-checkout-place-order-button:active,
.wc-block-cart__submit-button:active,
.wc-block-components-button.contained:active {
  transform: translateY(1px);
}

.wc-block-components-checkout-place-order-button:focus-visible,
.wc-block-cart__submit-button:focus-visible,
.wc-block-components-button.contained:focus-visible {
  outline: 2px solid var(--sp-c-orange);
  outline-offset: 3px;
}

@media (prefers-reduced-motion: reduce) {
  .wc-block-components-checkout-place-order-button,
  .wc-block-cart__submit-button,
  .wc-block-components-button.contained { transition: none; }
  .wc-block-components-checkout-place-order-button:active,
  .wc-block-cart__submit-button:active,
  .wc-block-components-button.contained:active { transform: none; }
}

/* ------------------------------------------------------------
   5. CHECKOUT - ship / pickup toggle
   Pickup is the default now, so this control is the first thing a
   shopper reads. Stock styling marked the selected tab with a thin
   border while the UNselected tab carried a grey fill, which reads
   backwards (filled = chosen, to most people).
   ---------------------------------------------------------- */

.wc-block-checkout__shipping-method-container {
  gap: 8px;
  border: 0;
  padding: 0;
  background: transparent;
}

.wc-block-checkout__shipping-method-option {
  border: 1px solid var(--sp-c-line);
  border-radius: 999px;
  background: var(--sp-c-paper);
  color: var(--sp-c-ink-soft);
  min-height: 52px;
  transition: background-color 160ms cubic-bezier(0.2, 0.7, 0.25, 1),
              color 160ms cubic-bezier(0.2, 0.7, 0.25, 1),
              border-color 160ms cubic-bezier(0.2, 0.7, 0.25, 1);
}

.wc-block-checkout__shipping-method-option:hover {
  border-color: var(--sp-c-ink);
}

/* Woo's own selected-state rule outranks a single class here, so the
   fill needs the container prefix. Without it the label goes white
   while the pill stays white, i.e. an invisible tab. */
.wc-block-checkout__shipping-method-container
  .wc-block-checkout__shipping-method-option--selected {
  background-color: var(--sp-c-ink) !important;
  border-color: var(--sp-c-ink) !important;
  color: #FFFFFF !important;
}

.wc-block-checkout__shipping-method-container
  .wc-block-checkout__shipping-method-option--selected
  .wc-block-checkout__shipping-method-option-title,
.wc-block-checkout__shipping-method-container
  .wc-block-checkout__shipping-method-option--selected svg {
  color: #FFFFFF !important;
  fill: currentColor;
}

.wc-block-checkout__shipping-method-option-title {
  font-family: "Futura Cyrillic", Arial, sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.wc-block-checkout__shipping-method-option:focus-within {
  outline: 2px solid var(--sp-c-orange);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .wc-block-checkout__shipping-method-option { transition: none; }
}

/* ------------------------------------------------------------
   6. CHECKOUT - form fields
   ---------------------------------------------------------- */

.wc-block-components-text-input input[type="text"],
.wc-block-components-text-input input[type="email"],
.wc-block-components-text-input input[type="tel"],
.wc-block-components-text-input input[type="number"],
.wc-blocks-components-select__select {
  border: 1px solid var(--sp-c-line-solid);
  border-radius: 2px;
  background: var(--sp-c-paper);
  color: var(--sp-c-ink);
  font-family: "Futura Cyrillic", Arial, sans-serif;
  font-size: 15px;   /* >=16px on mobile below, to stop iOS zoom */
  min-height: 52px;
}

.wc-block-components-text-input input:focus,
.wc-blocks-components-select__select:focus {
  border-color: var(--sp-c-ink);
  outline: 2px solid var(--sp-c-orange);
  outline-offset: 1px;
  box-shadow: none;
}

/* iOS zooms the viewport when a focused input is under 16px. */
@media (max-width: 767px) {
  .wc-block-components-text-input input,
  .wc-blocks-components-select__select { font-size: 16px; }
}

/* Float-labels: Woo animates a real <label>, so this stays an
   accessible label rather than placeholder-as-label. Only the
   colour needed lifting to pass AA in its resting state. */
.wc-block-components-text-input label,
.wc-blocks-components-select__label {
  color: var(--sp-c-muted);
  font-family: "Futura Cyrillic", Arial, sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 12px;
}

.wc-block-components-text-input.is-active label {
  color: var(--sp-c-ink-soft);
}

/* Radio rows (pickup location, payment method). */
.wc-block-components-radio-control__option {
  border-radius: 2px;
}

.wc-block-components-radio-control--highlight-checked
  .wc-block-components-radio-control__option--checked-option-highlighted::after {
  border-color: var(--sp-c-ink);
  border-width: 1px;
  border-radius: 2px;
}

.wc-block-components-checkbox__input:checked {
  background-color: var(--sp-c-ink);
  border-color: var(--sp-c-ink);
}

.wc-block-components-checkbox__input:focus-visible {
  outline: 2px solid var(--sp-c-orange);
  outline-offset: 2px;
}

/* ------------------------------------------------------------
   7. CART - line items
   ---------------------------------------------------------- */

.wc-block-cart-items__header {
  font-family: "Futura Cyrillic", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sp-c-muted);
  border-bottom: 1px solid var(--sp-c-line);
}

/* Stepper fell back to Arial while everything around it was Futura. */
.wc-block-components-quantity-selector {
  border: 1px solid var(--sp-c-line-solid);
  border-radius: 999px;
  max-width: 112px;
}

.wc-block-components-quantity-selector__input,
.wc-block-components-quantity-selector__button {
  font-family: "Futura Cyrillic", Arial, sans-serif;
  color: var(--sp-c-ink);
  background: transparent;
}

.wc-block-components-quantity-selector__button:hover {
  color: var(--sp-c-orange);
}

.wc-block-cart-item__remove-link {
  font-family: "Futura Cyrillic", Arial, sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sp-c-muted);
}

.wc-block-cart-item__remove-link:hover {
  color: var(--sp-c-orange);
}

/* ------------------------------------------------------------
   8. Panels, rules and the coupon disclosure
   The system prefers hairlines over card chrome.
   ---------------------------------------------------------- */

.wc-block-components-totals-wrapper {
  border-top: 1px solid var(--sp-c-line);
}

.wc-block-components-panel__button {
  font-family: "Futura Cyrillic", Arial, sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sp-c-ink-soft);
}

.wc-block-components-panel__button:hover { color: var(--sp-c-orange); }

.wc-block-components-express-payment__title-container::before,
.wc-block-components-express-payment__title-container::after,
.wc-block-components-express-payment-continue-rule::before,
.wc-block-components-express-payment-continue-rule::after {
  border-color: var(--sp-c-line);
}

.wc-block-components-express-payment__title,
.wc-block-components-express-payment-continue-rule {
  font-family: "Futura Cyrillic", Arial, sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--sp-c-muted);
}

/* ------------------------------------------------------------
   9. Loading + empty states
   The payment step renders a bare spinner glyph on a blank panel
   while gateways resolve, which reads as a broken control. Give it
   a skeleton the shape of the rows that will replace it.
   ---------------------------------------------------------- */

.wc-block-components-radio-control-accordion-option
  .wc-block-components-loading-mask {
  min-height: 96px;
}

.wc-block-components-spinner::before {
  border-color: var(--sp-c-ink);
  border-top-color: transparent;
}

.wc-block-components-loading-mask__children {
  opacity: 0.35;
}

/* ------------------------------------------------------------
   10. Mobile
   ---------------------------------------------------------- */

@media (max-width: 767px) {
  .wc-block-components-checkout-place-order-button,
  .wc-block-cart__submit-button {
    width: 100%;
    min-height: 56px;
  }

  .wc-block-components-sidebar { position: static; }
}
