.skip-link {
  position: fixed;
  left: 16px;
  top: 12px;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 10px 14px;
  transform: translateY(-160%);
}

.skip-link:focus { transform: none; }
.add-button:disabled { cursor: not-allowed; opacity: .55; }
.cart-item > strong { align-self: start; }

.quantity-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  margin-top: 8px;
}

.quantity-control button {
  width: 30px;
  height: 28px;
  text-decoration: none;
  font-size: 18px;
  color: var(--ink);
}

.quantity-control span { min-width: 26px; text-align: center; font-size: 13px; }

/* The same control on a product card: full width, sitting above Add to bag. */
.card-quantity {
  display: flex;
  justify-content: space-between;
  width: 100%;
  margin-top: 14px;
}

.card-quantity button {
  width: 44px;
  height: 34px;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.card-quantity button:hover { background: var(--cream); }
.card-quantity span { flex: 1; font-size: 14px; font-weight: 600; align-self: center; }
.remove-item { display: block !important; margin-top: 8px; }

/* Subtotal and delivery sit above the total, which keeps the emphasis. */
.cart-footer > .cart-line {
  font-size: 14px;
  color: #667064;
  margin-bottom: 8px;
}

.cart-footer > .cart-line strong { font-weight: 600; }

.checkout-dialog {
  width: min(1040px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 25px 80px #10191055;
}

.checkout-dialog::backdrop { background: #101910b5; backdrop-filter: blur(3px); }
.checkout-shell { min-height: 520px; }

.checkout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 34px;
  border-bottom: 1px solid var(--line);
}

.checkout-head .eyebrow { margin-bottom: 5px; }
.checkout-head h2, .checkout-success h2 { font: 600 40px Fraunces; margin: 0; }
.checkout-head > button { border: 0; background: none; font-size: 35px; cursor: pointer; }
.checkout-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .8fr); }
.checkout-fields { padding: 30px 34px; }
.checkout-fields fieldset { border: 0; padding: 0; margin: 0 0 32px; }
.checkout-fields fieldset:last-child { margin-bottom: 0; }
.checkout-fields legend, .order-review h3 { font: 600 23px Fraunces; margin-bottom: 18px; }
.checkout-fields label { display: grid; gap: 7px; margin-bottom: 16px; font-size: 12px; font-weight: 700; }

/* An optional field says so on the label itself. The label is a grid, so the
   marker is wrapped with the label text to keep the two on one line. */
.checkout-fields label .field-label { display: block; }

.checkout-fields label .field-optional {
  margin-left: 6px;
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #55705c;
}

.checkout-fields label .field-hint {
  margin-top: -2px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  color: #55705c;
}

.checkout-fields input, .checkout-fields select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 11px 12px;
  color: var(--ink);
  font: 14px "DM Sans", sans-serif;
  border-radius: 0;
}

.checkout-fields input:focus, .checkout-fields select:focus { outline: 2px solid var(--orange); outline-offset: 1px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }

.order-review {
  background: var(--cream);
  padding: 32px;
  display: flex;
  flex-direction: column;
}

.summary-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.summary-item small { display: block; color: #6c756a; margin-top: 3px; }
.summary-total { display: flex; justify-content: space-between; padding: 19px 0; font-size: 18px; }
.checkout-note { font-size: 12px; color: #667064; line-height: 1.55; margin: 4px 0 16px; }
.checkout-consent { border-top: 1px solid var(--line); padding-top: 15px; margin-bottom: 12px; }
.checkout-consent label { display: grid; grid-template-columns: 18px 1fr; gap: 9px; align-items: start; font-size: 12px; line-height: 1.5; font-weight: 600; }
.checkout-consent input { width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--green); }
.checkout-consent a { color: var(--green); }
.checkout-consent p { margin: 9px 0 0 27px; color: #667064; font-size: 11px; line-height: 1.5; }
.form-error { min-height: 20px; color: #a43d2c; font-size: 13px; margin: 0 0 10px; }
.checkout-fallback { color: var(--ink); font-size: 13px; font-weight: 700; margin: 0 0 18px; }
.order-review .button { width: 100%; margin-top: auto; }
.order-review .button:disabled { cursor: wait; opacity: .65; }
.checkout-success { padding: 70px max(34px, 12vw); text-align: center; }
.success-mark { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 25px; border-radius: 50%; background: var(--green); color: #fff; font-size: 30px; }
.checkout-success > p:not(.eyebrow) { max-width: 560px; margin: 18px auto; color: #667064; line-height: 1.7; }
.success-actions { display: flex; align-items: center; justify-content: center; gap: 28px; margin-top: 30px; }
.dark-link { color: var(--ink); }
.success-secondary { border: 0; background: transparent; cursor: pointer; }

@media (max-width: 760px) {
  .checkout-dialog { width: 100%; max-height: 100vh; height: 100vh; }
  .checkout-layout { grid-template-columns: 1fr; }
  .checkout-head { padding: 22px 20px; }
  .checkout-head h2 { font-size: 34px; }
  .checkout-fields { padding: 24px 20px; }
  .order-review { padding: 25px 20px; }
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .checkout-success { padding: 55px 22px; }
  .success-actions { flex-direction: column; }
  .cart-item { grid-template-columns: 50px 1fr auto; }
  .cart-swatch { width: 50px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Delivery area choice in the bag. The cart shows a total before any address
   exists, so the customer states the area and the totals follow from it. */
.delivery-area {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.delivery-area legend {
  font-size: 12px;
  font-weight: 700;
  padding: 0;
  margin-bottom: 8px;
}

.delivery-area label {
  display: flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 130px;
  border: 1px solid var(--line);
  padding: 9px 11px;
  font-size: 13px;
  cursor: pointer;
}

.delivery-area label:has(input:checked) {
  border-color: var(--green);
  background: var(--cream);
  font-weight: 600;
}

.delivery-area label:has(input:focus-visible) {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

.delivery-area input { accent-color: var(--green); margin: 0; }

.delivery-progress {
  margin: 0 0 14px;
  padding: 9px 11px;
  background: var(--cream);
  border-left: 3px solid var(--gold);
  font-size: 12px;
  line-height: 1.5;
}
