/* ============================================================
   FRANCIS ELETRÔNICOS — CLIENT SHOWCASE (CATÁLOGO)
   Dark Black Premium — Bordas Douradas — Mobile-First
   v3 — Refinamento Estético Premium
   ============================================================ */

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

/* ── Design Tokens (Dark Black + Gold) ──────────────────────── */
:root {
  /* Fundos */
  --bg-base:       #080808;
  --bg-deep:       #050505;
  --bg-card:       rgba(255, 255, 255, 0.045);
  --bg-card-h:     rgba(255, 255, 255, 0.075);
  --bg-header:     rgba(8, 8, 8, 0.96);
  --bg-modal:      #0e0e0e;

  /* Dourado (extraído da logo) */
  --gold-1:        #C9A84C;
  --gold-2:        #E2B96F;
  --gold-3:        #F0CF8A;
  --gold-dim:      rgba(201, 168, 76, 0.18);
  --gold-glow:     rgba(201, 168, 76, 0.28);
  --gold-border:   rgba(201, 168, 76, 0.35);
  --gold-grad:     linear-gradient(135deg, #C9A84C 0%, #F0CF8A 50%, #C9A84C 100%);

  /* Bordas */
  --border:        rgba(201, 168, 76, 0.2);
  --border-light:  rgba(201, 168, 76, 0.1);
  --border-white:  rgba(255, 255, 255, 0.08);

  /* Texto */
  --text-1:        #ffffff;
  --text-2:        rgba(255, 255, 255, 0.6);
  --text-3:        rgba(255, 255, 255, 0.3);

  /* Status */
  --sold-bg:       rgba(248, 113, 113, 0.85);
  --sold-text:     #ffffff;
  --green-wa:      #25d366;
  --green-wa-glow: rgba(37, 211, 102, 0.32);

  /* Raios */
  --r-sm:   10px;
  --r-md:   14px;
  --r-lg:   20px;
  --r-xl:   26px;
  --r-2xl:  32px;

  /* Sombras */
  --shadow-card:  0 2px 20px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(201,168,76,0.06);
  --shadow-modal: 0 -8px 48px rgba(0, 0, 0, 0.8);
  --shadow-btn:   0 6px 28px rgba(37, 211, 102, 0.38);
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --trans:        all 0.26s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after {
  margin: 0; padding: 0;
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Display', sans-serif;
  background-color: var(--bg-base);
  color: var(--text-1);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  /* Foto da loja como background fixo */
  background-image:
    linear-gradient(to bottom,
      rgba(8,8,8,0.88) 0%,
      rgba(8,8,8,0.75) 40%,
      rgba(8,8,8,0.82) 100%
    ),
    url('./back-catag-opt.jpg');
  background-size: cover;
  background-position: center top;
  background-attachment: scroll;
  background-repeat: no-repeat;
}

body.no-scroll { overflow: hidden; }

/* ── Loading Screen ─────────────────────────────────────────── */
#loadingScreen {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  gap: 28px;
}

.loading-logo {
  width: 130px;
  height: auto;
  animation: breathe 2s ease-in-out infinite;
  filter: brightness(1.05);
}

@keyframes breathe {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%       { transform: scale(0.96); opacity: 0.75; }
}

.loading-ring {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(201, 168, 76, 0.2);
  border-top-color: var(--gold-1);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.loading-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.3px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── Header ───────────────────────────────────────────────────── */
.app-header {
  position: sticky;
  top: 0;
  z-index: 150;
  background: rgba(6, 6, 6, 0.92);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top, 0);
  overflow: visible;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px 16px;
  position: relative;
}

/* Wave SVG decorativa no rodapé do header */
.header-inner::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 0;
  right: 0;
  height: 12px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 12' preserveAspectRatio='none'%3E%3Cpath d='M0,6 C50,0 100,12 150,6 C200,0 250,12 300,6 C350,0 400,12 400,6 L400,12 L0,12 Z' fill='%23C9A84C' opacity='0.07'/%3E%3Cpath d='M0,9 C60,3 120,15 180,9 C240,3 300,15 360,9 C380,6 400,10 400,9 L400,12 L0,12 Z' fill='%23C9A84C' opacity='0.04'/%3E%3C/svg%3E") no-repeat center;
  background-size: 100% 100%;
  pointer-events: none;
  z-index: 1;
}

/* Brand: logo + divisor + slogan */
.header-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-logo {
  height: 38px;
  object-fit: contain;
  filter: brightness(1.05);
  flex-shrink: 0;
}

.header-divider {
  width: 1px;
  height: 32px;
  background: linear-gradient(to bottom, transparent, var(--gold-1), transparent);
  flex-shrink: 0;
  opacity: 0.6;
}

.header-slogan {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.slogan-line1 {
  font-size: 15px;
  font-weight: 900;
  color: var(--gold-2);
  letter-spacing: 3px;
  text-transform: uppercase;
  line-height: 1;
}

.slogan-line2 {
  font-size: 11px;
  font-weight: 500;
  color: var(--gold-1);
  letter-spacing: 2.5px;
  text-transform: uppercase;
  line-height: 1;
  opacity: 0.8;
}

/* ── Category Tabs ──────────────────────────────────────────── */
.cat-bar {
  background: rgba(8, 8, 8, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}

.cat-bar::-webkit-scrollbar { display: none; }

.cat-track {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  min-width: 100%;
}

.cat-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border: 1px solid var(--gold-border);
  border-radius: 8px;
  background: rgba(201, 168, 76, 0.04);
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--trans);
  user-select: none;
  -webkit-user-select: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.cat-tab .cat-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  transition: var(--trans);
}

.cat-tab.active {
  background: var(--gold-tab, var(--gold-1));
  border-color: transparent;
  color: #0a0a0a;
  font-weight: 800;
  box-shadow: 0 4px 18px var(--gold-glow), 0 0 0 1px rgba(201,168,76,0.3);
}

.cat-tab.active .cat-icon {
  stroke: #0a0a0a;
}

.cat-tab:active:not(.active) {
  background: var(--gold-dim);
  color: var(--gold-2);
}

/* ── Main Content ────────────────────────────────────────────────── */
.app-main {
  padding: 20px 14px;
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 40px);
}

/* ── Products Grid ───────────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

/* ── Product Card ───────────────────────────────────────────── */
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.26s var(--ease), box-shadow 0.26s var(--ease);
  animation: cardIn 0.36s var(--ease) both;
  -webkit-tap-highlight-color: transparent;
  isolation: isolate;
}

/* Desktop: card flutua ao passar o mouse — sinaliza clickabilidade */
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.07);
  will-change: transform;
}

/* Mobile/Desktop: feedback tátil ao pressionar — feel nativo */
.product-card:active {
  transform: scale(0.965);
  filter: brightness(1.12);
  transition: transform 0.08s ease, filter 0.08s ease;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Card Image */
.card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  /* border-radius no wrap = clipping correto em WebKit mesmo com transform ativo */
  border-radius: var(--r-md) var(--r-md) 0 0;
}

.card-img-wrap.no-img::after {
  content: '📱';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 48px;
}

/* Zoom suave na imagem ao hover do card (desktop) */
.product-card:hover .card-img {
  transform: scale(1.04);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s var(--ease);
}

.product-card.is-sold .card-img {
  filter: grayscale(40%) brightness(0.8);
}

/* Sold badge */
.badge-sold {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--sold-bg);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: var(--sold-text);
  font-size: 9px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
}

/* Battery badge */
.badge-battery {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(201, 168, 76, 0.25);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 20px;
}

/* Card Body */
.card-body {
  padding: 14px 14px 16px;
  background: rgba(8, 8, 8, 0.93);
}

.card-cat {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-1);
  text-transform: uppercase;
  letter-spacing: 0.9px;
  margin-bottom: 4px;
}

.card-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-1);
  line-height: 1.3;
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.2px;
}

.card-specs {
  font-size: 11px;
  color: var(--text-3);
  margin-bottom: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Preço do card — dourado, peso máximo */
.card-price {
  font-size: 17px;
  font-weight: 900;
  color: var(--gold-2);
  letter-spacing: -0.4px;
}

/* ── Hero Card (Oportunidade) — split: foto | info ────────── */
/* Glow pulsante aplicado diretamente no .hero-card — box-shadow segue o border-radius do elemento */
@keyframes heroGlowBox {
  0%, 100% {
    box-shadow:
      0 0 0px  0px  rgba(201,168,76,0),
      0 4px 20px    rgba(0,0,0,0.45);
  }
  50% {
    box-shadow:
      0 0 18px  5px  rgba(201,168,76,0.46),
      0 0 36px  8px  rgba(201,168,76,0.14),
      0 4px 20px     rgba(0,0,0,0.5);
  }
}

@keyframes badgePulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.78; }
}

/* Carousel wrapper — ocupa coluna inteira da grid */
.hero-carousel {
  grid-column: 1 / -1;
  margin-bottom: 4px;
  /* Padding vertical para o drop-shadow do card não ser cortado */
  padding: 6px 0 6px;
}

.hero-track {
  display: flex;
  overflow-x: scroll;
  overflow-y: visible; /* não clipa o drop-shadow vertical */
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  overscroll-behavior-x: contain;
  gap: 10px;
  width: 100%;
  /* Padding lateral para o drop-shadow lateral não ser clipado */
  padding: 2px 1px;
}

.hero-track::-webkit-scrollbar { display: none; }

/* Modo multi: cada card ocupa 100% — 1 por vez */
.hero-track.multi .hero-card {
  width: 100%;
}

.hero-track.multi {
  padding-right: 0;
}

.hero-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 8px;
}

.hero-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  transition: background 0.3s ease, transform 0.3s ease;
  flex-shrink: 0;
}

.hero-dot.active {
  background: var(--gold-1);
  transform: scale(1.4);
}

.hero-card {
  flex-shrink: 0;
  width: 100%;
  scroll-snap-align: start;
  display: flex;
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(201, 168, 76, 0.35);
  background: rgba(8, 8, 8, 0.93);
  cursor: pointer;
  isolation: isolate;
  /* heroGlowBox no card direto: box-shadow segue o border-radius 16px sem clipping */
  animation: cardIn 0.35s ease both, heroGlowBox 2.4s ease-in-out 0.4s infinite;
  min-height: 175px;
  transition: transform 0.18s ease, border-color 0.6s ease;
  position: relative;
}

/* ::before removido — glow migrou para box-shadow direto no .hero-card (heroGlowBox) */
/* box-shadow no elemento pai SEMPRE respeita seu border-radius — sem clipping quadriculado */

.hero-card:active {
  transform: scale(0.983);
}

/* Brilho da borda pulsa junto com o ::before */
.hero-card:hover { border-color: rgba(201,168,76,0.6); }

@media (hover: hover) {
  .hero-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(201,168,76,0.12), 0 4px 20px rgba(0,0,0,0.5);
  }
}

.hero-img-wrap {
  width: 44%;
  flex-shrink: 0;
  overflow: hidden;
  position: relative;
  z-index: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-img-placeholder {
  width: 100%;
  height: 100%;
  background: rgba(255,255,255,0.04);
}

.hero-body {
  flex: 1;
  padding: 14px 14px 14px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 2px;
  overflow: hidden;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: linear-gradient(135deg, #C9A84C, #e8c96a);
  color: #000;
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 4px;
  width: fit-content;
  margin-bottom: 0;
  animation: badgePulse 2.2s ease-in-out 0.5s infinite;
}

.hero-cat {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-1);
  text-transform: uppercase;
  letter-spacing: 0.9px;
}

.hero-title {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-1);
  line-height: 1.25;
  letter-spacing: -0.2px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-specs {
  font-size: 10px;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-warranty {
  font-size: 10px;
  color: var(--text-3);
}

.hero-price {
  font-size: 16px;
  font-weight: 900;
  color: var(--gold-2);
  letter-spacing: -0.4px;
}

.hero-price-from {
  font-size: 11px;
  color: var(--text-3);
  text-decoration: line-through;
  opacity: 0.7;
}

.hero-avista {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-3);
}

.hero-installment {
  font-size: 10px;
  color: var(--text-3);
}

.hero-cta {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-1);
  letter-spacing: 0.02em;
}

/* ── Hero Banner (imagem promocional full-width no carousel) ──── */
.hero-banner {
  flex-shrink: 0;
  width: 100%;
  scroll-snap-align: start;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid rgba(201, 168, 76, 0.35);
  /* Mesmo glow pulsante do hero-card */
  animation: cardIn 0.35s ease both, heroGlowBox 2.4s ease-in-out 0.4s infinite;
  transition: transform 0.18s ease, border-color 0.6s ease;
  isolation: isolate;
}

.hero-banner:active { transform: scale(0.983); }

@media (hover: hover) {
  .hero-banner:hover {
    transform: translateY(-2px);
    border-color: rgba(201, 168, 76, 0.6);
  }
}

.hero-banner-img {
  width: 100%;
  height: auto;
  display: block;
  object-fit: cover;
}

/* Badge de Oportunidade nos cards regulares */
.badge-opportunity {
  position: absolute;
  top: 8px;
  left: 8px;
  background: linear-gradient(135deg, #C9A84C, #e8c96a);
  color: #000;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  padding: 3px 7px;
  border-radius: 4px;
  z-index: 2;
}

/* Preço riscado nos cards regulares */
.card-price-from {
  font-size: 11px;
  color: var(--text-3);
  text-decoration: line-through;
  opacity: 0.7;
  margin-bottom: 1px;
}

/* ── Empty State ─────────────────────────────────────────────── */
#emptyState {
  grid-column: 1 / -1;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 64px 20px;
  text-align: center;
  gap: 10px;
}

#emptyState.show { display: flex; }

.empty-icon  { font-size: 60px; }
.empty-title { font-size: 18px; font-weight: 800; color: var(--text-1); }
.empty-sub   { font-size: 14px; color: var(--text-3); }

/* ── Section Header (contador de produtos) ───────────────────── */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-header::before,
.section-header::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
}

.section-count {
  font-size: 10px;
  font-weight: 700;
  color: var(--gold-1);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  white-space: nowrap;
  opacity: 0.8;
}

/* ── Update Toast (PWA) ─────────────────────────────────── */
#updateToast {
  position: fixed;
  top: calc(env(safe-area-inset-top, 0px) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-100px);
  z-index: 800;
  background: rgba(10, 10, 10, 0.96);
  border: 1px solid var(--gold-border);
  border-radius: 14px;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.6), 0 0 0 1px rgba(201,168,76,0.15);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
  white-space: nowrap;
}

#updateToast.show {
  transform: translateX(-50%) translateY(0);
}

.update-toast-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-1);
  letter-spacing: 0.1px;
}

.update-toast-btn {
  font-size: 12px;
  font-weight: 800;
  color: #0a0a0a;
  background: var(--gold-grad);
  border: none;
  border-radius: 8px;
  padding: 6px 14px;
  cursor: pointer;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  transition: var(--trans);
  font-family: 'Inter', sans-serif;
}

.update-toast-btn:active {
  transform: scale(0.95);
  opacity: 0.9;
}

/* ── LIGHTBOX (Full-screen gallery swipe) ────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0, 0, 0, 0.96);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s var(--ease);
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-close {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 18px);
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid var(--border-white);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: var(--trans);
}

.lightbox-close svg {
  width: 18px;
  height: 18px;
}

.lightbox-close:active {
  background: rgba(255,255,255,0.16);
  transform: scale(0.9);
}

/* Viewport: CLIPPA o conteúdo — NÃO translada */
.lightbox-viewport {
  width: 100%;
  height: 80vh;
  overflow: hidden;
  position: relative;
}

/* Track: TRANSLADA — NÃO tem overflow próprio */
.lightbox-track {
  display: flex;
  align-items: stretch;
  height: 100%;
  will-change: transform;
  touch-action: pan-y pinch-zoom;
}

.lightbox-slide {
  flex-shrink: 0;
  width: 100vw;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
}

.lightbox-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--r-sm);
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
}

/* Dots */
.lightbox-dots {
  display: flex;
  gap: 6px;
  margin-top: 16px;
}

.lightbox-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  transition: var(--trans);
}

.lightbox-dot.active {
  background: var(--gold-1);
  width: 18px;
  border-radius: 3px;
}

/* ── MODAL (Bottom Sheet Dark) ───────────────────────────────── */
#productModal {
  position: fixed;
  inset: 0;
  z-index: 400;
  display: flex;
  align-items: flex-end;
  background: rgba(0, 0, 0, 0);
  pointer-events: none;
  transition: background 0.32s var(--ease);
}

#productModal.open {
  background: rgba(0, 0, 0, 0.78);
  pointer-events: all;
}

.modal-sheet {
  width: 100%;
  max-height: 93vh;
  background: var(--bg-modal);
  border: 1px solid var(--border);
  border-bottom: none;
  border-radius: 26px 26px 0 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  transform: translateY(100%);
  transition: transform 0.38s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: transform;
  box-shadow: var(--shadow-modal);
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
}

#productModal.open .modal-sheet {
  transform: translateY(0);
}

/* Modal handle */
.modal-handle {
  width: 38px;
  height: 4px;
  background: var(--gold-border);
  border-radius: 2px;
  margin: 12px auto 0;
}

/* Modal top bar */
.modal-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px 8px;
}

.modal-cat-chip {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-1);
  background: var(--gold-dim);
  border: 1px solid var(--gold-border);
  padding: 5px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
}

.modal-close-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2);
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--trans);
  border: 1px solid var(--border-white);
}

.modal-close-btn:active {
  background: rgba(255, 255, 255, 0.14);
  transform: scale(0.9);
}

/* ── Modal Gallery ───────────────────────────────────────────── */
.modal-gallery {
  padding: 0 16px 12px;
}

.modal-main-img-wrap {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: var(--r-md);
  overflow: hidden;
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 10px;
  border: 1px solid var(--border);
  cursor: pointer;
  position: relative;
}

/* Feedback visual ao tocar na imagem */
.modal-main-img-wrap:active::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--r-md);
  background: rgba(201,168,76,0.08);
  pointer-events: none;
}

/* ── Hint "Toque para ampliar" ───────────────────────────────── */
.img-expand-hint {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(0, 0, 0, 0.72);
  border: 1px solid rgba(201, 168, 76, 0.35);
  border-radius: 20px;
  padding: 6px 14px 6px 10px;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  white-space: nowrap;
  pointer-events: none;
  /* Estado inicial: visível */
  opacity: 1;
  transition: opacity 0.5s ease;
}

.img-expand-hint.hidden {
  opacity: 0;
}

.img-expand-hint svg {
  width: 14px;
  height: 14px;
  stroke: var(--gold-2);
  flex-shrink: 0;
}

.img-expand-hint span {
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-2);
  letter-spacing: 0.2px;
}

/* ── Contador de fotos "1 / 3" ───────────────────────────────── */
.img-counter {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.3px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  /* Oculto por padrão — JS exibe quando há mais de 1 foto */
  display: none;
}

/* ── Badge de quantidade de fotos no card ────────────────────── */
.badge-photos {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(0, 0, 0, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 20px;
  padding: 3px 9px;
  font-size: 10px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.75);
  letter-spacing: 0.2px;
  pointer-events: none;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  gap: 4px;
}

#modalMainImg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity 0.22s ease;
}

/* Thumbnails */
.modal-thumbs-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}

.modal-thumbs-row::-webkit-scrollbar { display: none; }

.modal-thumb {
  flex-shrink: 0;
  width: 66px;
  height: 66px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 2px solid transparent;
  cursor: pointer;
  transition: var(--trans);
  opacity: 0.45;
  background: rgba(255, 255, 255, 0.05);
}

.modal-thumb.active {
  border-color: var(--gold-1);
  opacity: 1;
  box-shadow: 0 0 0 1px rgba(201,168,76,0.3);
}

.modal-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── Modal Info ──────────────────────────────────────────────── */
.modal-info {
  padding: 4px 20px 20px;
}

.modal-title {
  font-size: 22px;
  font-weight: 900;
  color: var(--text-1);
  line-height: 1.2;
  letter-spacing: -0.6px;
  margin-bottom: 6px;
}

/* Preço do modal — dourado, peso máximo */
.modal-price {
  font-size: 30px;
  font-weight: 900;
  color: var(--gold-2);
  letter-spacing: -1px;
  margin-bottom: 20px;
}

/* Specs grid */
.specs-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.spec-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  padding: 12px 14px;
}

.spec-emoji { font-size: 20px; flex-shrink: 0; }

.spec-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-bottom: 3px;
}

.spec-value {
  font-size: 13px;
  font-weight: 800;
  color: var(--text-1);
  letter-spacing: -0.2px;
  line-height: 1;
}

/* Sold notice */
.sold-notice {
  background: rgba(248, 113, 113, 0.08);
  border: 1px solid rgba(248, 113, 113, 0.25);
  border-radius: var(--r-sm);
  padding: 12px 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: #f87171;
  margin-bottom: 24px;
}

/* ── WhatsApp CTA ────────────────────────────────────────────── */
.btn-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 18px 24px;
  border-radius: var(--r-lg);
  background: var(--green-wa);
  color: #fff;
  font-size: 17px;
  font-weight: 800;
  font-family: 'Inter', sans-serif;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: var(--trans);
  box-shadow: var(--shadow-btn);
  letter-spacing: -0.3px;
  -webkit-user-select: none;
}

.btn-whatsapp:active {
  transform: scale(0.97);
  box-shadow: 0 2px 14px rgba(37, 211, 102, 0.22);
}

.btn-whatsapp .wa-icon { width: 24px; height: 24px; flex-shrink: 0; }

.btn-whatsapp.disabled {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-3);
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
  border: 1px solid var(--border-white);
}

/* ── Banner Troca iPhone (Lacrados) ─────────────────────────── */
.trade-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(37, 211, 102, 0.07);
  border: 1px solid rgba(37, 211, 102, 0.28);
  border-radius: var(--r-sm);
  padding: 13px 16px;
  margin-bottom: 14px;
  animation: tradeIn 0.35s var(--ease) both;
}

@keyframes tradeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.trade-banner svg {
  width: 18px;
  height: 18px;
  stroke: #25d366;
  flex-shrink: 0;
}

.trade-banner span {
  font-size: 13px;
  font-weight: 700;
  color: #25d366;
  letter-spacing: 0.1px;
}

/* ── Garantia no card ─────────────────────────────────────────── */
.card-warranty {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold-1);
  opacity: 0.75;
  margin-bottom: 4px;
  letter-spacing: 0.15px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── "à vista" inline ao lado do preço no card ───────────────── */
.price-avista {
  font-size: 11px;
  font-weight: 400;
  color: var(--text-2);
  letter-spacing: 0;
}

/* ── Parcelamento no card ────────────────────────────────────── */
.card-installment {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-3);
  margin-top: 3px;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Garantia no modal ────────────────────────────────────────── */
.modal-warranty {
  font-size: 12px;
  font-weight: 600;
  color: var(--gold-1);
  opacity: 0.82;
  margin-bottom: 14px;
  letter-spacing: 0.1px;
}

/* ── Parcelamento no modal ───────────────────────────────────── */
.modal-installment {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-2);
  margin-top: -10px;
  margin-bottom: 18px;
  letter-spacing: 0.1px;
}
