/* ============================================================
   RiscaPreço — Design System 2026
   Flat · Minimal · Inter · Lucide icons
   Desktop: full site layout / Mobile: clean native-feel
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

/* ── Variables ─────────────────────────────────────────────── */
:root {
  --primary:       #DC2626;
  --primary-hover: #B91C1C;
  --primary-light: #FEF2F2;
  --primary-dim:   rgba(220,38,38,.08);
  --accent:        #F97316;
  --success:       #059669;
  --success-light: #ECFDF5;
  --warning:       #D97706;
  --danger:        #DC2626;

  --text:          #0F0F0F;
  --text-2:        #6B7280;
  --text-3:        #9CA3AF;
  --text-inv:      #FFFFFF;

  --bg:            #F9FAFB;
  --bg-card:       #FFFFFF;
  --bg-subtle:     #F3F4F6;

  --border:        #E5E7EB;
  --border-strong: #D1D5DB;
  --border-focus:  #DC2626;

  --font: 'Inter', system-ui, -apple-system, -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: ui-monospace, 'Cascadia Code', monospace;

  --topbar-h:  60px;
  --nav-h:     56px;
  --radius:    8px;
  --radius-sm: 6px;
  --radius-lg: 12px;
  --radius-xl: 16px;

  --shadow-xs: 0 1px 2px rgba(0,0,0,.06);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);

  --transition: 0.15s ease;
  --transition-fast: 0.1s ease;
}

/* ── Reset ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; font-size: inherit; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; }
[data-lucide] { display: inline-block; vertical-align: middle; flex-shrink: 0; }

/* ── Typography ─────────────────────────────────────────────── */
h1, h2, h3, h4 { letter-spacing: -.025em; line-height: 1.25; font-weight: 700; }
.text-xs   { font-size: 11px; }
.text-sm   { font-size: 13px; }
.text-base { font-size: 15px; }
.text-lg   { font-size: 17px; }
.text-xl   { font-size: 20px; }
.text-2xl  { font-size: 24px; }
.text-3xl  { font-size: 30px; }
.font-medium { font-weight: 500; }
.font-semibold { font-weight: 600; }
.font-bold   { font-weight: 700; }
.font-black  { font-weight: 900; }
.text-muted  { color: var(--text-2); }
.text-faint  { color: var(--text-3); }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-center  { text-align: center; }

/* ══════════════════════════════════════════════════════════════
   TOP BAR
   ══════════════════════════════════════════════════════════════ */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  z-index: 100;
  padding: 0 20px;
  gap: 16px;
}

/* Brand / logo */
.topbar__brand {
  display: flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  flex-shrink: 0;
}
.topbar__wordmark {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.04em;
  line-height: 1;
  position: relative;
}
.topbar__wordmark span { color: var(--primary); }
/* The signature risca — a clean diagonal line through "Risca" */
.topbar__wordmark::before {
  content: '';
  position: absolute;
  left: 0;
  right: 56%;  /* covers only "Risca" */
  top: 50%;
  height: 2px;
  background: var(--primary);
  transform: translateY(-50%) rotate(-8deg);
  border-radius: 2px;
  opacity: .65;
}

/* Desktop nav links — hidden on mobile, shown via media query */
.topbar__nav {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: 24px;
}
.topbar__nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-2);
  transition: color var(--transition), background var(--transition);
}
.topbar__nav a:hover { color: var(--text); background: var(--bg-subtle); }
.topbar__nav a.active { color: var(--primary); }

/* Flash nav item */
.topbar__nav a.nav-flash {
  color: var(--primary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* City selector */
.topbar__city {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  cursor: pointer;
  transition: border-color var(--transition), color var(--transition);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}
.topbar__city:hover { border-color: var(--border-strong); color: var(--text); }
.topbar__city [data-lucide] { color: var(--primary); width: 14px; height: 14px; }

/* Right side actions */
.topbar__spacer { flex: 1; }
.topbar__actions { display: flex; align-items: center; gap: 4px; }
.topbar__icon-btn {
  position: relative;
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm);
  color: var(--text-2);
  transition: color var(--transition), background var(--transition);
}
.topbar__icon-btn:hover { color: var(--text); background: var(--bg-subtle); }
.topbar__icon-btn [data-lucide] { width: 20px; height: 20px; }
.topbar__badge {
  position: absolute;
  top: 2px; right: 2px;
  min-width: 15px; height: 15px;
  background: var(--primary);
  color: #fff;
  font-size: 9px;
  font-weight: 700;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 3px;
  border: 1.5px solid var(--bg-card);
}

/* Desktop search in topbar */
.topbar__search {
  flex: 1;
  max-width: 400px;
  display: none; /* shown on desktop */
}
.topbar__search .search-input-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 36px;
  transition: border-color var(--transition);
}
.topbar__search .search-input-inner:focus-within {
  border-color: var(--border-focus);
  background: var(--bg-card);
}
.topbar__search input {
  flex: 1; border: none; outline: none;
  background: none; font-size: 14px; color: var(--text);
}
.topbar__search input::placeholder { color: var(--text-3); }
.topbar__search [data-lucide] { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }

/* ══════════════════════════════════════════════════════════════
   BOTTOM NAV (mobile only)
   ══════════════════════════════════════════════════════════════ */
.bottom-nav {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  /* Height grows to absorb iPhone home indicator area */
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: flex-start; /* items align to top, safe area fills the bottom */
  padding-top: 0;
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 100;
}
.nav-item {
  flex: 1;
  height: var(--nav-h); /* fixed to nav height, not stretching into safe area */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  color: var(--text-3);
  font-size: 10px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--transition-fast);
}
.nav-item [data-lucide] { width: 22px; height: 22px; }
.nav-item.active { color: var(--primary); }
.nav-item--flash {
  color: var(--bg-card);
  background: var(--primary);
  border-radius: 12px;
  margin: -8px 4px 0;
  padding: 8px 12px 10px;
  font-weight: 700;
  font-size: 10px;
  z-index: 1;
  box-shadow: 0 4px 12px rgba(220,38,38,.35);
}
.nav-item--flash [data-lucide] { width: 24px; height: 24px; }

/* ══════════════════════════════════════════════════════════════
   LAYOUT
   ══════════════════════════════════════════════════════════════ */
body {
  padding-top: var(--topbar-h);
}
/* mobile: add bottom nav space */
@media (max-width: 767px) {
  body { padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }
}

.page-wrapper {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}
.page-wrapper--narrow { max-width: 640px; }
.page-wrapper--wide   { max-width: 1440px; }

.section { padding: 32px 0 0; }
.section--sm { padding: 20px 0 0; }

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}
.section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title [data-lucide] { width: 18px; height: 18px; color: var(--primary); }
.section-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--primary);
  display: flex; align-items: center; gap: 2px;
}
.section-link:hover { text-decoration: underline; }
.section-link [data-lucide] { width: 14px; height: 14px; }

/* ══════════════════════════════════════════════════════════════
   SEARCH BAR (standalone, mobile only sticky)
   ══════════════════════════════════════════════════════════════ */
.search-bar {
  padding: 12px 16px;
  background: var(--bg);
  position: sticky;
  top: var(--topbar-h);
  z-index: 50;
}
.search-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 12px;
  height: 40px;
  gap: 8px;
  transition: border-color var(--transition);
}
.search-input-wrap:focus-within { border-color: var(--border-focus); }
.search-input-wrap [data-lucide] { width: 16px; height: 16px; color: var(--text-3); flex-shrink: 0; }
.search-input-wrap input {
  flex: 1; border: none; outline: none;
  background: none; font-size: 14px; color: var(--text);
}
.search-input-wrap input::placeholder { color: var(--text-3); }

/* ══════════════════════════════════════════════════════════════
   BANNER / HERO
   ══════════════════════════════════════════════════════════════ */
.hero-banner {
  background: var(--text);
  color: var(--text-inv);
  padding: 40px 20px;
  position: relative;
  overflow: hidden;
}
.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary) 0%, transparent 60%);
  opacity: .15;
  pointer-events: none;
}
.hero-banner__content { position: relative; z-index: 1; }
.hero-banner__label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--primary);
  margin-bottom: 8px;
  display: flex; align-items: center; gap: 6px;
}
.hero-banner__label [data-lucide] { width: 14px; height: 14px; }
.hero-banner__title { font-size: clamp(22px, 4vw, 40px); font-weight: 800; letter-spacing: -.04em; line-height: 1.1; margin-bottom: 8px; }
.hero-banner__city { font-size: 14px; color: rgba(255,255,255,.6); }

/* Carousel */
.carousel {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: 12px;
  padding: 16px 20px;
}
.carousel::-webkit-scrollbar { display: none; }
.carousel-slide {
  scroll-snap-align: start;
  flex-shrink: 0;
  width: calc(100vw - 64px);
  max-width: 560px;
  height: 180px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
}
.carousel-slide img { width: 100%; height: 100%; object-fit: cover; }
.carousel-slide__overlay {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(0,0,0,.7));
  display: flex; align-items: flex-end;
  padding: 16px;
  color: #fff;
}
.carousel-slide__title { font-size: 15px; font-weight: 600; line-height: 1.3; }
.carousel-dots { display: flex; justify-content: center; gap: 4px; padding: 0 0 8px; }
.carousel-dots span {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--border-strong);
  transition: all var(--transition);
}
.carousel-dots span.active { background: var(--primary); width: 16px; border-radius: 3px; }

/* ══════════════════════════════════════════════════════════════
   CATEGORY PILLS
   ══════════════════════════════════════════════════════════════ */
.cat-pills {
  display: flex;
  overflow-x: auto;
  gap: 6px;
  padding: 0 20px 4px;
  scrollbar-width: none;
}
.cat-pills::-webkit-scrollbar { display: none; }
.cat-pill {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-2);
  white-space: nowrap;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.cat-pill [data-lucide] { width: 14px; height: 14px; }
.cat-pill:hover { border-color: var(--border-strong); color: var(--text); }
.cat-pill.active { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* ══════════════════════════════════════════════════════════════
   PRODUCT CARDS
   ══════════════════════════════════════════════════════════════ */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--border);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.cards-row {
  display: flex;
  overflow-x: auto;
  gap: 12px;
  padding: 0 20px 8px;
  scrollbar-width: none;
}
.cards-row::-webkit-scrollbar { display: none; }
.cards-row .card { flex-shrink: 0; width: 160px; border-radius: var(--radius); border: 1px solid var(--border); }

.card {
  background: var(--bg-card);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--transition-fast);
}
/* In grid: no individual border radius — handled by parent */
.cards-grid .card { border-radius: 0; }
/* In grid, corners */
.cards-grid .card:first-child     { border-radius: var(--radius-lg) 0 0 0; }
.cards-grid .card:nth-child(2)    { border-radius: 0 var(--radius-lg) 0 0; }
.cards-grid .card:nth-last-child(1):nth-child(odd) { border-radius: 0 0 0 var(--radius-lg); }
.cards-grid .card:last-child      { border-radius: 0 0 var(--radius-lg) 0; }
.cards-grid .card:nth-last-child(1):nth-child(odd) ~ .card:last-child { border-radius: 0; }

.card:hover { background: var(--bg-subtle); }

.card__img {
  position: relative;
  width: 100%;
  padding-top: 66.66%;
  background: var(--bg-subtle);
  overflow: hidden;
}
.card__img img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s ease;
}
.card:hover .card__img img { transform: scale(1.02); }
.card__img--placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-subtle);
}
.card__img--placeholder [data-lucide] { width: 32px; height: 32px; color: var(--text-3); }

/* Discount badge */
.card__badge {
  position: absolute;
  top: 8px; right: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: .01em;
}
.card__badge--flash {
  top: 8px; left: 8px;
  right: auto;
  background: var(--text);
  display: flex; align-items: center; gap: 3px;
}
.card__badge--flash [data-lucide] { width: 10px; height: 10px; }
.card__badge--clearance {
  background: var(--accent);
}

.card__body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card__price-row { display: flex; align-items: baseline; gap: 6px; margin-top: 4px; }
.card__price-app {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -.02em;
}
.card__price-store {
  font-size: 12px;
  color: var(--text-3);
  text-decoration: line-through;
}
.card__seller { font-size: 11px; color: var(--text-3); margin-top: 2px; }
.card__delivery {
  margin-top: auto;
  padding-top: 8px;
  font-size: 11px;
  color: var(--text-3);
  display: flex; align-items: center; gap: 4px;
  border-top: 1px solid var(--border);
}
.card__delivery [data-lucide] { width: 12px; height: 12px; color: var(--text-3); }
.card__delivery .free { color: var(--success); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   FLASH / COUNTDOWN
   ══════════════════════════════════════════════════════════════ */
.flash-header {
  background: var(--text);
  color: #fff;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.flash-header__title {
  display: flex; align-items: center; gap: 8px;
  font-size: 16px; font-weight: 700;
}
.flash-header__title [data-lucide] { width: 18px; height: 18px; color: var(--primary); }
.countdown { display: flex; align-items: center; gap: 4px; }
.countdown-unit {
  background: rgba(255,255,255,.12);
  border-radius: 4px;
  padding: 2px 6px;
  text-align: center;
  min-width: 30px;
}
.countdown-unit strong { display: block; font-size: 16px; font-weight: 800; line-height: 1.1; }
.countdown-unit span   { display: block; font-size: 9px; color: rgba(255,255,255,.5); text-transform: uppercase; }
.countdown-sep { font-size: 14px; font-weight: 700; color: rgba(255,255,255,.5); margin-bottom: 8px; }

.stock-bar { height: 3px; background: var(--border); border-radius: 2px; overflow: hidden; margin-top: 6px; }
.stock-bar__fill { height: 100%; background: var(--primary); border-radius: 2px; transition: width 1s; }
.stock-label { font-size: 11px; color: var(--primary); font-weight: 600; }

/* ══════════════════════════════════════════════════════════════
   PRICE / DISCOUNT DISPLAY (brand signature)
   ══════════════════════════════════════════════════════════════ */
.price-block { margin: 16px 0; }
.price-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}
.price-app {
  font-size: 32px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -.04em;
  line-height: 1;
}
.price-app .currency { font-size: 18px; font-weight: 600; vertical-align: super; letter-spacing: 0; }
.price-store {
  font-size: 16px;
  color: var(--text-3);
  text-decoration: line-through;
  text-decoration-color: var(--text-3);
  text-decoration-thickness: 1.5px;
}
.discount-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--primary-dim);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 4px;
}
.discount-tag [data-lucide] { width: 13px; height: 13px; }
.saving-text {
  font-size: 13px;
  color: var(--text-2);
  margin-top: 4px;
}
.saving-text strong { color: var(--success); }

/* ══════════════════════════════════════════════════════════════
   SELLER CARD
   ══════════════════════════════════════════════════════════════ */
.seller-card {
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  transition: border-color var(--transition);
  -webkit-tap-highlight-color: transparent;
}
.seller-card:hover { border-color: var(--border-strong); }
.seller-card__logo {
  width: 48px; height: 48px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  border: 1px solid var(--border);
}
.seller-card__logo img { width: 100%; height: 100%; object-fit: cover; }
.seller-card__logo [data-lucide] { width: 22px; height: 22px; color: var(--text-3); }
.seller-card__info { flex: 1; min-width: 0; }
.seller-card__name { font-size: 14px; font-weight: 600; }
.seller-card__meta { font-size: 12px; color: var(--text-2); margin-top: 1px; }
.seller-card__badges { display: flex; gap: 4px; margin-top: 5px; flex-wrap: wrap; }

/* Chips / tags */
.chip {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 11px; font-weight: 600;
  padding: 2px 7px;
  border-radius: 4px;
  line-height: 1.5;
}
.chip [data-lucide] { width: 10px; height: 10px; }
.chip--open     { background: var(--success-light); color: var(--success); }
.chip--closed   { background: var(--bg-subtle); color: var(--text-3); }
.chip--verified { background: #EFF6FF; color: #1D4ED8; }
.chip--founder  { background: #FFF7ED; color: #C2410C; }
.chip--flash    { background: var(--primary-dim); color: var(--primary); }
.status-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.status-dot--open   { background: var(--success); }
.status-dot--closed { background: var(--text-3); }

/* ══════════════════════════════════════════════════════════════
   PRODUCT DETAIL
   ══════════════════════════════════════════════════════════════ */
.detail-img-wrap {
  position: relative;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}
.detail-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
}
.detail-back-btn {
  position: absolute; top: 12px; left: 12px;
  width: 34px; height: 34px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text);
  cursor: pointer;
  transition: background var(--transition);
}
.detail-back-btn:hover { background: var(--bg-subtle); }
.detail-back-btn [data-lucide] { width: 16px; height: 16px; }

.detail-body { padding: 20px; }
.detail-name { font-size: 22px; font-weight: 700; letter-spacing: -.03em; margin-bottom: 4px; }

.detail-info-row {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; color: var(--text-2);
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.detail-info-row [data-lucide] { width: 15px; height: 15px; color: var(--text-3); flex-shrink: 0; }
.detail-info-row .label { font-weight: 600; color: var(--text); min-width: 80px; }

/* Quantity */
.qty-selector { display: flex; align-items: center; gap: 10px; }
.qty-btn {
  width: 34px; height: 34px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 600; color: var(--text);
  transition: background var(--transition), border-color var(--transition);
}
.qty-btn:hover { border-color: var(--border-strong); background: var(--bg); }
.qty-val { font-size: 17px; font-weight: 700; min-width: 24px; text-align: center; }

/* ══════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: all var(--transition);
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  border: 1px solid transparent;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .4; pointer-events: none; }
.btn [data-lucide] { width: 15px; height: 15px; }

.btn--primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn--primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }

.btn--outline { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn--outline:hover { border-color: var(--text); }

.btn--ghost { background: transparent; color: var(--text-2); border-color: transparent; padding: 10px; }
.btn--ghost:hover { background: var(--bg-subtle); color: var(--text); }

.btn--success { background: #25D366; color: #fff; border-color: #25D366; }
.btn--success:hover { background: #128C7E; border-color: #128C7E; }

.btn--full { width: 100%; }
.btn--sm { padding: 6px 12px; font-size: 12px; }
.btn--lg { padding: 13px 24px; font-size: 15px; }
.btn--xl { padding: 15px 28px; font-size: 16px; }

/* Add to cart button */
.btn-add-cart {
  width: 100%;
  background: var(--text);
  color: #fff;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background var(--transition), transform var(--transition-fast);
  border: 1px solid var(--text);
}
.btn-add-cart:hover { background: #222; }
.btn-add-cart:active { transform: scale(.99); }
.btn-add-cart [data-lucide] { width: 18px; height: 18px; }

/* WhatsApp CTA */
.btn-checkout {
  width: 100%;
  background: #25D366;
  color: #fff;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  border: none;
  transition: background var(--transition);
}
.btn-checkout:hover { background: #1da851; }
.btn-checkout [data-lucide] { width: 18px; height: 18px; }

/* ══════════════════════════════════════════════════════════════
   FORMS
   ══════════════════════════════════════════════════════════════ */
.form-group { margin-bottom: 16px; }
.form-label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .04em; }
.form-input, .form-select, .form-textarea {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--border-focus); }
.form-input::placeholder, .form-textarea::placeholder { color: var(--text-3); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-hint  { font-size: 12px; color: var(--text-3); margin-top: 4px; }
.form-error { font-size: 12px; color: var(--primary); margin-top: 4px; }

.discount-preview {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  margin-top: 8px;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 6px;
  color: var(--text-2);
}
.discount-preview [data-lucide] { width: 14px; height: 14px; }
.discount-preview.ok    { border-color: var(--success); color: var(--success); background: var(--success-light); }
.discount-preview.error { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }

/* Payment options */
.payment-option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--transition);
}
.payment-option.selected { border-color: var(--text); }
.payment-option input { display: none; }
.payment-option [data-lucide] { width: 18px; height: 18px; color: var(--text-3); }
.payment-option__label { font-size: 14px; font-weight: 500; }

/* ══════════════════════════════════════════════════════════════
   CART
   ══════════════════════════════════════════════════════════════ */
.cart-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.cart-item__img {
  width: 64px; height: 64px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-subtle);
  display: flex; align-items: center; justify-content: center;
}
.cart-item__img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item__img [data-lucide] { width: 24px; height: 24px; color: var(--text-3); }
.cart-item__info { flex: 1; }
.cart-item__name { font-size: 14px; font-weight: 600; margin-bottom: 2px; }
.cart-item__price { font-size: 15px; font-weight: 700; }
.cart-item__store-price { font-size: 11px; color: var(--text-3); text-decoration: line-through; }

.cart-summary {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 16px;
}
.summary-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 6px 0; font-size: 14px; color: var(--text-2);
}
.summary-row strong { color: var(--text); }
.summary-row--total {
  font-size: 16px; font-weight: 700;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin-top: 8px; padding-top: 10px;
}
.summary-row .saving { color: var(--success); font-weight: 700; }

/* ══════════════════════════════════════════════════════════════
   MODALS / SHEETS
   ══════════════════════════════════════════════════════════════ */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 200;
  display: flex; align-items: flex-end;
  opacity: 0; pointer-events: none;
  transition: opacity .2s;
  backdrop-filter: blur(2px);
}
.overlay.open { opacity: 1; pointer-events: all; }
.sheet {
  width: 100%;
  background: var(--bg-card);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 20px 20px calc(20px + env(safe-area-inset-bottom));
  max-height: 82vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform .28s cubic-bezier(.4,0,.2,1);
}
.overlay.open .sheet { transform: translateY(0); }
.sheet__handle {
  width: 32px; height: 4px;
  background: var(--border-strong);
  border-radius: 2px;
  margin: 0 auto 16px;
}
.sheet__title { font-size: 17px; font-weight: 700; margin-bottom: 14px; }

/* Toast */
.toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  left: 16px; right: 16px;
  background: var(--text);
  color: #fff;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  z-index: 300;
  transform: translateY(120%);
  transition: transform .25s cubic-bezier(.4,0,.2,1);
  display: flex; align-items: center; gap: 8px;
  box-shadow: var(--shadow);
  max-width: 480px;
}
.toast.show { transform: translateY(0); }
.toast--success { background: var(--success); }
.toast--error   { background: var(--primary); }
.toast [data-lucide] { width: 16px; height: 16px; }

/* ══════════════════════════════════════════════════════════════
   ORDERS / STATUS
   ══════════════════════════════════════════════════════════════ */
.order-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
}
.order-status {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 4px;
  text-transform: uppercase; letter-spacing: .04em;
}
.order-status [data-lucide] { width: 10px; height: 10px; }
.order-status--sent       { background: #EFF6FF; color: #1D4ED8; }
.order-status--confirmed  { background: var(--success-light); color: var(--success); }
.order-status--delivering { background: #FFF7ED; color: #C2410C; }
.order-status--completed  { background: var(--success-light); color: var(--success); }
.order-status--cancelled  { background: var(--primary-light); color: var(--primary); }
.order-status--expired    { background: var(--bg-subtle); color: var(--text-3); }

/* ══════════════════════════════════════════════════════════════
   EMPTY STATE
   ══════════════════════════════════════════════════════════════ */
.empty-state {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; padding: 56px 24px; text-align: center;
}
.empty-state__icon {
  width: 56px; height: 56px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 16px;
}
.empty-state__icon [data-lucide] { width: 24px; height: 24px; color: var(--text-3); }
.empty-state__title { font-size: 17px; font-weight: 700; margin-bottom: 6px; }
.empty-state__text { font-size: 14px; color: var(--text-2); line-height: 1.6; max-width: 280px; }

/* ══════════════════════════════════════════════════════════════
   SWITCH / TOGGLE
   ══════════════════════════════════════════════════════════════ */
.switch { position: relative; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch__track {
  position: absolute; inset: 0;
  background: var(--border-strong); border-radius: 12px;
  transition: background .2s; cursor: pointer;
}
.switch input:checked + .switch__track { background: var(--success); }
.switch__thumb {
  position: absolute; top: 2px; left: 2px;
  width: 20px; height: 20px;
  background: #fff; border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
  transition: transform .2s; pointer-events: none;
}
.switch input:checked ~ .switch__thumb { transform: translateX(20px); }

/* ══════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════ */
.tabs {
  display: flex; overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border);
  background: var(--bg-card);
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex-shrink: 0; padding: 12px 16px;
  font-size: 13px; font-weight: 600;
  color: var(--text-3);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
  cursor: pointer; white-space: nowrap;
}
.tab.active { color: var(--text); border-bottom-color: var(--text); }

/* ══════════════════════════════════════════════════════════════
   AUTH / OTP
   ══════════════════════════════════════════════════════════════ */
.otp-inputs { display: flex; gap: 8px; justify-content: center; }
.otp-input {
  width: 44px; height: 52px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 20px; font-weight: 700;
  text-align: center; outline: none;
  transition: border-color var(--transition);
  background: var(--bg-card);
  color: var(--text);
}
.otp-input:focus { border-color: var(--border-focus); }

/* ══════════════════════════════════════════════════════════════
   SKELETON LOADERS
   ══════════════════════════════════════════════════════════════ */
@keyframes shimmer {
  from { background-position: -200% 0; }
  to   { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--bg-subtle) 25%, var(--bg) 50%, var(--bg-subtle) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}

/* ══════════════════════════════════════════════════════════════
   PWA INSTALL BANNER
   ══════════════════════════════════════════════════════════════ */
.install-banner {
  position: fixed;
  bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom));
  left: 16px; right: 16px;
  background: var(--text);
  color: #fff;
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  z-index: 150;
  transform: translateY(140%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--shadow);
  max-width: 480px;
}
.install-banner.show { transform: translateY(0); }
.install-banner [data-lucide] { width: 20px; height: 20px; color: rgba(255,255,255,.6); flex-shrink: 0; }
.install-banner__text { flex: 1; }
.install-banner__text strong { font-size: 13px; font-weight: 700; display: block; }
.install-banner__text span   { font-size: 12px; color: rgba(255,255,255,.6); }
.install-banner .btn--outline { border-color: rgba(255,255,255,.3); color: #fff; font-size: 12px; padding: 6px 12px; }
.install-banner .btn--close   { padding: 4px; color: rgba(255,255,255,.5); }

/* ══════════════════════════════════════════════════════════════
   DIVIDERS / UTILS
   ══════════════════════════════════════════════════════════════ */
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.spacer  { height: 16px; }
.spacer--lg { height: 32px; }
.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; }
.p-16  { padding: 16px; }
.p-20  { padding: 20px; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.flex   { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — MOBILE ADJUSTMENTS
   ══════════════════════════════════════════════════════════════ */
@media (max-width: 767px) {
  /* Topbar compacto: sem nav links, city só com ícone, 2 ícones no máximo */
  .topbar { padding: 0 14px; gap: 6px; }
  .topbar__spacer { min-width: 0; }

  /* City: mostra só o pin, sem texto */
  .topbar__city-label { display: none; }
  .topbar__city { padding: 7px; max-width: none; min-width: 0; gap: 0; border-radius: var(--radius-sm); }

  /* Favoritos e Perfil ficam no bottom nav — ocultar do topbar */
  .topbar__icon-btn--desktop-only { display: none; }

  /* Install banner: full-width */
  .install-banner { left: 12px; right: 12px; max-width: none; }
}

/* ══════════════════════════════════════════════════════════════
   RESPONSIVE — DESKTOP
   ══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  /* Show desktop search in topbar */
  .topbar__search { display: flex; }

  /* Hide mobile bottom nav */
  .bottom-nav { display: none !important; }
  body { padding-bottom: 0; }

  /* Show desktop nav links */
  .topbar__nav { display: flex; }

  /* Hide mobile-only search bar page element */
  .search-bar--mobile-only { display: none; }

  /* Install banner: centered */
  .install-banner {
    left: 50%; right: auto;
    transform: translateX(-50%) translateY(140%);
    bottom: 24px;
  }
  .install-banner.show { transform: translateX(-50%) translateY(0); }

  /* Page content has more breathing room */
  .section { padding: 40px 0 0; }
  .section-title { font-size: 20px; }

  /* Cards grid: more columns on desktop */
  .cards-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Row scroll → wrap on desktop */
  .cards-row { flex-wrap: wrap; padding: 0; gap: 1px; }
  .cards-row .card {
    width: auto;
    flex: none;
    flex-basis: calc(25% - 1px);
    border-radius: 0;
    border: none;
    border-right: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
  }

  /* Seller detail page: 2-column layout */
  .detail-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    align-items: start;
  }
  .detail-img { aspect-ratio: 1/1; border-radius: var(--radius-lg); border: 1px solid var(--border); }

  /* Carousel: show more slides */
  .carousel-slide { width: 380px; height: 200px; }

  /* Flash header: wider */
  .flash-header { padding: 20px 0; }

  /* Toast: bottom-center, not full-width */
  .toast {
    left: 50%;
    right: auto;
    transform: translateX(-50%) translateY(120%);
    min-width: 320px;
    bottom: 24px;
  }
  .toast.show { transform: translateX(-50%) translateY(0); }
}

@media (min-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(5, 1fr); }
  .topbar { padding: 0 32px; }
}

/* ── City picker option ─────────────────────────────────────── */
.city-option {
  width: 100%;
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500;
  color: var(--text);
  background: var(--bg-card);
  border: 1px solid var(--border);
  cursor: pointer; text-align: left;
  margin-bottom: 6px;
  transition: border-color var(--transition), background var(--transition);
}
.city-option:hover { border-color: var(--border-strong); }
.city-option.active {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}

/* ── Scrollbar ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-3); }
