/*
Theme Name: Ofertaí
Description: Tema para sites de ofertas e links de afiliados. Vitrine de produtos com selo de desconto, busca, categorias, modo escuro e botões flutuantes de WhatsApp e curso.
Version: 1.2.0
Requires at least: 5.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ofertai
*/

:root {
  --bg: #FFF8F0;
  --surface: #FFFFFF;
  --ink: #1C1612;
  --muted: #6F645B;
  --line: #F1E4D6;
  --orange: #FF6B00;
  --orange-dark: #E85F00;
  --yellow: #FFD43B;
  --pill: #FFEFC9;
  --pill-hover: #FFE3A0;
  --on-orange: #FFFFFF;
  --thumb: #FFFFFF;
  --shadow: 0 6px 20px rgba(255, 107, 0, .10);
  --f-display: "Archivo Black", "Arial Black", Impact, sans-serif;
  --f-body: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --gutter-l: max(16px, env(safe-area-inset-left, 0px));
  --gutter-r: max(16px, env(safe-area-inset-right, 0px));
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #17110C; --surface: #221A13; --ink: #FFF3E6; --muted: #B8A99A; --line: #3A2D22;
    --pill: #3A2A14; --pill-hover: #4B3719; --shadow: 0 6px 20px rgba(0,0,0,.35); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #17110C; --surface: #221A13; --ink: #FFF3E6; --muted: #B8A99A; --line: #3A2D22;
  --pill: #3A2A14; --pill-hover: #4B3719; --shadow: 0 6px 20px rgba(0,0,0,.35); color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 15px; line-height: 1.45;
}
img { max-width: 100%; height: auto; }
a { color: inherit; }
button { font-family: inherit; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

.screen-reader-text {
  border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); height: 1px; margin: -1px; overflow: hidden;
  padding: 0; position: absolute !important; width: 1px; word-wrap: normal !important;
}
.skip-link:focus {
  clip: auto; clip-path: none; height: auto; width: auto; margin: 0; padding: 12px 18px; background: var(--yellow); color: #1C1612;
  left: 8px; top: 8px; z-index: 100000; font-weight: 700; border-radius: 8px;
}
.wrap { max-width: 1180px; margin: 0 auto; padding-left: var(--gutter-l); padding-right: var(--gutter-r); }

/* Cabeçalho */
.site-header { position: sticky; top: 0; z-index: 20; background: var(--surface); border-bottom: 1px solid var(--line); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; } }
.header-top { display: flex; align-items: center; gap: 20px; padding-block: 16px 12px; }
.logo { font-family: var(--f-display); font-size: 34px; letter-spacing: -1px; color: var(--orange); text-decoration: none; line-height: 1; text-transform: uppercase; flex: none; }
.logo span { color: var(--ink); }
.logo-img img { max-height: 48px; width: auto; display: block; }
.search { flex: 1; display: flex; max-width: 560px; min-width: 0; }
.search input[type="search"] {
  flex: 1; min-width: 0; height: 46px; padding: 0 16px; font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; -webkit-appearance: none; appearance: none;
}
.search input::placeholder { color: var(--muted); }
.search button {
  height: 46px; padding: 0 22px; border: 0; border-radius: 0 10px 10px 0; background: var(--orange); color: var(--on-orange);
  font-weight: 700; letter-spacing: .5px; cursor: pointer;
}
.search button:hover { background: var(--orange-dark); }
.icon-btn {
  width: 48px; height: 46px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line);
  border-radius: 10px; color: var(--orange); cursor: pointer; flex: none; text-decoration: none; padding: 0;
}
.icon-btn svg { width: 20px; height: 20px; }
.theme-btn { margin-left: auto; }
.pills { display: flex; gap: 10px; padding-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.pills::-webkit-scrollbar { display: none; }
.pill {
  flex: none; background: var(--pill); color: var(--ink); font-size: 14px; font-weight: 500; text-decoration: none;
  padding: 9px 16px; border-radius: 999px; transition: background .15s;
}
.pill:hover { background: var(--pill-hover); }
.pill.is-current { background: var(--yellow); color: #1C1612; font-weight: 700; }

/* Banner */
.hero {
  margin-top: 26px; border-radius: 26px; padding: 40px;
  background: linear-gradient(120deg, #FF6B00 0%, #FF8A12 60%, #FF9A1F 100%); color: #fff; position: relative; overflow: hidden;
}
.hero h1 { margin: 0 0 10px; font-family: var(--f-display); font-weight: 400; font-size: clamp(34px, 6vw, 56px); letter-spacing: -1.5px; line-height: 1.05; text-wrap: balance; }
.hero p { margin: 0 0 24px; max-width: 540px; font-size: 17px; line-height: 1.6; }
.hero .cta {
  display: inline-block; background: var(--yellow); color: #1C1612; text-decoration: none; font-weight: 800;
  letter-spacing: .5px; padding: 15px 24px; border-radius: 12px;
}
.hero .cta:hover { background: #FFDD66; }
.hero .tag { position: absolute; right: 8%; top: 50%; width: 110px; transform: translateY(-50%) rotate(-8deg); opacity: .95; }

/* Títulos de seção */
.section-head { margin: 34px 0 16px; }
.section-head h1, .section-head h2 { margin: 0; font-size: 26px; font-weight: 700; letter-spacing: -.3px; }
.section-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }

/* Cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 18px; padding-bottom: 20px; }
.card {
  display: flex; flex-direction: column; min-width: 0; background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 0 14px 14px; position: relative; transition: transform .15s, box-shadow .15s;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.badge {
  position: absolute; top: 12px; left: 12px; z-index: 1; background: var(--yellow); color: #1C1612;
  font-weight: 800; font-size: 13px; padding: 5px 10px; border-radius: 9px;
}
.thumb {
  height: 190px; margin: 0 -14px 16px; display: grid; place-items: center; background: var(--thumb);
  border-radius: 17px 17px 0 0; overflow: hidden; padding: 8px;
}
.thumb img { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumb svg { width: 90px; height: 90px; color: #E2C9AE; }
.cat { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--orange); }
.title { margin: 6px 0 14px; font-size: 15px; font-weight: 400; line-height: 1.5; flex: 1; }
.title a { text-decoration: none; }
.title a:hover { text-decoration: underline; }
.price { font-family: var(--f-display); font-size: 25px; letter-spacing: -.5px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.old { margin-top: 2px; font-size: 12px; color: var(--muted); text-decoration: line-through; font-variant-numeric: tabular-nums; }
.store { margin: 4px 0 14px; font-size: 12.5px; color: var(--muted); }
.offer-btn {
  display: block; text-align: center; text-decoration: none; background: var(--orange); color: var(--on-orange);
  font-weight: 800; letter-spacing: .6px; padding: 14px; border-radius: 12px;
}
.offer-btn:hover { background: var(--orange-dark); }
.empty { grid-column: 1 / -1; text-align: center; padding: 50px 0; color: var(--muted); }

/* Paginação */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; padding: 6px 0 30px; }
.pagination .page-numbers {
  min-width: 42px; height: 42px; padding: 0 14px; display: inline-grid; place-items: center; background: var(--surface);
  border: 1px solid var(--line); border-radius: 10px; text-decoration: none; font-weight: 600;
}
.pagination a.page-numbers:hover { background: var(--pill); }
.pagination .page-numbers.current { background: var(--orange); color: var(--on-orange); border-color: var(--orange); }
.pagination .dots { border: 0; background: none; }

/* Página da oferta */
.back-link { display: inline-block; margin: 26px 0 0; color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--orange); }
.offer-detail { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 34px; margin-top: 16px; align-items: start; }
.offer-media { position: relative; background: var(--thumb); border: 1px solid var(--line); border-radius: 20px; padding: 24px; display: grid; place-items: center; min-height: 320px; }
.offer-media img { max-height: 460px; width: auto; max-width: 100%; object-fit: contain; }
.offer-media svg { width: 120px; height: 120px; color: #E2C9AE; }
.offer-info h1 { margin: 6px 0 16px; font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; letter-spacing: -.4px; text-wrap: balance; }
.offer-info .price { font-size: 38px; }
.offer-info .old { font-size: 14px; }
.offer-info .store { font-size: 14px; margin-bottom: 20px; }
.offer-info .offer-btn { display: inline-block; padding: 16px 34px; }
.aff-note { margin-top: 14px; color: var(--muted); font-size: 12.5px; max-width: 460px; }
.stores { margin-top: 26px; max-width: 460px; }
.stores-title { margin: 0 0 10px; font-size: 15px; font-weight: 700; }
.stores-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.stores-list li { display: flex; align-items: center; gap: 8px 12px; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; }
.s-name { font-weight: 700; flex: 1; min-width: 90px; }
.s-price { font-family: var(--f-display); font-variant-numeric: tabular-nums; }
.store-btn { text-decoration: none; font-weight: 800; font-size: 13px; letter-spacing: .5px; color: var(--orange); border: 2px solid var(--orange); padding: 8px 14px; border-radius: 10px; }
.store-btn:hover { background: var(--orange); color: var(--on-orange); }
.entry-content { max-width: 720px; line-height: 1.7; font-size: 16px; }
.entry-content > *:first-child { margin-top: 0; }
.entry-content a { color: var(--orange-dark); }
.entry-content img { border-radius: 12px; }
.offer-desc { margin-top: 26px; }
.page-wrap { padding-block: 30px 40px; }
.page-wrap h1 { font-size: clamp(26px, 4vw, 38px); letter-spacing: -.5px; margin: 0 0 18px; }
.post-list article { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px 20px; margin-bottom: 14px; }
.post-list h2 { margin: 0 0 6px; font-size: 20px; }
.post-list h2 a { text-decoration: none; }
.alignleft { float: left; margin: 0 1.5em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1.5em; }
.aligncenter { display: block; margin-inline: auto; }
.wp-caption-text, figcaption { font-size: 13px; color: var(--muted); }

/* Rodapé */
.site-footer { margin-top: 30px; border-top: 1px solid var(--line); background: var(--surface); padding-block: 26px; color: var(--muted); font-size: 13px; }
.footer-in { display: flex; flex-wrap: wrap; gap: 14px 30px; align-items: center; justify-content: space-between; }
.footer-in p { margin: 0; max-width: 620px; }
.footer-in .logo { font-size: 24px; }

/* Botões flutuantes */
.float-dock {
  position: fixed; z-index: 40; right: max(16px, env(safe-area-inset-right, 0px));
  bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 12px; align-items: flex-end;
}
.fab {
  position: relative; display: flex; align-items: center; justify-content: center; width: 58px; height: 58px; border-radius: 50%;
  color: #fff; text-decoration: none; box-shadow: 0 8px 22px rgba(0,0,0,.25); transition: transform .15s;
}
.fab:hover { transform: scale(1.07); }
.fab svg { width: 28px; height: 28px; }
.fab-wa { background: #1FAF54; }
.fab-pdf { background: #D8353A; }
.fab-label {
  position: absolute; right: calc(100% + 10px); top: 50%; transform: translateY(-50%) translateX(6px); white-space: nowrap;
  background: var(--ink); color: var(--bg); font-size: 13px; font-weight: 600; padding: 8px 12px; border-radius: 9px;
  opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.fab:hover .fab-label, .fab:focus-visible .fab-label { opacity: 1; transform: translateY(-50%); }

@media (max-width: 800px) {
  .offer-detail { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 640px) {
  .header-top { flex-wrap: wrap; gap: 12px; }
  .logo { font-size: 30px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hero { padding: 28px 22px; border-radius: 20px; }
  .hero .tag { display: none; }
  .thumb { height: 170px; }
  .fab { width: 54px; height: 54px; }
  .fab-label { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .pill, .fab { transition: none; }
  .card:hover, .fab:hover { transform: none; }
}
