/* ErikVip · Perfil
   Mobile-first. Pontos de quebra: 768px (layout desktop) e 1024px (barra lateral de Achados). */

:root {
  --bg: #0a0e14;
  --surface: #111823;
  --surface-2: #1b2230;
  --code-bg: #0c1017;
  --border: #232b38;
  --text: #f4f6f9;
  --text-2: #b4bcc8;
  --muted: #7d8796;
  --blue: #1170ff;
  --blue-hover: #2b81ff;
  --cyan: #22c3e6;
  --radius-lg: 16px;
  --radius-md: 10px;
  --header-h: 60px;
  --bottom-nav-h: 68px;
  --gutter: 12px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
}

h1, h2, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }
img, video, svg { display: block; }

:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.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;
}

.accent { color: var(--blue); }

.container {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
}

/* Visibilidade por tamanho de tela */
.only-desktop, .only-desktop-inline { display: none; }
.only-mobile { display: block; }
.only-mobile-inline { display: inline; }

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 46px;
  padding: 0 20px;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-size: 16px;
  white-space: nowrap;
  transition: background-color .15s, border-color .15s;
}
.btn-sm { height: 40px; padding: 0 16px; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-hover); }
.btn-outline { border: 1px solid var(--border); background: transparent; }
.btn-outline:hover { border-color: #3a4556; }
.btn-store {
  min-width: 0;
  height: 45px;
  padding: 0 10px;
  border: 1px solid var(--border);
  background: var(--code-bg);
  font-size: 14px;
}
.btn-store:hover { border-color: var(--blue); }

.follow-btn[aria-pressed="true"] {
  background: transparent;
  border: 1px solid var(--blue);
  color: var(--blue);
}

.icon-btn {
  width: 40px; height: 40px;
  display: inline-grid; place-items: center;
  border-radius: 50%;
}

/* ---------- Cabeçalho ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(10, 14, 20, .92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid #1a212c;
}
.header-inner {
  min-height: var(--header-h);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 12px;
  padding: 0 12px 0 16px;
}
.brand { height: var(--header-h); }

/* Menu de categorias: segunda linha no mobile, dentro da barra no desktop */
.cat-nav {
  order: 3;
  flex-basis: 100%;
  display: flex;
  gap: 22px;
  height: 40px;
  align-items: center;
  margin: -6px 0 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav a {
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.cat-nav a:hover { color: var(--text); }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { width: 40px; height: 20px; }
.brand-name { font-weight: 700; font-size: 18px; letter-spacing: -.01em; }

.search { display: none; flex: 1; }
.search input {
  width: 100%;
  height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 15px;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--blue); }

.header-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }

html { scroll-padding-top: calc(var(--header-h) + 52px); }

/* Busca aberta no mobile */
.site-header.search-open .search {
  display: block;
  position: absolute;
  left: 12px; right: 12px;
  top: calc(100% + 8px);
}

/* ---------- Capa ---------- */
.page { padding: 12px var(--gutter) 0; }

.cover {
  position: relative;
  aspect-ratio: 9 / 16;
  border-radius: var(--radius-lg);
  background: var(--surface);
  overflow: hidden;
}
.cover-video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.cover-placeholder {
  position: absolute; inset: 0;
  display: grid; place-items: center;
  color: #4a5465;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .2em;
  text-transform: uppercase;
  pointer-events: none;
}
.cover.has-video .cover-placeholder { display: none; }

.mute-btn {
  position: absolute;
  right: 12px; bottom: 16px;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(10, 14, 20, .55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.mute-btn .ico-sound { display: none; }
.mute-btn[aria-pressed="true"] .ico-sound { display: block; }
.mute-btn[aria-pressed="true"] .ico-muted { display: none; }

.cover-progress {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2px;
  background: rgba(255, 255, 255, .08);
}
.cover-progress-bar {
  display: block;
  width: 0;
  height: 100%;
  background: var(--cyan);
}
/* Sem vídeo: barra animada só para mostrar o comportamento */
.cover:not(.has-video) .cover-progress-bar { animation: fake-progress 12s linear infinite; }
@keyframes fake-progress { from { width: 0; } to { width: 100%; } }
@media (prefers-reduced-motion: reduce) {
  .cover:not(.has-video) .cover-progress-bar { animation: none; width: 33%; }
}

/* ---------- Perfil ---------- */
.profile-info {
  position: relative;
  padding: 0 8px;
}
.avatar {
  position: relative;
  z-index: 2;
  width: 96px; height: 96px;
  margin-top: -48px;
  display: grid; place-items: center;
  border-radius: 24px;
  background: var(--code-bg);
  border: 1px solid var(--border);
  box-shadow: 0 0 0 6px var(--bg);
}
.avatar img { width: 58px; height: 29px; }

.profile-text { margin-top: 18px; }
.profile-name { font-size: 32px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; }
.profile-bio { margin-top: 6px; color: var(--text-2); font-size: 15px; line-height: 1.45; }

.profile-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

/* ---------- Abas ---------- */
.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 24px calc(var(--gutter) * -1) 0;
  border-bottom: 1px solid var(--border);
}
.tab {
  position: relative;
  height: 50px;
  color: var(--text-2);
  font-size: 15px;
  font-weight: 500;
}
.tab:hover { color: var(--text); }
.tab.is-active { color: var(--text); font-weight: 700; }
.tab.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 2px;
  background: var(--blue);
}

/* ---------- Conteúdo ---------- */
.content { padding-top: 16px; }
.feed { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }

.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 18px;
}

.post-author { display: flex; align-items: center; gap: 10px; }
.author-avatar {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface-2);
  flex: none;
}
.author-name { font-weight: 700; font-size: 15px; }
.author-meta { color: var(--muted); font-size: 13px; }
.post-author .author-meta { color: var(--text-2); }

.post-title {
  margin-top: 14px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.post-title a:hover { color: #dbe7ff; }

.code {
  margin: 14px 0 0;
  padding: 16px 14px;
  background: var(--code-bg);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.9;
  color: var(--text-2);
  overflow-x: auto;
}
.code .kw { color: var(--cyan); }

.post-actions { display: flex; gap: 24px; margin-top: 14px; padding: 0 2px; }
.link-btn { color: var(--text-2); font-size: 15px; }
.link-btn:hover { color: var(--text); }

.product-photo {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  background: var(--surface-2);
  display: grid; place-items: center;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}
.product-body { margin-top: 18px; }
.product-title {
  margin-top: 10px;
  font-size: 19px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}
.product-price { margin-top: 12px; color: var(--text-2); font-size: 15px; }
.product-price strong { color: var(--text); }
.stores {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-top: 14px;
}
.affiliate-note { margin-top: 12px; color: var(--muted); font-size: 12px; }

.empty-state {
  padding: 40px 16px;
  text-align: center;
  color: var(--muted);
}

/* ---------- Achados ---------- */
.finds { margin-top: 24px; padding: 0 4px 40px; }
.finds-head { display: flex; align-items: baseline; justify-content: space-between; }
.finds-head h2 { font-size: 16px; font-weight: 700; }
.muted-link { color: var(--text-2); font-size: 15px; }
.muted-link:hover { color: var(--text); }
.finds-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-top: 16px;
}
.finds-grid a {
  display: block;
  aspect-ratio: 1 / 1;
  border-radius: 8px;
  background: var(--surface);
  transition: background-color .15s;
}
.finds-grid a:hover { background: var(--surface-2); }
.finds-note { margin-top: 18px; color: var(--muted); font-size: 12px; line-height: 1.6; }

/* Filtro das abas */
.page[data-active="artigos"] .card:not([data-kind="artigos"]),
.page[data-active="achados"] .card:not([data-kind="achados"]),
.page[data-active="videos"] .card { display: none; }
.page[data-active="artigos"] .finds,
.page[data-active="artigos"] .catalog,
.page[data-active="videos"] .catalog { display: none; }

/* ---------- Ofertas por categoria ---------- */
.catalog { display: grid; gap: 40px; padding: 8px 0 48px; }

.category-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  padding: 0 4px;
}
.category-head h2 { font-size: 22px; font-weight: 800; letter-spacing: -.01em; }

.store-filter {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  max-width: 100%;
}
.filter-btn {
  height: 34px;
  padding: 0 14px;
  border-radius: 8px;
  color: var(--text-2);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}
.filter-btn:hover { color: var(--text); }
.filter-btn[aria-pressed="true"] { background: var(--blue); color: #fff; }

.offer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  margin-top: 16px;
}
.offer[hidden] { display: none; }
.offer {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .15s;
}
.offer:hover { border-color: var(--border); }
.offer-media {
  aspect-ratio: 4 / 3;
  background: #fff;
  display: grid;
  place-items: center;
  padding: 16px;
}
.offer-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.offer-img-fallback {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: #eef1f5;
  color: #7d8796;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.offer-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  padding: 16px;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}
.store-amazon { background: #ff9900; color: #131921; }
.store-ml { background: #ffe600; color: #2d3277; }
.offer-name {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2);
}
.offer-price { font-size: 20px; font-weight: 800; letter-spacing: -.01em; }
.offer-cta { width: 100%; height: 44px; margin-top: auto; font-size: 15px; }
.offer-empty { padding: 24px 4px; color: var(--muted); }
.price-note { margin-top: 12px; padding: 0 4px; color: var(--muted); font-size: 12px; }

/* ---------- Rodapé ---------- */
.site-footer { border-top: 1px solid #1a212c; }
.footer-inner {
  display: grid;
  gap: 14px;
  padding: 28px 16px 32px;
}
.site-footer .brand { height: auto; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.footer-links a { color: var(--text-2); font-size: 14px; }
.footer-links a:hover { color: var(--text); }
.affiliate-disclaimer { color: var(--muted); font-size: 13px; line-height: 1.55; max-width: 720px; }
.copyright { color: #59636f; font-size: 12px; }

@media (min-width: 600px) {
  .offer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offer-media { aspect-ratio: 1 / 1; }
}
@media (min-width: 900px) {
  .offer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
}
@media (min-width: 1200px) {
  .offer-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* ---------- Navegação inferior ---------- */
.bottom-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(10, 14, 20, .96);
  border-top: 1px solid var(--border);
}
.bottom-nav a {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-2);
  font-size: 11px;
  font-weight: 500;
}
.bottom-nav svg { width: 22px; height: 22px; }
.bottom-nav a.is-active { color: var(--text); font-weight: 700; }
.bottom-nav a.is-active svg { color: var(--blue); }

/* =========================================================
   Desktop (≥ 768px)
   ========================================================= */
@media (min-width: 768px) {
  :root { --header-h: 76px; --gutter: 24px; }

  body { padding-bottom: 0; }

  .only-mobile, .only-mobile-inline { display: none; }
  .only-desktop { display: block; }
  .only-desktop-inline { display: inline; }

  .header-inner { column-gap: 24px; padding: 0 var(--gutter); flex-wrap: nowrap; }
  html { scroll-padding-top: calc(var(--header-h) + 16px); }
  .brand-logo { width: 46px; height: 23px; }
  .brand-name { font-size: 20px; }
  .search { display: block; max-width: 400px; min-width: 0; }
  .search-toggle { display: none; }
  .btn-sm { height: 44px; padding: 0 18px; }

  .page { padding: 24px var(--gutter) 0; }

  .cover {
    aspect-ratio: 16 / 9;
    max-height: 420px;
    width: 100%;
    border-radius: 20px;
  }
  .cover-placeholder { font-size: 12px; }
  .mute-btn { right: 18px; bottom: 18px; }

  .profile-info {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: end;
    column-gap: 24px;
    padding: 0 32px;
  }
  .avatar {
    width: 116px; height: 116px;
    margin-top: -52px;
    border-radius: 28px;
  }
  .avatar img { width: 70px; height: 35px; }
  .profile-text { margin: 0; padding-bottom: 8px; }
  .profile-name { font-size: 34px; }
  .profile-bio { font-size: 16px; }
  .profile-actions {
    display: flex;
    gap: 10px;
    margin: 0;
    padding-bottom: 4px;
  }
  .profile-actions .btn { height: 48px; padding: 0 20px; }

  .tabs {
    display: flex;
    gap: 32px;
    margin: 32px 0 0;
    padding: 0 32px;
  }
  .tab { height: 56px; font-size: 16px; }

  .content { padding-top: 40px; }

  .card { padding: 24px; border-radius: 20px; }
  .feed { gap: 20px; }
  .post-title { font-size: 22px; }
  .code { font-size: 12.5px; padding: 18px; }

  .product {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 20px;
    align-items: start;
  }
  .product-photo { aspect-ratio: 1 / 1; border-radius: 14px; }
  .product-body { margin-top: 0; }
  .product-title { font-size: 20px; }
  .stores { display: flex; gap: 8px; }
  .btn-store { height: 38px; padding: 0 14px; font-size: 14px; }

  .finds { padding: 0 0 48px; }
  .finds-grid { grid-template-columns: repeat(6, 1fr); gap: 6px; }

  .bottom-nav { display: none; }

  .catalog { gap: 56px; padding: 24px 0 64px; }
  .category-head h2 { font-size: 26px; }
  .footer-inner { padding: 36px var(--gutter) 40px; }
}

/* Entre 768 e 1023px o menu fica na segunda linha do cabeçalho */
@media (min-width: 768px) and (max-width: 1023px) {
  .header-inner { flex-wrap: wrap; }
  .cat-nav { margin-top: -10px; }
  html { scroll-padding-top: calc(var(--header-h) + 52px); }
}
@media (min-width: 1024px) {
  .cat-nav { order: 0; flex-basis: auto; height: auto; margin: 0 0 0 4px; }
}

/* =========================================================
   Desktop largo (≥ 1024px): Achados vira barra lateral
   ========================================================= */
@media (min-width: 1024px) {
  .content {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 280px;
    gap: 40px;
    align-items: start;
  }
  .finds {
    margin-top: 0;
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
  .finds-head { padding-top: 4px; }
  .finds-grid { grid-template-columns: repeat(3, 1fr); }
}
