/* Achados — design system compartilhado */

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'DM Sans', sans-serif;
  color: #1A1A1A;
  background: #F7F5F0;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

::selection { background: #E85D3A; color: #fff; }

a { color: inherit; }

/* ── Scrollbar oculta (listas de pills/tabs) ─── */

.ach-scroll               { scrollbar-width: none; }
.ach-scroll::-webkit-scrollbar { display: none; }

/* ── Animação do ponto no banner de anúncio ─── */

@keyframes achPulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }

/* ── Barra de anúncio (topo, idêntica em todas as páginas) ── */

.ach-adbar { background: #1A1A1A; color: #F7F5F0; }

.ach-adbar-row {
  max-width: 1240px;
  margin: 0 auto;
  padding: 9px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 13px;
}

/* ── Header sticky (idêntico em todas as páginas) ────────── */

.ach-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid #E5E0D8;
}

.ach-header-row {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* ── Footer (idêntico em todas as páginas) ───────────────── */

.ach-footer { background: #1A1A1A; color: #E5E0D8; }

.ach-footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 48px 40px 40px;
}

/* ── Grid de produtos ────────────────────────── */

.ach-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

/* ── Card de produto (hover via CSS; resto inline) */

.ach-card {
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.ach-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px -18px rgba(26,26,26,0.3);
}

/* ── CTA do card ─────────────────────────────── */

.ach-cta { display: block; }
.ach-cta:hover { background: #C94D2C !important; }

/* ── Tabs de categoria (página de produtos) ──── */

.cat-tab {
  text-decoration: none;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 500;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid #E5E0D8;
  background: #fff;
  color: #4B4B4B;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  display: inline-block;
}

.tab-active {
  background: #E85D3A !important;
  color: #fff !important;
  border-color: #E85D3A !important;
  font-weight: 600;
}

.tab-idle:hover { border-color: #1A1A1A; }

/* ── Skeleton de carregamento ────────────────── */

.card-skeleton {
  background: #fff;
  border: 1px solid #E5E0D8;
  border-radius: 16px;
  overflow: hidden;
  min-height: 340px;
}

.card-skeleton::before {
  content: '';
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #F3EDE3 25%, #E9E2D8 50%, #F3EDE3 75%);
  background-size: 200% 100%;
  animation: achShimmerSkeleton 1.5s infinite;
}

@keyframes achShimmerSkeleton {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ── Estado de erro ──────────────────────────── */

.error-state {
  grid-column: 1 / -1;
  padding: 64px 24px;
  text-align: center;
}

.error-state p {
  font-size: 16px;
  color: #6B7280;
  margin: 0 0 20px;
}

.error-state button {
  background: #E85D3A;
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
}

.error-state button:hover { background: #C94D2C; }

/* ── Tab bar fixa (navegação mobile/tablet) ──── */

.ach-tabbar {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid #E5E0D8;
  padding: 9px 8px calc(14px + env(safe-area-inset-bottom));
}

.ach-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 48px;
  border-radius: 12px;
  text-decoration: none;
  color: #6B7280;
  font-size: 10.5px;
  font-weight: 600;
}

.ach-tab span[aria-hidden] { font-size: 18px; line-height: 1; }

body[data-page="home"]      .ach-tab[data-tab="home"],
body[data-page="products"]  .ach-tab[data-tab="products"],
body[data-page="historico"] .ach-tab[data-tab="historico"],
body[data-page="sobre"]     .ach-tab[data-tab="sobre"] {
  color: #E85D3A;
  background: #FFF1EC;
}

/* ── Responsivo ──────────────────────────────── */

@media (max-width: 960px) {
  .ach-hero  { grid-template-columns: 1fr !important; gap: 40px !important; }
  .ach-hero-media { order: -1 !important; }
  .ach-grid  { grid-template-columns: repeat(2, 1fr) !important; }
  .ach-top3  { grid-template-columns: 1fr !important; }
  .ach-wrap  { padding-left: 24px !important; padding-right: 24px !important; }
  .ach-tg    { flex-direction: column !important; align-items: flex-start !important; gap: 24px !important; }
}

@media (max-width: 768px) {
  .ach-nav    { display: none !important; }
  .ach-tabbar { display: grid !important; grid-template-columns: repeat(4, 1fr); }
  body        { padding-bottom: 84px; }

  /* Card horizontal na Home (thumb 104x104 à esquerda) */
  body[data-page="home"] #product-grid.ach-grid {
    grid-template-columns: 1fr !important;
  }

  body[data-page="home"] #product-grid .ach-card {
    flex-direction: row !important;
    padding: 12px !important;
    gap: 12px !important;
  }

  body[data-page="home"] #product-grid .ach-card-media {
    width: 104px !important;
    height: 104px !important;
    aspect-ratio: auto !important;
    flex-shrink: 0 !important;
    border-radius: 12px !important;
    border: 1px solid #E5E0D8 !important;
  }

  body[data-page="home"] #product-grid .ach-card-body {
    padding: 0 !important;
  }
}

@media (max-width: 600px) {
  .ach-grid      { grid-template-columns: 1fr !important; }
  .ach-trust     { grid-template-columns: 1fr 1fr !important; }
  .ach-tg        { flex-direction: column !important; align-items: flex-start !important; gap: 24px !important; }
  .ach-hero-h1   { font-size: 42px !important; }
  .ach-herobtns  { flex-direction: column !important; }
  .ach-herobtns > a { width: 100% !important; text-align: center !important; justify-content: center !important; }
  .ach-wrap      { padding-left: 18px !important; padding-right: 18px !important; }
  .ach-sobre-h1  { font-size: 40px !important; }
  .ach-hist-h1   { font-size: 40px !important; }
  .ach-filter    { position: static !important; }
  .ach-ed-head   { flex-direction: column !important; align-items: flex-start !important; gap: 14px !important; }
  .ach-ed-num    { font-size: 56px !important; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
