/* ============================================================
   Apex Retail — design tokens
   Paleta inspirada no varejo físico: etiqueta de gôndola
   (amarelo/preto), painel LED de vitrine e recibo térmico.
   ============================================================ */
:root {
  --ink: #101418;          /* texto principal, quase-preto azulado */
  --paper: #ffffff;        /* fundo */
  --tag-yellow: #ffd21f;   /* amarelo de etiqueta de preço */
  --live-green: #16b364;   /* destaque "ao vivo" */
  --slate: #5c6670;        /* texto secundário */
  --line: #e4e7ea;

  --font-display: "Bricolage Grotesque", system-ui, sans-serif;
  --font-body: "Archivo", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;

  --maxw: 1080px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- Header ---------- */
.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: .6rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  background: var(--tag-yellow);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.2rem;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .8rem 1.5rem;
  font-weight: 500;
  font-size: .95rem;
}

.site-nav a {
  color: var(--ink);
  text-decoration: none;
}

.site-nav a:hover { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- Seletor de idioma ---------- */
.lang-switch {
  display: inline-flex;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
}

.lang-switch button {
  appearance: none;
  border: none;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: .78rem;
  font-weight: 500;
  padding: .35rem .55rem;
  cursor: pointer;
}

.lang-switch button + button { border-left: 2px solid var(--ink); }

.lang-switch button:hover { background: var(--line); }

.lang-switch button.active {
  background: var(--tag-yellow);
  font-weight: 700;
}

/* ---------- Link discreto para a administração ---------- */
.admin-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--slate);
  opacity: .55;
  padding: .3rem;
  transition: opacity .15s ease, color .15s ease;
}

.admin-link:hover,
.admin-link:focus-visible {
  opacity: 1;
  color: var(--ink);
}

/* botão do carrinho */
.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.6rem;
  height: 2.6rem;
  background: var(--paper);
  color: var(--ink);
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.cart-btn:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 var(--ink);
}

.cart-count {
  position: absolute;
  top: -.55rem;
  right: -.55rem;
  min-width: 1.25rem;
  height: 1.25rem;
  display: grid;
  place-items: center;
  padding: 0 .25rem;
  background: var(--tag-yellow);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 500;
  line-height: 1;
}

/* ---------- Hero ---------- */
.hero {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 4.5rem 1.5rem 3.5rem;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .78rem;
  letter-spacing: .12em;
  color: var(--live-green);
  margin-bottom: 1.2rem;
}

.live-dot {
  width: .55rem;
  height: .55rem;
  border-radius: 50%;
  background: var(--live-green);
  animation: pulse 1.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(22, 179, 100, .5); }
  50%      { box-shadow: 0 0 0 8px rgba(22, 179, 100, 0); }
}

.hero h1 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  max-width: 16ch;
}

.hero h1 em {
  font-style: normal;
  background: var(--tag-yellow);
  padding: 0 .15em;
  box-decoration-break: clone;
}

.hero-sub {
  margin-top: 1.4rem;
  max-width: 52ch;
  font-size: 1.1rem;
  color: var(--slate);
}

.hero-actions {
  margin-top: 2.2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

/* ---------- Botões ---------- */
.btn {
  display: inline-block;
  padding: .8rem 1.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  text-align: center;
  border: 2px solid var(--ink);
  color: var(--ink);
  background: var(--paper);
  cursor: pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}

.btn-primary {
  background: var(--tag-yellow);
  box-shadow: 4px 4px 0 var(--ink);
}

.btn-ghost {
  background: transparent;
  box-shadow: 4px 4px 0 var(--line);
}

.btn:hover { transform: translate(2px, 2px); }
.btn-primary:hover { box-shadow: 2px 2px 0 var(--ink); }
.btn-ghost:hover { box-shadow: 2px 2px 0 var(--line); }

.btn-sm {
  padding: .5rem .9rem;
  font-size: .88rem;
  box-shadow: 3px 3px 0 var(--ink);
}

/* ---------- Ticker de promoções ---------- */
.ticker {
  background: var(--ink);
  overflow: hidden;
  border-top: 3px solid var(--tag-yellow);
  border-bottom: 3px solid var(--tag-yellow);
}

.ticker-track {
  display: inline-flex;
  gap: 3rem;
  white-space: nowrap;
  padding: .7rem 0;
  animation: scroll 32s linear infinite;
  font-family: var(--font-mono);
  font-size: .88rem;
  color: var(--tag-yellow);
}

@keyframes scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .live-dot { animation: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Vitrine de produtos ---------- */
.products {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3.5rem 1.5rem 3rem;
}

.section-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  letter-spacing: -0.01em;
  margin-bottom: 2rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.5rem;
}

.product-card {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  background: var(--paper);
  transition: transform .12s ease;
}

.product-card:hover { transform: translate(-2px, -2px); }

.product-img {
  display: grid;
  place-items: center;
  font-size: 4rem;
  padding: 2rem 0 1.6rem;
  background:
    repeating-linear-gradient(-45deg, transparent 0 14px, rgba(16, 20, 24, .03) 14px 28px);
  border-bottom: 2px dashed var(--line);
}

.product-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  padding: .9rem 1rem 0;
}

.product-price {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 1.05rem;
  padding: .2rem 1rem .9rem;
}

.product-add { margin: 0 1rem 1rem; }

/* ---------- Vantagens: etiquetas de preço ---------- */
.benefits {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 3rem 1.5rem 4rem;
}

.benefit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
}

.tag-card {
  background: var(--tag-yellow);
  border: 2px solid var(--ink);
  box-shadow: 5px 5px 0 var(--ink);
  padding: 1.4rem 1.2rem 1.2rem;
  transform: rotate(var(--tilt, 0deg));
  position: relative;
}

/* furo da etiqueta */
.tag-card::before {
  content: "";
  position: absolute;
  top: .55rem;
  left: .55rem;
  width: .5rem;
  height: .5rem;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--ink);
}

.benefit-icon {
  display: block;
  font-size: 1.8rem;
  margin-bottom: .4rem;
}

.benefit-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.25rem;
}

.benefit-body {
  margin-top: .3rem;
  font-size: .95rem;
  font-weight: 500;
}

/* ---------- Carrinho ---------- */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(16, 20, 24, .45);
  z-index: 40;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(420px, 100%);
  background: var(--paper);
  border-left: 2px solid var(--ink);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(105%);
  transition: transform .25s ease;
}

.cart-drawer.open { transform: none; }

@media (prefers-reduced-motion: reduce) {
  .cart-drawer { transition: none; }
}

.cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.3rem;
  border-bottom: 2px solid var(--ink);
}

.cart-head h2 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.3rem;
}

.cart-close {
  width: 2.2rem;
  height: 2.2rem;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
}

.cart-close:hover { transform: translate(1px, 1px); box-shadow: 1px 1px 0 var(--ink); }

.cart-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 1.3rem;
}

.cart-empty { color: var(--slate); }

.cart-items {
  list-style: none;
  display: grid;
  gap: .9rem;
}

.cart-item {
  display: flex;
  align-items: center;
  gap: .8rem;
  border: 1px solid var(--line);
  border-left: 3px solid var(--ink);
  padding: .7rem .8rem;
}

.cart-item-img { font-size: 1.7rem; }

.cart-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.cart-item-name { font-weight: 600; font-size: .92rem; }

.cart-item-price {
  font-family: var(--font-mono);
  font-size: .85rem;
  color: var(--slate);
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-family: var(--font-mono);
  font-size: .9rem;
}

.cart-qty button {
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  background: var(--paper);
  border: 2px solid var(--ink);
  font-family: var(--font-mono);
  font-size: .95rem;
  line-height: 1;
  cursor: pointer;
}

.cart-qty button:hover { background: var(--tag-yellow); }

.cart-foot {
  margin-top: auto;
  padding-top: 1.2rem;
  display: grid;
  gap: .7rem;
}

.cart-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 2px dashed var(--line);
  padding-top: 1rem;
  font-size: 1.05rem;
}

.cart-total-row strong {
  font-family: var(--font-mono);
  font-size: 1.2rem;
}

/* confirmação da compra fake */
.cart-success {
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: .5rem;
}

.success-icon { font-size: 2.6rem; }

.cart-success h3 {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
}

.order-number {
  font-family: var(--font-mono);
  font-size: .95rem;
}

.order-note {
  color: var(--slate);
  font-size: .9rem;
  max-width: 30ch;
  margin-bottom: 1rem;
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.5rem;
  text-align: center;
  font-size: .85rem;
  color: var(--slate);
}

.footer-demo {
  margin-top: .3rem;
  font-size: .75rem;
  color: #9aa3ab;
}

/* ---------- Acessibilidade ---------- */
:focus-visible {
  outline: 3px solid var(--live-green);
  outline-offset: 2px;
}

/* ---------- Mobile ---------- */
@media (max-width: 640px) {
  .site-header { flex-direction: column; gap: .8rem; }
  .hero { padding-top: 3rem; }
}
