/* ============================================================
   shop.css — styles for shop.php. Uses the design tokens from style.css
   (--gold, --ivory, --deep-olive, --font-serif ...). All classes are
   prefixed "sp-" so they never clash with Bootstrap or the other pages.
   ============================================================ */

:root {
  --sp-error: #9b2c2c;
  --sp-line: rgba(44, 49, 39, 0.16);
}

[hidden] { display: none !important; }
.sp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── Hero (shorter than the other pages' full-height hero) ── */
.sp-hero { height: auto; min-height: 70vh; padding-top: 150px; }
.sp-hero .page-hero-title { font-size: clamp(3rem, 6vw, 5.5rem); }
.sp-hero .page-hero-content { padding-bottom: 4rem; }

/* ── Cart button in the navbar ── */
.sp-cart-btn {
  position: relative; display: grid; place-items: center; width: 44px; height: 44px; margin-left: 1.5rem;
  border: 1px solid rgba(255,255,255,0.45); border-radius: 50%; background: transparent; color: var(--warm-white);
  cursor: pointer; transition: background var(--transition), border-color var(--transition), color var(--transition);
}
.navbar.scrolled .sp-cart-btn { border-color: rgba(255,255,255,0.45); color: var(--warm-white); }
.sp-cart-btn:hover { border-color: var(--gold); background: rgba(197,164,107,0.12); }
.sp-cart-count {
  position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: var(--gold); color: var(--charcoal); font-size: 0.7rem; font-weight: 600; display: grid; place-items: center;
}
.sp-cart-count.bump { animation: spBump 0.35s ease; }
@keyframes spBump { 40% { transform: scale(1.35); } }
@media (min-width: 768px) { .sp-cart-btn { order: 10; } }
@media (max-width: 767px) {
  .sp-cart-btn { margin-left: auto; margin-right: 1rem; width: 40px; height: 40px; }
  .sp-cart-btn + .hamburger { margin-left: 0; }
}

/* ── Section ── */
.sp-section { background: var(--ivory); padding: 4rem 0 6rem; }
.sp-empty-shop { text-align: center; padding: 4rem 0; max-width: 560px; margin: 0 auto; }
.sp-empty-shop h2 em { color: var(--olive-mid); }
.sp-empty-shop p { margin-top: 1rem; }

/* ── Toolbar ── */
.sp-toolbar { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; justify-content: space-between; padding-bottom: 2rem; margin-bottom: 2.5rem; border-bottom: 1px solid var(--sp-line); }
.sp-chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sp-chip {
  border: 1px solid var(--sp-line); background: transparent; border-radius: 999px; padding: 0.5rem 1.1rem;
  font-family: var(--font-sans); font-size: 0.78rem; font-weight: 500; letter-spacing: 0.06em; color: var(--charcoal); cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.sp-chip .sp-n { color: var(--text-muted); font-weight: 400; margin-left: 0.25rem; }
.sp-chip:hover { background: var(--gold-pale); }
.sp-chip.is-on { background: var(--charcoal); border-color: var(--charcoal); color: var(--ivory); }
.sp-chip.is-on .sp-n { color: rgba(248,244,239,0.7); }
.sp-tools { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.sp-tools input, .sp-tools select {
  height: 42px; border: 1px solid var(--sp-line); background: var(--warm-white); padding: 0 0.9rem; min-width: 160px;
  font-family: var(--font-sans); font-size: 0.85rem; color: var(--charcoal); border-radius: 0;
}

/* ── Grid & cards ── */
.sp-grid { display: grid; gap: 2.5rem 1.6rem; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .sp-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px)  { .sp-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.8rem 1rem; } }
.sp-card[hidden] { display: none; }
.sp-card-hit { display: block; width: 100%; padding: 0; border: 0; background: none; text-align: left; cursor: pointer; color: inherit; font: inherit; }
.sp-media { position: relative; display: block; aspect-ratio: 4 / 5; overflow: hidden; background: var(--gold-pale); }
.sp-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.sp-card-hit:hover .sp-media img { transform: scale(1.04); }
.sp-ph { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-serif); font-style: italic; font-weight: 300; font-size: clamp(90px, 13vw, 170px); line-height: 1; }
.sp-cat-merch    { background: var(--deep-olive); color: var(--gold-pale); }
.sp-cat-prints   { background: var(--gold-pale);  color: var(--olive-mid); }
.sp-cat-digital  { background: var(--charcoal);   color: var(--gold); }
.sp-cat-sessions { background: var(--gold);       color: var(--charcoal); }
.sp-badge { position: absolute; top: 0.7rem; left: 0.7rem; padding: 0.2rem 0.7rem; background: var(--ivory); color: var(--charcoal); font-size: 0.65rem; font-weight: 600; letter-spacing: 0.14em; text-transform: uppercase; }
.sp-badge.out { background: var(--charcoal); color: var(--ivory); }
.sp-card.is-out .sp-media img, .sp-card.is-out .sp-ph { opacity: 0.45; }
.sp-meta { display: grid; gap: 0.1rem; padding-top: 0.9rem; }
.sp-name { font-family: var(--font-serif); font-size: 1.45rem; font-weight: 500; line-height: 1.2; color: var(--charcoal); }
.sp-kind { font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--text-muted); }
.sp-price { font-weight: 500; margin-top: 0.3rem; color: var(--charcoal); }
.sp-nomatch { text-align: center; color: var(--text-muted); padding: 2rem 0; }

/* ── Buttons & fields (inside dialogs) ── */
.sp-btn {
  display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 1.8rem; border: 1px solid var(--charcoal);
  background: transparent; color: var(--charcoal); font-family: var(--font-sans); font-size: 0.72rem; font-weight: 600;
  letter-spacing: 0.2em; text-transform: uppercase; text-decoration: none; cursor: pointer; transition: background 0.2s;
}
.sp-btn:hover { background: var(--gold-pale); color: var(--charcoal); }
.sp-btn.primary { background: var(--gold); border-color: var(--gold); }
.sp-btn.primary:hover { background: var(--gold-light); border-color: var(--gold-light); }
.sp-btn.block { width: 100%; }
.sp-btn[disabled] { opacity: 0.55; cursor: wait; }
.sp-btn-add { height: 48px; }
.sp-link { background: none; border: 0; padding: 0; color: var(--text-muted); text-decoration: underline; font-size: 0.82rem; cursor: pointer; }

.sp-field { display: grid; gap: 0.35rem; margin-bottom: 1rem; }
.sp-field label, .sp-field .sp-lbl { font-size: 0.8rem; font-weight: 500; color: var(--charcoal); }
.sp-field input, .sp-field select, .sp-field textarea {
  width: 100%; border: 1px solid var(--sp-line); background: var(--warm-white); padding: 0.75rem 0.85rem; font-family: var(--font-sans);
  font-size: 1rem; color: var(--charcoal); border-radius: 0;
}
.sp-field textarea { min-height: 84px; resize: vertical; }
.sp-field input:focus, .sp-field select:focus, .sp-field textarea:focus { outline: none; border-color: var(--gold); }
.sp-hint { font-size: 0.78rem; color: var(--text-muted); }
.sp-field.bad input, .sp-field.bad textarea { border-color: var(--sp-error); }
.sp-row2 { display: grid; gap: 0.8rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 480px) { .sp-row2 { grid-template-columns: 1fr; } }

/* ── Dialogs ── */
dialog.sp-sheet { border: 0; padding: 0; background: var(--ivory); color: var(--text-body); max-width: none; max-height: none; }
dialog.sp-sheet::backdrop { background: rgba(26, 26, 24, 0.55); }
.sp-close {
  position: absolute; top: 0.8rem; right: 0.8rem; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--sp-line);
  background: var(--ivory); font-size: 1.5rem; line-height: 1; z-index: 2; cursor: pointer; color: var(--charcoal);
}
.sp-close:hover { background: var(--gold-pale); }

dialog.sp-product { width: min(980px, calc(100vw - 2rem)); max-height: calc(100vh - 2rem); margin: auto; overflow: auto; position: fixed; }
dialog.sp-product[open] { display: grid; grid-template-columns: 1fr 1fr; }
@media (max-width: 720px) { dialog.sp-product[open] { grid-template-columns: 1fr; } }
.sp-pd-media { position: relative; min-height: 320px; }
.sp-pd-media .sp-media { aspect-ratio: auto; height: 100%; min-height: 320px; }
.sp-pd-body { padding: 2.2rem; display: flex; flex-direction: column; gap: 0.2rem; }
.sp-pd-kind { margin: 0; font-size: 0.7rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.sp-pd-body h2 { margin: 0.2rem 0 0; font-size: clamp(2.1rem, 4.5vw, 3rem); }
.sp-pd-price { margin: 0.6rem 0 0; font-size: 1.35rem; font-weight: 500; color: var(--charcoal); }
.sp-pd-desc { margin: 0.8rem 0 0.4rem; max-width: 52ch; }
.sp-opt { margin: 0.9rem 0 0.3rem; }
.sp-opt .sp-lbl { display: block; font-size: 0.8rem; font-weight: 500; margin-bottom: 0.5rem; color: var(--charcoal); }
.sp-opt-values { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sp-opt-values button { min-width: 48px; height: 42px; padding: 0 0.9rem; border: 1px solid var(--sp-line); background: var(--warm-white); font-family: var(--font-sans); font-weight: 500; color: var(--charcoal); cursor: pointer; }
.sp-opt-values button[aria-pressed="true"] { background: var(--charcoal); border-color: var(--charcoal); color: var(--ivory); }
.sp-qty-row { display: flex; gap: 0.8rem; align-items: center; margin-top: 1.4rem; flex-wrap: wrap; }
.sp-qty { display: inline-flex; align-items: center; border: 1px solid var(--sp-line); background: var(--warm-white); }
.sp-qty button { width: 40px; height: 46px; border: 0; background: none; font-size: 1.25rem; cursor: pointer; color: var(--charcoal); }
.sp-qty output { min-width: 32px; text-align: center; font-weight: 500; color: var(--charcoal); }
.sp-qty.sm button { width: 32px; height: 34px; font-size: 1.1rem; }
.sp-pd-note { min-height: 1.4em; margin: 0.6rem 0 0; font-size: 0.85rem; color: var(--sp-error); }

/* Drawer */
dialog.sp-drawer { position: fixed; inset: 0 0 0 auto; margin: 0; height: 100%; width: min(480px, 100vw); flex-direction: column; }
dialog.sp-drawer[open] { display: flex; animation: spSlide 0.25s ease; }
@keyframes spSlide { from { transform: translateX(32px); opacity: 0; } }
.sp-drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1.1rem 1.5rem; border-bottom: 1px solid var(--sp-line); }
.sp-drawer-head h2 { margin: 0; font-size: 2rem; }
.sp-drawer-head .sp-close { position: static; }
.sp-drawer-body { flex: 1; overflow-y: auto; padding: 0.5rem 1.5rem 1.5rem; }

.sp-line { display: grid; grid-template-columns: 76px 1fr; gap: 0.9rem; padding: 1rem 0; border-bottom: 1px solid var(--sp-line); }
.sp-line .sp-media { aspect-ratio: 1; }
.sp-line .sp-ph { font-size: 44px; }
.sp-line-name { font-family: var(--font-serif); font-size: 1.3rem; font-weight: 500; line-height: 1.2; color: var(--charcoal); }
.sp-line-opt { font-size: 0.8rem; color: var(--text-muted); }
.sp-line-foot { display: flex; align-items: center; justify-content: space-between; margin: 0.5rem 0 0.3rem; gap: 0.5rem; }
.sp-line-total { font-weight: 500; color: var(--charcoal); }

.sp-totals { padding: 1rem 0; display: grid; gap: 0.5rem; }
.sp-totals > div { display: flex; justify-content: space-between; color: var(--charcoal); }
.sp-totals .grand { font-weight: 600; font-size: 1.1rem; padding-top: 0.7rem; border-top: 1px solid var(--sp-line); }
.sp-totals .free { color: var(--olive-mid); }
.sp-note-small { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.sp-cart-empty { text-align: center; padding: 3.5rem 0; color: var(--text-muted); }
.sp-cart-empty p { margin: 0 0 1.2rem; }
.sp-back { margin: 0.8rem 0 0.4rem; }

.sp-pay-opts { display: grid; gap: 0.5rem; margin: 0 0 1rem; border: 0; padding: 0; min-width: 0; }
.sp-pay-opts legend { font-size: 0.8rem; font-weight: 500; margin-bottom: 0.5rem; padding: 0; color: var(--charcoal); }
.sp-pay { display: flex; gap: 0.8rem; align-items: flex-start; padding: 0.8rem 0.9rem; border: 1px solid var(--sp-line); background: var(--warm-white); cursor: pointer; }
.sp-pay:has(input:checked) { border-color: var(--charcoal); box-shadow: 0 0 0 1px var(--charcoal); }
.sp-pay input { margin-top: 0.3rem; accent-color: var(--olive-mid); }
.sp-pay b { display: block; font-weight: 600; color: var(--charcoal); }
.sp-pay span { font-size: 0.8rem; color: var(--text-muted); }
.sp-hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.sp-form-err { background: #f6e3e0; color: var(--sp-error); padding: 0.7rem 0.8rem; font-size: 0.88rem; margin-bottom: 0.9rem; }

.sp-done { text-align: center; padding: 2.5rem 0 1rem; }
.sp-tick { width: 64px; height: 64px; border-radius: 50%; background: var(--olive-mid); color: var(--ivory); display: grid; place-items: center; margin: 0 auto 1.2rem; font-size: 1.8rem; }
.sp-tick.wait { background: var(--gold-pale); color: var(--olive-mid); }
.sp-tick.wait::after { content: ""; width: 26px; height: 26px; border-radius: 50%; border: 3px solid currentColor; border-top-color: transparent; animation: spSpin 0.9s linear infinite; }
@keyframes spSpin { to { transform: rotate(360deg); } }
.sp-done h3 { font-size: 2.1rem; margin: 0 0 0.5rem; }
.sp-done p { margin: 0 auto 1rem; max-width: 36ch; }
.sp-ref { font-weight: 600; color: var(--charcoal); letter-spacing: 0.02em; }

.sp-toast {
  position: fixed; left: 50%; bottom: 1.5rem; transform: translate(-50%, 24px); opacity: 0; pointer-events: none; z-index: 2000;
  background: var(--charcoal); color: var(--ivory); padding: 0.75rem 1.3rem; border-radius: 999px; font-size: 0.85rem; transition: opacity 0.2s, transform 0.2s;
}
.sp-toast.on { opacity: 1; transform: translate(-50%, 0); }

@media (prefers-reduced-motion: reduce) {
  .sp-card-hit:hover .sp-media img { transform: none; }
  dialog.sp-drawer[open] { animation: none; }
}

/* Terms / privacy agreement in checkout */
.sp-terms { display:flex; gap:.6rem; align-items:flex-start; font-size:.78rem; line-height:1.5; color:var(--olive-mid); margin:1rem 0; cursor:pointer; }
.sp-terms input { margin-top:.2rem; accent-color:var(--gold); width:auto; flex:0 0 auto; }
.sp-terms a { color:var(--gold); text-decoration:underline; }
.sp-terms.bad { outline:2px solid #C0392B; outline-offset:4px; }
