@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Inter:wght@400;500;600;700&display=swap");

/* ============================================================
   Quantum Industries — Public storefront
   Same paper/ink/copper identity as the admin app, applied with
   more warmth: this is the page most customers meet the shop on.
   ============================================================ */
:root {
  --paper: #f6f3ec;
  --paper-dim: #ede8dc;
  --ink: #1e2530;
  --ink-soft: #55606f;
  --line: #dcd5c4;
  --copper: #a8601f;
  --copper-dark: #7f4816;
  --copper-tint: #f1e1cd;
  --whatsapp: #2f9e58;
  --whatsapp-dark: #257e46;
  --danger: #b3402f;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
  --shadow: 0 1px 2px rgba(30, 37, 48, 0.06), 0 6px 20px rgba(30, 37, 48, 0.07);
}

* { box-sizing: border-box; }

/* `hidden` must win over the display rules set below. */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { font-family: var(--font-display); margin: 0 0 6px; font-weight: 600; }
p { margin: 0 0 10px; line-height: 1.55; color: var(--ink-soft); }
img { max-width: 100%; display: block; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0; padding: 0; margin: -1px;
}

:focus-visible { outline: 2px solid var(--copper); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-header-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand img#header-logo { height: 42px; width: auto; max-width: 140px; object-fit: contain; }
.logo-fallback {
  width: 42px; height: 42px; border-radius: 8px; background: var(--copper);
  color: #fff; font-family: var(--font-display); font-weight: 600; font-size: 1.05rem;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; line-height: 1.2; }
.brand-tagline { font-size: 0.8rem; color: var(--ink-soft); }
.header-cta { white-space: nowrap; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid transparent; border-radius: var(--radius);
  padding: 12px 18px; font-size: 0.92rem; font-weight: 600; text-decoration: none;
  cursor: pointer; font-family: inherit;
  transition: background 0.15s ease, transform 0.1s ease;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--copper); color: #fff; }
.btn-primary:hover { background: var(--copper-dark); }
.btn-primary:disabled { background: var(--ink-soft); cursor: progress; }
.btn-secondary { background: var(--copper-tint); color: var(--copper-dark); }
.btn-secondary:hover { background: #e8d3b6; }
.btn-whatsapp { background: var(--whatsapp); color: #fff; }
.btn-whatsapp:hover { background: var(--whatsapp-dark); }
.btn-block { width: 100%; margin-top: 8px; }

/* ---------- Info strip ---------- */
.info-strip { background: var(--copper-tint); border-bottom: 1px solid var(--line); }
.info-strip-inner {
  max-width: 1100px; margin: 0 auto; padding: 14px 20px;
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px;
}
.info-item { display: flex; flex-direction: column; gap: 2px; font-size: 0.86rem; }
.info-label { font-weight: 600; color: var(--copper-dark); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; }
.info-link { color: var(--copper-dark); font-weight: 500; text-decoration: underline; }

@media (max-width: 640px) {
  .info-strip-inner { grid-template-columns: 1fr; }
}

/* ---------- How it works ---------- */
.how-it-works { background: #fff; border-bottom: 1px solid var(--line); }
.how-it-works-inner {
  max-width: 1100px; margin: 0 auto; padding: 20px 20px;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.how-step { display: flex; align-items: center; gap: 10px; }
.how-num {
  width: 28px; height: 28px; border-radius: 50%; background: var(--copper); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 0.85rem; flex-shrink: 0;
}
.how-step p { margin: 0; font-size: 0.86rem; color: var(--ink); }

@media (max-width: 780px) {
  .how-it-works-inner { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Catalogue ---------- */
.catalogue-section { max-width: 1100px; margin: 0 auto; padding: 40px 20px 20px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-bottom: 16px; }
.section-head h1 { font-size: 1.7rem; }
.section-sub { margin: 0; font-size: 0.88rem; max-width: 60ch; }
.search-input {
  padding: 10px 14px; border: 1px solid var(--line); border-radius: 20px;
  font-size: 0.88rem; width: 280px; max-width: 100%; background: #fff;
  font-family: inherit; color: var(--ink);
}
.category-tabs { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 20px; }
.category-tab {
  flex-shrink: 0; padding: 8px 16px; border-radius: 20px; border: 1px solid var(--line);
  background: #fff; font-size: 0.85rem; font-weight: 500; color: var(--ink-soft);
  cursor: pointer; font-family: inherit;
}
.category-tab.active { background: var(--copper); border-color: var(--copper); color: #fff; }

.result-count { font-size: 0.82rem; margin: 0 0 14px; }

.catalogue-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px;
}
.product-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.product-open {
  border: 0; padding: 0; margin: 0; background: none; text-align: left;
  font: inherit; color: inherit; cursor: pointer; display: block; width: 100%;
}
.product-open:hover .product-name { color: var(--copper-dark); }
.product-image { width: 100%; height: 150px; object-fit: cover; background: var(--paper-dim); }
.product-image-empty {
  display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.product-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.badge-row { display: flex; gap: 6px; margin-bottom: 2px; flex-wrap: wrap; }
.badge { font-size: 0.7rem; font-weight: 600; padding: 3px 9px; border-radius: 20px; text-transform: uppercase; letter-spacing: 0.03em; }
.badge-popular { background: var(--copper-tint); color: var(--copper-dark); }
.badge-turnaround { background: #e1efe7; color: #3a7d5c; }
.product-name { font-size: 1.02rem; margin: 0; }
.product-desc { font-size: 0.85rem; margin: 2px 0 6px; }
.product-footer { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; gap: 10px; }
.product-price { font-weight: 700; color: var(--ink); }
.product-category { font-size: 0.78rem; color: var(--ink-soft); }
.product-actions { padding: 0 16px 16px; }
.no-results { grid-column: 1 / -1; text-align: center; padding: 40px 0; }

/* Skeleton loading state */
.skeleton-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.skeleton-card {
  height: 260px; border-radius: var(--radius); background: linear-gradient(100deg, var(--paper-dim) 30%, #fff 50%, var(--paper-dim) 70%);
  background-size: 200% 100%; animation: shimmer 1.4s infinite;
}
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .skeleton-card { animation: none; } }

.empty-state { text-align: center; padding: 48px 20px; background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }

/* ---------- Lightbox ---------- */
.lightbox { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 20px; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(30, 37, 48, 0.62); }
.lightbox-panel {
  position: relative; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
  width: min(860px, 100%); max-height: 90vh; overflow: auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}
.lightbox-close {
  position: absolute; top: 8px; right: 10px; z-index: 2;
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  background: #fff; color: var(--ink); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.lightbox-media { background: var(--paper-dim); min-height: 240px; position: relative; }
.lightbox-media img { width: 100%; height: 100%; object-fit: cover; }
.lightbox-media-empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  color: var(--ink-soft); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em;
}
.lightbox-body { padding: 26px 24px 28px; display: flex; flex-direction: column; gap: 6px; }
.lightbox-body h3 { font-size: 1.35rem; margin: 6px 0 2px; }
.lightbox-body .badge { align-self: flex-start; }
.lightbox-price { font-weight: 700; color: var(--ink); font-size: 1.15rem; margin: 0; }
.lightbox-meta { font-size: 0.85rem; margin: 0; }
.lightbox-desc { font-size: 0.9rem; margin: 8px 0 6px; }
body.modal-open { overflow: hidden; }

/* ---------- Testimonials ---------- */
.testimonials-section { max-width: 1100px; margin: 20px auto 0; padding: 30px 20px; }
.testimonials-section h2 { text-align: center; margin-bottom: 20px; font-size: 1.3rem; }
.testimonials-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.testimonial { margin: 0; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.testimonial p { color: var(--ink); font-style: italic; margin-bottom: 8px; }
.testimonial cite { font-style: normal; font-size: 0.82rem; color: var(--ink-soft); }

/* ---------- Order form ---------- */
.order-section { background: var(--ink); padding: 50px 20px; margin-top: 20px; }
.order-inner { max-width: 640px; margin: 0 auto; }
.order-copy h2 { color: #fff; }
.order-copy p { color: #c7ccd4; }
.order-form { margin-top: 20px; background: #fff; border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
.order-form label { display: block; font-size: 0.82rem; font-weight: 600; color: var(--ink-soft); margin: 14px 0 6px; }
.order-form label:first-child { margin-top: 0; }
.order-form input, .order-form select, .order-form textarea {
  width: 100%; padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: 0.94rem; font-family: inherit; background: var(--paper); color: var(--ink);
}
.order-form textarea { resize: vertical; }
.order-form input:focus, .order-form select:focus, .order-form textarea:focus {
  outline: 2px solid var(--copper); outline-offset: 1px;
}
.order-form .invalid { border-color: var(--danger); }
.order-confirmation { margin-top: 14px; padding: 12px 14px; background: #e1efe7; color: #3a7d5c; border-radius: var(--radius); font-size: 0.88rem; }
.form-error { color: var(--danger); font-size: 0.85rem; margin-top: 10px; }

/* ---------- Tracking ---------- */
.tracking-section { background: #fff; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tracking-inner { max-width: 1100px; margin: 0 auto; padding: 36px 20px 40px; }
.tracking-inner h2 { font-size: 1.3rem; }
.tracking-list { display: grid; gap: 10px; }
.tracking-empty { font-size: 0.88rem; margin: 0; }
.tracking-card {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  border: 1px solid var(--line); border-left: 4px solid var(--line);
  border-radius: var(--radius); padding: 14px 16px; background: var(--paper);
}
.tracking-card[data-status="Pending"]   { border-left-color: #d79a3b; }
.tracking-card[data-status="Confirmed"] { border-left-color: var(--copper); }
.tracking-card[data-status="Ready"]     { border-left-color: var(--whatsapp); }
.tracking-card[data-status="Collected"] { border-left-color: var(--ink-soft); }
.tracking-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tracking-title { font-weight: 600; font-size: 0.94rem; }
.tracking-meta { font-size: 0.8rem; color: var(--ink-soft); }
.status-badge { font-size: 0.75rem; font-weight: 700; padding: 5px 12px; border-radius: 20px; white-space: nowrap; text-transform: uppercase; letter-spacing: 0.03em; }
.status-badge[data-status="Pending"]   { background: #fbf0dc; color: #8a5c12; }
.status-badge[data-status="Confirmed"] { background: var(--copper-tint); color: var(--copper-dark); }
.status-badge[data-status="Ready"]     { background: #e1efe7; color: #2b6e4c; }
.status-badge[data-status="Collected"] { background: var(--paper-dim); color: var(--ink-soft); }

/* ---------- Footer ---------- */
.site-footer { text-align: center; padding: 24px 20px 40px; color: var(--ink-soft); font-size: 0.82rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: var(--radius);
  font-size: 0.88rem; opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; z-index: 70;
  max-width: 92vw; text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast-error { background: var(--danger); }

@media (max-width: 760px) {
  .lightbox { padding: 0; }
  .lightbox-panel { grid-template-columns: 1fr; max-height: 100vh; height: 100%; border-radius: 0; }
  .lightbox-media { min-height: 180px; height: 200px; }
  .search-input { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .toast { transition: none; }
}
