/**
 * Made for You shop — product pages, cart, checkout. Kept separate
 * from style.css (already ~2900 lines) and loaded only on shop-related
 * pages. Reuses the site's existing tokens (--ivory/--navy/--crimson/
 * --gold/--near-black/--ink-slate, --font-display/--font-ui/--font-body,
 * .btn/.btn-navy/.btn-crimson/.btn-ghost, .p24-form-*) rather than
 * introducing a new visual language.
 */

.pdp-hero {
  background: var(--ivory);
  padding: 48px 0 0;
}
.pdp-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 480px);
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
  padding-bottom: var(--space-2xl);
}
.pdp-visual {
  position: sticky;
  top: 100px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}
.pdp-visual-frame {
  width: 100%;
  max-width: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 24px 40px rgba(35,31,32,.14));
}
.pdp-visual-frame svg { width: 100%; height: auto; }

/* Real product photography (paperback designs) — a photo with the
   live name typed onto it, positioned to match where the sample
   personalisation sat in the client's reference shots (centre-bottom
   on the cover). */
.pdp-photo-stage {
  position: relative;
  width: 100%;
  border-radius: var(--radius-card);
  overflow: hidden;
}
.pdp-photo-stage img { width: 100%; height: auto; display: block; }
/* Anchored to a POINT (left/top %, JS-set per design — see
   assets/js/shop.js) rather than a fixed box, since these are 16
   different SKU photos with the cover sitting at a different position
   and tilt in each one — not one common placement. The whole element
   rotates via an inline transform JS sets to match that design's
   cover tilt, so a name on an angled cover reads as angled too. */
.pdp-photo-name-overlay {
  position: absolute;
  left: 50%; top: 78%;
  transform: translate(-50%, -50%);
  text-align: center;
  pointer-events: none;
  --name-scale: 1; /* per-design multiplier, JS-set from mask_font_size — see assets/js/shop.js */
}
.pdp-photo-name-overlay span {
  display: inline-block;
  font-size: calc(clamp(1.1rem, 4.2cqw, 1.6rem) * var(--name-scale, 1));
  color: rgba(15,12,10,.88);
  text-shadow: 0 1px 1px rgba(255,255,255,.15);
  line-height: 1;
  white-space: nowrap;
}
.pdp-photo-stage { container-type: inline-size; }

.pdp-design-picker {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  width: 100%;
}
.pdp-design-swatch {
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: none;
}
.pdp-design-swatch img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdp-radio:checked + .pdp-design-swatch { border-color: var(--navy); }
.pdp-design-label {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-slate);
  text-align: center;
  margin-top: -6px;
}
@media (max-width: 480px) {
  .pdp-design-picker { grid-template-columns: repeat(5, 1fr); }
}

/* One name field per notebook in the pack — rendered dynamically by
   shop.js to match the selected pack size. */
.pdp-multiname-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.pdp-multiname-row label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink-slate);
  width: 60px;
  flex-shrink: 0;
}
.pdp-multiname-row input {
  flex: 1;
  padding: 10px 12px;
  border: 1.5px solid var(--ivory-border, #E8E1D3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 14px;
}

.pdp-info { padding-top: 8px; }
.pdp-eyebrow { margin-bottom: 14px; }
.pdp-title {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 700;
  color: var(--near-black);
  margin-bottom: 10px;
}
.pdp-desc {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--ink-slate);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 46ch;
}
.pdp-price {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  color: var(--near-black);
  margin-bottom: 4px;
}
.pdp-price .was {
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 400;
  color: var(--ink-slate);
  margin-left: 10px;
}
.pdp-price-note {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--ink-slate);
  margin-bottom: 28px;
}

.pdp-option-group { margin-bottom: 24px; }
.pdp-option-label {
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--near-black);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.pdp-option-label .val { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--ink-slate); }
.pdp-option-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* Real radio/checkbox inputs drive selection state — visually hidden,
   immediately followed by the label they belong to, so a plain CSS
   adjacent-sibling selector (:checked + label) handles the "selected"
   look with no JS required. JS only needs to read :checked state and
   toggle the .is-disabled class for pack options invalid on the
   current edition/size — it never has to manage "which one looks
   selected" itself. */
.pdp-radio { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }

.pdp-option-btn {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--near-black);
  background: #fff;
  border: 1.5px solid var(--ivory-border, #E8E1D3);
  border-radius: var(--radius-sm);
  padding: 10px 16px;
  cursor: pointer;
  transition: all .15s ease;
  display: inline-block;
}
.pdp-option-btn:hover { border-color: var(--navy); }
.pdp-radio:checked + .pdp-option-btn {
  border-color: var(--navy);
  background: var(--navy);
  color: #fff;
}
.pdp-option-btn.is-disabled {
  opacity: .35;
  cursor: not-allowed;
  pointer-events: none;
}
.pdp-swatch-row { display: flex; gap: 10px; }
.pdp-swatch {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  display: inline-block;
  position: relative;
}
.pdp-radio:checked + .pdp-swatch { border-color: var(--navy); }
.pdp-swatch[data-colour="kraft"] { background: #C7A97B; }
.pdp-swatch[data-colour="ivory"] { background: #F3EEE1; box-shadow: inset 0 0 0 1px rgba(35,31,32,.15); }
.pdp-swatch[data-colour="charcoal"] { background: #33363B; }

.pdp-personalise {
  background: #fff;
  border: 1px solid var(--ivory-border, #E8E1D3);
  border-radius: var(--radius-card);
  padding: 22px;
  margin-bottom: 24px;
}
.pdp-personalise-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.pdp-personalise-title {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--near-black);
}
.pdp-personalise-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-slate);
  cursor: pointer;
}
.pdp-personalise-note {
  font-family: var(--font-body);
  font-size: 13px;
  color: var(--ink-slate);
  margin-bottom: 16px;
}
.pdp-personalise-body { display: none; }
.pdp-personalise-body.is-open { display: block; }
.pdp-name-row { position: relative; margin-bottom: 16px; }
.pdp-name-input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--ivory-border, #E8E1D3);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--near-black);
}
.pdp-name-input:focus { outline: none; border-color: var(--navy); }
.pdp-name-count {
  position: absolute;
  right: 12px; top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-ui);
  font-size: 11px;
  color: var(--ink-slate);
  pointer-events: none;
}
.pdp-name-error {
  font-family: var(--font-ui);
  font-size: 12px;
  color: var(--crimson);
  margin-top: 6px;
  display: none;
}
.pdp-font-row { display: flex; flex-wrap: wrap; gap: 8px; }
.pdp-font-btn {
  display: inline-block;
  border: 1.5px solid var(--ivory-border, #E8E1D3);
  border-radius: var(--radius-sm);
  background: #fff;
  padding: 10px 14px;
  font-size: 16px;
  cursor: pointer;
  color: var(--near-black);
  transition: all .15s ease;
}
.pdp-radio:checked + .pdp-font-btn { border-color: var(--gold); background: #FBF6E9; }

.pdp-qty-row { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.pdp-qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--ivory-border, #E8E1D3); border-radius: var(--radius-sm); }
.pdp-qty-stepper button {
  width: 38px; height: 38px;
  background: none; border: none;
  font-size: 18px; font-weight: 600;
  color: var(--near-black); cursor: pointer;
}
.pdp-qty-stepper input {
  width: 44px; text-align: center;
  border: none; font-family: var(--font-ui); font-size: 14px; font-weight: 700;
}
.pdp-error-banner {
  font-family: var(--font-ui);
  font-size: 13px;
  color: var(--crimson);
  background: #FBEAEA;
  border: 1px solid #F2C9C4;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
  display: none;
}
.pdp-error-banner.is-visible { display: block; }
.pdp-added-banner {
  font-family: var(--font-ui);
  font-size: 13px;
  color: #1a7d3a;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 16px;
}

@media (max-width: 860px) {
  .pdp-layout { grid-template-columns: 1fr; }
  .pdp-visual { position: static; }
}

/* Notebook illustration colour variants — cosmetic only, no price
   effect (the price sheet has no colour-based pricing). */
.notebook-illus .cover { fill: #C7A97B; transition: fill .2s ease; }
.notebook-illus .nameplate-text { fill: #3a2f22; transition: fill .2s ease; }
.notebook-illus[data-colour="ivory"] .cover { fill: #F3EEE1; }
.notebook-illus[data-colour="charcoal"] .cover { fill: #33363B; }
.notebook-illus[data-colour="charcoal"] .nameplate-text { fill: #F3EEE1; }
.notebook-illus[data-colour="charcoal"] .nameplate { fill: rgba(255,255,255,.12) !important; }

/* Diary illustration — Corporate Diary cream/gold palette, gold foil
   name-plate styling reserved for the Elite tiers. */
.diary-illus .cover { fill: #F6EFDD; }
.diary-illus .nameplate-text { fill: #7a5a1e; }
.diary-illus .foil-rule { stroke: #C9A84C; }

/* ---- Cart page ---- */
.cart-wrap { max-width: 960px; margin: 0 auto; padding: 60px var(--space-lg) var(--space-2xl); }
.cart-empty {
  text-align: center;
  padding: 80px 20px;
  font-family: var(--font-body);
  color: var(--ink-slate);
}
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 32px; }
.cart-row { border-bottom: 1px solid var(--ivory-border, #E8E1D3); }
.cart-row td { padding: 20px 12px; vertical-align: top; }
.cart-item-title { font-family: var(--font-display); font-size: 17px; font-weight: 700; color: var(--near-black); margin-bottom: 4px; }
.cart-item-meta { font-family: var(--font-ui); font-size: 12px; color: var(--ink-slate); }
.cart-item-price { font-family: var(--font-ui); font-weight: 700; color: var(--near-black); white-space: nowrap; }
.cart-remove-btn { background: none; border: none; color: var(--crimson); font-family: var(--font-ui); font-size: 12px; font-weight: 600; cursor: pointer; padding: 0; margin-top: 8px; }
.cart-summary { max-width: 360px; margin-left: auto; }
.cart-summary-row { display: flex; justify-content: space-between; font-family: var(--font-ui); font-size: 14px; color: var(--ink-slate); margin-bottom: 10px; }
.cart-summary-row.total { font-size: 18px; font-weight: 700; color: var(--near-black); border-top: 1px solid var(--ivory-border, #E8E1D3); padding-top: 14px; margin-top: 4px; }

/* ---- Checkout page ---- */
.checkout-wrap { max-width: 1080px; margin: 0 auto; padding: 60px var(--space-lg) var(--space-2xl); }
.checkout-grid { display: grid; grid-template-columns: 1fr 380px; gap: 48px; align-items: start; }
@media (max-width: 860px) { .checkout-grid { grid-template-columns: 1fr; } }
.checkout-summary-card {
  background: #fff;
  border: 1px solid var(--ivory-border, #E8E1D3);
  border-radius: var(--radius-card);
  padding: 24px;
}

/* Payment reassurance line under the checkout / portal pay button */
.checkout-secure-note { margin-top: 12px; font-family: var(--font-body); font-size: 13px; line-height: 1.6; color: var(--ink-slate); text-align: center; }
.checkout-secure-note a { color: inherit; text-decoration: underline; }

/* Order-portal "Pay for your order" card */
.op-pay-card { margin: 8px auto 0; max-width: 460px; background: #fff; border: 1px solid rgba(15, 23, 42, .1); border-radius: 12px; padding: 24px; text-align: left; box-shadow: 0 12px 32px rgba(15, 23, 42, .06); }
.op-pay-row { display: flex; justify-content: space-between; gap: 12px; font-family: var(--font-body); font-size: 15px; color: var(--ink-slate); padding: 8px 0; }
.op-pay-total { border-top: 1px solid rgba(15, 23, 42, .1); margin: 8px 0 18px; padding-top: 14px; font-weight: 700; font-size: 18px; color: var(--near-black); }
.op-pay-error { background: #FDF2F2; color: #9B1C1C; border-radius: 8px; padding: 10px 12px; font-size: 14px; line-height: 1.5; margin: 0 0 14px; }
