/* Crazy Horse Camisetas — estilos base compartilhados (docs/CONTRATO.md §6).
   Paleta herdada do catálogo original: preto, papel e dourado.
   Fontes (Barlow Condensed 700/800/900 e DM Sans 400–700): carregadas por <link> no <head> de cada página,
   e não por @import aqui, para o navegador pedi-las já no início (ver CONTRATO.md §6). */

:root {
  --ink: #080808;
  --ink-2: #1a1814;
  --paper: #f6f4ee;
  --paper-2: #ece8dd;
  --card: #ffffff;
  --gold: #d8b66c;
  --gold-deep: #b28a3f;
  --gold-ink: #76581f;
  --muted: #6b675e;
  --line: #d9d4c7;
  --line-dark: #332b1c;
  --ok: #2f6b3a;
  --ok-bg: #e3efe1;
  --warn: #7a5a12;
  --warn-bg: #f6ecd2;
  --error: #9b2b27;
  --error-bg: #f7e1df;
  --info: #274f7a;
  --info-bg: #e2ebf5;
  --radius: 6px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .12);
  --font-display: 'Barlow Condensed', Impact, 'Arial Narrow', sans-serif;
  --font-body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --wrap: 1240px;
  --gutter: clamp(16px, 4vw, 40px);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 15px/1.55 var(--font-body); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
img { max-width: 100%; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--gold-deep); outline-offset: 3px; }
[hidden] { display: none !important; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row-between { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 720px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } .hide-mobile { display: none !important; } }

/* Tipografia */
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.05; }
.display { font: 900 clamp(44px, 7vw, 104px)/.88 var(--font-display); text-transform: uppercase; letter-spacing: -1px; }
.h1 { font: 800 clamp(34px, 5vw, 54px)/.95 var(--font-display); text-transform: uppercase; letter-spacing: -.5px; }
.h2 { font: 800 clamp(28px, 3.6vw, 42px)/.95 var(--font-display); text-transform: uppercase; }
.h3 { font: 700 22px/1.1 var(--font-display); text-transform: uppercase; letter-spacing: .3px; }
.eyebrow { font-size: 11px; letter-spacing: 2px; font-weight: 700; text-transform: uppercase; display: inline-flex; align-items: center; gap: 10px; color: var(--gold-ink); }
.eyebrow::before { content: ''; width: 7px; height: 7px; background: var(--gold); border-radius: 50%; }
.on-dark .eyebrow { color: var(--gold); }
.lead { font-size: 16px; color: var(--muted); max-width: 60ch; }

/* Barra de aviso + cabeçalho */
.announce { background: var(--gold); color: var(--ink); text-align: center; padding: 8px var(--gutter); font-size: 12px; font-weight: 700; letter-spacing: 1px; }
/* Altura do cabeçalho reservada (com o fundo preto) antes de o JavaScript montá-lo: a página não "pula"
   quando ele aparece. 76/64 px da linha + 1 px da borda (ver .header-row). */
#site-header { position: sticky; top: 0; z-index: 40; min-height: 77px; background: var(--ink); }
.site-header { background: var(--ink); color: #fff; border-bottom: 1px solid var(--line-dark); position: relative; }
.skip-link { position: absolute; left: 12px; top: -80px; z-index: 200; background: var(--gold); color: var(--ink); padding: 12px 18px; border-radius: var(--radius); font-weight: 700; text-decoration: none; box-shadow: var(--shadow); }
.skip-link:focus { top: 12px; }
main:focus { outline: none; }
.header-row { display: flex; align-items: center; gap: 20px; min-height: 76px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: inherit; flex-shrink: 0; }
/* O logo tem fundo preto puro (#000) e o site usa #080808: "lighten" apaga o quadrado mais escuro em volta.
   Funciona porque o logo só aparece sobre fundo escuro (cabeçalho, rodapé e topo da home). */
.brand-logo { width: 56px; height: 56px; object-fit: contain; mix-blend-mode: lighten; }
.brand-name { font: 800 23px/.85 var(--font-display); letter-spacing: -.3px; }
.brand-name small { display: block; font: 600 9px var(--font-body); letter-spacing: 4px; margin-top: 5px; color: var(--gold); }
.main-nav { display: flex; gap: 22px; margin-left: auto; font-size: 13px; font-weight: 500; }
.main-nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; }
.main-nav a:hover, .main-nav a[aria-current="page"] { border-color: var(--gold); }
.header-actions { display: flex; gap: 6px; align-items: center; margin-left: 12px; }
.icon-btn { display: inline-flex; align-items: center; gap: 7px; background: none; border: 1px solid transparent; color: inherit; text-decoration: none; padding: 8px 10px; border-radius: 30px; font-size: 13px; position: relative; }
.icon-btn:hover { border-color: #5c4c2e; }
.icon-btn svg { width: 22px; height: 22px; }
.cart-link { border-color: #78633c; }
.cart-count { background: var(--gold); color: var(--ink); font-weight: 700; font-size: 11px; min-width: 20px; height: 20px; border-radius: 10px; display: inline-grid; place-items: center; padding: 0 5px; }
.menu-toggle { display: none; }
.menu-toggle svg + svg, .nav-open .menu-toggle svg:first-child { display: none; } /* ≡ fechado, X aberto */
.nav-open .menu-toggle svg + svg { display: block; }
.nav-extra { display: none; } /* atalhos extras: só no menu do celular */
@media (max-width: 980px) {
  #site-header { min-height: 65px; }
  .menu-toggle { display: inline-flex; }
  .header-row { gap: 8px; min-height: 64px; }
  .brand-logo { width: 44px; height: 44px; }
  .brand-name { font-size: 18px; }
  .brand-name small { font-size: 7px; letter-spacing: 3px; }
  .header-actions { margin-left: auto; }
  /* Texto "Entrar"/"Minha conta" escondido só visualmente (como .sr-only): o ícone continua com nome
     para leitores de tela e comandos de voz. */
  .icon-label { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  /* Menu aberto: painel um pouco mais claro que o preto, com borda dourada e sombra, para não se misturar
     com o banner preto da home. Rola sozinho se não couber na tela. */
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--ink-2); flex-direction: column; gap: 0; padding: 8px var(--gutter) 18px; border-bottom: 2px solid var(--gold-deep); box-shadow: 0 18px 30px rgba(0, 0, 0, .45); font-size: 16px; max-height: calc(100vh - 65px); max-height: calc(100dvh - 65px); overflow-y: auto; overscroll-behavior: contain; }
  .main-nav a { padding: 12px 0; border-bottom: 1px solid #2c2820; }
  .nav-open .main-nav { display: flex; }
  .nav-extra { display: flex; flex-direction: column; margin-top: 10px; font-size: 15px; }
  .nav-extra a { color: #d6d0c3; }
  .nav-extra a:last-child { border-bottom: 0; }
}

/* Botões */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; border: 1px solid transparent; border-radius: var(--radius); padding: 13px 22px; font-weight: 700; font-size: 14px; text-decoration: none; line-height: 1.2; min-height: 46px; transition: filter .15s, background .15s; }
.btn:hover { filter: brightness(.96); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; filter: none; }
.btn-primary { background: var(--gold); color: var(--ink); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-ghost { background: transparent; border-color: #b9b4a8; color: var(--ink); }
.btn-danger { background: var(--error); color: #fff; }
.btn-whatsapp { background: #187a42; color: #fff; } /* verde mais escuro: texto branco com contraste 5,4:1 */
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; min-height: 36px; font-size: 13px; }
.btn-link { background: none; border: 0; padding: 0; text-decoration: underline; font-weight: 600; font-size: 13px; }
.on-dark .btn-ghost { color: #fff; border-color: #5c4c2e; }

/* Formulários */
.field { display: block; margin: 0 0 16px; }
.field > span, .field-label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
/* Fonte de 16 px: com menos que isso o iPhone dá zoom sozinho ao tocar no campo.
   Borda #8f8a7e: contraste ≥ 3:1 com o branco e o bege, para o campo ser visto como campo. */
.input, .select, .textarea, .field input:not([type=checkbox]):not([type=radio]), .field select, .field textarea {
  display: block; width: 100%; padding: 12px 14px; background: #fff; border: 1px solid #8f8a7e; border-radius: var(--radius); font-size: 16px; min-height: 46px;
}
.field textarea, .textarea { min-height: 120px; resize: vertical; }
/* Campo em uso: borda e contorno dourado-escuro firmes (#76581f, 6:1 sobre o bege). O seletor repete o da
   regra acima para vencê-la; caixas de seleção e botões de opção ficam com o contorno global de :focus-visible. */
.input:focus, .select:focus, .textarea:focus, .field input:not([type=checkbox]):not([type=radio]):focus, .field select:focus, .field textarea:focus { border-color: var(--gold-ink); outline: 2px solid var(--gold-ink); outline-offset: 0; }
.field input[aria-invalid="true"], .field input:not([type=checkbox]):not([type=radio])[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--error); }
.field-hint { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
.field-error { display: block; font-size: 12px; color: var(--error); margin-top: 5px; min-height: 0; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; margin: 12px 0; }
.check input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--gold-deep); }
fieldset { border: 0; padding: 0; margin: 0 0 16px; }
legend { font-weight: 700; margin-bottom: 8px; }
.hp { position: absolute !important; left: -9999px !important; } /* honeypot anti-spam */

/* Tamanhos (botões de escolha) */
.size-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.size-picker button { min-width: 50px; min-height: 44px; padding: 8px 12px; border: 1px solid #b9b4a8; background: #fff; border-radius: var(--radius); font-weight: 600; }
.size-picker button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.size-picker button:disabled { opacity: .35; text-decoration: line-through; cursor: not-allowed; }

/* Cartões, alertas, selos */
.card { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 22px; }
.card-dark { background: var(--ink); color: #fff; border-color: var(--line-dark); }
.alert { border-radius: var(--radius); padding: 14px 16px; font-size: 14px; border: 1px solid transparent; }
.alert-info { background: var(--info-bg); color: var(--info); }
.alert-ok { background: var(--ok-bg); color: var(--ok); }
.alert-warn { background: var(--warn-bg); color: var(--warn); }
.alert-error { background: var(--error-bg); color: var(--error); }
.badge { display: inline-block; padding: 4px 9px; border-radius: 20px; font-size: 11px; font-weight: 700; letter-spacing: .3px; background: var(--paper-2); color: var(--ink); white-space: nowrap; }
.badge-gold { background: var(--gold); color: var(--ink); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-warn { background: var(--warn-bg); color: var(--warn); }
.badge-error { background: var(--error-bg); color: var(--error); }
.badge-info { background: var(--info-bg); color: var(--info); }
.divider { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* Tabelas */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700; }
.table .num { text-align: right; white-space: nowrap; }

/* Cabeçalho de páginas internas */
.page-head { background: var(--ink); color: #fff; padding: 42px 0 36px; }
.page-head .lead { color: #c9c3b6; }
.page { padding-top: 40px; padding-bottom: 70px; }
.breadcrumbs { font-size: 12px; color: var(--muted); margin-bottom: 14px; }
/* Área de toque 10 px mais alta (padding) sem mudar o espaço ocupado (margem negativa igual). */
.breadcrumbs a { text-decoration: none; display: inline-block; padding: 5px 0; margin: -5px 0; }
.breadcrumbs a:hover { text-decoration: underline; }
.page-head .breadcrumbs { color: #a9a293; }

/* Cartão de produto (vitrine e relacionados) */
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 26px 20px; }
@media (max-width: 1100px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 12px; } }
.product-card { position: relative; min-width: 0; display: flex; flex-direction: column; }
/* Fundo branco atrás da foto (era bege #e8e5dd): as fotos de fundo branco se fundem ao quadro, sem "caixa dentro de caixa". */
.product-card .thumb { display: block; background: #fff; aspect-ratio: 1080 / 1280; border-radius: 8px; overflow: hidden; position: relative; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s; }
.product-card:hover .thumb img { transform: scale(1.03); }
.product-card .flags { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; flex-wrap: nowrap; z-index: 1; } /* no máximo 1 selo, numa linha (home.js/produto.js) */
.product-card h3 { font: 600 14px/1.35 var(--font-body); margin: 12px 0 4px; }
.product-card h3 a { text-decoration: none; }
.product-card h3 a::after { content: ''; position: absolute; inset: 0; } /* cartão inteiro clicável */
.product-card .meta { font-size: 12px; color: var(--muted); }
.product-card .price { font-weight: 700; font-size: 17px; margin-top: 6px; }
.product-card.unavailable .thumb img { opacity: .55; }
.product-card.unavailable .price { color: var(--muted); font-size: 14px; }

/* Diálogo */
dialog { border: 0; border-radius: 12px; padding: 26px; width: min(520px, calc(100vw - 32px)); max-height: calc(100vh - 40px); background: var(--paper); color: var(--ink); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(0, 0, 0, .6); }
.dialog-close { position: absolute; right: 14px; top: 12px; background: none; border: 0; font-size: 26px; line-height: 1; padding: 6px; }

/* Aviso flutuante */
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 14px 20px; border-radius: 8px; box-shadow: var(--shadow); z-index: 100; font-size: 14px; max-width: calc(100vw - 32px); transition: opacity .2s, transform .2s; border-left: 4px solid var(--gold); width: max-content; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="error"] { border-left-color: #e0685f; }

/* Estados de carregamento e vazio */
.skeleton { background: linear-gradient(90deg, #e6e2d8 0, #f1eee6 50%, #e6e2d8 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; }
@keyframes sk { to { background-position: -200% 0; } }
.empty-state { text-align: center; padding: 50px 20px; color: var(--muted); }
.spinner { width: 22px; height: 22px; border: 3px solid rgba(0, 0, 0, .15); border-top-color: var(--gold-deep); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* Rodapé */
.site-footer { background: var(--ink); color: #e9e5da; margin-top: 60px; padding: 46px 0 22px; font-size: 14px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
.footer-grid a { display: block; text-decoration: none; padding: 4px 0; color: #d6d0c3; overflow-wrap: anywhere; }
.footer-grid a:hover { color: var(--gold); }
.footer-grid .brand { display: flex; padding: 0; color: #fff; } /* flex de novo: ".footer-grid a" punha "CAMISETAS" embaixo do escudo */
.footer-title { font: 700 15px var(--font-display); letter-spacing: 1.5px; text-transform: uppercase; color: var(--gold); margin-bottom: 10px; }
.footer-tag { color: #a9a293; font-size: 13px; margin-top: 14px; }
/* Contato: um canal por linha, com ícone (Instagram e e-mail aparecem sozinhos quando preenchidos no painel). */
.footer-contact a { display: flex; align-items: center; gap: 10px; }
.footer-contact svg { width: 18px; height: 18px; flex-shrink: 0; color: var(--gold); }
.footer-legal { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px 24px; flex-wrap: wrap; border-top: 1px solid #262219; margin-top: 30px; padding-top: 18px; font-size: 12px; line-height: 1.6; color: #8f887a; }
.footer-legal p { margin: 0; }
.footer-company strong { display: block; color: #d6d0c3; font-weight: 600; font-size: 13px; }
.footer-legal .nowrap { white-space: nowrap; }
@media (max-width: 800px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid > div:first-child, .footer-grid > .footer-contact { grid-column: 1 / -1; }
}

/* Botão flutuante do WhatsApp. Ele nunca é escondido; em troca, o fim da página ganha um espaço livre
   para o botão não cobrir a última linha do rodapé (em telas largas ele já fica fora do texto). */
.wa-float { position: fixed; right: 18px; bottom: 18px; width: 56px; height: 56px; border-radius: 50%; background: #1f8f4e; color: #fff; display: grid; place-items: center; box-shadow: var(--shadow); z-index: 50; }
.wa-float svg { width: 30px; height: 30px; }
@media (max-width: 1360px) { .has-wa-float .site-footer { padding-bottom: 90px; } }
