/* ============================================
   STORE
   Mirrors the Art-page palette (warm cream bg, muted/ink type)
   and reuses gallery-grid sizing patterns.
   ============================================ */

.container--narrow { max-width: 560px; }
.container--wide   { max-width: 960px; }

/* ---- Header / sub-nav (mirrors gallery-header / gallery-subnav) ---- */

.store-header {
  padding: 48px 0 0;
  margin-bottom: 40px;
}

.store-header h1 {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 24px;
}

.store-subnav {
  display: flex;
  align-items: center;
  gap: 24px;
  padding-bottom: 36px;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--rule);
  flex-wrap: wrap;
}

.store-subnav a {
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
  transition: color 0.15s;
}

.store-subnav a:hover,
.store-subnav a.is-active {
  color: var(--ink);
}

.store-subnav a.is-active {
  text-decoration: underline;
  text-underline-offset: 6px;
  text-decoration-thickness: 1px;
}

.store-subnav-cart {
  margin-left: auto;
}

.store-subnav-cart-count {
  display: inline-block;
  margin-left: 4px;
  padding: 0 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  background: var(--ink);
  color: var(--bg);
  border-radius: 10px;
  line-height: 16px;
}

.store-intro {
  font-size: 14px;
  font-weight: 300;
  color: var(--muted);
  max-width: 520px;
  margin: 0 0 48px;
  line-height: 1.55;
}

.store-empty {
  font-size: 14px;
  color: var(--muted);
  padding: 24px 0 80px;
}

.store-breadcrumb {
  padding: 32px 0 0;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.store-breadcrumb a { color: var(--muted); text-decoration: none; }
.store-breadcrumb a:hover { color: var(--ink); }
.store-breadcrumb span { margin: 0 8px; }

/* ---- Category grid (store index) ---- */

.store-category-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 32px;
  padding: 0 0 80px;
  margin: 0;
}

.store-category-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
}
.store-category-card img,
.store-category-card-empty {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--rule);
  transition: opacity 0.2s ease;
}
.store-category-card:hover img { opacity: 0.92; }

.store-category-card-name {
  display: block;
  margin-top: 14px;
  font-size: 14px;
  font-weight: 400;
}
.store-category-card-count {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---- Product grid (category page) ---- */

.store-product-grid {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px 32px;
  padding: 0 0 80px;
  margin: 0;
}

.store-product-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
}
.store-product-card img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--rule);
  transition: opacity 0.2s ease;
}
.store-product-card:hover img { opacity: 0.92; }

.store-product-card-name {
  display: block;
  margin-top: 14px;
  font-size: 14px;
}
.store-product-card-meta {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: var(--muted);
}
.store-product-card-price {
  display: block;
  margin-top: 4px;
  font-size: 13px;
  font-weight: 500;
}

/* ---- Product detail ---- */

.product-detail {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 56px;
  padding: 24px 0 80px;
}

/* Stacked layout (originals): wide slideshow on top, modules left-aligned below. */
.product-detail--stacked {
  display: block;
  padding: 24px 0 80px;
}
.product-detail--stacked .product-gallery {
  margin-bottom: 32px;
}
.product-detail--stacked .product-info {
  max-width: 640px;
}

.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Wide gallery — for the stacked PDP. Slightly tames the arrow-button gap so
   the painting reads as the dominant element, not the chrome. */
.product-gallery--wide .post-slideshow {
  gap: 24px;
}
.product-gallery--wide .post-slideshow-counter {
  margin: 8px 0 0;
  text-align: left;
}

.product-image img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--rule);
}
.product-image--empty {
  width: 100%;
  aspect-ratio: 1 / 1;
  background: var(--rule);
}

.product-title {
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.005em;
  line-height: 1.2;
  margin: 0 0 6px;
  color: var(--ink);
}
.product-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 24px;
}
.product-price {
  font-size: 18px;
  font-weight: 500;
  margin: 0 0 24px;
  color: var(--ink);
}
.product-description {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink);
  margin-bottom: 28px;
}
.product-description p { margin: 0 0 12px; }

.product-cart-error {
  background: rgba(180, 60, 40, 0.08);
  border: 1px solid rgba(180, 60, 40, 0.3);
  padding: 10px 14px;
  font-size: 13px;
  color: #b43c28;
  margin: 0 0 16px;
}

.product-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  margin-bottom: 24px;
}
.product-form-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-form-label {
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.product-form select,
.product-form input {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  border-radius: 0;
}
.product-form-field--qty input { max-width: 100px; }

.product-form-delivery {
  border: 1px solid var(--rule);
  padding: 12px 14px;
  margin: 0;
  /* Override the browser default `min-inline-size: min-content` on
     <fieldset> that prevents it from filling its flex parent. */
  min-inline-size: 0;
  width: 100%;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.product-form-delivery legend {
  padding: 0 6px;
}
.product-form-radio {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
}
.product-form-radio input[type="radio"] {
  accent-color: var(--ink);
  margin: 0;
}

.product-add-btn {
  margin-top: 8px;
  padding: 14px 20px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  border: none;
  cursor: pointer;
  transition: opacity 0.2s;
}
.product-add-btn:hover { opacity: 0.85; }

.product-meta-list {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}
.product-meta-list li {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid var(--rule);
}
.product-meta-list li:last-child { border-bottom: none; }
.product-meta-list span:first-child {
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---- Cart ---- */

.cart-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  border-top: 1px solid var(--rule);
}

.cart-item {
  display: grid;
  grid-template-columns: 96px 1fr 80px 90px 32px;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--rule);
}

.cart-item-image img {
  display: block;
  width: 96px;
  height: 96px;
  object-fit: cover;
  background: var(--rule);
}
.cart-item-title {
  font-size: 14px;
  color: var(--ink);
  text-decoration: none;
  display: block;
}
.cart-item-title:hover { text-decoration: underline; }
.cart-item-variant {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}
.cart-item-price {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
.cart-item-qty input {
  width: 64px;
  padding: 6px 8px;
  font: inherit;
  font-size: 14px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
}
.cart-item-qty--fixed {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
}
.cart-item-line-total {
  font-size: 14px;
  text-align: right;
  font-weight: 500;
  margin: 0;
}
.cart-item-remove button {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
  padding: 0;
}
.cart-item-remove button:hover { color: var(--ink); }

.cart-summary {
  margin-bottom: 80px;
}
.cart-summary dl {
  margin: 0 0 16px;
  border-top: 1px solid var(--rule);
}
.cart-summary dl > div {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  font-size: 14px;
  border-bottom: 1px solid var(--rule);
}
.cart-summary dt { color: var(--muted); margin: 0; }
.cart-summary dd { margin: 0; color: var(--ink); }
.cart-summary-total dt,
.cart-summary-total dd {
  font-weight: 500;
  font-size: 16px;
  color: var(--ink);
}
.cart-summary-note {
  font-size: 11px;
  color: var(--muted);
  margin: 0 0 20px;
  letter-spacing: 0.05em;
}
.cart-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.cart-checkout-btn {
  display: inline-block;
  padding: 14px 24px;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  text-decoration: none;
  transition: opacity 0.2s;
}
.cart-checkout-btn:hover { opacity: 0.85; }
.cart-continue-link {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
  text-decoration: none;
}
.cart-continue-link:hover { color: var(--ink); }

/* ---- Checkout ---- */

.checkout-summary {
  padding: 24px;
  background: rgba(0, 0, 0, 0.025);
  margin-bottom: 32px;
}
.checkout-summary h2 {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 16px;
}
.checkout-summary-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
}
.checkout-summary-list li {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink);
  border-bottom: 1px solid var(--rule);
}
.checkout-summary-totals {
  margin: 0;
  border-top: 1px solid var(--rule);
}
.checkout-summary-totals > div {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--rule);
}
.checkout-summary-totals dt { color: var(--muted); margin: 0; }
.checkout-summary-totals dd { margin: 0; color: var(--ink); }

.checkout-form h2 {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 32px 0 16px;
}
.checkout-form h2:first-child { margin-top: 0; }
.checkout-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.checkout-row--3 {
  grid-template-columns: 1fr 1fr 1fr;
}
.checkout-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  /* Allow grid items to shrink below input intrinsic width so the City /
     State / ZIP row doesn't overflow the form. */
  min-width: 0;
}
.checkout-label {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}
.checkout-field input {
  font: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--rule);
  background: transparent;
  color: var(--ink);
  /* Fill the grid cell — without this the input keeps its default
     intrinsic width and can blow out narrow columns. */
  width: 100%;
  box-sizing: border-box;
}
.checkout-payment {
  border: 1px solid var(--rule);
  padding: 14px;
  margin-bottom: 8px;
  min-height: 48px;
}
.checkout-payment-message {
  font-size: 12px;
  color: var(--muted);
  min-height: 1.4em;
  margin: 0 0 16px;
}
.checkout-submit-btn {
  width: 100%;
  padding: 16px 20px;
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  background: var(--ink);
  color: var(--bg);
  border: none;
  cursor: pointer;
  margin-bottom: 80px;
  position: relative;
}
.checkout-submit-btn:disabled { opacity: 0.6; cursor: progress; }
.checkout-submit-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: store-spin 0.8s linear infinite;
  margin-left: 8px;
  vertical-align: middle;
}
.checkout-submit-btn.is-loading .checkout-submit-spinner { display: inline-block; }
@keyframes store-spin { to { transform: rotate(360deg); } }

/* ---- Order receipt page ---- */

.order-hero {
  padding-bottom: 32px;
  border-bottom: 1px solid var(--rule);
  margin-bottom: 32px;
}

.order-hero-num {
  font-size: 40px;
  font-weight: 400;
  font-family: ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.04em;
  margin: 0;
  color: var(--ink);
  line-height: 1;
}

.order-hero-meta {
  margin: 12px 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.order-item-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
}

.order-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 16px;
  align-items: flex-start;
  padding: 16px 0;
  border-bottom: 1px solid var(--rule);
}

.order-item:first-child { padding-top: 0; }
.order-item:last-child { border-bottom: none; }

.order-item-image {
  display: block;
  width: 80px;
  height: 80px;
  background: var(--rule);
  overflow: hidden;
}
.order-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.order-item-image--empty { display: block; }

.order-item-body { min-width: 0; }

.order-item-name {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
}
.order-item-name a { color: inherit; text-decoration: none; }
.order-item-name a:hover { text-decoration: underline; }

.order-item-meta {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}
.order-item-sku {
  font-family: ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.04em;
}

.order-item-qty {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--muted);
}

.order-item-line-total {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink);
  text-align: right;
  white-space: nowrap;
}

.order-totals {
  margin: 0 0 48px;
  padding: 16px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.order-totals > div {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
}
.order-totals dt { color: var(--muted); margin: 0; }
.order-totals dd { margin: 0; color: var(--ink); }
.order-totals-grand {
  margin-top: 6px !important;
  padding-top: 12px !important;
  border-top: 1px solid var(--rule);
}
.order-totals-grand dt,
.order-totals-grand dd {
  font-size: 16px;
  font-weight: 500;
  color: var(--ink) !important;
}

.order-meta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
  margin-bottom: 48px;
}

.order-meta-heading {
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
  font-weight: 400;
}

.order-meta-block {
  margin: 0;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}
.order-meta-ref {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.04em;
}
.order-meta-ref code {
  font-family: ui-monospace, SFMono-Regular, monospace;
}

.order-actions {
  font-size: 12px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  margin: 0 0 80px;
}
.order-actions a {
  color: var(--muted);
  text-decoration: none;
}
.order-actions a:hover { color: var(--ink); }

@media (max-width: 640px) {
  .order-hero-num { font-size: 32px; }
  .order-item {
    grid-template-columns: 64px 1fr auto;
  }
  .order-item-image,
  .order-item-image img,
  .order-item-image--empty { width: 64px; height: 64px; }
  .order-meta-grid { grid-template-columns: 1fr; gap: 24px; }
}

.success-body {
  font-size: 14px;
  color: var(--ink);
  padding-bottom: 80px;
}
.success-body p { margin: 0 0 16px; }
.success-order-num {
  font-size: 18px;
  font-weight: 400;
  letter-spacing: 0.04em;
  margin: 0 0 24px !important;
  color: var(--ink);
}
.success-order-num strong {
  font-weight: 500;
  font-family: ui-monospace, SFMono-Regular, monospace;
  letter-spacing: 0.06em;
}
.success-order-total {
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0;
}
.success-ref {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.05em;
}
.success-ref code {
  font-family: ui-monospace, SFMono-Regular, monospace;
}

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

/* ---- Mobile ---- */

@media (max-width: 640px) {
  .store-category-grid,
  .store-product-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .product-detail {
    grid-template-columns: 1fr;
    gap: 32px;
  }
  .cart-item {
    grid-template-columns: 72px 1fr 32px;
    grid-template-areas:
      "img title remove"
      "img price remove"
      "img qty   total";
    row-gap: 4px;
  }
  .cart-item-image { grid-area: img; }
  .cart-item-image img { width: 72px; height: 72px; }
  .cart-item-body { grid-area: title; }
  .cart-item-price { grid-area: price; }
  .cart-item-qty { grid-area: qty; }
  .cart-item-line-total { grid-area: total; }
  .cart-item-remove { grid-area: remove; }
  .checkout-row,
  .checkout-row--3 {
    grid-template-columns: 1fr;
  }
}
