/*
 * THE SHOP: product cards under the hero, the add-to-cart dropdown, the
 * product pages, the cart, the thank-you page and the questions wizard.
 *
 * Built on page.css: the same tokens, type, buttons and header. Nothing here
 * restyles the home page outside the shop's own classes.
 */

/* ------------------------------------------------------------ header cart */
.nav-cart { position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 10px 18px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); background: transparent; text-decoration: none; font: 600 14px/1 var(--body); }
.nav-cart:hover { background: var(--ink); color: var(--cream); }
.nav-cart svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-count { min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--orange); color: var(--cream); font: 700 12px/1 var(--body); font-variant-numeric: tabular-nums; }
.cart-count[hidden] { display: none; }
.header-actions { display: flex; align-items: center; gap: 12px; }

/* ------------------------------------------------------------- the strip */
.shop-section { background: var(--cream); }
.shop-section .section-heading p { max-width: 520px; }
/* Four across, or two by two on a phone so all four fit on one screen. */
.shop-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; align-items: stretch; padding: 4px 0 18px; }
.shop-strip:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }

.shop-card { display: flex; flex-direction: column; min-width: 0; border-radius: 22px; overflow: hidden; background: var(--card-bg, var(--lavender)); color: var(--ink); }
.shop-card[data-tone="1"] { --card-bg: var(--lavender); }
.shop-card[data-tone="2"] { --card-bg: var(--peach); }
.shop-card[data-tone="3"] { --card-bg: var(--sky); }
.shop-card[data-tone="4"] { --card-bg: #b9d3c9; }
.shop-card[data-tone="5"] { --card-bg: var(--soft-yellow); }
.shop-card-art { position: relative; aspect-ratio: 4 / 3; background: #ffffff55; display: grid; place-items: center; overflow: hidden; }
.shop-card-art img { width: 100%; height: 100%; object-fit: cover; }
.shop-card-art img.is-fallback { width: 46%; height: auto; object-fit: contain; }
/* The working player laid over the one drawn into the audiobook pictures.
   Measured in the picture's own pixels (1024 x 768, shown at 4:3 with
   nothing cropped), so it sits on the drawn one at any card width. */
.shop-card-media { position: relative; container-type: inline-size; }
.card-player { --u: calc(100cqw / 1024); --progress: 0; position: absolute; left: calc(50 * var(--u)); top: calc(600 * var(--u)); width: calc(925 * var(--u)); height: calc(119 * var(--u)); border-radius: 999px; background: var(--player-bg, #2a3a66); }
.card-player-button { position: absolute; inset: 0; width: 100%; border: 0; border-radius: inherit; padding: 0; background: transparent; cursor: pointer; }
.card-player-button:focus-visible { outline: 3px solid var(--cream, #fff7ea); outline-offset: 2px; }
.card-player-icon { position: absolute; left: calc(23 * var(--u)); top: 50%; width: calc(70 * var(--u)); height: calc(70 * var(--u)); transform: translateY(-50%); border-radius: 50%; background: #e9c56f; }
.card-player-icon::before { content: ""; position: absolute; left: 38%; top: 28%; border-style: solid; border-width: calc(16 * var(--u)) 0 calc(16 * var(--u)) calc(26 * var(--u)); border-color: transparent transparent transparent #2a3a66; }
.card-player.is-playing .card-player-icon::before { left: 31%; top: 29%; width: calc(26 * var(--u)); height: calc(29 * var(--u)); box-sizing: border-box; border: 0; border-left: calc(9 * var(--u)) solid #2a3a66; border-right: calc(9 * var(--u)) solid #2a3a66; }
.card-player-track { position: absolute; left: calc(134 * var(--u)); right: calc(51 * var(--u)); top: 50%; height: calc(8 * var(--u)); transform: translateY(-50%); border-radius: 99px; background: #777f9c; pointer-events: none; }
.card-player-fill { position: absolute; inset: 0 auto 0 0; width: calc(var(--progress) * 100%); border-radius: inherit; background: #fdf4e2; }
.card-player-knob { position: absolute; top: 50%; left: calc(var(--progress) * 100%); width: calc(28 * var(--u)); height: calc(28 * var(--u)); transform: translate(-50%, -50%); border-radius: 50%; background: #fef5e4; }
@media (hover: hover) and (pointer: fine) {
  .card-player-track { pointer-events: auto; cursor: pointer; }
  .card-player-track::before { content: ""; position: absolute; inset: calc(-24 * var(--u)) 0; }
}
.shop-card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 20px; flex: 1; }
.shop-card .eyebrow { margin: 0; font-size: 11px; }
.shop-card h3 { margin: 0; font-size: clamp(1.25rem, 1.5vw, 1.5rem); line-height: 1.1; }
.shop-price { margin: 0; font: 900 1.45rem/1 var(--heading); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.shop-price small { margin-left: 6px; font: 500 12px/1.4 var(--body); letter-spacing: 0; }
.shop-card-blurb { margin: 0; font-size: 15px; line-height: 1.45; }
.shop-card-actions { display: grid; gap: 8px; margin-top: auto; padding-top: 6px; }
.shop-card-actions .button { width: 100%; padding: 12px 18px; font-size: 15px; gap: 14px; }
.shop-more { justify-self: center; font-size: 14px; text-underline-offset: 5px; }

/* ------------------------------------------------- the add-to-cart dropdown */
.shop-card.is-open { box-shadow: 0 0 0 3px var(--ink); }
.shop-dropdown { position: relative; margin-top: 4px; padding: clamp(16px, 2vw, 26px); border-radius: 22px; background: var(--card-bg, var(--lavender)); animation: picker-in .22s ease-out; }
.shop-dropdown[data-tone="1"] { --card-bg: var(--lavender); }
.shop-dropdown[data-tone="2"] { --card-bg: var(--peach); }
.shop-dropdown[data-tone="3"] { --card-bg: var(--sky); }
.shop-dropdown[data-tone="4"] { --card-bg: #b9d3c9; }
.shop-dropdown[data-tone="5"] { --card-bg: var(--soft-yellow); }
.shop-dropdown-head { display: flex; align-items: start; gap: 16px; margin-bottom: 14px; padding-right: 44px; }
.shop-dropdown-head > div { flex: 1; }
.shop-dropdown-head .eyebrow { margin: 0 0 4px; font-size: 11px; }
.shop-dropdown-head h3 { margin: 0; }
.shop-dropdown-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border: 0; border-radius: 999px; background: var(--cream); color: var(--ink); font: 400 26px/1 system-ui, sans-serif; cursor: pointer; }
.shop-dropdown .shop-picker { margin: 0; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); column-gap: clamp(18px, 3vw, 40px); align-items: start; animation: none; }
.shop-dropdown .shop-picker > h4, .shop-dropdown .shop-picker > .shop-card-blurb, .shop-dropdown .shop-picker > .shop-basics { grid-column: 1; }
.shop-dropdown .shop-picker > .shop-extras { grid-column: 2; grid-row: 1 / span 4; }
.shop-dropdown .shop-picker > .shop-picker-summary, .shop-dropdown .shop-picker > .button, .shop-dropdown .shop-picker > .shop-picker-note { grid-column: 1; }
.shop-dropdown .shop-extras { grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); }
@media (max-width: 760px) {
  .shop-dropdown .shop-picker { grid-template-columns: 1fr; }
  .shop-dropdown .shop-picker > * { grid-column: 1 !important; grid-row: auto !important; }
}
.shop-picker { display: grid; gap: 14px; padding: 16px; margin-top: 4px; border-radius: 16px; background: var(--cream); box-shadow: 0 1px 0 #1b2d5c20; animation: picker-in .22s ease-out; }
@keyframes picker-in { from { opacity: 0; transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .shop-picker { animation: none; } }
.shop-picker[hidden] { display: none; }
.shop-picker h4 { margin: 0; font: 900 1.05rem/1.2 var(--heading); letter-spacing: -.02em; }
.shop-basics { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 14px; line-height: 1.4; }
.shop-basics li { position: relative; padding-left: 22px; }
.shop-basics li::before { content: '✓'; position: absolute; left: 0; font-weight: 700; }
.shop-extras { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; }
.shop-extras legend { padding: 0; margin-bottom: 6px; font: 700 12px/1.4 var(--body); text-transform: uppercase; letter-spacing: .12em; }
.shop-extra { display: grid; grid-template-columns: auto 44px minmax(0, 1fr) auto; align-items: center; gap: 10px; padding: 10px; border: 1.5px solid #1b2d5c30; border-radius: 12px; cursor: pointer; background: #fff8; }
.shop-extra:has(input:checked) { border-color: var(--ink); background: #fff; }
.shop-extra:has(input:focus-visible) { outline: 3px solid var(--ink); outline-offset: 2px; }
.shop-extra input { width: 20px; height: 20px; margin: 0; accent-color: var(--ink); }
.shop-extra img { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; background: var(--soft-yellow); }
.shop-extra img.is-fallback { object-fit: contain; padding: 6px; }
.shop-extra-name { display: block; font-weight: 700; font-size: 14px; line-height: 1.25; }
.shop-extra-blurb { display: block; font-size: 12.5px; line-height: 1.35; opacity: .8; }
.shop-extra-price { display: grid; justify-items: end; gap: 3px; font: 700 14px/1 var(--body); white-space: nowrap; text-align: right; font-variant-numeric: tabular-nums; }
.shop-extra-price small { font: 500 11px/1.2 var(--body); opacity: .8; }
.shop-extra:has(input:disabled) { cursor: default; border-color: var(--ink); background: #fff; }
.shop-extra input:disabled { opacity: .55; }
.shop-picker-summary { display: grid; gap: 8px; }
.shop-picker-lines { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; font-size: 14px; font-variant-numeric: tabular-nums; }
.shop-picker-lines:empty { display: none; }
.shop-picker-lines li { display: flex; justify-content: space-between; gap: 12px; }
.shop-picker-lines li.is-saving { font-weight: 700; }
.shop-picker-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-top: 10px; border-top: 1px solid #1b2d5c25; font-size: 14px; }
.shop-picker-total strong { font: 900 1.2rem/1 var(--heading); font-variant-numeric: tabular-nums; }
.shop-picker .button { width: 100%; justify-content: center; gap: 12px; }
.shop-picker-note { margin: -4px 0 0; font-size: 12.5px; line-height: 1.4; opacity: .75; }

/* The little confirmation after adding. */
.shop-toast { position: fixed; z-index: 3000; left: 50%; bottom: max(18px, env(safe-area-inset-bottom)); transform: translate(-50%, 140%); display: flex; align-items: center; gap: 16px; max-width: calc(100vw - 32px); padding: 12px 14px 12px 20px; border-radius: 999px; background: var(--ink); color: var(--cream); box-shadow: 0 10px 30px #1b2d5c40; transition: transform .28s ease; font-size: 15px; }
.shop-toast.is-shown { transform: translate(-50%, 0); }
.shop-toast a { color: var(--ink); background: var(--yellow); padding: 9px 16px; border-radius: 999px; text-decoration: none; font-weight: 700; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .shop-toast { transition: none; } }

/* ---------------------------------------------------- the standalone pages */
body.shop-page *, body.shop-page *::before, body.shop-page *::after { box-sizing: border-box; }
body.shop-page { margin: 0; min-height: 100svh; background: var(--cream); color: var(--ink); font: 400 17px/1.7 var(--body); }
.shop-main { padding: clamp(28px, 4vw, 64px) max(16px, calc((100vw - 1180px) / 2)) clamp(48px, 6vw, 96px); }
.shop-main h1 { margin: 0 0 .4em; font: 900 clamp(2.2rem, 4.6vw, 4.2rem)/1.02 var(--heading); letter-spacing: -.045em; text-wrap: balance; }
.shop-back { display: inline-block; margin-bottom: 22px; font-size: 15px; text-underline-offset: 5px; }
.shop-footer { padding: 28px max(16px, calc((100vw - 1180px) / 2)); border-top: 1px solid #1b2d5c25; font-size: 14px; display: flex; flex-wrap: wrap; gap: 8px 22px; }
.shop-footer a { text-underline-offset: 4px; }
.shop-status { padding: 16px 18px; border-radius: 14px; background: var(--soft-yellow); font-size: 15px; }
.shop-status.is-error { background: #f6d2c6; }
.shop-loading { opacity: .7; }

/* Product page */
.product-layout { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 64px); align-items: start; }
@media (max-width: 860px) { .product-layout { grid-template-columns: 1fr; } }
.product-hero-art { position: relative; container-type: inline-size; border-radius: 26px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--card-bg, var(--lavender)); display: grid; place-items: center; }
.product-hero-art img { width: 100%; height: 100%; object-fit: cover; }
.product-hero-art img.is-fallback { width: 40%; height: auto; object-fit: contain; }
.product-copy .shop-price { font-size: 2rem; margin: 6px 0 18px; }
.product-copy > p { max-width: 62ch; }
.product-delivery { font-size: 15px; font-weight: 600; }
.product-buy { position: sticky; top: 130px; }
.product-buy .shop-picker { background: #fff; box-shadow: 0 1px 0 #1b2d5c20, 0 10px 30px #1b2d5c12; }
.product-extras { margin-top: clamp(40px, 5vw, 72px); }
.product-extras h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.product-extra-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
/* One add-on on its own (the Christmas book) still spans the page, but with
   the picture to the side at a sensible size rather than filling the width.
   Matthew, 24 Nov 2026. */
@media (min-width: 700px) {
  .product-extra-card:only-child { grid-template-columns: minmax(0, 340px) 1fr; column-gap: 24px; align-content: center; align-items: start; }
  .product-extra-card:only-child > :first-child { grid-row: 1 / span 4; }
}
.product-extra-card { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 18px; background: #fff; }
.product-extra-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 12px; background: var(--soft-yellow); }
.product-extra-card img.is-fallback { object-fit: contain; padding: 18px; }
.product-extra-card h3 { margin: 0; font-size: 1.2rem; }
.product-extra-card p { margin: 0; font-size: 15px; line-height: 1.5; }
.product-others { margin-top: clamp(40px, 5vw, 72px); }

/* Cart */
.cart-layout { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(300px, 1fr); gap: clamp(20px, 3vw, 48px); align-items: start; }
@media (max-width: 860px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-lines { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.cart-line { display: grid; grid-template-columns: 84px 1fr auto; gap: 14px; align-items: start; padding: 14px; border-radius: 18px; background: #fff; }
.cart-line > img { width: 84px; height: 84px; border-radius: 12px; object-fit: cover; background: var(--lavender); }
.cart-line > img.is-fallback { object-fit: contain; padding: 12px; }
.cart-line h3 { margin: 0 0 4px; font-size: 1.15rem; }
.cart-line-extras { margin: 0; font-size: 14px; line-height: 1.45; opacity: .85; }
.cart-line-price { text-align: right; font: 700 16px/1.3 var(--body); font-variant-numeric: tabular-nums; }
.cart-line-price s { display: block; font-weight: 400; font-size: 13px; opacity: .6; }
.cart-line-actions { display: flex; gap: 16px; margin-top: 8px; font-size: 14px; }
.cart-line-actions button, .cart-line-actions a { padding: 0; border: 0; background: none; color: inherit; text-decoration: underline; text-underline-offset: 4px; cursor: pointer; font: inherit; }
.cart-summary { position: sticky; top: 130px; display: grid; gap: 14px; padding: 20px; border-radius: 20px; background: var(--soft-yellow); }
.cart-summary h2 { margin: 0; font-size: 1.6rem; }
.cart-sums { display: grid; gap: 6px; margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.cart-sums div { display: flex; justify-content: space-between; gap: 12px; }
.cart-sums dt, .cart-sums dd { margin: 0; }
.cart-sums .cart-sums-product { margin-top: 6px; font-weight: 700; }
.cart-sums .cart-sums-product:first-child { margin-top: 0; }
.cart-sums .cart-sums-part { padding-left: 12px; font-size: 14px; opacity: .85; }
.cart-sums .cart-sums-postage { margin-top: 6px; padding-top: 8px; border-top: 1px solid #1b2d5c20; }
.cart-total { padding-top: 10px; border-top: 1px solid #1b2d5c30; font: 900 1.35rem/1.2 var(--heading); }
.cart-field { display: grid; gap: 6px; font-size: 14px; font-weight: 600; }
.cart-field input { width: 100%; min-height: 48px; padding: 10px 14px; border: 1.5px solid #1b2d5c40; border-radius: 12px; background: #fff; color: var(--ink); font-size: 16px; }
.cart-code { display: grid; grid-template-columns: 1fr auto; gap: 8px; }
.cart-code .button { min-height: 48px; padding: 10px 16px; }
.cart-code-note { margin: 0; font-size: 13px; }
.cart-code-note.is-bad { color: var(--orange); font-weight: 600; }
.cart-explain { margin: 0; padding: 14px; border-radius: 14px; background: #fff9; font-size: 14px; line-height: 1.5; }
.cart-summary .button { width: 100%; justify-content: center; gap: 12px; }
.cart-empty { display: grid; gap: 14px; justify-items: start; }

.order-received .cart-next { margin-left: auto; }

/* Thank-you page */
.thanks-list { display: grid; gap: 12px; margin: 22px 0; padding: 0; list-style: none; max-width: 760px; }
.thanks-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px 20px; padding: 16px 18px; border-radius: 18px; background: #fff; }
.thanks-item > :first-child { min-width: 0; }
.thanks-item > :last-child { min-width: 11em; justify-content: space-between; }
@media (max-width: 560px) { .thanks-item { grid-template-columns: 1fr; } .thanks-item > :last-child { justify-self: start; } }
.thanks-item h3 { margin: 0; font-size: 1.15rem; }
.thanks-item p { margin: 2px 0 0; font-size: 14px; opacity: .8; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; font: 700 12px/1 var(--body); letter-spacing: .04em; text-transform: uppercase; }
.pill-done { background: #cfe5da; }
.pill-waiting { background: var(--soft-yellow); }

@media (max-width: 640px) {
  .shop-main h1 { font-size: 2.2rem; }
  .cart-line { grid-template-columns: 64px 1fr; }
  .cart-line > img { width: 64px; height: 64px; }
  .cart-line-price { grid-column: 2; text-align: left; }
  .header-actions .nav-create { display: none; }
}

/*
 * The planner on a paid order. page.js hides its shopping panel then; the
 * email, the code and the "after checkout" line sit outside that panel since
 * 1 Nov, so they would still show. The cart asked for both already.
 */
#story-brief:has([data-panel="story"][hidden]) :is(.summary-email, .summary-code, .after-checkout-note) { display: none; }

/* The gift card after payment: the planner is already saved, so there is no
   going back to it from here. */
.gift-dialog.is-after-payment [data-gift-back] { display: none; }

/* The hero's characters standing in on the cards until the real pictures
   arrive, sized like the picture they replace. */
.shop-card-art .shop-character { width: 46%; height: auto; overflow: visible; }
.shop-extra .shop-character { width: 44px; height: 44px; padding: 6px; border-radius: 8px; background: var(--soft-yellow); }
.shop-character .default-face { display: inline; }

/* Phones: the four cards two by two, small enough to see all four at once.
   Last in the file so it wins over the card styles above. */
@media (max-width: 860px) {
  .shop-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .shop-card { border-radius: 16px; }
  /* Same 4:3 as the desktop, so the play bar along the bottom is never cut. */
  .shop-card-art .shop-character, .shop-card-art img.is-fallback { width: 38%; }
  .shop-card-body { gap: 4px; padding: 10px 10px 12px; }
  .shop-card .eyebrow { display: none; }
  .shop-card h3 { font-size: 15px; line-height: 1.15; letter-spacing: -.01em; min-height: 2.3em; }
  .shop-price { font-size: 17px; }
  .shop-price small { display: block; margin: 2px 0 0; font-size: 10.5px; }
  .shop-card-actions { padding-top: 4px; }
  .shop-card-actions .button { min-height: 38px; padding: 7px 12px; font-size: 13px; gap: 6px; justify-content: center; }
  .shop-card-actions .button span[aria-hidden] { font-size: 16px; }
  .shop-more { font-size: 13px; }
  /* Under the heading on a phone, small and close: Matthew, 24 Nov 2026. */
  .shop-section .section-heading { gap: 6px; }
  .shop-section .section-heading p { font-size: 15px; }
}

/*
 * An add-on row with its "i" button. The button has a column of its own, the
 * full height of the row, so a tap near it opens the description instead of
 * ticking the add-on. The border sits on the row around both.
 */
.shop-extra-item { display: grid; grid-template-columns: minmax(0, 1fr) 48px; border: 1.5px solid #1b2d5c30; border-radius: 12px; background: #fff8; overflow: hidden; }
.shop-extra-item:has(input:checked) { border-color: var(--ink); background: #fff; }
.shop-extra-item .shop-extra { border: 0; border-radius: 0; background: transparent; padding-right: 4px; }
.shop-extra-item .shop-extra:has(input:checked), .shop-extra-item .shop-extra:has(input:disabled) { background: transparent; }
.shop-extra-info { display: grid; place-items: center; width: 48px; height: 100%; min-height: 48px; padding: 0; border: 0; border-left: 1px solid #1b2d5c18; background: transparent; color: var(--ink); cursor: pointer; }
.shop-extra-info::before { content: 'i'; width: 26px; height: 26px; display: grid; place-items: center; border: 1.5px solid #1b2d5c60; border-radius: 999px; font: italic 700 13px/1 Georgia, serif; }
.shop-extra-info[aria-expanded="true"]::before { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.shop-extra-info:focus-visible { outline: 3px solid var(--ink); outline-offset: -4px; }
.shop-extra-about { grid-column: 1 / -1; margin: 0; padding: 10px 14px 12px; border-top: 1px solid #1b2d5c18; font-size: 13.5px; line-height: 1.5; }
.shop-basics[hidden] { display: none; }
.shop-extra-price small { white-space: normal; max-width: 76px; text-align: right; }
@media (max-width: 860px) {
  .shop-extra { grid-template-columns: auto 36px minmax(0, 1fr) auto; gap: 8px; padding: 8px; }
  .shop-extra img, .shop-extra .shop-character { width: 36px; height: 36px; }
  .shop-extra-name { font-size: 13.5px; }
}

/* The live characters on the product, cart and thank-you pages. */
.product-hero-art .shop-character { width: 40%; height: auto; overflow: visible; }
.product-extra-card .shop-character { width: 100%; aspect-ratio: 16 / 10; padding: 18px 0; border-radius: 12px; background: var(--soft-yellow); }
.cart-line > .shop-character { width: 84px; height: 84px; padding: 12px; border-radius: 12px; background: var(--lavender); }
@media (max-width: 640px) { .cart-line > .shop-character { width: 64px; height: 64px; } }

/* Editing a product's add-ons in the cart: the dropdown opens under its line. */
.cart-edit { grid-column: 1 / -1; }
.cart-edit .shop-picker { margin: 4px 0 0; background: var(--cream); }

/* With a mouse, the add-on description floats over the list beside its "i"
   rather than pushing everything down. */
@media (hover: hover) and (pointer: fine) {
  .shop-extra-item { position: relative; overflow: visible; }
  .shop-extra-item .shop-extra { border-radius: 12px 0 0 12px; }
  .shop-extra-about { position: absolute; z-index: 30; top: calc(100% + 6px); right: 0; width: min(340px, 100%); margin: 0; padding: 12px 14px; border: 0; border-radius: 12px; background: var(--ink); color: var(--cream); box-shadow: 0 10px 28px #1b2d5c40; pointer-events: none; }
  .shop-extra-about::before { content: ''; position: absolute; top: -6px; right: 18px; width: 12px; height: 12px; background: var(--ink); transform: rotate(45deg); }
}

/* "Our Products" has no eyebrow above it, so it sits centred against its
   paragraph rather than on the paragraph's last line. */
.shop-section .section-heading { align-items: center; }
.shop-section .section-heading > p { margin: 0; }

/* The audiobook's page: sample stories with their covers and a player. */
.product-samples { margin-top: clamp(40px, 5vw, 72px); }
.product-samples h2 { font-size: clamp(1.8rem, 3vw, 2.6rem); }
.product-sample-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.product-sample { display: grid; gap: 10px; align-content: start; padding: 16px; border-radius: 18px; background: #fff; }
.product-sample img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.product-sample h3 { margin: 0; font-size: 1.15rem; }
.product-sample p { margin: 0; font-size: 15px; line-height: 1.5; }
.product-sample audio { width: 100%; }

/*
 * THE HEADER FOLDS INTO "MENU" SOONER.
 * With the Cart button the full row needs about 1100px; below that it ran off
 * the right edge. Same folded menu as a phone, from 761px up to 1100px.
 */
@media (min-width: 761px) and (max-width: 1100px) {
  .site-header { flex-wrap: wrap; }
  .menu-toggle { display: flex; gap: 10px; align-items: center; background: none; color: var(--ink); border: 0; font-size: 15px; min-height: 44px; margin-left: auto; padding: 10px; }
  .menu-toggle span { font-size: 22px; }
  .site-header nav { display: none; order: 4; flex-basis: 100%; flex-direction: column; align-items: stretch; gap: 0; padding: 10px 0; }
  .site-header.menu-open nav { display: flex; }
  .site-header nav a, .site-header nav .nav-link { padding: 12px 8px; font-size: 16px; }
}

/* "Back to your order" at the top of a questionnaire card from a cart. */
.cart-back { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; margin: 0 0 8px; padding: 8px 0; border: 0; background: none; color: var(--ink); font: 600 15px/1 var(--body); text-decoration: underline; text-underline-offset: 4px; cursor: pointer; }
.cart-back:focus-visible { outline: 2px solid var(--ink); outline-offset: 4px; border-radius: 6px; }

/* The Full Package tick, at the top of the extras. */
.shop-pack { border-color: var(--ink); background: var(--soft-yellow, #f7e6b8); }
.shop-pack.shop-extra-item { grid-template-columns: minmax(0, 1fr); }
.shop-pack .shop-extra-name small { display: block; margin-top: 2px; font: 500 12px/1.3 var(--body); opacity: .8; }
.shop-pack-mark { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 8px; background: var(--ink); color: var(--cream); font: 800 14px/1 var(--body); }
.shop-pack-save { font-weight: 700; }
@media (max-width: 860px) { .shop-pack-mark { width: 36px; height: 36px; font-size: 12px; } }

/* The price before the Full Package saving, crossed out beside the total. */
.shop-picker-sum { display: inline-flex; align-items: baseline; gap: 10px; }
.shop-picker-was { font: 800 1rem/1 var(--heading); font-variant-numeric: tabular-nums; opacity: .45; }
.shop-picker-was[hidden] { display: none; }

/* "(see below for add ons)" beside the price on a product page. */
.product-addons-hint { margin-left: 10px; font: 500 15px/1.4 var(--body); letter-spacing: 0; opacity: .6; }

/* Under the add-ons on a product page: back to the products on the home page. */
.product-continue { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; margin-top: 14px; padding: 10px 20px; border: 2px solid var(--ink); border-radius: 999px; color: var(--ink); text-decoration: none; font: 600 15px/1 var(--body); }
.product-continue:hover { background: var(--ink); color: var(--cream); }
.product-continue:focus-visible { outline: 2px solid var(--ink); outline-offset: 3px; }

/* "Same child?" on the order page, above the Next button. */
.thanks-same { display: flex; align-items: flex-start; gap: 12px; max-width: 760px; margin: 0 0 18px; padding: 14px 16px; border-radius: 14px; background: #fff; cursor: pointer; font-size: 15px; line-height: 1.45; }
.thanks-same input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--ink); }
.thanks-same strong { margin-right: 4px; }

/*
 * THE HOME PAGE (24 Nov 2026): two big containers, one product each. Under
 * the price, "Add-ons available" and the add-ons small and side by side.
 */
.shop-strip.is-pairs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.shop-card.is-wide .shop-card-body { padding: 22px 24px 24px; }
.shop-card.is-wide h3 { font-size: clamp(1.5rem, 2vw, 1.9rem); }
.shop-card.is-wide .shop-card-actions { grid-template-columns: 1fr; }
.shop-addons { display: grid; gap: 8px; margin-top: 6px; }
.shop-addons-title { margin: 0; font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.shop-addons-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.shop-addons-row li { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 8px 10px; border-radius: 14px; background: #ffffff59; }
.shop-addons-pic { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 8px; overflow: hidden; }
.shop-addons-pic img { width: 100%; height: 100%; object-fit: contain; }
.shop-addons-row li.is-hardcover .shop-addons-pic img { object-fit: cover; }
.shop-addons-row strong { font: 800 14px/1.15 var(--heading); }

@media (max-width: 860px) {
  .shop-strip.is-pairs { grid-template-columns: 1fr; gap: 14px; }
  .shop-card.is-wide .shop-card-body { gap: 6px; padding: 14px 14px 16px; }
  .shop-card.is-wide h3 { min-height: 0; font-size: 18px; }
  .shop-addons-row { gap: 6px; }
  .shop-addons-row li { grid-template-columns: 1fr; justify-items: center; row-gap: 3px; padding: 8px 4px; text-align: center; }
  .shop-addons-pic { width: 34px; height: 34px; }
  .shop-addons-row strong { font-size: 12px; }
}
