/* ── Memorial Slate builder styles ───────────────────────────────────────── */

/* ── Page ───────────────────────────────────────────────────────────────── */
.slate-builder-page {
  background: var(--cream);
  /* space for sticky CTA */
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

[x-cloak] { display: none !important; }

/* ── Hero (dark preview section) ────────────────────────────────────────── */
.slate-hero {
  background: linear-gradient(165deg, #2C2825 0%, #1A1714 100%);
  padding: 28px 20px 36px;
  position: relative;
  overflow: hidden;
}
.slate-hero-glow {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 50% at 50% 0%, rgba(176,107,46,0.18) 0%, transparent 70%);
  pointer-events: none;
}
.slate-hero-label {
  text-align: center;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: rgba(255,255,255,0.88);
  letter-spacing: -0.01em;
  margin-bottom: 2px;
  position: relative;
}
.slate-hero-sub {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.38);
  margin-bottom: 18px;
  letter-spacing: 0.02em;
  font-family: var(--font-body);
  position: relative;
}

/* ── Canvas mockup ──────────────────────────────────────────────────────── */
.slate-mockup-wrap {
  position: relative;
  width: 100%;
  margin: 0 auto;
  filter: drop-shadow(0 20px 48px rgba(0,0,0,0.65));
}
.slate-canvas {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}
.slate-mockup-stand {
  display: flex;
  justify-content: center;
  gap: 50px;
  margin-top: 0;
}
.stand-leg {
  width: 14px;
  height: 22px;
  background: #111;
  border-radius: 1px 1px 4px 4px;
  opacity: 0.85;
}

/* Canvas hint text */
.slate-canvas-hint {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  font-size: 11px;
  color: rgba(255,255,255,0.38);
  text-align: center;
  margin-top: 10px;
  font-family: var(--font-body);
  position: relative;
}
.slate-canvas-hint svg {
  width: 13px;
  height: 13px;
  flex-shrink: 0;
}

/* Photo controls (shown when photo loaded) */
.photo-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.10);
  border-radius: var(--r-lg);
  position: relative;
}
.photo-ctrl-group {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}
.photo-ctrl-sep {
  width: 1px;
  height: 1.5rem;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.photo-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.3rem 0.6rem;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  background: none;
  color: rgba(255,255,255,0.6);
  font-size: 0.72rem;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
  white-space: nowrap;
  font-family: var(--font-body);
  min-height: 36px;
}
.photo-ctrl-btn svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
}
.photo-ctrl-btn:hover {
  border-color: var(--gold2);
  color: var(--gold2);
  background: rgba(212,134,74,0.10);
}
.photo-ctrl-reset { color: rgba(255,255,255,0.45); }

/* Hero pills */
.slate-hero-pills {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  flex-wrap: wrap;
  position: relative;
}
.slate-pill {
  display: flex;
  align-items: center;
  gap: 5px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 20px;
  padding: 5px 10px;
  font-size: 11px;
  color: rgba(255,255,255,0.65);
  font-weight: 500;
  white-space: nowrap;
  font-family: var(--font-body);
}
.slate-pill svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.slate-pill--gold {
  border-color: rgba(212,134,74,0.35);
  color: rgba(255,220,170,0.9);
}

/* ── Form card ──────────────────────────────────────────────────────────── */
.slate-form-card {
  background: #fff;
  border-radius: 20px 20px 0 0;
  margin-top: -12px;
  position: relative;
  z-index: 10;
  padding: 6px 0 24px;
  box-shadow: 0 -4px 24px rgba(28,23,20,0.14);
}
.drag-pill {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 10px auto 0;
}

/* ── Sections ───────────────────────────────────────────────────────────── */
.slate-section {
  padding: 20px 20px 0;
}
.slate-section-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink3);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
}
.slate-section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
.slate-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--gold);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  flex-shrink: 0;
}
.slate-section-hint {
  font-size: 11px;
  color: var(--ink3);
  margin-top: 6px;
  font-family: var(--font-body);
}

/* ── Upload zone (horizontal) ───────────────────────────────────────────── */
.slate-upload-zone {
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: var(--cream2);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  -webkit-tap-highlight-color: transparent;
  position: relative;
  overflow: hidden;
}
.slate-upload-zone:hover,
.slate-upload-zone--drag { border-color: var(--gold); background: var(--gold-bg); }
.slate-upload-zone--filled { border-style: solid; border-color: var(--gold); background: var(--gold-bg); }
.slate-upload-zone--processing { border-color: var(--gold); cursor: default; pointer-events: none; }

.slate-upload-thumb {
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  border-radius: 8px;
  overflow: hidden;
  background: var(--warm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--border);
  transition: border-color 0.2s;
}
.slate-upload-zone--filled .slate-upload-thumb { border-color: var(--gold); }
.slate-upload-thumb svg { width: 22px; height: 22px; color: var(--ink3); opacity: 0.55; }
.slate-thumb-img { width: 100%; height: 100%; object-fit: cover; display: block; }

.processing-spinner {
  width: 24px; height: 24px;
  border: 2.5px solid var(--gold-bg);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.slate-upload-text { flex: 1; }
.slate-upload-main { font-weight: 600; font-size: 14px; color: var(--ink); line-height: 1.2; font-family: var(--font-body); }
.slate-upload-sub { font-size: 12px; color: var(--ink3); margin-top: 2px; font-family: var(--font-body); }
.slate-upload-change { font-size: 11px; color: var(--gold); font-weight: 600; margin-top: 4px; font-family: var(--font-body); }

.slate-upload-arrow {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.slate-upload-arrow svg { width: 14px; height: 14px; color: #fff; }

.slate-upload-error {
  color: #c0392b;
  font-size: 12px;
  margin-top: 6px;
  font-family: var(--font-body);
}

/* ── Input grid ─────────────────────────────────────────────────────────── */
.slate-input-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}
.slate-input-full { grid-column: 1 / -1; }
.slate-input-group { display: flex; flex-direction: column; gap: 5px; }
.slate-lbl {
  font-size: 11px;
  font-weight: 600;
  color: var(--ink2);
  letter-spacing: 0.04em;
  font-family: var(--font-body);
}
.slate-char-hint { font-size: 11px; color: var(--ink3); text-align: right; margin-top: 3px; font-family: var(--font-body); }

/* ── Size grid ──────────────────────────────────────────────────────────── */
.slate-size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 10px;
}
.slate-size-opt {
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px 12px;
  cursor: pointer;
  background: #fff;
  position: relative;
  overflow: hidden;
  transition: border-color 0.18s, background 0.18s;
  text-align: left;
  min-height: 44px;
}
.slate-size-opt:active { transform: scale(0.98); }
.slate-size-opt.active { border-color: var(--gold); background: var(--gold-bg); }
.slate-size-tag {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 4px;
  margin-bottom: 8px;
  font-family: var(--font-body);
}
.slate-size-opt.active .slate-size-tag { background: var(--gold); color: #fff; }
.slate-size-opt:not(.active) .slate-size-tag { background: var(--cream2); color: var(--ink3); }
.slate-size-name { font-size: 14px; font-weight: 700; color: var(--ink); line-height: 1.1; margin-bottom: 1px; font-family: var(--font-body); }
.slate-size-price { font-size: 17px; font-weight: 700; color: var(--gold); font-family: var(--font-body); }
.slate-size-check {
  position: absolute; top: 10px; right: 10px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--gold);
  display: none;
  align-items: center; justify-content: center;
}
.slate-size-opt.active .slate-size-check { display: flex; }
.slate-size-check svg { width: 10px; height: 10px; }

/* ── Quantity ───────────────────────────────────────────────────────────── */
.slate-qty-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.slate-qty-inline {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}
.slate-qty-btn {
  width: 44px; height: 42px;
  background: #fff; border: none;
  font-size: 22px; color: var(--ink);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.1s;
}
.slate-qty-btn:active { background: var(--cream2); }
.slate-qty-num {
  width: 52px; height: 42px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 700; color: var(--ink);
  background: #fff; font-family: var(--font-body);
}
.slate-qty-hint { font-size: 12px; color: var(--ink3); font-family: var(--font-body); }

/* ── Shipping ───────────────────────────────────────────────────────────── */
.slate-ship-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 10px;
}
.slate-ship-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 11px 14px;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.18s, background 0.18s;
  text-align: left;
  width: 100%;
  min-height: 44px;
}
.slate-ship-opt.active { border-color: var(--gold); background: var(--gold-bg); }
.slate-ship-radio {
  width: 18px; height: 18px;
  border-radius: 50%;
  flex-shrink: 0;
  border: 2px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  transition: border-color 0.18s;
}
.slate-ship-opt.active .slate-ship-radio { border-color: var(--gold); }
.slate-ship-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); display: none; }
.slate-ship-opt.active .slate-ship-dot { display: block; }
.slate-ship-info { flex: 1; }
.slate-ship-name { font-size: 13px; font-weight: 600; color: var(--ink); font-family: var(--font-body); }
.slate-ship-eta { font-size: 11px; color: var(--ink3); font-family: var(--font-body); }
.slate-ship-price { font-size: 14px; font-weight: 700; color: var(--gold); font-family: var(--font-body); }

/* ── Order total bar ────────────────────────────────────────────────────── */
.slate-total-bar {
  margin: 18px 20px 0;
  background: var(--cream2);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.slate-total-line {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--ink2);
  font-family: var(--font-body);
}
.slate-total-main {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  padding-top: 8px;
  margin-top: 2px;
  border-top: 1px solid var(--border);
}
.slate-total-vat {
  font-size: 10px;
  color: var(--ink3);
  font-family: var(--font-body);
  text-align: right;
}

/* ── Guarantee row ──────────────────────────────────────────────────────── */
.slate-guarantee-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px 0;
  font-size: 12px;
  color: var(--ink3);
  font-family: var(--font-body);
}
.slate-guarantee-row svg { width: 15px; height: 15px; color: var(--green); flex-shrink: 0; }

/* ── Trust icons ────────────────────────────────────────────────────────── */
.slate-trust-row {
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 16px 20px 0;
  border-top: 1px solid var(--border);
  margin-top: 20px;
}
.slate-trust-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--ink3);
  font-weight: 500;
  text-align: center;
  font-family: var(--font-body);
}
.slate-trust-item svg { width: 18px; height: 18px; color: var(--ink3); opacity: 0.6; }

/* ── Submit error ───────────────────────────────────────────────────────── */
.slate-submit-error {
  color: #c0392b;
  font-size: 13px;
  margin: 12px 20px 0;
  font-family: var(--font-body);
}

/* ── Reviews section ────────────────────────────────────────────────────── */
.slate-reviews-section {
  padding: 48px 0;
  border-top: 1px solid var(--border);
  background: var(--cream2);
}

/* ── Sticky CTA bar ─────────────────────────────────────────────────────── */
.slate-sticky-cta {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 80;
  background: rgba(248,244,240,0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
}
.slate-sticky-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  max-width: 500px;
  margin: 0 auto;
}
.slate-cta-btn {
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 52px;
  transition: background 0.15s, transform 0.1s;
  width: 100%;
}
.slate-cta-btn:active { background: #8F5225; transform: scale(0.98); }
.slate-cta-btn:disabled { background: var(--ink3); cursor: not-allowed; transform: none; }
.slate-cta-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  text-align: left;
}
.slate-cta-title { font-size: 15px; font-weight: 700; line-height: 1.2; }
.slate-cta-note { font-size: 11px; opacity: 0.75; font-weight: 400; }
.slate-cta-price { font-size: 18px; font-weight: 700; white-space: nowrap; }

.slate-preview-btn {
  width: 52px; height: 52px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-shrink: 0;
  transition: border-color 0.15s;
  color: var(--ink2);
}
.slate-preview-btn:hover { border-color: var(--gold); color: var(--gold); }
.slate-preview-btn svg { width: 18px; height: 18px; }
.slate-preview-btn span { font-size: 9px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; font-family: var(--font-body); color: var(--ink3); }

/* ── Preview modal (bottom sheet) ───────────────────────────────────────── */
.slate-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(20,16,14,0.72);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.slate-modal-sheet {
  background: var(--cream);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  padding: 0 0 calc(20px + env(safe-area-inset-bottom));
}
.modal-pill {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--border);
  margin: 10px auto 16px;
}
.slate-modal-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  text-align: center;
  margin-bottom: 16px;
  padding: 0 20px;
}
.slate-modal-canvas-wrap {
  display: flex;
  justify-content: center;
  padding: 0 20px;
}
.slate-modal-canvas {
  width: 170px;
  height: auto;
  border-radius: 5px;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.32));
}
.slate-modal-note {
  font-size: 12px;
  color: var(--ink3);
  text-align: center;
  margin-top: 12px;
  padding: 0 20px;
  font-family: var(--font-body);
}
.slate-modal-actions {
  padding: 14px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.slate-modal-cta {
  width: 100%;
  padding: 14px;
  background: var(--gold);
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  min-height: 48px;
  transition: background 0.15s;
}
.slate-modal-cta:hover { background: #8F5225; }
.slate-modal-cta:disabled { background: var(--ink3); cursor: not-allowed; }
.slate-modal-close {
  width: 100%;
  padding: 12px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-family: var(--font-body);
  font-size: 14px;
  color: var(--ink2);
  cursor: pointer;
  min-height: 44px;
}
.slate-modal-close:hover { border-color: var(--ink2); }

/* ── Visually hidden utility ────────────────────────────────────────────── */
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ── Responsive: wider screens get a max-width container ─────────────────── */
@media (min-width: 600px) {
  .slate-hero { padding: 36px 40px 44px; }
  .slate-mockup-wrap { width: 580px; }
  .slate-canvas { width: 580px; }
  .slate-form-card { max-width: 520px; margin: -12px auto 0; }
  .slate-reviews-section .container { max-width: 520px; }
}

/* ── Product Gallery Strip ─────────────────────────────────────────── */
.pg-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin: 16px auto 0;
  max-width: 320px;
}
.pg-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
  background: none;
  transition: border-color 0.18s ease, transform 0.18s ease;
  flex-shrink: 0;
}
.pg-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.pg-thumb:hover { border-color: var(--gold2); transform: scale(1.05); }
.pg-thumb.is-active { border-color: var(--gold); }

/* ── Product Gallery Lightbox ──────────────────────────────────────── */
.pg-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(10,8,6,0.93);
  display: none;
  align-items: center;
  justify-content: center;
  flex-direction: column;
}
.pg-lb-img-wrap {
  max-width: min(90vw, 800px);
  max-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pg-lb-img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.6);
}
.pg-lb-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  line-height: 1;
  opacity: 0.8;
  padding: 4px 8px;
}
.pg-lb-close:hover { opacity: 1; }
.pg-lb-prev,
.pg-lb-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  font-size: 2.5rem;
  cursor: pointer;
  padding: 12px 16px;
  border-radius: 8px;
  line-height: 1;
  opacity: 0.7;
  transition: opacity 0.15s, background 0.15s;
}
.pg-lb-prev { left: 12px; }
.pg-lb-next { right: 12px; }
.pg-lb-prev:hover,
.pg-lb-next:hover { opacity: 1; background: rgba(255,255,255,0.18); }
.pg-lb-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.6);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
@media (max-width: 500px) {
  .pg-thumb { width: 52px; height: 52px; }
  .pg-lb-prev { left: 4px; }
  .pg-lb-next { right: 4px; }
}
