/* Cart / Checkout / Confirmation */

.cart-page,
.checkout-page,
.confirmation-page {
  background: var(--cream);
  min-height: 100vh;
}
.cart-page .page,
.checkout-page .page,
.confirmation-page .page {
  position: relative;
  min-height: 100vh;
  padding: 96px var(--pad-x) 64px;
  display: flex;
  flex-direction: column;
}

.page-header {
  margin-bottom: 36px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(17,17,17,0.10);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.page-title {
  font-size: clamp(32px, 3.5vw, 44px);
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #111;
  margin: 0;
  line-height: 1.1;
}
.item-count {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.42);
  margin: 0;
}

.cart-layout {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 48px;
  align-items: start;
}
.lines { display: flex; flex-direction: column; }
.line {
  display: grid;
  grid-template-columns: 88px 1fr auto;
  gap: 22px;
  align-items: center;
  padding: 22px 0;
  border-bottom: 1px solid rgba(17,17,17,0.10);
}
.thumb {
  width: 88px; height: 88px;
  background: #ebe6dc;
  border-radius: 3px;
  border: 1px solid rgba(17,17,17,0.05);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.thumb img {
  max-height: 76px;
  max-width: 70px;
  object-fit: contain;
}
.line-info { display: flex; flex-direction: column; gap: 8px; }
.line-name { font-size: 22px; font-weight: 600; letter-spacing: 0.01em; color: #111; }
.line-meta {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(17,17,17,0.48);
}
.line-controls {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(17,17,17,0.14);
  border-radius: 3px;
  overflow: hidden;
}
.qty button {
  width: 32px; height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  color: #111;
}
.qty span {
  min-width: 28px;
  text-align: center;
  font-family: var(--sans);
  font-size: 13px;
}
.remove {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.42);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
@media (hover: hover) {
  .remove:hover { color: #111; }
}
.line-price {
  font-size: 20px;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.aside {
  background: #ebe6dc;
  border: 1px solid rgba(17,17,17,0.05);
  border-radius: 4px;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}
/* The hidden attribute must win over display:flex (empty cart). */
.aside[hidden] { display: none; }
.aside-title { font-size: 22px; font-weight: 600; color: #111; margin: 0; }
.sub-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.sub-label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.48);
}
.sub-value { font-size: 28px; }
.aside-note {
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: #111;
  line-height: 1.45;
  margin: 0;
}
.checkout-btn, .pay-btn, .btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 54px;
  width: 100%;
  background: #111;
  color: #f4f1eb;
  border: none;
  border-radius: 3px;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}
@media (hover: hover) {
  .checkout-btn:hover, .pay-btn:hover, .btn-primary:hover { background: #2a2a2a; }
}
.checkout-btn[aria-disabled="true"],
.pay-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  background: #111;
}
.continue {
  text-align: center;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.48);
  text-decoration: none;
}
@media (hover: hover) {
  .continue:hover { color: #111; }
}

.cart-empty {
  padding: 48px 0;
  text-align: center;
}
.cart-empty p {
  font-size: 20px;
  margin: 0 0 20px;
}
.cart-empty a.btn-primary {
  width: auto;
  padding: 0 28px;
  display: inline-flex;
}

/* Checkout */
.pickup-banner {
  margin-top: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #111;
  padding: 9px 16px;
  border: 1.5px solid rgba(17,17,17,0.28);
  border-radius: 999px;
  background: rgba(255,255,255,0.55);
}
.checkout-layout {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: start;
}
.form-col { display: flex; flex-direction: column; gap: 22px; }
.section-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.38);
  margin: 0 0 4px;
}
.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.48);
}
.field input {
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: 0.01em;
  color: #111;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(17,17,17,0.14);
  border-radius: 3px;
  padding: 14px 16px;
  outline: none;
  width: 100%;
}
.field input:focus {
  border-color: rgba(17,17,17,0.40);
}
.field.is-invalid input {
  border-color: #8b2e2e;
}
.field-error {
  font-family: var(--sans);
  font-size: 12px;
  color: #8b2e2e;
  margin: 0;
}
.field-error[hidden] { display: none; }
.field input::placeholder { color: rgba(17,17,17,0.32); }
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.field-hint {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(17,17,17,0.42);
  line-height: 1.4;
  margin: -2px 0 0;
}

.summary-col {
  background: #ebe6dc;
  border: 1px solid rgba(17,17,17,0.05);
  border-radius: 4px;
  padding: 28px 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.summary-title {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  margin: 0;
}
.line-items {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(17,17,17,0.10);
}
.summary-col .line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 0;
  border: none;
  grid-template-columns: none;
}
.summary-col .line-name { font-size: 16px; font-weight: 400; }
.summary-col .line-price {
  font-family: var(--sans);
  font-size: 14px;
}
.subtotal-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.subtotal-label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.48);
}
.subtotal-value { font-size: 24px; letter-spacing: 0.01em; }
.tax-note {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(17,17,17,0.42);
  line-height: 1.4;
  margin: 0;
}
.square-panel {
  margin-top: 4px;
  background: rgba(255,255,255,0.55);
  border: 1px solid rgba(17,17,17,0.12);
  border-radius: 3px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.square-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.38);
  margin: 0;
}
.square-card-mock {
  border: 1px solid rgba(17,17,17,0.14);
  border-radius: 3px;
  padding: 18px 16px;
  background: #fffdf9;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 88px;
}
.square-card-mock[hidden] { display: none; }
.square-card-container {
  border: 1px solid rgba(17,17,17,0.14);
  border-radius: 3px;
  padding: 12px 12px 4px;
  background: #fffdf9;
  min-height: 88px;
}
.square-card-container[hidden] { display: none; }
.payment-id-note {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(17,17,17,0.55);
  margin: 8px 0 0;
  word-break: break-all;
}
.payment-id-note[hidden] { display: none; }
#pay-error:not([hidden]) {
  display: block;
}
.square-card-line {
  height: 12px;
  background: rgba(17,17,17,0.08);
  border-radius: 2px;
}
.square-card-line.short { width: 42%; }
.square-card-line.mid { width: 68%; }
.pickup-foot {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(17,17,17,0.42);
  text-align: center;
  line-height: 1.45;
  margin: 0;
}
.stub-note {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(17,17,17,0.55);
  line-height: 1.4;
  margin: 0;
  padding: 10px 12px;
  background: rgba(17,17,17,0.04);
  border-radius: 3px;
}
.stub-note[hidden] { display: none; }
.empty-note {
  font-family: var(--sans);
  font-size: 14px;
  color: rgba(17,17,17,0.55);
  margin: 0;
}
.empty-note a { text-decoration: underline; }

/* Confirmation */
.confirm-wrap {
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding-top: 24px;
}
.confirm-wrap[hidden] { display: none; }
.eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.42);
  margin: 0;
}
.confirm-title {
  font-size: clamp(36px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.1;
  color: #111;
  margin: 0;
}
.confirm-lede {
  font-size: clamp(17px, 1.6vw, 20px);
  font-weight: 500;
  line-height: 1.45;
  color: #111;
  max-width: 560px;
  margin: 0;
}
.pickup-card {
  background: #ebe6dc;
  border: 1px solid rgba(17,17,17,0.05);
  border-radius: 4px;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.pickup-label {
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #111;
  margin: 0;
}
.pickup-body {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  color: #111;
  margin: 0;
}
.pickup-note {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: rgba(17,17,17,0.48);
  line-height: 1.45;
  margin: 0;
}
.confirm-summary {
  border-top: 1px solid rgba(17,17,17,0.10);
  padding-top: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.confirm-summary .line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(17,17,17,0.08);
  grid-template-columns: none;
}
.confirm-summary .line-name { font-size: 17px; font-weight: 400; }
.confirm-summary .line-price {
  font-family: var(--sans);
  font-size: 14px;
}
.total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 4px;
}
.total-label {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(17,17,17,0.48);
}
.total-value { font-size: 28px; }
.actions {
  display: flex;
  gap: 12px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.btn-primary, .btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  padding: 0 28px;
  border-radius: 3px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  width: auto;
}
.btn-ghost {
  background: transparent;
  color: #111;
  border: 1px solid rgba(17,17,17,0.18);
}
.stub-banner {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  padding: 12px 16px;
  background: rgba(17,17,17,0.06);
  border-radius: 3px;
  margin: 0;
}
.stub-banner[hidden] { display: none; }

@media (max-width: 900px) {
  .cart-layout,
  .checkout-layout {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .field-row { grid-template-columns: 1fr; }
  .line {
    grid-template-columns: 72px 1fr;
    gap: 14px;
  }
  .line-price {
    grid-column: 2;
    justify-self: start;
  }
  .thumb { width: 72px; height: 72px; }
  .line-name { font-size: 18px; }
}

/* Shown only when a stored quantity is over 99. */
.cart-limit-note {
  font-family: var(--sans);
  font-size: 13px;
  line-height: 1.4;
  color: #8a1f11;
  margin: 0 0 12px;
}
