/* The website's shop (lib/shop-page.js, shared/assets/js/shop-public.js), on every dojo's site. Like the gallery
   (gallery.css), it takes its colours from the page it sits in: text is the page's own colour, lines and quiet text
   are tints of it, and the accent is the site's (--accent on the starter site, --red on San Yama's). Stripe's card
   form brings its own look. */
.shp {
  --shp-accent: var(--accent, var(--red, #d11d2b));
  --shp-line: color-mix(in srgb, currentColor 16%, transparent);
  --shp-quiet: color-mix(in srgb, currentColor 66%, transparent);
  --shp-fill: color-mix(in srgb, currentColor 6%, transparent);
  --shp-radius: 12px;
  display: grid; gap: 1.3rem; min-width: 0;
}
.shp a { color: inherit; }
.shp img { display: block; max-width: 100%; }
.shp-h { margin: 0; font-size: clamp(1.5rem, 4vw, 2.1rem); line-height: 1.15; overflow-wrap: anywhere; }
.shp-bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.shp-back { text-decoration: none; color: var(--shp-quiet); font-weight: 600; }
.shp-back:hover { color: inherit; }
.shp-cartlink { display: inline-flex; align-items: center; gap: .45rem; padding: .5rem 1rem; border: 1px solid var(--shp-line); border-radius: 999px; text-decoration: none; font-weight: 600; }
.shp-cartlink [data-shop-count]:not(:empty) { display: inline-grid; place-items: center; min-width: 1.4rem; height: 1.4rem; padding: 0 .35rem; border-radius: 999px; background: var(--shp-accent); color: #fff; font-size: .8rem; }
.shp-member { margin: 0; padding: .7rem 1rem; border: 1px dashed var(--shp-line); border-radius: var(--shp-radius); color: var(--shp-quiet); }
.shp-member a { font-weight: 600; color: inherit; }
.shp-empty { margin: 1.5rem 0; color: var(--shp-quiet); font-size: 1.05rem; }
.shp-chips { display: flex; gap: .45rem; flex-wrap: wrap; }
.shp-chips a { padding: .42rem 1rem; border: 1px solid var(--shp-line); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: .92rem; color: var(--shp-quiet); }
.shp-chips a[aria-current] { background: var(--shp-accent); border-color: transparent; color: #fff; }

.shp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 1.2rem; }
.shp-card { display: grid; gap: .45rem; text-decoration: none; }
.shp-card__img { aspect-ratio: 1; border-radius: var(--shp-radius); overflow: hidden; background: var(--shp-fill); display: grid; place-items: center; color: var(--shp-quiet); }
.shp-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s cubic-bezier(.22, 1, .36, 1); }
.shp-card:hover .shp-card__img img { transform: scale(1.03); }
.shp-card__title { font-weight: 600; font-size: 1.05rem; line-height: 1.3; overflow-wrap: anywhere; }
.shp-card__price { color: var(--shp-quiet); font-variant-numeric: tabular-nums; }
.shp-tag { display: inline-block; margin-left: .3rem; padding: .1rem .5rem; border-radius: 999px; border: 1px solid var(--shp-line); font-size: .78rem; }

.shp-product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(1.2rem, 4vw, 2.5rem); align-items: start; }
.shp-gallery { display: grid; gap: .7rem; }
.shp-gallery__main { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; border-radius: var(--shp-radius); background: var(--shp-fill); }
.shp-gallery--empty { aspect-ratio: 4 / 3; border-radius: var(--shp-radius); background: var(--shp-fill); place-items: center; color: var(--shp-quiet); }
.shp-thumbs { display: flex; gap: .5rem; flex-wrap: wrap; }
.shp-thumbs button { width: 68px; height: 68px; padding: 0; border: 2px solid transparent; border-radius: 9px; overflow: hidden; background: var(--shp-fill); cursor: pointer; }
.shp-thumbs button[aria-current] { border-color: var(--shp-accent); }
.shp-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.shp-buy { display: grid; gap: 1rem; align-content: start; }
.shp-price { margin: 0; font-size: 1.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.shp-opts { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.shp-opts legend { width: 100%; margin-bottom: .45rem; color: var(--shp-quiet); font-size: .9rem; }
.shp-opts label { position: relative; }
.shp-opts input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.shp-opts span { display: inline-block; min-width: 3.2rem; padding: .55rem .95rem; text-align: center; border: 1px solid var(--shp-line); border-radius: 10px; font-weight: 600; }
.shp-opts input:checked + span { border-color: var(--shp-accent); box-shadow: inset 0 0 0 1px var(--shp-accent); }
.shp-opts input:focus-visible + span { outline: 2px solid var(--shp-accent); outline-offset: 2px; }
.shp-opts label.is-out span { opacity: .4; text-decoration: line-through; }
.shp-stock { margin: 0; color: var(--shp-quiet); font-size: .92rem; }
.shp-qty { display: flex; align-items: center; gap: .7rem; }
.shp-qty input { width: 5rem; }
.shp input[type="number"], .shp input[type="text"], .shp input[type="email"], .shp input[type="tel"], .shp textarea, .shp select {
  font: inherit; color: inherit; background: var(--shp-fill); border: 1px solid var(--shp-line); border-radius: 10px; padding: .6rem .75rem; min-width: 0; }
.shp-btn { justify-self: start; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .8rem 1.6rem; border: 0; border-radius: 999px; background: var(--shp-accent); color: #fff; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.shp-btn:disabled { opacity: .5; cursor: progress; }
.shp-btn--ghost { background: transparent; color: inherit; border: 1px solid var(--shp-line); }
.shp-added { margin: 0; min-height: 1.4em; font-weight: 600; }
.shp-added a { color: inherit; }
.shp-desc { line-height: 1.65; color: var(--shp-quiet); }
.shp-hand { margin: 0; color: var(--shp-quiet); font-size: .9rem; }

.shp-panel { border: 1px solid var(--shp-line); border-radius: var(--shp-radius); padding: clamp(1rem, 3vw, 1.5rem); background: var(--shp-fill); min-width: 0; }
.shp-checkout { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 1.2rem; align-items: start; }
.shp-panel h3 { margin: 0 0 .9rem; font-size: 1.05rem; }
.shp-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.shp-lines li { display: flex; justify-content: space-between; gap: 1rem; align-items: center; }
.shp-lines small { color: var(--shp-quiet); }
.shp-line { display: grid !important; grid-template-columns: 56px minmax(0, 1fr) auto auto; gap: .8rem; align-items: center; }
.shp-line__img { width: 56px; height: 56px; border-radius: 8px; overflow: hidden; background: var(--shp-fill); display: grid; place-items: center; color: var(--shp-quiet); }
.shp-line__img img { width: 100%; height: 100%; object-fit: cover; }
.shp-line__what { display: grid; gap: .1rem; min-width: 0; }
.shp-line__what b { overflow-wrap: anywhere; }
.shp-step { display: inline-flex; align-items: center; gap: .45rem; }
.shp-step button { width: 32px; height: 32px; border-radius: 8px; border: 1px solid var(--shp-line); background: transparent; color: inherit; font-size: 1.05rem; cursor: pointer; }
.shp-step button:disabled { opacity: .35; cursor: not-allowed; }
.shp-step span { min-width: 1.4rem; text-align: center; font-weight: 600; }
.shp-totals { display: grid; grid-template-columns: 1fr auto; gap: .35rem 0; margin: 1rem 0; font-variant-numeric: tabular-nums; }
.shp-totals dt { color: var(--shp-quiet); }
.shp-totals dd { margin: 0; text-align: right; padding-left: 1rem; }
.shp-totals .is-total { font-weight: 700; color: inherit; font-size: 1.1rem; border-top: 1px solid var(--shp-line); padding-top: .45rem; }
.shp-field { display: grid; gap: .3rem; margin-bottom: .8rem; font-size: .9rem; color: var(--shp-quiet); }
.shp-field input, .shp-field textarea { color: var(--text, inherit); }
.shp-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 .8rem; }
.shp-grid2 .full { grid-column: 1 / -1; }
.shp-choices { display: grid; gap: .5rem; margin-bottom: 1rem; }
.shp-choices label { display: flex; gap: .6rem; align-items: flex-start; padding: .7rem .8rem; border: 1px solid var(--shp-line); border-radius: 10px; cursor: pointer; }
.shp-choices label:has(input:checked) { border-color: var(--shp-accent); }
.shp-choices input { accent-color: var(--shp-accent); margin-top: .25rem; }
.shp-choices small { display: block; color: var(--shp-quiet); }
.shp-error { margin: 0 0 .8rem; padding: .7rem .9rem; border-radius: 10px; border: 1px solid color-mix(in srgb, #e5484d 60%, transparent); color: inherit; background: color-mix(in srgb, #e5484d 12%, transparent); }
.shp-payment { margin: .4rem 0 1rem; min-height: 2rem; }
.shp-place { width: 100%; justify-self: stretch; }
.shp-status { font-size: 1.15rem; font-weight: 600; margin: .4rem 0 1rem; }
.shp-status.is-pending { color: var(--shp-quiet); }
.shp-ship { color: var(--shp-quiet); line-height: 1.55; }
.shp-ship b { color: inherit; }
@media (max-width: 820px) {
  .shp-product, .shp-checkout { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .shp-grid { grid-template-columns: 1fr 1fr; gap: .8rem; }
  .shp-line { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .shp-line .shp-step { grid-column: 2; }
  .shp-grid2 { grid-template-columns: 1fr; }
}
/* The shop inside an association's own page frame (lib/org/sites/*.js shop()). */
.shop-section { padding: clamp(1.5rem, 5vw, 3rem) 0 clamp(3rem, 8vw, 5rem); }
