/*
 * Wines: original Shopify bottle images on paper, the box builder, selection lists.
 * The Shopify squares are white with the bottle centred; a 1:2 window shows the middle
 * half, which crops off award badges baked into the top-right corner. multiply melts the
 * white into the paper surface.
 * Pinyon Script is used only for wine names here (.tile-script, .pv-script), per A-79 item 12.
 */

/* ---------- Bottle window ---------- */
.btl { position: relative; display: block; flex: none; aspect-ratio: 1 / 2; overflow: hidden; background: var(--paper); border-radius: 8px; }
.btl img { position: absolute; top: 0; left: 50%; height: 100%; width: auto; max-width: none; transform: translateX(-50%) scale(1.05); transform-origin: 50% 50%; mix-blend-mode: multiply; }
.btl-contain img { top: 3%; height: 94%; transform: translateX(-50%); }
.btl-md { width: 76px; }
.btl-xs { width: 22px; border-radius: 4px; }
.btl-cap { display: none; }
.btl-missing .btl-cap { display: block; position: absolute; left: 32%; right: 32%; top: 8%; bottom: 6%; border-radius: 30% 30% 10% 10% / 12% 12% 4% 4%; background: linear-gradient(var(--cap) 0 14%, #2a1a1a 14%); }

/* ---------- Estate tags ---------- */
.etag { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: 0.02em; }
.etag::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.etag-abruzzo { color: #24578a; }
.etag-abruzzo::before { background: var(--abruzzo); }
.etag-sanpietro { color: #535a3c; }
.etag-sanpietro::before { background: var(--sanpietro); }

/* ---------- Build layout ---------- */
.build { display: grid; gap: var(--s-5); padding: var(--s-3) var(--s-4) var(--s-6); max-width: 1320px; }
.build-main { min-width: 0; }
.build-main > .stack { margin-bottom: var(--s-5); }
.group { margin-top: var(--s-6); position: relative; }
.group:first-of-type { margin-top: 0; }
.group-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 12px; margin-bottom: var(--s-3); }
.group-head .h-sec { margin: 0; }
.group-head .dim { font-size: var(--fs-sm); }
.group-banner { height: 140px; border-radius: var(--r-card); margin-bottom: var(--s-4); }
.group-banner::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(0,0,0,.6), transparent 70%); }
.group > .notice { margin-bottom: var(--s-3); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line-2); border-radius: var(--r-pill); margin-bottom: var(--s-4); }
.seg button { background: none; border: 0; border-radius: var(--r-pill); padding: 8px 14px; min-height: 40px; cursor: pointer; font-size: var(--fs-sm); color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--ivory); color: var(--black); font-weight: 700; }

/* the two estates: each its own header, colour and wording */
.estate { margin-bottom: var(--s-5); padding-left: var(--s-4); border-left: 2px solid var(--abruzzo); }
.estate-sanpietro { border-left-color: var(--sanpietro); }
.estate-head { margin-bottom: var(--s-3); max-width: 42em; }
.estate-name { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; letter-spacing: 0.14em; font-size: var(--fs-2xl); margin: 0; line-height: 1.1; }
.estate-place { margin: 0; font-family: var(--font-display); font-style: italic; font-size: var(--fs-lg); line-height: 1.25; }
.estate-abruzzo .estate-place { color: var(--abruzzo-hi); }
.estate-sanpietro .estate-place { color: var(--sanpietro-hi); }
.estate-line { color: var(--ink-2); font-size: var(--fs-sm); margin: 4px 0 0; }

/* ---------- Wine tiles (paper) ---------- */
.tiles { list-style: none; display: grid; gap: var(--s-3); }
.tile { position: relative; display: grid; grid-template-columns: 76px 1fr; grid-template-areas: "btl text" "btl step" "more more"; gap: 4px var(--s-3); padding: var(--s-3); background: var(--paper); color: var(--paper-ink); border-radius: var(--r-tile); box-shadow: inset 0 0 0 1px rgba(200,169,106,.35); transition: box-shadow .25s; }
.tile > .btl { grid-area: btl; }
.tile.is-in { box-shadow: inset 0 0 0 2px var(--red), 0 8px 30px rgba(210,0,0,.12); }
.tile.is-out { background: var(--paper-2); }
.tile.is-out .btl img { opacity: .45; filter: grayscale(1); }
.tile-text { grid-area: text; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-script { font-family: var(--font-script); font-size: var(--fs-xl); line-height: 1.1; color: #1e2d5c; }
.tile .etag-sanpietro ~ * , .estate-sanpietro .tile-script { color: #3f4630; }
.tile-name { font-weight: 700; font-size: var(--fs-sm); }
.tile-note { font-size: var(--fs-sm); color: var(--paper-ink-2); line-height: 1.4; }
.tile .chip { align-self: flex-start; margin-top: 4px; }
.tile .chip-flag, .tile .chip-r1 { color: #b00000; border-color: #b00000; }
.tile .chip-r2, .tile .chip-r3, .tile .chip-r4 { color: #6b4e12; border-color: #b9a06a; background: rgba(200,169,106,.16); }
.stepper { grid-area: step; display: flex; align-items: center; gap: 4px; align-self: end; justify-self: start; border: 1px solid #d8cfb8; border-radius: var(--r-pill); padding: 2px; }
.stepper button { width: 44px; height: 44px; border-radius: 50%; border: 0; background: transparent; color: var(--paper-ink); display: grid; place-items: center; cursor: pointer; }
.stepper button:hover { background: rgba(0,0,0,.06); }
.stepper button[data-action="add"] { background: var(--red); color: var(--white); }
.stepper button[data-action="add"]:hover { background: #b30000; }
.stepper button[aria-disabled="true"] { background: transparent; color: #a9a294; cursor: not-allowed; }
.stepper .ico { width: 20px; height: 20px; stroke-width: 2; }
.qty { min-width: 26px; text-align: center; font-family: var(--font-display); font-size: var(--fs-lg); }
.refusal { grid-column: 1 / -1; margin: 4px 0 0; font-size: var(--fs-sm); color: #6b4e12; background: rgba(200,169,106,.16); border-radius: 8px; padding: 8px 10px; }
.tile :focus-visible { outline-color: var(--red); }
.more { grid-area: more; font-size: var(--fs-sm); }
.more summary { cursor: pointer; min-height: 36px; display: flex; align-items: center; color: inherit; text-decoration: underline; text-underline-offset: 3px; }
.tile .more summary { color: var(--paper-ink-2); }
.tile .fine { color: var(--paper-ink-2); }
.tile .warn-line { color: #8a5a00; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 12px; margin: 8px 0 0; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
.awards { list-style: none; }

/* ---------- Summary panel (sticky) ---------- */
.sum { position: sticky; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom)); z-index: 20; align-self: end; }
.sum-in { background: rgba(12,12,12,.9); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--gold-line); border-radius: var(--r-panel); padding: var(--s-3) var(--s-4); box-shadow: 0 -10px 40px rgba(0,0,0,.6); }
.sum-top { display: flex; align-items: center; gap: var(--s-3); }
.sum-top .case { width: 84px; padding: 5px; gap: 3px; }
.sum-top .case-12 { width: 96px; }
.sum .h-card { margin: 0; font-size: var(--fs-md); }
.sum-left { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); }
.meters { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; margin: var(--s-2) 0 0; font-size: var(--fs-xs); }
.meters li { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "l v" "m m"; gap: 2px 6px; color: var(--ink-2); }
.meters li > span:first-child { grid-area: l; }
.meters strong { grid-area: v; color: var(--ink); }
.mtr { grid-area: m; height: 3px; background: var(--line); border-radius: 2px; overflow: hidden; }
.mtr i { display: block; height: 100%; background: var(--gold); border-radius: 2px; transition: width .4s var(--ease); }
.sum .btn-block { margin-top: var(--s-3); min-height: 44px; }
.sum .fine { margin-top: 6px; }

.card-shortcut { display: flex; align-items: center; gap: var(--s-3); }
.card-shortcut > span { display: flex; flex-direction: column; flex: 1; }
.card-shortcut > .ico:first-child { color: var(--gold-hi); }

/* ---------- Selection lists ---------- */
.lines-group { margin-top: var(--s-4); }
.lines-group h3 { font-size: var(--fs-xs); font-weight: 700; color: var(--gold); margin: 0 0 6px; }
.lines-abruzzo h3 { color: var(--abruzzo-hi); }
.lines-sanpietro h3 { color: var(--sanpietro-hi); }
.lines { list-style: none; display: grid; gap: 6px; }
.lines li { display: grid; grid-template-columns: 22px 1fr auto; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.ln-q { font-family: var(--font-display); color: var(--ink-2); }
.strip { display: inline-flex; gap: 3px; flex-wrap: wrap; margin: var(--s-2) 0; }
.preview { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--s-3); margin: var(--s-4) 0; }
.pv { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: var(--s-4) var(--s-3); background: var(--paper); color: var(--paper-ink); border-radius: var(--r-tile); box-shadow: inset 0 0 0 1px rgba(200,169,106,.35); }
.pv .btl { width: 70px; margin-bottom: 6px; }
.pv-script { font-family: var(--font-script); font-size: var(--fs-lg); color: #1e2d5c; line-height: 1.1; }
.pv-name { font-size: var(--fs-xs); font-weight: 700; }
.pv-q { position: absolute; top: 8px; right: 10px; font-family: var(--font-display); font-size: var(--fs-lg); color: var(--red-deep); }
.pv .chip-flag { color: #b00000; border-color: #b00000; }
.card-past .strip { margin-top: var(--s-3); }

/* membership experience embedded in the member area (upgrade) */
.exp-embed .exp-nav { top: 57px; }

@media (min-width: 700px) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .build { padding-left: var(--s-6); padding-right: var(--s-6); }
}
@media (min-width: 1000px) {
  .build { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
  .sum { top: var(--s-5); bottom: auto; align-self: start; }
  .sum-in { padding: var(--s-5); box-shadow: none; }
  .sum-top { flex-direction: column; align-items: flex-start; }
  .sum-top .case, .sum-top .case-12 { width: 100%; max-width: 220px; padding: 8px; gap: 5px; }
  .meters { grid-template-columns: 1fr; gap: 10px; font-size: var(--fs-sm); margin-top: var(--s-4); }
  .exp-embed .exp-nav { top: 0; }
}
@media (min-width: 1400px) {
  .tiles { grid-template-columns: repeat(3, 1fr); }
}
