/* spa.css — Critical shell CSS for the SPA */

/* ── RESET ──────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ── SHOP THEME VARS (default) ───────────────────────────────────── */
:root {
  --nav:     #0C2A45;
  --nav2:    #123A5D;
  --nav3:    #1D507C;
  --orange:  #0F6CBD;
  --yellow:  #7ED3F7;
  --btn-buy: #0F6CBD;
  --btn-cart:#134D7A;
  --bg:      #F1F5F9;
  --white:   #FFFFFF;
  --text:    #132033;
  --muted:   #5B6F84;
  --link:    #0F6CBD;
  --prime:   #1D9B5F;
  --star:    #F59E0B;
  --green:   #1D9B5F;
  --border:  #D4DEE9;
  --red:     #C0392B;
  --font:    'Manrope','Segoe UI',Tahoma,sans-serif;
}

/* ── DARK THEME (admin + service pages) ──────────────────────────── */
body.theme-dark {
  --black:  #080808;
  --dark:   #111111;
  --panel:  #1a1a1a;
  --white:  #F5F2EB;
  --muted:  rgba(245,242,235,0.65);
  --acid:   #CAFF00;
  --green:  #00FF9C;
  --orange: #FF4D00;
  --red:    #FF4D00;
  --border: rgba(245,242,235,0.12);
  --bg:     #080808;
  --text:   #F5F2EB;
  --font:   'IBM Plex Mono', monospace;
  background: var(--black);
  color: var(--white);
}

/* ── DARK MODE (user preference toggle) ─────────────────────────── */
body.dark-mode {
  --bg:     #0D1117;
  --white:  #FFFFFF;
  --text:   #E6EDF3;
  --muted:  #8B949E;
  --border: #30363D;
  --nav:    #161B22;
  --nav2:   #21262D;
  background: var(--bg);
  color: var(--text);
}
body.dark-mode .az-section,
body.dark-mode .deal-card,
body.dark-mode .az-card { background: #161B22; border-color: var(--border); }

/* ── BODY BASE ──────────────────────────────────────────────────── */
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body.theme-dark { font-family: 'IBM Plex Mono', monospace; }

/* ── PAGE PROGRESS BAR ──────────────────────────────────────────── */
#page-progress {
  position: fixed;
  top: 0; left: 0;
  height: 3px;
  width: 0;
  background: var(--orange);
  z-index: 9999;
  opacity: 0;
  transition: width 300ms ease, opacity 300ms ease;
  pointer-events: none;
}

/* ── APP VIEW TRANSITIONS ────────────────────────────────────────── */
#app-view {
  flex: 1;
  min-height: 0;
}
#app-view.view-exit {
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 100ms ease, transform 100ms ease;
}
#app-view.view-enter {
  opacity: 0;
  transform: translateY(-6px);
  animation: viewEnter 180ms ease forwards;
}
@keyframes viewEnter {
  to { opacity: 1; transform: translateY(0); }
}

/* ── SCROLL TO TOP BUTTON ────────────────────────────────────────── */
#scroll-top-btn {
  position: fixed;
  bottom: 28px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .2s, transform .2s;
  pointer-events: none;
  z-index: 800;
  cursor: pointer;
}
#scroll-top-btn.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
#scroll-top-btn:hover { background: #0B5A9A; }

/* ── SKIP LINK (accessibility) ───────────────────────────────────── */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--orange);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  transition: top .2s;
}
.skip-link:focus { top: 0; }

/* ── COOKIE CONSENT BANNER ───────────────────────────────────────── */
#cookie-banner {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #132033;
  color: #E6EDF3;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  z-index: 8000;
  font-size: 13px;
  box-shadow: 0 -4px 20px rgba(0,0,0,.3);
  transform: translateY(100%);
  transition: transform .3s ease;
}
#cookie-banner.show { transform: translateY(0); }
#cookie-banner p { flex: 1; line-height: 1.5; }
#cookie-banner a { color: var(--yellow); text-decoration: underline; }
#cookie-banner .cookie-btns { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-accept {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 8px 18px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cookie-decline {
  background: transparent;
  color: #aaa;
  border: 1px solid #444;
  padding: 8px 14px;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
}

/* ── LOADING SPINNER ─────────────────────────────────────────────── */
.page-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40vh;
  font-size: 13px;
  color: var(--muted);
  gap: 12px;
}
.spin {
  width: 24px; height: 24px;
  border: 3px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── SKELETON CARDS ─────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, #e8edf2 25%, #d4dce6 37%, #e8edf2 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: 4px;
}
@keyframes shimmer {
  0%   { background-position: 100% 50%; }
  100% { background-position: 0%   50%; }
}
.skeleton-card {
  background: var(--white);
  padding: 14px;
  border-radius: 4px;
  border: 1px solid var(--border);
}
.skeleton-img  { height: 160px; width: 100%; border-radius: 4px; }
.skeleton-line { height: 12px; margin-top: 8px; border-radius: 3px; }
.skeleton-line.w80 { width: 80%; }
.skeleton-line.w60 { width: 60%; }
.skeleton-line.w40 { width: 40%; }

/* ── SCROLL REVEAL ANIMATIONS ────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .5s ease, transform .5s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .3s; }
.reveal[data-delay="4"] { transition-delay: .4s; }
.reveal[data-delay="5"] { transition-delay: .5s; }

/* ── VIEW ERROR ──────────────────────────────────────────────────── */
.view-error {
  background: #fff3f3;
  border: 1px solid #f5c6cb;
  padding: 12px 16px;
  border-radius: 6px;
  color: #721c24;
  font-size: 13px;
  margin: 16px;
}
.view-error-full {
  text-align: center;
  padding: 60px 20px;
  color: var(--text);
}
.view-error-full h2 { font-size: 24px; margin-bottom: 10px; }
.view-error-full a { color: var(--orange); text-decoration: underline; }

/* ── BREADCRUMBS ─────────────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  padding: 10px 0;
  flex-wrap: wrap;
}
.breadcrumb a { color: var(--link); }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); }

/* ── QUICK VIEW MODAL ────────────────────────────────────────────── */
#qv-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 5000;
  align-items: flex-end;
  justify-content: center;
}
#qv-overlay.open { display: flex; }
#qv-modal {
  background: var(--white);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 16px 16px 0 0;
  padding: 24px;
  position: relative;
  animation: slideUp .25s ease;
}
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.qv-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  font-size: 24px; cursor: pointer;
  color: var(--muted);
  line-height: 1;
}

/* ── LIGHTBOX ────────────────────────────────────────────────────── */
#lb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.92);
  z-index: 6000;
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
}
#lb-overlay.open { display: flex; }
#lb-overlay img {
  max-width: 90vw;
  max-height: 90vh;
  object-fit: contain;
  border-radius: 4px;
}
.lb-close {
  position: fixed;
  top: 16px; right: 20px;
  background: none; border: none;
  color: #fff; font-size: 32px;
  cursor: pointer; z-index: 6001;
  line-height: 1;
}
.lb-arrow {
  position: fixed;
  top: 50%; transform: translateY(-50%);
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  font-size: 28px;
  padding: 12px 16px;
  cursor: pointer;
  border-radius: 4px;
  z-index: 6001;
}
.lb-arrow.l { left: 16px; }
.lb-arrow.r { right: 16px; }

/* ── COMPARE TRAY ────────────────────────────────────────────────── */
#compare-tray {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: var(--nav);
  color: #fff;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 700;
  transform: translateY(100%);
  transition: transform .25s ease;
  font-size: 13px;
}
#compare-tray.show { transform: translateY(0); }
.compare-items { display: flex; gap: 10px; flex: 1; }
.compare-item {
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.compare-item-rm { background: none; border: none; color: #ccc; cursor: pointer; font-size: 16px; padding: 0; }
.compare-go-btn {
  background: var(--yellow);
  color: var(--nav);
  border: none;
  padding: 9px 20px;
  border-radius: 6px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
  white-space: nowrap;
}
.compare-clear { color: #aaa; background: none; border: none; cursor: pointer; font-size: 12px; white-space: nowrap; }

/* ── TOAST (override for shop theme) ────────────────────────────── */
body.theme-light .rb-toast-wrap {
  background: var(--white) !important;
  color: var(--text) !important;
  border: 1px solid var(--border) !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.12) !important;
}

/* ── FOCUS VISIBLE (accessibility) ──────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 2px;
}

/* ── TRUST BADGES ────────────────────────────────────────────────── */
.trust-badges {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: var(--muted);
}
.trust-badge svg { width: 16px; height: 16px; color: var(--green); }

/* ── NOTIFICATION PREFS / FORM ───────────────────────────────────── */
.pref-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.pref-row:last-child { border-bottom: none; }
.pref-label { color: var(--text); }
.pref-desc  { font-size: 11px; color: var(--muted); margin-top: 2px; }
.toggle-switch {
  width: 42px; height: 24px;
  background: var(--border);
  border-radius: 12px;
  position: relative;
  cursor: pointer;
  border: none;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-switch.on { background: var(--green); }
.toggle-switch::after {
  content: '';
  position: absolute;
  width: 18px; height: 18px;
  background: #fff;
  border-radius: 50%;
  top: 3px; left: 3px;
  transition: left .2s;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.toggle-switch.on::after { left: 21px; }

/* ── MATERIALS GALLERY (print page) ─────────────────────────────── */
.material-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin: 16px 0;
}
.mat-card {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 16px;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
  text-align: center;
}
.mat-card:hover, .mat-card.selected {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(15,108,189,.15);
}
.mat-icon { font-size: 32px; margin-bottom: 8px; }
.mat-name { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.mat-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
.color-swatches { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; margin-top: 8px; }
.color-swatch {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  cursor: pointer;
  transition: transform .15s, border-color .15s;
  title: attr(data-color);
}
.color-swatch:hover, .color-swatch.selected {
  transform: scale(1.2);
  border-color: var(--text);
}

/* ── ORDER TIMELINE ──────────────────────────────────────────────── */
.order-timeline {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 16px 0;
}
.ot-step {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding-bottom: 20px;
  position: relative;
}
.ot-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 13px; top: 26px;
  width: 2px;
  bottom: 0;
  background: var(--border);
}
.ot-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  flex-shrink: 0;
  z-index: 1;
}
.ot-dot.done { background: var(--green); border-color: var(--green); color: #fff; }
.ot-dot.active { background: var(--orange); border-color: var(--orange); color: #fff; }
.ot-info { flex: 1; }
.ot-status { font-weight: 600; font-size: 13px; }
.ot-time   { font-size: 11px; color: var(--muted); }
.ot-note   { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── FAQ ACCORDION ───────────────────────────────────────────────── */
.faq-section { max-width: 760px; margin: 0 auto; padding: 32px 16px; }
.faq-section h1 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.faq-category { margin-bottom: 32px; }
.faq-category h2 { font-size: 16px; font-weight: 700; margin-bottom: 12px; color: var(--orange); }
details.faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
details.faq-item summary {
  padding: 14px 16px;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  list-style: none;
  user-select: none;
}
details.faq-item summary::-webkit-details-marker { display: none; }
details.faq-item summary::after { content: '+'; font-size: 18px; color: var(--muted); }
details.faq-item[open] summary::after { content: '−'; }
details.faq-item[open] summary { background: var(--bg); }
.faq-answer { padding: 0 16px 16px; font-size: 13px; color: var(--muted); line-height: 1.7; }

/* ── 404 PAGE ────────────────────────────────────────────────────── */
.not-found {
  text-align: center;
  padding: 80px 20px;
  max-width: 560px;
  margin: 0 auto;
}
.not-found .nf-code { font-size: 80px; font-weight: 900; color: var(--border); line-height: 1; }
.not-found h2 { font-size: 22px; margin: 12px 0; }
.not-found p { color: var(--muted); font-size: 14px; margin-bottom: 24px; }
.not-found .nf-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }

/* ── ORDER TRACKING PUBLIC PAGE ──────────────────────────────────── */
.track-page { max-width: 600px; margin: 0 auto; padding: 40px 16px; }
.track-page h1 { font-size: 26px; font-weight: 700; margin-bottom: 24px; }
.track-input-row { display: flex; gap: 10px; margin-bottom: 24px; }
.track-input-row input {
  flex: 1;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--white);
  color: var(--text);
}
.track-input-row button {
  background: var(--orange);
  color: #fff;
  border: none;
  padding: 0 20px;
  border-radius: 6px;
  font-weight: 600;
}

/* ── COMPARE PAGE ────────────────────────────────────────────────── */
.compare-table-wrap { overflow-x: auto; margin: 16px 0; }
.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}
.compare-table th, .compare-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  vertical-align: top;
}
.compare-table th { background: var(--bg); font-weight: 600; text-align: left; }
.compare-table td:first-child { background: var(--bg); font-weight: 500; white-space: nowrap; }
.compare-table tr:nth-child(even) td { background: #fafbfc; }

/* ── NEWSLETTER BANNER ───────────────────────────────────────────── */
.newsletter-bar {
  background: linear-gradient(135deg, var(--nav) 0%, var(--nav2) 100%);
  color: #fff;
  padding: 28px 20px;
  text-align: center;
}
.newsletter-bar h3 { font-size: 18px; font-weight: 700; margin-bottom: 6px; }
.newsletter-bar p  { font-size: 13px; color: #bbd; margin-bottom: 14px; }
.newsletter-form { display: flex; gap: 10px; max-width: 420px; margin: 0 auto; }
.newsletter-form input {
  flex: 1;
  padding: 10px 14px;
  border: none;
  border-radius: 6px;
  font-size: 13px;
}
.newsletter-form button {
  background: var(--yellow);
  color: var(--nav);
  border: none;
  padding: 0 20px;
  border-radius: 6px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}

/* ── PRICE ESTIMATOR (print page) ────────────────────────────────── */
.est-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; margin: 12px 0; }
.est-field label { font-size: 11px; color: var(--muted); display: block; margin-bottom: 4px; }
.est-field input, .est-field select {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--white);
  color: var(--text);
}
.est-result {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  margin-top: 12px;
  font-size: 13px;
}
.est-price { font-size: 22px; font-weight: 800; color: var(--orange); }

/* ── UTILITY CLASSES ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background .15s, transform .1s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--btn-buy); color: #fff; }
.btn-primary:hover { background: #0B5A9A; }
.btn-secondary { background: var(--bg); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-danger { background: var(--red); color: #fff; }
.btn-sm { padding: 6px 14px; font-size: 12px; }
.btn-full { width: 100%; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.badge-success { background: #D1FAE5; color: #065F46; }
.badge-warning { background: #FEF3C7; color: #92400E; }
.badge-error   { background: #FEE2E2; color: #991B1B; }
.badge-info    { background: #DBEAFE; color: #1E40AF; }
.badge-neutral { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }

.divider { height: 1px; background: var(--border); margin: 16px 0; }

.text-muted  { color: var(--muted); }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-8  { margin-bottom: 8px; }
.mb-16 { margin-bottom: 16px; }
.gap-8 { gap: 8px; }

.flex   { display: flex; }
.flex-1 { flex: 1; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* ── RESPONSIVE ─────────────────────────────────────────────────── */
@media (max-width: 768px) {
  #scroll-top-btn { bottom: 16px; right: 12px; }
  .est-grid { grid-template-columns: 1fr 1fr; }
  .compare-items { display: none; }
  .newsletter-form { flex-direction: column; }
  .trust-badges { gap: 8px; }
}
