/* Structural styles for the markup shop.js renders. Sites theme it with these variables
   (set them on :root or any container) and may override any rule. */
:root {
  --shop-fg: #111;
  --shop-muted: #666;
  --shop-bg: #fff;
  --shop-surface: #f5f5f4;
  --shop-border: #d9d9d6;
  --shop-accent: #d52b1e;
  --shop-accent-fg: #fff;
  --shop-radius: 12px;
  --shop-gap: 12px;
  --shop-font: inherit;
  --shop-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

.shop-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.shop-hp { position: absolute !important; left: -10000px !important; width: 1px; height: 1px; opacity: 0; }
.shop-muted { color: var(--shop-muted); }

.shop-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .5em;
  min-height: 48px; padding: 0 1.4em; border: 0; border-radius: var(--shop-radius);
  background: var(--shop-accent); color: var(--shop-accent-fg); font: inherit; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
.shop-button:disabled, button[type=submit]:disabled { opacity: .5; cursor: not-allowed; }

/* tiers */
.shop-tiers { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--shop-gap); }
.shop-tier { display: grid; grid-template-columns: auto auto; column-gap: .6em; align-items: baseline;
  padding: .6em .9em; border: 1px solid var(--shop-border); border-radius: var(--shop-radius); }
.shop-tier__qty { font-weight: 700; }
.shop-tier__pct { color: var(--shop-accent); font-weight: 700; }
.shop-tier__name { grid-column: 1 / -1; color: var(--shop-muted); font-size: .85em; }

/* cart */
.shop-cart { display: grid; gap: var(--shop-gap); font-family: var(--shop-font); }
.shop-cart__empty { color: var(--shop-muted); margin: 1em 0; }
.shop-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--shop-gap); }
.shop-line { display: grid; grid-template-columns: 1fr auto auto auto; align-items: center; gap: .75em;
  padding-bottom: var(--shop-gap); border-bottom: 1px solid var(--shop-border); }
.shop-line__info { display: grid; min-width: 0; }
.shop-line__name { font-weight: 600; }
.shop-line__unit { color: var(--shop-muted); font-size: .85em; }
.shop-line__total { font-variant-numeric: tabular-nums; text-align: right; min-width: 5.5em; }
.shop-line__remove { border: 0; background: none; color: var(--shop-muted); font-size: 1.4em; line-height: 1; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; }
.shop-line__remove:hover { color: var(--shop-fg); background: var(--shop-surface); }
@media (max-width: 520px) {
  .shop-line { grid-template-columns: 1fr auto; }
  .shop-line__total { grid-column: 1; text-align: left; }
}
.shop-qty { display: inline-flex; align-items: center; border: 1px solid var(--shop-border); border-radius: 999px; }
.shop-qty__btn { width: 36px; height: 36px; border: 0; background: none; color: inherit; font-size: 1.1em; cursor: pointer; border-radius: 50%; }
.shop-qty__input { width: 2.6em; border: 0; background: none; color: inherit; text-align: center; font: inherit; -moz-appearance: textfield; }
.shop-qty__input::-webkit-outer-spin-button, .shop-qty__input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.shop-totals { margin: 0; display: grid; gap: .35em; }
.shop-totals__row { display: flex; justify-content: space-between; gap: 1em; font-variant-numeric: tabular-nums; }
.shop-totals__row dt, .shop-totals__row dd { margin: 0; }
.shop-totals__row--discount dd { color: var(--shop-accent); }
.shop-totals__row--total { font-weight: 700; font-size: 1.15em; padding-top: .35em; border-top: 1px solid var(--shop-border); }
.shop-totals__row--vat { color: var(--shop-muted); font-size: .85em; }
.shop-cart__hint { margin: 0; padding: .6em .8em; border-radius: var(--shop-radius); background: var(--shop-surface); font-size: .9em; }
.shop-cart__note { margin: 0; color: var(--shop-muted); font-size: .85em; }

/* checkout */
.shop-options { display: grid; gap: 8px; }
.shop-option { position: relative; display: grid; grid-template-columns: auto 1fr auto; column-gap: .75em; row-gap: .15em; align-items: center;
  padding: .85em 1em; border: 1px solid var(--shop-border); border-radius: var(--shop-radius); cursor: pointer; }
.shop-option:has(input:focus-visible) { outline: 2px solid var(--shop-accent); outline-offset: 2px; }
.shop-option.is-selected, .shop-option:has(input:checked) { border-color: var(--shop-accent); box-shadow: inset 0 0 0 1px var(--shop-accent); }
.shop-option input { grid-row: 1 / span 2; margin: 0; accent-color: var(--shop-accent); }
.shop-option__label { font-weight: 600; }
.shop-option__price { grid-row: 1 / span 2; grid-column: 3; font-variant-numeric: tabular-nums; font-weight: 600; }
.shop-option__meta { grid-column: 2; color: var(--shop-muted); font-size: .85em; }
.shop-badges { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 6px; margin-top: .3em; }
.shop-badge { font-size: .72em; letter-spacing: .02em; padding: .2em .55em; border: 1px solid var(--shop-border); border-radius: 6px; color: var(--shop-muted); }
.shop-summary { display: grid; gap: var(--shop-gap); }
.shop-summary__lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .4em; }
.shop-summary__lines li { display: flex; justify-content: space-between; gap: 1em; font-variant-numeric: tabular-nums; }
.shop-summary__char { display: block; color: var(--shop-muted); font-size: .8em; }
.shop-summary__vat { margin: 0; font-size: .8em; color: var(--shop-muted); }
.shop-summary__lead { margin: 0; font-size: .9em; color: var(--shop-muted); }
.shop-summary__lead.is-build { color: var(--shop-fg); }
.shop-field-error { display: block; color: #c0262d; font-size: .82em; margin-top: .3em; }
[aria-invalid="true"] { border-color: #c0262d !important; }
[data-shop-error]:empty { display: none; }
[data-shop-error] { color: #c0262d; }
form[aria-busy="true"] { cursor: progress; }

/* order page */
.shop-order { display: grid; gap: var(--shop-gap); }
.shop-order__status { margin: 0; font-weight: 600; }
.shop-order[data-status="paid"] .shop-order__status { color: #1d8a4f; }
.shop-order__number { margin: 0; }
.shop-bank { display: grid; gap: var(--shop-gap); padding: 1.2em; border: 1px solid var(--shop-border); border-radius: var(--shop-radius); }
.shop-bank h3 { margin: 0; }
.shop-bank__grid { display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 1.2em; align-items: start; }
@media (max-width: 560px) { .shop-bank__grid { grid-template-columns: 1fr; } }
.shop-bank__qr .shop-qr { width: 100%; height: auto; display: block; background: #fff; border-radius: 6px; }
.shop-bank__details { margin: 0; display: grid; gap: .5em; }
.shop-bank__details div { display: grid; }
.shop-bank__details dt { color: var(--shop-muted); font-size: .8em; }
.shop-bank__details dd { margin: 0; }
.shop-bank__details code { font-family: var(--shop-mono); word-break: break-all; }

/* cart drawer: sites provide <div data-shop-drawer class="..."><div class="shop-drawer__panel">…</div></div> */
[data-shop-drawer] { position: fixed; inset: 0; z-index: 1000; background: rgba(0,0,0,.0); transition: background .3s ease; }
[data-shop-drawer][data-open] { background: rgba(0,0,0,.45); }
.shop-drawer__panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); overflow: auto;
  background: var(--shop-bg); color: var(--shop-fg); padding: 24px; transform: translateX(100%); transition: transform .35s cubic-bezier(.2,.8,.2,1); }
[data-shop-drawer][data-open] .shop-drawer__panel { transform: none; }
html.shop-drawer-open { overflow: hidden; }
@media (prefers-reduced-motion: reduce) { [data-shop-drawer], .shop-drawer__panel { transition: none; } }
