/* ===== Premium polish on every page ===== */
:root {
  --glass: rgba(255, 255, 255, 0.72);
  --glass-strong: rgba(255, 255, 255, 0.88);
  --glass-border: rgba(255, 255, 255, 0.7);
  --glass-shadow: 0 10px 28px rgba(13, 71, 161, 0.1), inset 0 1px 0 rgba(255,255,255,.7);
  --liquid-1: #1a73e8;
  --liquid-2: #4f8ef7;
  --liquid-3: #c6ddff;
}

body {
  background:
    radial-gradient(980px 420px at 8% -12%, rgba(26,115,232,.11), transparent 62%),
    radial-gradient(760px 380px at 100% 0%, rgba(79,142,247,.1), transparent 58%),
    var(--background);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Header stays solid so scroll stays smooth */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(13,71,161,.04);
}
.site-header::before { content: none; }
.header-inner { position: relative; z-index: 1; }
.search-wrap input {
  background: #fff;
  border: 0;
  box-shadow: none;
}
.icon-btn {
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 1px 2px rgba(13,71,161,.05);
  border-radius: 10px;
}
.side-toggle { border-radius: 8px; }
.find-block { box-shadow: 0 4px 14px rgba(13,71,161,.06); }

/* iOS liquid tab bar */
.bottom-nav {
  background: rgba(255,255,255,.62);
  backdrop-filter: blur(22px) saturate(1.7);
  -webkit-backdrop-filter: blur(22px) saturate(1.7);
  border: 1px solid rgba(255,255,255,.76);
  box-shadow:
    0 10px 28px rgba(13,71,161,.14),
    inset 0 1px 0 rgba(255,255,255,.85);
  overflow: hidden;
}
.bottom-nav::before {
  content: "";
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(115deg, rgba(255,255,255,.62) 0%, rgba(255,255,255,0) 42%, rgba(168,212,255,.24) 100%);
}
.bottom-nav a { position: relative; z-index: 1; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .bottom-nav { background: rgba(255,255,255,.96); }
}

/* Modal */
.modal-backdrop {
  background: rgba(10, 26, 46, 0.34);
  backdrop-filter: blur(6px);
}
.modal-sheet {
  background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
  border: 1px solid rgba(255,255,255,.8);
  box-shadow: 0 18px 48px rgba(13,71,161,.16);
  position: relative;
  overflow: hidden;
}
.modal-sheet::before {
  content: "";
  position: absolute; width: 140px; height: 140px; border-radius: 50%;
  background: radial-gradient(circle, rgba(26,115,232,.12), transparent 70%);
  top: -50px; right: -30px; pointer-events: none;
}
.modal-sheet > * { position: relative; z-index: 1; }

.glass-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.btn-liquid {
  background: linear-gradient(135deg, #1a73e8 0%, #0b4aa8 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  box-shadow: 0 8px 16px rgba(26,115,232,.22);
}
.btn-liquid:hover { color: #fff; filter: brightness(1.04); }
.btn-ghost {
  background: #fff;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 12px;
}
.glass-input {
  background: #fff !important;
  border: 1px solid var(--border) !important;
}

/* Auth pages */
.auth-liquid {
  position: relative;
  min-height: 70vh;
  display: grid;
  place-items: center;
  padding: 12px 0 40px;
  overflow: hidden;
}
.liquid-blob {
  position: absolute;
  border-radius: 46% 54% 52% 48%;
  filter: blur(8px);
  opacity: .28;
  pointer-events: none;
}
.blob-a {
  width: 260px; height: 260px; left: 6%; top: 8%;
  background: radial-gradient(circle at 30% 30%, #7ab0ff, #1a73e8 62%, transparent 72%);
}
.blob-b {
  width: 300px; height: 300px; right: 4%; bottom: 6%;
  background: radial-gradient(circle at 70% 40%, #c6ddff, #4f8ef7 52%, transparent 72%);
}
.auth-card, .form-card.glass-card, .auth-liquid .form-card {
  width: min(440px, 100%);
  padding: 28px 22px 22px;
  position: relative;
  z-index: 2;
  border: 1px solid #d4e3f6;
  box-shadow: 0 16px 40px rgba(11, 74, 168, .1);
}
.auth-brand { text-align: center; margin-bottom: 18px; }
.auth-brand .brand-live { justify-content: center; }
.auth-liquid h1 {
  margin: 0 0 8px; font-size: 1.28rem; color: var(--primary-dark); letter-spacing: -.02em;
}
.auth-logo {
  display: inline-block;
  font-weight: 800; font-size: 1.5rem; letter-spacing: -.03em; color: var(--primary-dark);
}
.auth-brand p { margin: 6px 0 0; color: var(--muted); font-size: .9rem; }
.auth-tabs {
  display: grid; grid-template-columns: 1fr 1fr; gap: 6px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 14px; padding: 4px; margin-bottom: 16px;
}
.auth-tab {
  border: none; background: transparent; border-radius: 11px;
  padding: 10px 8px; font-weight: 700; font-size: .88rem; color: var(--muted); cursor: pointer;
}
.auth-tab.active {
  background: #fff;
  color: var(--primary-dark);
  box-shadow: 0 3px 10px rgba(13,71,161,.08);
}
.auth-pane { display: none; }
.auth-pane.active { display: block; }
.auth-hint { color: var(--muted); font-size: .9rem; margin: 0 0 12px; }
.auth-hint i { color: #25D366; margin-right: 4px; }
.auth-feedback { min-height: 1.2em; margin-top: 10px; font-size: .88rem; color: var(--primary-dark); }
.otp-input { letter-spacing: .35em; font-weight: 800; text-align: center; font-size: 1.2rem; }
.debug-note { margin-top: 12px; font-size: .75rem; color: var(--muted); text-align: center; }

.panel, .form-card, .product-card, .stat-card, .table-wrap, .gallery {
  background: #fff;
  border-color: var(--border);
}
.product-card { box-shadow: 0 1px 2px rgba(16,56,120,.04); }
.product-card:hover { box-shadow: 0 8px 20px rgba(16,56,120,.08); }
.btn-add { transition: background .15s, color .15s, border-color .15s; }
.cat-icon {
  background: linear-gradient(180deg, #fff 0%, var(--secondary) 100%);
  border: 1px solid var(--border);
}
.banner-card {
  box-shadow: 0 10px 24px rgba(11, 74, 168, .16);
}
.section-head h2 { color: var(--primary-dark); }
.footer { background: #eef3fa; }

.toast {
  background: rgba(10,26,46,.9);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,.12);
}
.toast.success { background: rgba(13,155,86,.94); }
.toast.error { background: rgba(217,45,32,.94); }

.qty-control { background: #fff; }
.form-control { background: #fff; }
.alert { border: 1px solid transparent; }
.alert-success { background: #e8f8ef; color: #0a6b3c; border-color: #c7ebd5; }
.alert-error { background: #fdeceb; color: #a31212; border-color: #f5c6c3; }

.admin-top { box-shadow: 0 1px 0 rgba(13,71,161,.04); }
.stat-card { box-shadow: 0 4px 14px rgba(16,56,120,.05); }
table.data th { background: #f4f8fd; }

@media (prefers-reduced-motion: reduce) {
  .liquid-blob, .logo-ring { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ===== Storefront: compact, colorful, premium ===== */
body.storefront {
  background:
    radial-gradient(680px 240px at -4% -6%, rgba(255, 122, 89, .18), transparent 62%),
    radial-gradient(620px 220px at 108% -8%, rgba(26, 115, 232, .18), transparent 60%),
    radial-gradient(480px 200px at 50% 12%, rgba(13, 184, 140, .1), transparent 64%),
    #f3f7fc;
}
body.storefront .container { padding: 8px 10px 2px; }
body.storefront .main h1 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}
body.storefront .section { margin: 10px 0; }
body.storefront .section-head { margin-bottom: 6px; }
body.storefront .section-head h2 {
  font-size: .92rem;
  display: flex;
  align-items: center;
  gap: 7px;
}
body.storefront .section-head h2::before {
  content: "";
  width: 4px;
  height: 13px;
  border-radius: 99px;
  background: #1a73e8;
  flex-shrink: 0;
}
body.storefront .section:nth-of-type(4n+2) .section-head h2::before { background: #0d9b56; }
body.storefront .section:nth-of-type(4n+3) .section-head h2::before { background: #ff7a59; }
body.storefront .section:nth-of-type(4n) .section-head h2::before { background: #7c5cfc; }
body.storefront .section-head a { font-weight: 700; font-size: .75rem; }

body.storefront .find-block {
  border-color: #d3e3f6;
  box-shadow: 0 8px 18px rgba(26, 115, 232, .08);
}
body.storefront .banner-card {
  height: 112px;
  border-radius: 16px;
  padding: 14px 16px;
}
body.storefront .banner-card h3 { font-size: 1.12rem; margin-bottom: 2px; }
body.storefront .banner-card p { font-size: .82rem; }
@media (min-width: 768px) {
  body.storefront .banner-card { height: 160px; }
}

body.storefront .cat-row { gap: 8px; }
body.storefront .cat-item { width: 68px; }
body.storefront .cat-icon {
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 15px;
  color: #fff;
  font-size: 1.05rem;
  box-shadow: 0 6px 12px rgba(16, 56, 120, .14);
}
body.storefront .cat-item:nth-child(6n+1) .cat-icon { background: linear-gradient(145deg, #4c97ff, #0b4aa8); }
body.storefront .cat-item:nth-child(6n+2) .cat-icon { background: linear-gradient(145deg, #34d399, #047857); }
body.storefront .cat-item:nth-child(6n+3) .cat-icon { background: linear-gradient(145deg, #ff8a65, #e11d48); }
body.storefront .cat-item:nth-child(6n+4) .cat-icon { background: linear-gradient(145deg, #c4b5fd, #6d28d9); }
body.storefront .cat-item:nth-child(6n+5) .cat-icon { background: linear-gradient(145deg, #fbbf24, #d97706); }
body.storefront .cat-item:nth-child(6n) .cat-icon { background: linear-gradient(145deg, #22d3ee, #0e7490); }
body.storefront .cat-item span { font-size: .68rem; font-weight: 700; line-height: 1.2; }

body.storefront .product-grid { gap: 8px; }
body.storefront .product-card {
  border-radius: 14px;
  border-color: #e3eef8;
  box-shadow: 0 4px 12px rgba(16, 56, 120, .05);
}
body.storefront .product-card .body { padding: 6px 7px 8px; gap: 2px; }
body.storefront .product-card .name { font-size: .78rem; }
body.storefront .price { color: #0b4aa8; }
body.storefront .disc {
  background: #fff1ea;
  color: #c2410c;
  border-radius: 999px;
  font-weight: 800;
}
body.storefront .btn-add {
  border: 0;
  background: linear-gradient(180deg, #2f86f3, #1565d8);
  color: #fff;
  padding: 6px 8px;
  border-radius: 9px;
  font-size: .74rem;
  box-shadow: 0 4px 10px rgba(26, 115, 232, .2);
}
body.storefront .btn-add:hover { background: #0b4aa8; color: #fff; }

body.storefront .panel,
body.storefront .gallery,
body.storefront .table-wrap,
body.storefront .addr-pick,
body.storefront .pay-card {
  border-radius: 14px;
  border-color: #e3eef8;
  box-shadow: 0 6px 16px rgba(16, 56, 120, .045);
}
body.storefront .panel { padding: 10px 12px; }
body.storefront .cart-item { padding: 8px 0; gap: 10px; }
body.storefront .totals-row { margin: 5px 0; font-size: .86rem; }
body.storefront .totals-row.grand { color: #0b4aa8; }
body.storefront .form-card { margin: 10px auto; padding: 16px 14px; }
body.storefront .form-group { margin-bottom: 10px; }
body.storefront .form-control { padding: 9px 12px; }
body.storefront .empty { padding: 28px 12px; }
body.storefront table.data th,
body.storefront table.data td { padding: 8px 10px; }
body.storefront .footer {
  background: linear-gradient(180deg, #f8fbff 0%, #e7f1ff 48%, #fff3ec 100%);
  border-top: 0;
  padding: 10px 12px calc(72px + env(safe-area-inset-bottom, 0px));
}
body.storefront .footer strong { color: #0b4aa8; }
body.storefront .auth-liquid { min-height: auto; padding: 2px 0 20px; }
body.storefront .auth-card,
body.storefront .auth-liquid .form-card { padding: 18px 16px 14px; }
body.storefront .track-eta { color: #0d9b56; }
body.storefront .chip:hover { background: #e8f8ee; border-color: #7dcea0; }
@media (min-width: 992px) {
  body.storefront .footer { padding-bottom: 14px; }
  body.storefront .container { padding: 10px 16px 4px; }
}
