/* =============================================================
   Kafetto — styles.css
   1. Tokens  2. Reset  3. Utilities  4. Typography  5. Components
   6. Sections  7. Comparator & charts  8. Responsive  9. Reduced motion
   ============================================================= */

/* =============================================================
   1. Tokens
   ============================================================= */
:root {
  --bg: #faf5ef;
  --bg-alt: #f1e6d8;
  --card: #ffffff;
  --text: #2b2016;
  --text-soft: #6e6052;
  --coffee-dark: #3d2b1f;
  --coffee-mid: #7a4a2b;
  --accent: #b5652f;
  --accent-strong: #934f22;
  --accent-soft: #f1ddc4;
  --cream: #e8cfa6;
  --ok: #5e8c5a;
  --ok-soft: #e6efe4;
  --warn-bg: #fdecc8;
  --warn-text: #8a5a00;
  --line: #e4d6c2;
  --error-bg: #fbe6e2;
  --error-text: #96351f;
  --focus: #934f22;

  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --serif: "Fraunces", Georgia, serif;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --radius: 16px;
  --radius-sm: 10px;
  --gutter: 1.25rem;
  --container: 1120px;
  --container-narrow: 760px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #211a14;
    --bg-alt: #2a2118;
    --card: #2a2118;
    --text: #f1e7da;
    --text-soft: #c4b4a0;
    --coffee-dark: #f1e7da;
    --coffee-mid: #d9a876;
    --accent: #e2975c;
    --accent-strong: #eeb27f;
    --accent-soft: #3c2e1f;
    --cream: #4a3824;
    --ok: #8fbf8a;
    --ok-soft: #273124;
    --warn-bg: #3a2e13;
    --warn-text: #e8c069;
    --line: #443627;
    --error-bg: #3a2620;
    --error-text: #f2a08e;
    --focus: #e2975c;
  }
}

/* =============================================================
   2. Reset & base
   ============================================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; tab-size: 2; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
  overscroll-behavior-y: none;
}
img, svg, video { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; }
a { color: inherit; text-decoration: none; }
p { text-wrap: pretty; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.1; font-family: var(--serif); font-weight: 600; color: var(--coffee-dark); }
ul, ol { padding-left: 1.2em; }
table { border-collapse: collapse; width: 100%; }
::selection { background: var(--accent-soft); color: var(--accent-strong); }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 3px; border-radius: 4px; }

/* =============================================================
   3. Utilities
   ============================================================= */
.container { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container-narrow { max-width: var(--container-narrow); margin-inline: auto; padding-inline: 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; }
.skip-link {
  position: fixed; top: -100px; left: 1rem; padding: .6rem 1rem; background: var(--card); color: var(--text);
  z-index: 9999; border-radius: 8px; font-weight: 600; box-shadow: 0 4px 14px rgba(0,0,0,.15);
}
.skip-link:focus { top: 1rem; }

/* =============================================================
   4. Typography
   ============================================================= */
.hero-title { font-size: clamp(1.9rem, 4.2vw, 3rem); max-width: 22ch; }
.hero-subtitle { color: var(--text-soft); font-size: 1.05rem; max-width: 56ch; margin-top: .75rem; }
.section-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: .6rem; }
.lead { color: var(--text-soft); max-width: 68ch; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--accent-strong); }

/* =============================================================
   5. Components
   ============================================================= */

/* header / nav */
.site-header { display: flex; align-items: center; justify-content: space-between; padding-block: 1rem; border-bottom: 1px solid var(--line); flex-wrap: wrap; gap: .75rem; }
.brand { display: flex; align-items: center; gap: .55rem; font-family: var(--serif); font-weight: 700; font-size: 1.2rem; color: var(--coffee-dark); }
.brand-mark { width: 30px; height: 30px; flex: none; }
.main-nav { display: flex; gap: 1.25rem; flex-wrap: wrap; font-weight: 600; font-size: .92rem; }
.main-nav a:hover { color: var(--accent); }

/* disclosure line — small, in the footer only */
.footer-disclosure { font-size: .82rem; color: var(--text-soft); margin-bottom: .5rem; }
.footer-disclosure a { text-decoration: underline; }

/* sample banner — on sample products only */
.sample-banner {
  background: var(--warn-bg); color: var(--warn-text); border: 1px solid #e8c069;
  border-radius: var(--radius-sm); padding: .9rem 1.1rem; font-size: .92rem; font-weight: 600;
  margin-bottom: 1.25rem;
}

/* panel / card */
.panel, .card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 12px 34px -20px rgba(60, 35, 10, .3); }
.panel { padding: 1.5rem; }
@media (min-width: 720px) { .panel { padding: 2rem; } }

/* category cards */
.cat-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-block: 1.5rem; }
.cat-card { display: block; padding: 1.25rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .2s var(--ease-out), box-shadow .2s var(--ease-out); }
.cat-card:hover { transform: translateY(-3px); box-shadow: 0 14px 30px -18px rgba(60,35,10,.35); }
.cat-card .cat-icon { width: 40px; height: 40px; color: var(--accent); margin-bottom: .6rem; }
.cat-card h3 { font-size: 1.05rem; margin-bottom: .3rem; }
.cat-card p { color: var(--text-soft); font-size: .9rem; }

/* filter bar */
.filter-bar { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; margin-block: 1.25rem; }
.filter-group { display: flex; flex-wrap: wrap; gap: .45rem; }
.chip {
  padding: .45rem .9rem; border-radius: 999px; border: 1px solid var(--line); background: var(--card);
  font-size: .85rem; font-weight: 600; color: var(--text-soft); transition: all .15s var(--ease-out);
}
.chip.is-active { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip:hover:not(.is-active) { border-color: var(--accent); color: var(--text); }

/* product grid + card */
.product-grid { display: grid; gap: 1.1rem; grid-template-columns: 1fr; margin-block: 1.25rem; }
.product-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.product-card[hidden] { display: none; }
.product-card .thumb { aspect-ratio: 4/3; background: var(--bg-alt); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.product-card .thumb svg { width: 56px; height: 56px; color: var(--coffee-mid); }
.product-card .thumb img { width: 100%; height: 100%; object-fit: contain; padding: .75rem; }
.product-card .body { padding: 1.1rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.product-card h3 { font-size: 1.02rem; }
.product-card .tag-row { display: flex; flex-wrap: wrap; gap: .4rem; }
.tag { font-size: .72rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); }
.price-row { display: flex; align-items: baseline; gap: .5rem; margin-top: .25rem; }
.price-now { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; color: var(--coffee-dark); }
.price-was { font-size: .88rem; color: var(--text-soft); text-decoration: line-through; }
.rating-row { display: flex; align-items: center; gap: .4rem; font-size: .85rem; color: var(--text-soft); }
.rating-row .stars { color: var(--accent); }
.price-note { font-size: .74rem; color: var(--text-soft); }

.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  background: var(--accent); color: #fff; font-weight: 700; font-size: .98rem;
  padding: .8rem 1.4rem; border-radius: 999px; transition: background .2s var(--ease-out), transform .15s var(--ease-out);
}
.btn-primary:hover { background: var(--accent-strong); }
.btn-primary:active { transform: scale(.98); }
.btn-primary[aria-disabled="true"] { opacity: .55; pointer-events: none; }
.btn-secondary {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  border: 1px solid var(--line); color: var(--text); font-weight: 700; font-size: .95rem;
  padding: .7rem 1.2rem; border-radius: 999px; transition: border-color .2s var(--ease-out);
}
.btn-secondary:hover { border-color: var(--accent); color: var(--accent); }
.btn-block { width: 100%; }

/* ficha (product page) */
.ficha-head { display: grid; gap: 1.5rem; grid-template-columns: 1fr; margin-bottom: 1.5rem; }
.ficha-gallery { aspect-ratio: 1/1; background: var(--bg-alt); border-radius: var(--radius); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.ficha-gallery svg { width: 96px; height: 96px; color: var(--coffee-mid); }
.ficha-gallery img { width: 100%; height: 100%; object-fit: contain; padding: 1.5rem; }
.ficha-info h1 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); margin-bottom: .4rem; }
.ficha-info .marca { color: var(--text-soft); font-size: .92rem; margin-bottom: .6rem; }

.spec-table { margin-block: 1rem; }
.spec-table caption { text-align: left; font-weight: 700; margin-bottom: .5rem; color: var(--coffee-dark); }
.spec-table tr { border-bottom: 1px solid var(--line); }
.spec-table th, .spec-table td { text-align: left; padding: .55rem .5rem; font-size: .92rem; }
.spec-table th { font-weight: 600; color: var(--text-soft); width: 55%; }
.spec-table td { font-weight: 700; }

.pros-cons { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-block: 1.25rem; }
.pros-cons .col h4 { font-size: .95rem; margin-bottom: .5rem; }
.pros-cons .pros h4 { color: var(--ok); }
.pros-cons .contras h4 { color: var(--error-text); }
.pros-cons ul { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .4rem; font-size: .92rem; }
.pros-cons li { display: flex; gap: .5rem; align-items: flex-start; }
.pros-cons li svg { width: 1.1em; height: 1.1em; flex: none; margin-top: .15em; }
.pros-cons .pros li svg { color: var(--ok); }
.pros-cons .contras li svg { color: var(--error-text); }

.ideal-para { background: var(--ok-soft); border-radius: var(--radius-sm); padding: 1rem 1.25rem; font-weight: 600; margin-block: 1.25rem; }

/* radar chart wrapper */
.radar-wrap { display: flex; flex-direction: column; align-items: center; gap: .6rem; margin-block: 1rem; }
.radar-wrap canvas { max-width: 100%; }
.radar-legend { display: flex; flex-wrap: wrap; gap: .6rem .9rem; font-size: .82rem; justify-content: center; }
.radar-legend .dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-right: .35rem; }

/* comparator */
.compare-picker { display: flex; flex-wrap: wrap; gap: .6rem; margin-block: 1.25rem; }
.compare-picker label { display: flex; align-items: center; gap: .4rem; padding: .5rem .8rem; border: 1px solid var(--line); border-radius: 999px; font-size: .88rem; font-weight: 600; cursor: pointer; }
.compare-picker input { accent-color: var(--accent); }
.compare-table-wrap { overflow-x: auto; }
.compare-table { min-width: 560px; }
.compare-table th, .compare-table td { padding: .6rem .7rem; border-bottom: 1px solid var(--line); font-size: .9rem; text-align: left; white-space: nowrap; }
.compare-table th:first-child, .compare-table td:first-child { white-space: normal; font-weight: 600; color: var(--text-soft); position: sticky; left: 0; background: var(--card); }
.compare-table td.is-best { color: var(--ok); font-weight: 700; }

/* faq */
.faq { border-top: 1px solid var(--line); }
.faq-item { border-bottom: 1px solid var(--line); padding-block: .9rem; }
.faq-item summary { cursor: pointer; font-weight: 700; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font-size: 1.3rem; color: var(--accent); flex: none; }
.faq-item[open] summary::after { content: "\2212"; }
.faq-item p { margin-top: .6rem; color: var(--text-soft); }

/* steps (buying guide) */
.steps { display: grid; gap: 1rem; grid-template-columns: 1fr; margin-block: 1.5rem; }
.step { display: flex; gap: .9rem; align-items: flex-start; }
.step-num { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent-strong); font-weight: 700; display: flex; align-items: center; justify-content: center; }

/* footer */
.site-footer { margin-top: 3rem; padding-block: 2rem; color: var(--text-soft); font-size: .88rem; border-top: 1px solid var(--line); }
.footer-links { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: .75rem; }
.footer-links a:hover { color: var(--accent); }

/* =============================================================
   6. Sections
   ============================================================= */
.hero { padding-block: 2.25rem 1.5rem; }
.section { padding-block: 1.5rem; }

/* =============================================================
   7. Comparator & charts
   ============================================================= */
.empty-state { text-align: center; padding: 2.5rem 1rem; color: var(--text-soft); }

/* =============================================================
   8. Responsive
   ============================================================= */
@media (min-width: 540px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
  .pros-cons { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 720px) {
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .ficha-head { grid-template-columns: 320px 1fr; align-items: start; }
}
@media (min-width: 960px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
}

/* =============================================================
   9. Reduced motion
   ============================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
