:root {
  color-scheme: light;
  --sf-bg: #fafafa;
  --sf-card: #ffffff;
  --sf-text: #0f172a;
  --sf-text-soft: #64748b;
  --sf-text-muted: #94a3b8;
  --sf-border: #e2e8f0;
  --sf-border-light: #f1f5f9;
  --sf-accent: #0f172a;
  --sf-badge: #ef4444;
  --sf-success: #10b981;
  --sf-radius: 16px;
  --sf-shadow-sm: 0 1px 2px #0000000a;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji';
  background: var(--sf-bg);
  color: var(--sf-text);
  line-height: 1.45;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font: inherit; }

/* ---------- Sticky header ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: #ffffffeb;
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding: 10px 0;
}
.topbar-inner {
  max-width: 576px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.icon-pill {
  width: 84px;
  height: 42px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 14px;
  border: 1.5px solid var(--sf-accent);
  background: var(--sf-accent);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  box-shadow: 0 10px 22px rgba(7, 11, 31, 0.16);
}
.icon-pill svg { width: 15px; height: 15px; flex-shrink: 0; }
.back-pill {
  width: auto;
  padding: 0 14px 0 10px;
}
.search-box {
  position: relative;
  flex: 1;
  min-width: 0;
}
.search-box svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--sf-text-soft);
}
.search-box .search-field {
  height: 42px;
  width: 100%;
  border-radius: 14px;
  border: 1.5px solid var(--sf-border);
  padding: 0 16px 0 40px;
  color: var(--sf-text-soft);
  background: rgba(0, 0, 0, 0.03);
  font-size: 14.5px;
  display: flex;
  align-items: center;
}
.cart-btn {
  position: relative;
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1.5px solid var(--sf-border);
  background: var(--sf-card);
  color: var(--sf-text);
}
.cart-btn svg { width: 19px; height: 19px; }
.cart-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  border-radius: 999px;
  background: var(--sf-badge);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  border: 1.5px solid #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  line-height: 1;
}

/* ---------- Layout shell ---------- */
.container {
  max-width: 576px;
  margin: 0 auto;
  padding: 24px 16px 40px;
}

/* ---------- Store card ---------- */
.store-card {
  background: #fff;
  border-radius: var(--sf-radius);
  padding: 12px;
  box-shadow: var(--sf-shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.store-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.store-logo {
  width: 44px;
  height: 44px;
  border-radius: 13px;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
  flex-shrink: 0;
  object-fit: cover;
}
.store-name-col { flex: 1; min-width: 0; }
.store-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}
.store-title {
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: -0.1px;
  margin: 0;
}
.store-name-row svg { width: 13px; height: 13px; color: var(--sf-success); flex-shrink: 0; }
.store-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 6px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--sf-text-muted);
}
.status-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  display: inline-block;
}
.dot { color: #d1d5db; }
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  border-radius: 999px;
  background: var(--sf-text);
  color: #fff;
  padding: 6px 9px 6px 7px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.1px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}
.cta-btn .icon-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cta-btn .icon-dot svg { width: 9.5px; height: 9.5px; }

.pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--sf-text);
  color: #fff;
  padding: 10px 20px;
  font-size: 13.5px;
  font-weight: 800;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
}

.badge-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.badge {
  background: rgba(0, 0, 0, 0.025);
  border-radius: 12px;
  padding: 7px 5px;
  text-align: center;
}
.badge .badge-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--sf-text);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
}
.badge .badge-icon svg { width: 13px; height: 13px; stroke-width: 2.2; }
.badge-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--sf-text);
  line-height: 1.15;
}
.badge-sub {
  font-size: 9.5px;
  color: var(--sf-text-muted);
  margin-top: 1px;
}

.store-tabs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  border-bottom: 1px solid rgba(15, 23, 42, 0.1);
  margin-top: 12px;
}
.store-tab {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14.5px;
  font-weight: 900;
  color: var(--sf-text-muted);
  position: relative;
  background: none;
  border: 0;
  cursor: pointer;
  text-decoration: none;
}
.store-tab.active { color: var(--sf-text); }
.store-tab::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  height: 2.5px;
  width: 0;
  background: var(--sf-text);
  border-radius: 2px;
  transition: width 160ms ease;
}
.store-tab.active::after { width: 92px; }

.filter-row {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  border-bottom: 1px solid rgba(15, 23, 42, 0.12);
  scrollbar-width: none;
}
.filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  height: 28px;
  padding: 0 8px;
  font-size: 13.5px;
  color: var(--sf-text-muted);
  font-weight: 700;
  background: none;
  border: 0;
  white-space: nowrap;
  cursor: pointer;
}
.filter-chip.active {
  color: var(--sf-text);
  font-weight: 850;
}
.filter-sep {
  width: 1px;
  height: 12px;
  background: rgba(15, 23, 42, 0.1);
  flex-shrink: 0;
}
.filter-grid-toggle {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
  color: var(--sf-text-muted);
}
.filter-grid-toggle svg { width: 13px; height: 13px; }

/* ---------- Section head ---------- */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  margin-bottom: 10px;
}
.section-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--sf-text);
  letter-spacing: -0.3px;
  margin: 0;
}
.section-count {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--sf-text-muted);
  background: rgba(0, 0, 0, 0.05);
  padding: 2px 8px;
  border-radius: 10px;
}

/* ---------- Product grid ---------- */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 8px;
  row-gap: 12px;
}
.product-card {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 14px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  display: flex;
  flex-direction: column;
}
.product-media {
  position: relative;
  aspect-ratio: 1;
  overflow: hidden;
  background: linear-gradient(135deg, #f8fafc, #eef2ff);
}
.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 700ms ease-out;
}
.product-card:hover .product-media img { transform: scale(1.04); }

.product-hot-tag {
  position: absolute;
  top: 6px;
  left: 6px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9.5px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: #fff;
  background: linear-gradient(135deg, #ef4444 0%, #dc2626 46%, #991b1b 100%);
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(239, 68, 68, 0.34);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.18);
}
.product-hot-tag svg { width: 9px; height: 9px; }

.mini-badges {
  position: absolute;
  bottom: 6px;
  left: 6px;
  display: flex;
  gap: 2px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.86);
  padding: 2px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.7);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.mini-badge {
  width: 58px;
  border-radius: 8px;
  padding: 4px;
  text-align: center;
  background: rgba(15, 23, 42, 0.03);
}
.mini-badge .mini-icon {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sf-success);
  margin: 0 auto 1px;
}
.mini-badge-title {
  font-size: 7px;
  font-weight: 900;
  color: var(--sf-text);
}
.mini-badge-sub {
  font-size: 6px;
  font-weight: 700;
  color: var(--sf-text);
  opacity: 0.75;
}

.product-body {
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.product-tag {
  display: inline-flex;
  align-self: flex-start;
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
  color: #b91c1c;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-radius: 999px;
  padding: 2px 7px;
}
.price-line {
  font-size: 13px;
  font-weight: 800;
  color: var(--sf-text);
  letter-spacing: -0.3px;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price-sub-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: -3px;
}
.discount-pill {
  font-size: 9px;
  font-weight: 800;
  color: #fff;
  background: var(--sf-badge);
  border-radius: 4px;
  padding: 1px 4px;
  line-height: 1.3;
}
.price-old {
  font-size: 10px;
  font-weight: 600;
  color: var(--sf-text-muted);
  text-decoration: line-through;
}
.product-title {
  font-size: 9px;
  font-weight: 600;
  color: var(--sf-text);
  min-height: 25px;
  line-height: 1.375;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8.5px;
  font-weight: 900;
  color: #64748b;
}
.select-btn {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 9px;
  padding: 7px 10px;
  background: var(--sf-text);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}
.select-btn svg { width: 12px; height: 12px; }

/* ---------- Footer ---------- */
.footer-wrap { padding-bottom: 8px; }
.marketplace-card {
  width: 100%;
  margin: 0 auto;
  border-radius: 22px;
  border: 1px solid var(--sf-border);
  background: #fff;
  padding: 12px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}
.marketplace-heading-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.marketplace-heading-row .divider { height: 1px; width: 28px; background: var(--sf-border); }
.marketplace-heading {
  font-size: 13.5px;
  font-weight: 900;
  letter-spacing: -0.2px;
  line-height: 1;
  color: var(--sf-text);
}
.marketplace-buttons {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.marketplace-btn {
  height: 40px;
  border-radius: 16px;
  border: 1px solid var(--sf-border);
  background: #fff;
  box-shadow: 0 3px 10px rgba(15, 23, 42, 0.07);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 1;
  color: var(--sf-text);
}
.marketplace-btn svg { width: 20px; height: 20px; }
.marketplace-btn.full {
  grid-column: 1 / -1;
  justify-self: stretch;
  max-width: calc(50% - 4px);
  margin: 0 auto;
}

.rating-chip-row {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
.rating-chip {
  border-radius: 18px;
  border: 1px solid var(--sf-border);
  background: #fff;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.05);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rating-chip svg { width: 12px; height: 12px; }

.hemat-wrap {
  margin-top: 10px;
  border-top: 1px solid var(--sf-border);
  padding-top: 10px;
}
.hemat-box {
  border-radius: 16px;
  border: 1px solid #a7f3d0;
  background: rgba(236, 253, 245, 0.9);
  padding: 8px 10px;
  box-shadow: 0 6px 16px rgba(16, 185, 129, 0.1);
  text-align: center;
}
.hemat-text {
  font-size: 11.5px;
  font-weight: 900;
  color: var(--sf-text);
}
.hemat-tag {
  display: inline-flex;
  border-radius: 999px;
  background: var(--sf-success);
  color: #fff;
  padding: 2px 6px;
  font-size: 8.5px;
  font-weight: 900;
  margin-left: 4px;
  vertical-align: middle;
}
.hemat-note {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--sf-text-soft);
  margin-top: 2px;
}

.footer-links {
  margin-top: 16px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  column-gap: 12px;
  row-gap: 8px;
  font-size: 12px;
  color: #475569;
}

.socials {
  margin-top: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.socials a {
  width: 32px;
  height: 32px;
  border-radius: 12px;
  box-shadow: 0 5px 14px rgba(15, 23, 42, 0.12);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
}
.socials a svg { width: 17px; height: 17px; }
.social-instagram { background: linear-gradient(135deg, #f59e0b 0%, #ef4444 45%, #a855f7 100%); }
.social-facebook { background: #1877f2; }
.social-whatsapp { background: #25d366; }
.social-threads { background: #0f172a; }

/* ---------- Install toast ---------- */
.install-toast {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translate(-50%, 12px);
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--sf-accent);
  color: #fff;
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 8px 30px #00000024;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease, transform 200ms ease;
  font-size: 0.9rem;
  max-width: calc(100vw - 32px);
}
.install-toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}
.install-toast button {
  border: 0;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 800;
  font-size: 0.83rem;
  cursor: pointer;
}
.install-toast .btn-install { background: #fff; color: var(--sf-accent); }
.install-toast .btn-dismiss { background: transparent; color: #cbd5e1; }

/* ---------- Static content pages (policy/contact) ---------- */
.page-header { margin-bottom: 16px; }
.page-title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--sf-text);
  letter-spacing: -0.3px;
  margin: 0 0 4px;
}
.page-subtitle {
  font-size: 0.9rem;
  color: var(--sf-text-soft);
  margin: 0;
}
.content-card {
  background: #fff;
  border-radius: var(--sf-radius);
  padding: 20px;
  box-shadow: var(--sf-shadow-sm);
  border: 1px solid rgba(0, 0, 0, 0.04);
}
.prose { font-size: 14px; line-height: 1.7; color: var(--sf-text); }
.prose h2 {
  font-size: 15px;
  font-weight: 800;
  color: var(--sf-text);
  margin: 20px 0 8px;
}
.prose h2:first-child { margin-top: 0; }
.prose p { margin: 0 0 12px; color: var(--sf-text-soft); }
.prose ul, .prose ol { margin: 0 0 12px; padding-left: 20px; color: var(--sf-text-soft); }
.prose li { margin-bottom: 6px; }
.prose strong { color: var(--sf-text); }
.prose-updated {
  font-size: 12px;
  color: var(--sf-text-muted);
  margin-bottom: 16px;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 20px;
}
.contact-tile {
  display: flex;
  align-items: center;
  gap: 10px;
  border-radius: 14px;
  border: 1px solid var(--sf-border);
  background: #fff;
  padding: 12px;
  box-shadow: var(--sf-shadow-sm);
}
.contact-tile .contact-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--sf-text);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.contact-tile .contact-icon svg { width: 16px; height: 16px; }
.contact-tile-label { font-size: 10.5px; color: var(--sf-text-muted); font-weight: 600; }
.contact-tile-value { font-size: 13px; font-weight: 700; color: var(--sf-text); }

/* ---------- Scale up gracefully on wider viewports ---------- */
@media (min-width: 640px) {
  .topbar-inner, .container { max-width: 640px; }
}
@media (min-width: 900px) {
  .topbar-inner, .container { max-width: 760px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .contact-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (min-width: 640px) {
  .marketplace-buttons { grid-template-columns: repeat(3, 1fr); }
  .marketplace-btn.full { grid-column: auto; max-width: none; margin: 0; }
}

/* ---------- Tighten footer on very narrow viewports ---------- */
@media (max-width: 359px) {
  .marketplace-card { padding: 10px; border-radius: 18px; }
  .marketplace-buttons { gap: 6px; }
  .marketplace-btn { font-size: 11.5px; padding: 0 6px; }
  .marketplace-btn.full { max-width: calc(50% - 3px); }
  .footer-links { column-gap: 8px; row-gap: 6px; font-size: 11px; }
  .content-card { padding: 14px; }
  .contact-grid { grid-template-columns: 1fr; }
}
