/* ==========================================================================
   GLATT MODA FITNESS — Design System
   Tipografia: Archivo (display/headings) + Inter (corpo/UI)
   ========================================================================== */

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

:root {
  color-scheme: light;
  /* ---- Modo claro (padrão) ---- */
  --bg: #FFFFFF;
  --surface: #F6F5F2;
  --surface-2: #EFEDE8;
  --ink: #161410;
  --ink-soft: #625D53;
  --ink-faint: #948E82;
  --border: #E7E3DB;
  --primary: #FF5A1F;
  --primary-dark: #E1470E;
  --primary-ink: #FFFFFF;
  --success: #1E8E4F;
  --danger: #D6392B;
  --warning: #C77C00;
  --shadow: 0 1px 2px rgba(22,20,16,.04);
  --radius: 6px;
  --radius-lg: 14px;
  --maxw: 1280px;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0A0A0B;
  --surface: #161615;
  --surface-2: #1E1E1D;
  --ink: #FBFAF8;
  --ink-soft: #D6D2C9;
  --ink-faint: #9C978C;
  --border: rgba(255,255,255,.20);
  --primary: #FF6A2E;
  --primary-dark: #FF8142;
  --primary-ink: #17140F;
  --shadow: 0 1px 2px rgba(0,0,0,.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0A0A0B;
    --surface: #161615;
    --surface-2: #1E1E1D;
    --ink: #FBFAF8;
    --ink-soft: #D6D2C9;
    --ink-faint: #9C978C;
    --border: rgba(255,255,255,.20);
    --primary: #FF6A2E;
    --primary-dark: #FF8142;
    --primary-ink: #17140F;
  }
}

/* Bordas de campos/botões um pouco mais fortes no escuro, pra ficar bem visível */
[data-theme="dark"] .size-btn,
[data-theme="dark"] .color-swatch,
[data-theme="dark"] .field input,
[data-theme="dark"] .field select,
[data-theme="dark"] .field textarea,
[data-theme="dark"] .qty-stepper,
[data-theme="dark"] .pay-method label {
  border-color: rgba(255,255,255,.32);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .size-btn,
  :root:not([data-theme="light"]) .color-swatch,
  :root:not([data-theme="light"]) .field input,
  :root:not([data-theme="light"]) .field select,
  :root:not([data-theme="light"]) .field textarea,
  :root:not([data-theme="light"]) .qty-stepper,
  :root:not([data-theme="light"]) .pay-method label {
    border-color: rgba(255,255,255,.32);
  }
}

* { box-sizing: border-box; overflow-wrap: break-word; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  transition: background-color .2s ease, color .2s ease;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 1rem; }

h1, h2, h3, h4 {
  font-family: 'Archivo', sans-serif;
  font-weight: 800;
  line-height: 1.08;
  margin: 0 0 .5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.1rem, 4.5vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; color: var(--ink-soft); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.visually-hidden { position:absolute; width:1px;height:1px; overflow:hidden; clip:rect(0,0,0,0); }

/* ---------------- Botões ---------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px; border-radius: var(--radius); border: 1.5px solid transparent;
  font-weight: 700; font-size: .95rem; transition: all .15s ease; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: transparent; border-color: var(--ink); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink); padding: 8px 14px; }
.btn-ghost:hover { background: var(--surface); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--bg); border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 24px; height: 76px;
  max-width: var(--maxw); margin: 0 auto; padding: 0 20px;
}
.logo-link { display: flex; align-items: center; height: 40px; flex-shrink: 0; }
.logo-link img { height: 34px; width: auto; }
.logo-clara-img { display: block; }
.logo-escura-img { display: none; }
[data-theme="dark"] .logo-clara-img { display: none; }
[data-theme="dark"] .logo-escura-img { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .logo-clara-img { display: none; }
  :root:not([data-theme="light"]) .logo-escura-img { display: block; }
}

.main-nav { display: flex; gap: 28px; margin-right: auto; }
.main-nav a { font-weight: 600; font-size: .95rem; color: var(--ink); position: relative; }
.main-nav a:hover { color: var(--primary); }

.header-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%; background: transparent; border: none; color: var(--ink);
  position: relative;
}
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 22px; height: 22px; }
.cart-badge {
  position: absolute; top: 3px; right: 3px; min-width: 17px; height: 17px; border-radius: 50%;
  background: var(--primary); color: #fff; font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}
.theme-toggle-track {
  width: 52px; height: 30px; border-radius: 30px; background: var(--surface-2); border: 1px solid var(--border);
  position: relative; flex-shrink: 0;
}
.theme-toggle-thumb {
  position: absolute; top: 2px; left: 2px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); transition: transform .2s ease; display: flex; align-items: center; justify-content: center;
}
[data-theme="dark"] .theme-toggle-thumb { transform: translateX(22px); background: var(--primary); }
.theme-toggle-thumb svg { width: 14px; height: 14px; color: var(--bg); }

.menu-toggle { display: none; }

/* Busca overlay */
.search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 200;
  display: none; align-items: flex-start; justify-content: center; padding-top: 12vh;
}
.search-overlay.active { display: flex; }
.search-box {
  background: var(--bg); width: min(600px, 92vw); border-radius: var(--radius-lg); padding: 8px;
  display: flex; align-items: center; gap: 10px; border: 1px solid var(--border);
}
.search-box input { flex: 1; border: none; background: transparent; padding: 14px; color: var(--ink); outline: none; font-size: 1.05rem; }
.search-close { padding: 10px; }

/* Menu mobile (off-canvas) */
.mobile-menu {
  position: fixed; inset: 0 15% 0 0; background: var(--bg); z-index: 300;
  transform: translateX(-100%); transition: transform .25s ease; padding: 24px 22px; overflow-y: auto;
  border-right: 1px solid var(--border);
}
.mobile-menu.active { transform: translateX(0); }
.mobile-menu-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 290; display: none;
}
.mobile-menu-overlay.active { display: block; }
.mobile-menu a { display: block; padding: 14px 4px; font-weight: 700; font-size: 1.1rem; border-bottom: 1px solid var(--border); }

@media (max-width: 900px) {
  .main-nav { display: none; }
  .menu-toggle { display: inline-flex; }
}

/* ---------------- Hero ---------------- */
.hero {
  display: grid; grid-template-columns: 1.05fr 1fr; align-items: stretch; gap: 0;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 64px 56px; }
.hero-eyebrow { color: var(--primary); font-weight: 800; letter-spacing: .04em; font-size: .85rem; margin-bottom: 14px; }
.hero-copy h1 { max-width: 12ch; }
.hero-copy p { font-size: 1.1rem; max-width: 46ch; margin-bottom: 1.6em; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-media { position: relative; overflow: hidden; min-height: 420px; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.hero-tag {
  position: absolute; left: 24px; bottom: 24px; background: var(--bg); padding: 12px 18px; border-radius: var(--radius);
  font-weight: 700; font-size: .85rem; box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; }
  .hero-copy { padding: 40px 22px; order: 2; }
  .hero-media { min-height: 320px; order: 1; }
}

/* ---------------- Seções ---------------- */
.section { padding: 64px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 32px; gap: 20px; }
.section-head h2 { margin: 0; }
.section-head .btn { flex-shrink: 0; }

/* ---------------- Grid de produtos ---------------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; } }

.product-card { display: block; }
.product-card-media {
  position: relative; aspect-ratio: 3/4; border-radius: var(--radius); overflow: hidden; background: var(--surface);
  margin-bottom: 12px; border: 1px solid var(--border);
}
.product-card-media img { width: 100%; height: 100%; object-fit: cover; object-position: top center; transition: transform .35s ease; }
.product-card:hover .product-card-media img { transform: scale(1.045); }
.product-card-media img.img-alt { position: absolute; inset: 0; opacity: 0; transition: opacity .3s ease; }
.product-card:hover .product-card-media img.img-alt { opacity: 1; }
.badge {
  position: absolute; top: 10px; left: 10px; background: var(--ink); color: var(--bg);
  font-size: .7rem; font-weight: 800; padding: 5px 10px; border-radius: 30px; text-transform: uppercase; letter-spacing: .03em;
}
.product-card-title { font-weight: 700; font-size: .95rem; margin-bottom: 4px; }
.product-card-price { font-weight: 800; color: var(--primary); font-size: 1rem; }
.product-card-colors { display: flex; gap: 5px; margin-top: 8px; }
.swatch-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid var(--border); }

/* ---------------- Categorias ---------------- */
.category-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 16px; }
@media (max-width: 900px) { .category-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 560px) { .category-grid { grid-template-columns: repeat(2, 1fr); } }
.category-card {
  position: relative; aspect-ratio: 1; border-radius: var(--radius-lg); overflow: hidden;
  display: flex; align-items: flex-end; padding: 16px; background: var(--surface); border: 1px solid var(--border);
}
.category-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top center; opacity: .9; }
.category-card::after { content:''; position:absolute; inset:0; background: linear-gradient(0deg, rgba(0,0,0,.55), transparent 60%); }
.category-card span { position: relative; z-index: 1; color: #fff; font-weight: 800; font-size: .95rem; }

/* ---------------- Rodapé ---------------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--border); margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.2fr; gap: 40px; padding: 56px 0 32px; }
@media (max-width: 800px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) {
  .footer-grid { grid-template-columns: 1fr; text-align: center; gap: 32px; }
  .footer-grid ul { align-items: center; justify-content: center; }
  .footer-logo { display: flex; flex-direction: column; align-items: center; }
}
.footer-grid h4 { font-size: .85rem; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 16px; color: var(--ink-faint); }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-grid li { max-width: 100%; word-break: break-word; }
.footer-grid a:hover { color: var(--primary); }
.footer-logo img { height: 32px; margin-bottom: 14px; }
.footer-bottom {
  border-top: 1px solid var(--border); padding: 20px 0; display: flex; justify-content: space-between;
  flex-wrap: wrap; gap: 10px; font-size: .82rem; color: var(--ink-faint);
}
@media (max-width: 560px) {
  .footer-bottom { justify-content: center; text-align: center; flex-direction: column; align-items: center; }
}

/* ---------------- WhatsApp flutuante ---------------- */
.whatsapp-float {
  position: fixed; right: 20px; bottom: 20px; z-index: 150;
  width: 58px; height: 58px; border-radius: 50%; background: #25D366; color: #fff;
  display: flex; align-items: center; justify-content: center; box-shadow: 0 8px 22px rgba(0,0,0,.28);
  transition: transform .15s ease;
}
.whatsapp-float:hover { transform: scale(1.07); }
.whatsapp-float svg { width: 30px; height: 30px; }

/* ---------------- Página de produto ---------------- */
.product-page { display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; padding: 40px 0 70px; }
@media (max-width: 900px) { .product-page { grid-template-columns: 1fr; gap: 24px; } }

.gallery-main {
  position: relative; aspect-ratio: 3/4; border-radius: var(--radius-lg); overflow: hidden; background: var(--surface);
  border: 1px solid var(--border); cursor: zoom-in; touch-action: pan-y;
}
.gallery-track { display: flex; height: 100%; width: 100%; transition: transform .3s ease; }
.gallery-slide { flex: 0 0 100%; height: 100%; }
.gallery-slide img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.gallery-main.zoomed .gallery-slide img { object-fit: contain; }
.gallery-main.zoomed { cursor: zoom-out; }
.gallery-dots { display: flex; gap: 6px; justify-content: center; margin-top: 12px; }
.gallery-dots button { width: 8px; height: 8px; border-radius: 50%; background: var(--border); border: none; padding: 0; }
.gallery-dots button.active { background: var(--primary); width: 20px; border-radius: 6px; }
.gallery-thumbs { display: flex; gap: 10px; margin-top: 12px; }
.gallery-thumbs img { width: 68px; height: 90px; object-fit: cover; border-radius: 6px; border: 2px solid transparent; cursor: pointer; opacity: .7; }
.gallery-thumbs img.active { border-color: var(--primary); opacity: 1; }
.gallery-hint { text-align:center; font-size:.78rem; color: var(--ink-faint); margin-top: 8px; }

.product-info .kicker { color: var(--primary); font-weight: 800; font-size: .82rem; letter-spacing: .04em; margin-bottom: 8px; }
.product-info h1 { font-size: clamp(1.6rem, 3vw, 2.1rem); margin-bottom: 10px; }
.product-price { font-size: 1.7rem; font-weight: 800; color: var(--primary); margin-bottom: 18px; }
.product-desc { margin-bottom: 24px; line-height: 1.65; }

.variation-group { margin-bottom: 22px; }
.variation-label { font-weight: 700; font-size: .9rem; margin-bottom: 10px; display: flex; justify-content: space-between; }
.variation-label .selected-value { color: var(--ink-soft); font-weight: 500; }
.size-options { display: flex; flex-wrap: wrap; gap: 8px; }
.size-btn {
  min-width: 48px; height: 44px; padding: 0 12px; border-radius: var(--radius); border: 1.5px solid var(--border);
  background: transparent; color: var(--ink); font-weight: 700; font-size: .9rem;
}
.size-btn.active { border-color: var(--ink); background: var(--ink); color: var(--bg); }
.color-options { display: flex; flex-wrap: wrap; gap: 10px; }
.color-swatch {
  width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--border); padding: 2px; position: relative;
}
.color-swatch .fill { display:block; width:100%; height:100%; border-radius:50%; border: 1px solid rgba(0,0,0,.08); }
.color-swatch.active { border-color: var(--primary); }

.qty-stepper { display: inline-flex; align-items: center; border: 1.5px solid var(--border); border-radius: var(--radius); }
.qty-stepper button { width: 40px; height: 44px; background: none; border: none; font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.qty-stepper input { width: 44px; height: 44px; border: none; text-align: center; background: transparent; color: var(--ink); }

.product-actions { display: flex; gap: 12px; margin-top: 22px; }
.product-trust { display: flex; flex-direction: column; gap: 10px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--border); font-size: .87rem; color: var(--ink-soft); }
.product-trust div { display: flex; gap: 10px; align-items: center; }
.product-trust svg { width: 18px; height: 18px; color: var(--primary); flex-shrink: 0; }

/* ---------------- Varejo / Atacado ---------------- */
.venda-tipo { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0 22px; }
@media (max-width: 360px) { .venda-tipo { grid-template-columns: 1fr; } }
.venda-tipo-opcao {
  display: flex; flex-direction: column; gap: 6px; padding: 14px; border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  cursor: pointer; position: relative;
}
.venda-tipo-opcao input { position: absolute; opacity: 0; }
.venda-tipo-opcao.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.venda-tipo-info { display: flex; flex-direction: column; }
.venda-tipo-info strong { font-size: .95rem; }
.venda-tipo-info small { color: var(--ink-faint); font-size: .78rem; }
.venda-tipo-preco { font-weight: 800; color: var(--primary); font-size: 1.05rem; }
.venda-tipo-preco small { font-weight: 600; font-size: .72rem; color: var(--ink-faint); }

.atacado-pecas-lista { display: flex; flex-direction: column; gap: 8px; margin-bottom: 18px; max-height: 320px; overflow-y: auto; padding-right: 4px; }
.atacado-peca-linha {
  display: flex; align-items: center; gap: 8px; padding: 10px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); flex-wrap: wrap;
}
.atacado-peca-num { font-size: .78rem; font-weight: 700; color: var(--ink-faint); min-width: 58px; }
.atacado-peca-linha select {
  flex: 1; min-width: 90px; padding: 9px 10px; border-radius: 6px; border: 1.5px solid var(--border);
  background: var(--bg); color: var(--ink); font-size: .85rem;
}

/* ---------------- Carrinho ---------------- */
.cart-layout { display: grid; grid-template-columns: 1.6fr 1fr; gap: 40px; padding: 40px 0 70px; align-items: start; }
@media (max-width: 860px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-item { display: grid; grid-template-columns: 90px 1fr auto; gap: 16px; padding: 18px 0; border-bottom: 1px solid var(--border); align-items: start; }
.cart-item img { width: 90px; height: 110px; object-fit: cover; object-position: top center; border-radius: 6px; }
.cart-item-details { min-width: 0; } /* evita que o texto empurre a coluna e vaze da grade */
.cart-item-title { font-weight: 700; margin-bottom: 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cart-item-meta { color: var(--ink-faint); font-size: .85rem; }
.cart-item-hint { font-size: .76rem; color: var(--ink-faint); margin: 6px 0 0; }
.cart-item-qty-form { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.cart-item-total { font-weight: 800; white-space: nowrap; text-align: right; }
.badge-atacado {
  display: inline-block; background: var(--primary); color: var(--primary-ink); font-size: .68rem; font-weight: 800;
  padding: 3px 9px; border-radius: 30px; text-transform: uppercase; letter-spacing: .03em;
}
.qty-stepper-sm button { width: 32px; height: 36px; font-size: 1rem; }
.qty-stepper-sm input { width: 36px; height: 36px; }

@media (max-width: 560px) {
  .cart-item { grid-template-columns: 68px 1fr; grid-template-areas: "img details" "total total"; row-gap: 10px; }
  .cart-item img { width: 68px; height: 86px; grid-area: img; }
  .cart-item-details { grid-area: details; }
  .cart-item-total { grid-area: total; text-align: left; padding-top: 4px; border-top: 1px dashed var(--border); }
}

.cart-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 26px; position: sticky; top: 96px; }
.summary-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; font-size: .95rem; color: var(--ink-soft); }
.summary-row.total { border-top: 1px solid var(--border); margin-top: 8px; padding-top: 16px; font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.remove-link { color: var(--danger); font-size: .82rem; font-weight: 600; background: none; border: none; padding: 0; text-decoration: underline; }

/* ---------------- Calculadora de frete (carrinho) ---------------- */
.frete-calc { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 16px; }
.frete-calc > label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 10px; }
.frete-calc-row { display: flex; gap: 8px; }
.frete-calc-row input {
  flex: 1; min-width: 0; padding: 11px 12px; border-radius: var(--radius); border: 1.5px solid var(--border);
  background: var(--bg); color: var(--ink); outline: none; font-size: .92rem;
}
.frete-calc-row input:focus { border-color: var(--primary); }
#frete-opcoes { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.frete-opcao {
  display: flex; align-items: center; gap: 10px; padding: 12px; border: 1.5px solid var(--border); border-radius: var(--radius);
  cursor: pointer; font-size: .88rem;
}
.frete-opcao:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 8%, transparent); }
.frete-opcao span { flex: 1; }
.frete-opcao input { width: auto; }
.frete-escolhido-atual { color: var(--success); font-weight: 700; font-size: .85rem; margin: 10px 0 0; }

/* ---------------- Formulários (login, cadastro, checkout) ---------------- */
.auth-wrap { max-width: 440px; margin: 60px auto; padding: 0 20px 60px; }
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 34px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 13px 14px; border-radius: var(--radius); border: 1.5px solid var(--border);
  background: var(--bg); color: var(--ink); outline: none;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }
.form-note { font-size: .85rem; color: var(--ink-faint); margin-top: 14px; text-align: center; }
.alert { padding: 12px 16px; border-radius: var(--radius); font-size: .9rem; margin-bottom: 16px; }
.alert-error { background: rgba(214,57,43,.1); color: var(--danger); border: 1px solid rgba(214,57,43,.25); }
.alert-success { background: rgba(30,142,79,.1); color: var(--success); border: 1px solid rgba(30,142,79,.25); }

/* ---------------- Checkout steps ---------------- */
.checkout-steps { display: flex; gap: 24px; margin-bottom: 36px; flex-wrap: wrap; }
.checkout-step { display: flex; align-items: center; gap: 10px; color: var(--ink-faint); font-weight: 700; font-size: .9rem; }
.checkout-step .num { width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; font-size: .8rem; }
.checkout-step.active { color: var(--ink); }
.checkout-step.active .num { background: var(--primary); border-color: var(--primary); color: #fff; }
.pay-method { display: flex; gap: 12px; margin-bottom: 20px; }
.pay-method label {
  flex: 1; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 16px; text-align: center;
  font-weight: 700; cursor: pointer;
}
.pay-method input { display: none; }
.pay-method input:checked + span { color: var(--primary); }
.pay-method label:has(input:checked) { border-color: var(--primary); }

/* ---------------- Utilidades ---------------- */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state svg { width: 64px; height: 64px; color: var(--ink-faint); margin-bottom: 16px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 37%, var(--surface) 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: var(--radius); }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}
@media (max-width: 560px) {
  .footer-grid p {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ---------------- Carteira do afiliado (minha-conta.php) ---------------- */
.carteira-card {
  background: linear-gradient(135deg, var(--ink), #2a2620);
  color: #fff; border-radius: 14px; padding: 24px; margin-top: 20px;
}
[data-theme="dark"] .carteira-card { background: linear-gradient(135deg, var(--primary), #b8420f); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .carteira-card { background: linear-gradient(135deg, var(--primary), #b8420f); } }
.carteira-topo { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; flex-wrap: wrap; }
.carteira-label { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; opacity: .85; margin-bottom: 6px; }
.carteira-valor { font-family: 'Archivo'; font-size: 2rem; font-weight: 800; }
.carteira-selo { background: rgba(255,255,255,.18); padding: 6px 14px; border-radius: 30px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.carteira-card .form-note { color: rgba(255,255,255,.8); }

/* ---------------- Cupom (checkout.php) ---------------- */
.cupom-box { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); margin: 14px 0; padding: 14px 0; }
.cupom-input-row { display: flex; gap: 8px; }
.cupom-input-row input {
  flex: 1; min-width: 0; padding: 11px 12px; border-radius: var(--radius); border: 1.5px solid var(--border);
  background: var(--bg); color: var(--ink); outline: none; font-size: .92rem; text-transform: uppercase;
}
.cupom-input-row input:focus { border-color: var(--primary); }
.cupom-aplicado-atual { display: flex; justify-content: space-between; align-items: center; gap: 10px; color: var(--success); font-weight: 700; font-size: .9rem; flex-wrap: wrap; }

/* ---------------- Pop-up de boas-vindas ---------------- */
.popup-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.55); z-index: 400;
  display: flex; align-items: center; justify-content: center; padding: 20px;
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.popup-overlay.ativo { opacity: 1; pointer-events: auto; }
.popup-card {
  background: var(--bg); color: var(--ink); border: 1px solid var(--border); border-radius: 18px;
  max-width: 420px; width: 100%; padding: 36px 30px 30px; text-align: center; position: relative;
  transform: translateY(14px) scale(.97); transition: transform .25s ease; box-shadow: 0 20px 60px rgba(0,0,0,.35);
}
.popup-overlay.ativo .popup-card { transform: translateY(0) scale(1); }
.popup-fechar {
  position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--border); color: var(--ink); font-size: 1.1rem;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.popup-fechar:hover { background: var(--surface-2); }
.popup-card img { height: 34px; margin: 0 auto 18px; }
.popup-card h3 { font-size: 1.4rem; margin-bottom: 10px; }
.popup-card p { margin-bottom: 20px; }
.popup-card .btn { width: 100%; }
