/* =========================================================
   OnlyShop - Storefront Styles
   Blue & white modern creator-platform aesthetic.
   ========================================================= */

:root {
  --blue: #2f6bff;
  --blue-dark: #1e50d6;
  --blue-light: #eaf0ff;
  --bg: #f6f8fd;
  --card: #ffffff;
  --text: #171a23;
  --muted: #6b7280;
  --border: #e6eaf3;
  --green: #16a34a;
  --red: #dc2626;
  --shadow: 0 10px 30px rgba(23, 26, 35, 0.08);
  --radius: 16px;
  --radius-sm: 10px;
  font-size: 16px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

h1, h2, h3, h4, .brand {
  font-family: 'Sora', 'Inter', sans-serif;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--blue);
  text-decoration: none;
}

/* ---------- Scroll reveal (added via ui.js) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1), transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.reveal.in {
  opacity: 1;
  transform: none;
}

/* ---------- Header ---------- */
.site-header {
  background: #fff;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 20;
}

.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.5px;
}

.brand .logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--blue), #7aa2ff);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 0.85rem;
  font-weight: 900;
  box-shadow: 0 4px 10px rgba(47, 107, 255, 0.35);
}

.brand .logo span {
  transform: rotate(-12deg);
}

.brand .os {
  color: var(--blue);
}

/* Brand logo image (wide banner) */
.brand-logo {
  height: 38px;
  width: auto;
  display: block;
}
.brand-logo-footer {
  height: 30px;
  margin: 0 auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav a {
  padding: 9px 14px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  color: var(--text);
  transition: background 0.2s, color 0.2s;
}

.nav a:hover {
  background: var(--blue-light);
  color: var(--blue);
}

.nav a.active {
  background: var(--blue-light);
  color: var(--blue);
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(135deg, #eef2ff 0%, #ffffff 52%, #eaf0ff 100%);
  border-bottom: 1px solid var(--border);
  text-align: center;
  padding: 66px 20px 60px;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 107, 255, 0.14), transparent 65%);
  top: -160px;
  left: -120px;
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(47, 107, 255, 0.12), transparent 65%);
  bottom: -150px;
  right: -100px;
  pointer-events: none;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  color: var(--blue);
  border: 1px solid var(--border);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  margin-bottom: 18px;
}
.hero-badge svg { width: 15px; height: 15px; }

.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1.1;
  background: linear-gradient(90deg, var(--blue), #7aa2ff);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  margin-bottom: 10px;
}

.tagline {
  font-family: 'Sora', 'Inter', sans-serif;
  font-size: clamp(1.15rem, 2.6vw, 1.7rem);
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--text);
  text-transform: uppercase;
  position: relative;
  display: inline-block;
}
.tagline::after {
  content: '';
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: -10px;
  width: 46px;
  height: 3px;
  border-radius: 3px;
  background: var(--blue);
}
.tagline {
  margin-bottom: 6px;
}

/* ---------- Container / sections ---------- */
.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px 20px;
}

.section-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 8px;
  height: 26px;
  border-radius: 4px;
  background: var(--blue);
}

/* ---------- Product grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  transition: transform 0.2s, box-shadow 0.2s;
}

.product-card:hover {
  transform: translateY(-4px);
}

.thumb {
  aspect-ratio: 1 / 1;
  background: var(--blue-light);
  overflow: hidden;
  display: grid;
  place-items: center;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.product-card:hover .thumb img {
  transform: scale(1.06);
}

.product-card {
  transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.25s ease;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(23, 26, 35, 0.14);
}

.thumb.sold .img {
  filter: grayscale(0.5);
  opacity: 0.6;
}

.sold-overlay {
  position: absolute;
  inset: 0;
  background: rgba(23, 26, 35, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 12px;
  padding: 13px 20px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
  min-height: 46px;
}

.btn:active {
  transform: translateY(1px) scale(0.98);
}

.btn {
  position: relative;
  overflow: hidden;
}
.btn::after {
  content: '';
  position: absolute;
  top: 0; left: -80%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: skewX(-20deg);
  transition: left 0.6s ease;
}
.btn:hover::after {
  left: 130%;
}

.btn-primary {
  background: var(--blue);
  color: #fff;
  box-shadow: 0 6px 16px rgba(47, 107, 255, 0.3);
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-primary:disabled {
  background: #c3c9dd;
  box-shadow: none;
  cursor: not-allowed;
}

.btn-ghost {
  background: var(--blue-light);
  color: var(--blue);
}

.btn-ghost:hover {
  background: #dfe8ff;
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 14px;
  min-height: 36px;
  font-size: 0.9rem;
}

/* ---------- Empty state ---------- */
.empty {
  text-align: center;
  padding: 56px 20px;
  background: var(--card);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

.empty .emoji,
.empty-icon {
  color: var(--blue);
  margin-bottom: 16px;
}
.empty-icon svg {
  width: 56px;
  height: 56px;
  stroke-width: 1.4;
}

.empty h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.empty p {
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: auto;
  background: #fff;
  border-top: 1px solid var(--border);
  padding: 22px 20px;
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
}

/* Feather icon default sizing + alignment inside UI controls */
.nav a svg,
.btn svg,
.theme-toggle svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
  vertical-align: -3px;
}
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; }
.theme-toggle svg { width: 20px; height: 20px; }
.brand a svg,
a svg { vertical-align: -3px; }

.site-footer .brand {
  justify-content: center;
  font-size: 1.05rem;
  margin-bottom: 6px;
  color: var(--text);
}

/* ---------- Forms ---------- */
.form-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  max-width: 640px;
  margin: 0 auto;
}

.field {
  margin-bottom: 18px;
}

.field label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 1rem;
  background: #fff;
}

.field input:focus,
.field select:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(47, 107, 255, 0.15);
}

.hint {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 4px;
}

/* ---------- Upload area ---------- */
.upload-box {
  border: 2px dashed #c9d3ec;
  border-radius: var(--radius);
  background: var(--blue-light);
  padding: 30px 18px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
}

.upload-box.dragover {
  border-color: var(--blue);
  background: #dfe8ff;
}

.upload-box .upload-icon,
.upload-box .icon {
  color: var(--blue);
  display: inline-flex;
}
.upload-box .upload-icon svg,
.upload-box .icon svg {
  width: 42px;
  height: 42px;
  stroke-width: 1.5;
}

.upload-box p {
  margin-top: 8px;
  color: var(--muted);
}

.upload-box strong {
  color: var(--blue);
}

.preview-wrap {
  margin-top: 14px;
  position: relative;
  display: none;
}

.preview-wrap img {
  border-radius: var(--radius-sm);
  max-height: 260px;
  object-fit: cover;
  width: 100%;
  border: 1px solid var(--border);
}

.preview-wrap .remove {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(23, 26, 35, 0.7);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  font-size: 1rem;
  cursor: pointer;
}

.file-meta {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 6px;
}

.payqr { cursor: pointer; }

/* Payment method tabs */
.pay-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}
.pay-tab {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  border-radius: 12px;
  padding: 11px 12px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.18s ease;
}
.pay-tab.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
  box-shadow: 0 6px 14px rgba(47,107,255,0.25);
}

/* GCash box */
.gcash-box {
  display: flex;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  background: var(--card);
}
.gcash-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: #00b96b;
  color: #fff;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}
.gcash-icon svg { width: 24px; height: 24px; }
.gcash-info strong { display: block; }
.gcash-info p { color: var(--muted); font-size: 0.9rem; }
.gcash-number {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.gcash-number span {
  font-family: 'Sora', monospace;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 1px;
  padding: 7px 12px;
  background: var(--blue-light);
  border-radius: 8px;
}

.payqr-image { position: relative; }
.qr-zoom {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(23, 26, 35, 0.65);
  color: #fff;
  display: grid;
  place-items: center;
}
.qr-zoom svg { width: 16px; height: 16px; }

/* QR lightbox */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(10, 12, 22, 0.72);
  display: none; align-items: center; justify-content: center;
  padding: 24px; z-index: 60;
}
.modal-backdrop.show { display: flex; }
.qr-modal-card {
  position: relative;
  background: var(--card);
  border-radius: 16px;
  padding: 18px;
  max-width: 92vw;
  box-shadow: 0 24px 60px rgba(0,0,0,0.5);
}
.qr-modal-card img {
  width: min(70vw, 340px);
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
}
.qr-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: var(--card);
  color: var(--text);
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* ---------- Payment QR ---------- */
.payqr {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--blue-light);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 14px;
}

.payqr-image img {
  width: 110px;
  height: 110px;
  object-fit: contain;
  background: #fff;
  border-radius: 8px;
  padding: 6px;
}

.payqr-text strong {
  display: block;
  color: var(--text);
  margin-bottom: 4px;
}

.payqr-text p {
  color: var(--muted);
  font-size: 0.9rem;
}

@media (max-width: 560px) {
  .payqr-image img {
    width: 90px;
    height: 90px;
  }
}

/* ---------- Theme toggle ---------- */
.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.15s;
}
.theme-toggle:hover { background: var(--blue-light); }

.optional { color: var(--muted); font-weight: 400; }

/* ---------- Order tracking ---------- */
.trow { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); }
.trow span { color: var(--muted); }

.badge { display: inline-block; border-radius: 20px; font-weight: 700; margin-bottom: 12px; padding: 4px 10px; font-size: 0.78rem; }
.badge.pending { background: #fef3c7; color: #92400e; }
.badge.verified { background: #dbeafe; color: #1e40af; }
.badge.completed { background: #dcfce7; color: #166534; }
.badge.cancelled { background: #fee2e2; color: #991b1b; }
.badge svg { width: 15px; height: 15px; vertical-align: -2px; }

.action-icon { display: inline-flex; margin-bottom: 8px; }
.action-icon svg { width: 30px; height: 30px; stroke-width: 1.6; color: var(--blue); }
.nav-item svg { width: 18px; height: 18px; vertical-align: -3px; }
.btn svg { width: 17px; height: 17px; vertical-align: -3px; }

.track-strip { margin-top: 12px; padding: 14px; background: var(--blue-light); border-radius: 10px; }
.track-strip p { font-weight: 600; margin-bottom: 6px; }
.track-strip input {
  width: 100%;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: #fff;
  color: var(--text);
  font-size: 0.85rem;
  margin-bottom: 10px;
}

/* Delivered digital product (message + file) shown to buyer */
.delivery-box {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card);
}
.delivery-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--blue);
  margin-bottom: 6px;
}
.delivery-title svg { width: 16px; height: 16px; }
.delivery-box p { color: var(--text); white-space: pre-wrap; }
.btn-block .btn { width: 100%; }

/* Save-link reminder on checkout success */
.save-link-warn {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(217, 119, 6, 0.1);
  border: 1px solid rgba(217, 119, 6, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
  color: #92400e;
  font-size: 0.9rem;
  text-align: left;
}
.save-link-warn svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 2px; color: #b45309; }
[data-theme="dark"] .save-link-warn { background: rgba(217,119,6,0.15); border-color: rgba(217,119,6,0.5); color: #fcd34d; }

.copy-row { display: flex; gap: 8px; margin-bottom: 10px; }
.copy-row input { flex: 1; font-family: monospace; }
.save-tip { text-align: center; margin-top: 12px; }

/* ---------- Dark theme (OnlyFans-style black) ---------- */
[data-theme="dark"] {
  --bg: #0a0a0c;
  --card: #151519;
  --text: #f0f0f4;
  --muted: #9a9aa4;
  --border: #26262e;
  --blue: #3f7bff;
  --blue-dark: #2b5fd6;
  --blue-light: #14213a;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.55);
}
[data-theme="dark"] .site-header,
[data-theme="dark"] .site-footer,
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .product-card,
[data-theme="dark"] .form-card,
[data-theme="dark"] .empty { background: var(--card); border-color: var(--border); }
[data-theme="dark"] .hero { background: linear-gradient(180deg, #101014 0%, #15151a 55%, #101014 100%); }
[data-theme="dark"] .hero::before,
[data-theme="dark"] .hero::after { background: radial-gradient(circle, rgba(63,123,255,0.18), transparent 65%); }
[data-theme="dark"] .tagline { color: var(--text); }
[data-theme="dark"] .hero-badge { background: var(--bg); }
[data-theme="dark"] .thumb,
[data-theme="dark"] .payqr,
[data-theme="dark"] .upload-box { background: var(--blue-light); }
[data-theme="dark"] .upload-box.dragover { background: #171c2b; }
[data-theme="dark"] input,
[data-theme="dark"] select {
  background: #202026;
  color: var(--text);
  border-color: var(--border);
}
[data-theme="dark"] .nav a:hover { background: var(--blue-light); }
[data-theme="dark"] .alert.error { background: #3f1418; color: #ffb0b0; }
[data-theme="dark"] .alert.success { background: #12352c; color: #7ee0a6; }
[data-theme="dark"] .track-strip input { background: var(--card); }
[data-theme="dark"] .payqr-image img { background: #fff; }

/* Non-refundable notice */
.no-refund {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: rgba(220, 38, 38, 0.07);
  border: 1px solid rgba(220, 38, 38, 0.35);
  border-radius: 12px;
  padding: 12px 14px;
  margin: 6px 0 14px;
  color: #991b1b;
  font-size: 0.9rem;
}
.no-refund svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--red);
}
[data-theme="dark"] .no-refund {
  background: rgba(220, 38, 38, 0.15);
  border-color: rgba(220, 38, 38, 0.5);
  color: #ffb0b0;
}

.qv-hint {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.75rem;
  color: var(--muted);
}
.qv-hint svg { width: 13px; height: 13px; }

/* Product quick-view modal */
.pv-card {
  position: relative;
  background: var(--card);
  border-radius: 18px;
  width: min(880px, 94vw);
  max-height: 92vh;
  overflow: auto;
  box-shadow: 0 26px 70px rgba(0,0,0,0.4);
}
.pv-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}
.pv-image {
  background: var(--blue-light);
  display: grid;
  place-items: center;
  min-height: 300px;
}
.pv-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.pv-info { padding: 26px; }
.pv-info h2 {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.2;
  margin-bottom: 6px;
}
.pv-info .price { font-size: 1.5rem; }
.pv-close { z-index: 5; }

@media (max-width: 640px) {
  .pv-content { grid-template-columns: 1fr; }
  .pv-image { min-height: 200px; }
  .pv-info { padding: 20px; }
}

/* =========================================================
   Floating chat support widget
   ========================================================= */
#os-chat-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 90;
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
}
#os-chat-open {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, var(--blue), #7aa2ff);
  color: #fff;
  box-shadow: 0 10px 26px rgba(47,107,255,0.4);
  cursor: pointer;
  position: relative;
  transition: transform 0.18s ease;
}
#os-chat-open:hover { transform: scale(1.06); }
#os-chat-open svg { width: 26px; height: 26px; }
#os-chat-open .os-online-dot {
  position: absolute;
  top: 4px;
  left: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #9e9e9e;
}
#os-chat-open .os-online-dot.on { background: #16a34a; }

#os-chat-panel {
  position: absolute;
  right: 0;
  bottom: 74px;
  width: min(360px, calc(100vw - 28px));
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.25);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.os-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--blue), #5b8bff);
  color: #fff;
}
.os-chat-head strong { font-size: 1rem; }
.os-chat-head button {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
}
.os-status { display: block; font-size: 0.78rem; opacity: 0.95; margin-top: 2px; }
.os-status.os-online { color: #dcfce7; }
.os-status.os-offline { color: #fecaca; }

.os-chat-body {
  padding: 14px;
  height: 300px;
  overflow-y: auto;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.os-msg { max-width: 84%; }
.os-msg .os-who { font-size: 0.7rem; color: var(--muted); display: block; margin-bottom: 2px; }
.os-msg .os-bubble {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 0.9rem;
  line-height: 1.4;
}
.os-msg .os-time { font-size: 0.68rem; color: var(--muted); display: block; margin-top: 2px; }
.os-msg.buyer { align-self: flex-end; }
.os-msg.buyer .os-bubble { background: var(--blue); color: #fff; border-bottom-right-radius: 3px; }
.os-msg.buyer .os-time { text-align: right; }
.os-msg.admin { align-self: flex-start; }
.os-msg.admin .os-bubble { background: var(--blue-light); color: var(--text); border-bottom-left-radius: 3px; }
.os-msg.system { align-self: flex-start; }
.os-msg.system .os-bubble { background: #f1f1f4; color: var(--muted); font-style: italic; }

.os-chat-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.os-chat-input input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 9px 14px;
  font: inherit;
  background: var(--card);
  color: var(--text);
}
.os-chat-input button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.os-chat-input button svg { width: 18px; height: 18px; }

.os-chat-input button svg { width: 18px; height: 18px; }

/* Verify gate */
.os-chat-verify { text-align: center; padding: 8px 4px; }
.os-chat-verify p { font-size: 0.88rem; color: var(--text); margin-bottom: 10px; }
.os-chat-verify input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 9px 12px;
  font: inherit;
  margin-bottom: 8px;
  background: var(--card);
  color: var(--text);
}
.os-chat-verify .btn { width: 100%; }
.os-verify-msg { display: block; font-size: 0.8rem; color: var(--muted); margin-top: 6px; }

/* Order-page chat embed (on track.html) */
.support-chat {
  margin-top: 20px;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  background: var(--card);
}
.support-chat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: linear-gradient(135deg, var(--blue), #5b8bff);
  color: #fff;
}
.support-chat-head strong { display: inline-flex; align-items: center; gap: 6px; }
.support-chat-head svg { width: 16px; height: 16px; }
.support-chat .os-chat-body { border-bottom: 1px solid var(--border); }

[data-theme="dark"] .os-chat-body { background: var(--bg); }
[data-theme="dark"] .os-msg.system .os-bubble { background: #20232b; color: var(--muted); }

/* ---------- Alerts ---------- */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin: 14px 0;
  display: none;
  font-weight: 500;
}

.alert.show {
  display: block;
}

.alert.error {
  background: #fee2e2;
  color: #991b1b;
}

.alert.success {
  background: #dcfce7;
  color: #166534;
}

/* ---------- Responsive ---------- */
@media (max-width: 560px) {
  .header-inner {
    padding: 12px 14px;
    flex-direction: column;
    gap: 10px;
  }
  .grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .container {
    padding: 24px 14px;
  }
  .form-card {
    padding: 18px;
  }
  .btn {
    min-height: 50px;
  }
}
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.card-body h3 {
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.3;
}

.price {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--blue);
}

.stock {
  font-size: 0.82rem;
  color: var(--muted);
}

.stock.low {
  color: #b45309;
  font-weight: 600;
}

.stock.soldout {
  color: var(--red);
  font-weight: 700;
}

.stock.incoming {
  color: var(--blue);
  font-weight: 700;
}