/* Black Friday Portugal: "catálogo de Natal em papel" design. Decisions in docs/DESIGN.md. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url(/assets/fonts/fraunces-600-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Palette */
  --paper: #f6f0e4;          /* canvas: wrapping-paper cream */
  --paper-deep: #ede3d0;     /* alternate band */
  --surface: #fffdf8;        /* cards and forms */
  --photo: #ffffff;          /* product photos are shot on white */
  --ink: #1c2621;            /* text: pine-tinted near black */
  --ink-soft: #4f564f;       /* secondary text */
  --line: #ddd2bd;           /* warm hairlines */
  --pine: #173f30;           /* brand: header, active chips */
  --pine-2: #22553f;         /* pine hover */
  --pine-tint: #e3ebe5;      /* pine wash */
  --ribbon: #b3202c;         /* action: Amazon buttons, primary CTA */
  --ribbon-hover: #951a24;
  --ribbon-press: #7d1520;
  --gold: #c8962c;           /* small decorative accents only, never text */
  --on-dark: #fbf6ec;        /* text on pine */
  --link: #1d5a43;
  --focus: #0b5cad;

  /* Type */
  --font-display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --step--1: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.0625rem);
  --step-1: clamp(1.125rem, 1.07rem + 0.25vw, 1.25rem);
  --step-2: clamp(1.375rem, 1.25rem + 0.6vw, 1.75rem);
  --step-3: clamp(1.75rem, 1.45rem + 1.4vw, 2.5rem);
  --step-4: clamp(2rem, 1.5rem + 2.4vw, 3.25rem);
  --measure: 68ch;

  /* Geometry: radius scale, sharper for big containers */
  --r-lg: 18px;
  --r-md: 12px;
  --r-sm: 8px;
  --r-pill: 999px;
  --shadow: 0 1px 1px rgb(60 45 20 / 0.05), 0 2px 4px rgb(60 45 20 / 0.05), 0 8px 18px rgb(60 45 20 / 0.06);
  --shadow-hover: 0 1px 1px rgb(60 45 20 / 0.06), 0 4px 8px rgb(60 45 20 / 0.07), 0 14px 28px rgb(60 45 20 / 0.09);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 var(--step-0)/1.6 var(--font-body); }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--link); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.site-header :focus-visible, .site-footer :focus-visible, .feature-draw :focus-visible { outline-color: #f2c9a0; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; text-wrap: balance; color: var(--ink); }
h1 { font-size: var(--step-4); line-height: 1.08; margin: 0.3em 0 0.35em; letter-spacing: -0.01em; }
h2 { font-size: var(--step-3); line-height: 1.15; margin: 0 0 0.5em; }
h3 { font-size: var(--step-1); line-height: 1.25; margin: 0 0 0.4em; }
p { margin: 0 0 1em; }
.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 { position: absolute; left: 1rem; top: 0; transform: translateY(-120%); background: var(--surface); color: var(--ink); padding: 0.6rem 1rem; border-radius: var(--r-sm); z-index: 10; }
.skip:focus { transform: translateY(0.5rem); }
.wrap { width: min(1180px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-header { background: var(--pine); color: var(--on-dark); border-bottom: 5px solid var(--ribbon); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; flex-wrap: wrap; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--on-dark); text-decoration: none; font: 600 1.2rem/1 var(--font-display); }
.brand em { font-style: normal; color: #f2c9a0; }
.brand-mark { width: 30px; height: 30px; fill: none; stroke: var(--on-dark); stroke-width: 2; stroke-linejoin: round; }
.brand:hover { color: var(--on-dark); }
.nav { display: flex; gap: 0.25rem 1.1rem; flex-wrap: wrap; }
.nav a { color: var(--on-dark); text-decoration: none; font-size: var(--step--1); padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover, .nav a[aria-current="page"] { border-bottom-color: #f2c9a0; color: var(--on-dark); }

/* Hero */
.hero { padding: 1.25rem 0 1.5rem; border-bottom: 1px solid var(--line); }
.hero .lede { font-size: var(--step-1); max-width: 60ch; color: var(--ink); margin-bottom: 0.6rem; }
.hero-meta { display: flex; flex-direction: column; gap: 0.35rem; max-width: 78ch; }
.updated { font-size: var(--step--1); color: var(--ink-soft); margin: 0; }
.disclosure { font-size: var(--step--1); color: var(--ink-soft); margin: 0; max-width: 78ch; }
.hero-home { background: var(--paper-deep); padding: 1.75rem 0 1.5rem; }
.hero-home .updated { margin-top: 0.3rem; }
@media (min-width: 1000px) {
  .hero-home { background: var(--paper-deep) url(/img/hero-inicio.webp) no-repeat right max(16px, calc((100vw - 1180px) / 2)) center / auto 92%; }
  .hero-home .hero-grid > div { max-width: 640px; }
}
.crumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 0.2rem 0.5rem; padding: 0; margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: var(--line); }

/* Buttons */
.cta { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0.6rem 1.15rem; border-radius: 10px; background: var(--ribbon); color: #fff; font-weight: 650; text-decoration: none; border: 0; cursor: pointer; font-size: var(--step-0); line-height: 1.2; }
.cta:hover { background: var(--ribbon-hover); color: #fff; }
.cta:active { background: var(--ribbon-press); }
.cta-small { min-height: 40px; padding: 0.5rem 0.9rem; font-size: var(--step--1); }
.cta-big { min-height: 52px; padding: 0.8rem 1.6rem; font-size: var(--step-1); }
.btn-secondary { min-height: 44px; padding: 0.5rem 1rem; border-radius: 10px; border: 1.5px solid var(--pine); background: var(--surface); color: var(--pine); font: 600 var(--step--1) var(--font-body); cursor: pointer; }
.btn-secondary:hover { background: var(--pine-tint); }
.btn-secondary:active { background: #d2e0d6; }
.text-link { margin-left: 0.8rem; font-weight: 600; }

/* Quick picks: first screen on phones shows a product and its button */
.picks { margin: 1.25rem 0 0.5rem; }
.picks-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; counter-reset: pick; }
.pick { display: grid; grid-template-columns: 96px 1fr; gap: 0.85rem; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0.7rem; box-shadow: var(--shadow); counter-increment: pick; position: relative; }
.pick::before { content: counter(pick); position: absolute; top: -0.5rem; left: -0.5rem; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--pine); color: var(--on-dark); font: 600 0.9rem/1.6rem var(--font-display); text-align: center; }
.pick-media { background: var(--photo); border-radius: var(--r-sm); height: 96px; padding: 6px; overflow: hidden; }
.pick-media img { width: 100%; height: 100%; object-fit: contain; }
.pick-label { margin: 0; font-size: var(--step--1); font-weight: 650; color: var(--pine); }
.pick-name { margin: 0.1rem 0 0.5rem; font: 600 var(--step-0)/1.3 var(--font-display); }
@media (min-width: 760px) {
  .picks-list { grid-template-columns: repeat(3, 1fr); gap: 1.1rem; }
  .pick { grid-template-columns: 1fr; align-items: start; padding: 1rem; }
  .pick-media { height: 210px; }
}

.prose { max-width: var(--measure); }
.intro { margin-top: 1.5rem; }
.toc { margin: 1rem 0 0.5rem; padding: 0.9rem 1.1rem; background: var(--pine-tint); border-radius: var(--r-md); max-width: var(--measure); }
.toc p { margin: 0 0 0.3rem; font-weight: 650; font-size: var(--step--1); }
.toc ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; }

/* Sections */
.section { margin: 2.6rem 0; }
.section-intro { color: var(--ink-soft); max-width: var(--measure); }

/* Product cards */
.cards { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr)); margin-top: 1rem; }
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow); }
.card-media { background: var(--photo); height: 220px; padding: 1rem; overflow: hidden; border-bottom: 1px solid var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: contain; }
.card-body { display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem 1.1rem 1.2rem; flex: 1; }
.card-body h3 { margin: 0; }
.why { margin: 0; }
.facts { margin: 0 0 0.4rem; display: grid; gap: 0.4rem; font-size: var(--step--1); }
.facts div { display: grid; grid-template-columns: 6.6rem 1fr; gap: 0.5rem; }
.facts dt { font-weight: 650; color: var(--pine); }
.facts dd { margin: 0; color: var(--ink-soft); }
.card .cta { margin-top: auto; align-self: flex-start; }
@media (prefers-reduced-motion: no-preference) {
  .card, .tile, .mini { transition: box-shadow 0.18s ease, transform 0.18s ease; }
  .card:hover, .tile:hover { box-shadow: var(--shadow-hover); transform: translateY(-2px); }
}

/* Lists, FAQ, dates */
.how ul, .dates ul, .prose ul { padding-left: 1.2rem; max-width: var(--measure); }
.how li, .dates li { margin-bottom: 0.5rem; }
.steps { padding-left: 1.3rem; max-width: var(--measure); }
.steps li { margin-bottom: 0.6rem; }
.dates { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.4rem 1.5rem 0.8rem; }
.faq details { border-bottom: 1px solid var(--line); padding: 0.85rem 0; max-width: var(--measure); }
.faq summary { cursor: pointer; font-weight: 650; list-style-position: outside; }
.faq summary:hover { color: var(--pine); }
.faq details p { margin: 0.6rem 0 0; color: var(--ink-soft); }

/* Tiles */
.tiles { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.9rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .tiles { grid-template-columns: repeat(3, 1fr); gap: 1.2rem; } }
.tile { display: flex; flex-direction: column; height: 100%; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.tile img { aspect-ratio: 3 / 2; width: 100%; object-fit: cover; background: var(--paper-deep); }
.tile-name { font: 600 var(--step-1)/1.2 var(--font-display); padding: 0.7rem 0.85rem 0.15rem; }
.tile-line { font-size: var(--step--1); color: var(--ink-soft); padding: 0 0.85rem 0.85rem; }
.tile:hover { color: var(--ink); }

/* Home finder */
.finder { margin: 1.4rem 0 2rem; }
.finder h2 { font-size: var(--step-2); margin-bottom: 0.6rem; }
.finder-controls { display: grid; gap: 0.7rem; margin-bottom: 0.9rem; }
.chip-group { display: flex; flex-wrap: wrap; gap: 0.45rem; align-items: center; }
.chip-title { font-size: var(--step--1); font-weight: 650; color: var(--ink-soft); width: 100%; }
@media (min-width: 760px) { .chip-title { width: 6.5rem; } }
.chip { min-height: 40px; padding: 0.4rem 0.95rem; border-radius: var(--r-pill); border: 1.5px solid var(--pine); background: var(--surface); color: var(--pine); font: 600 var(--step--1) var(--font-body); cursor: pointer; }
.chip:hover { background: var(--pine-tint); }
.chip[aria-pressed="true"] { background: var(--pine); color: var(--on-dark); }
.finder-status { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.finder .disclosure { margin-bottom: 0.8rem; }
.finder-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 760px) { .finder-grid { grid-template-columns: repeat(4, 1fr); gap: 1rem; } }
.mini { display: flex; flex-direction: column; gap: 0.35rem; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 0.7rem; }
.mini[hidden] { display: none; }
.mini img { aspect-ratio: 1; width: 100%; object-fit: contain; background: var(--photo); border-radius: var(--r-sm); padding: 6px; }
.mini-name { margin: 0; font: 600 var(--step--1)/1.3 var(--font-display); font-size: 1rem; }
.mini-why { margin: 0; font-size: var(--step--1); color: var(--ink-soft); line-height: 1.45; }
.mini .cta { margin-top: auto; width: 100%; white-space: nowrap; padding-inline: 0.5rem; }
@media (max-width: 759px) {
  .chip-group { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px 4px; }
  .chip-group::-webkit-scrollbar { display: none; }
  .chip, .chip-title { flex: none; }
  .chip-title { width: auto; margin-right: 0.2rem; }
  .hero-home { padding: 1.1rem 0 1rem; }
  .hero-home h1 { font-size: 1.75rem; }
  .hero-guide h1 { font-size: 1.55rem; margin: 0.25em 0 0.3em; }
  .hero-guide .hero-meta { gap: 0.2rem; }
  .mini img { aspect-ratio: 4 / 3; }
  .finder h2 { font-size: var(--step-1); margin-bottom: 0.4rem; }
  .hero-guide { padding: 0.9rem 0 1rem; }
  .hero-guide .lede { font-size: var(--step-0); margin-bottom: 0.4rem; }
  .picks { margin-top: 0.9rem; }
  .pick { padding: 0.55rem; }
  .hero-home .lede { font-size: var(--step-0); }
  .header-row { padding: 0.55rem 0; row-gap: 0.2rem; }
  .nav { gap: 0.2rem 0.9rem; }
}
.finder-empty { padding: 1rem; background: var(--surface); border-radius: var(--r-md); }

.feature-draw { background: var(--pine); color: var(--on-dark); border-radius: var(--r-lg); padding: 1.6rem 1.5rem; }
.feature-draw h2 { color: var(--on-dark); }
.feature-draw p { max-width: 62ch; }
.feature-draw .text-link { color: #f2c9a0; }
.feature-draw .text-link:hover { color: var(--on-dark); }
.method { border-top: 1px solid var(--line); padding-top: 2rem; }

/* Draw tool */
.tool { margin: 1.25rem 0 2rem; }
.draw-form, .results, .reveal { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.3rem; box-shadow: var(--shadow); max-width: 760px; }
.field { margin: 0 0 1.1rem; border: 0; padding: 0; }
fieldset.field { min-width: 0; }
.field label, .field legend { display: block; font-weight: 650; margin-bottom: 0.35rem; }
.optional { font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); }
.hint { font-size: var(--step--1); color: var(--ink-soft); margin: 0 0 0.5rem; }
.field-row { display: grid; gap: 0 1rem; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
input[type="text"], input[type="date"], select { width: 100%; min-height: 46px; padding: 0.55rem 0.75rem; font: inherit; color: var(--ink); background: #fff; border: 1.5px solid #8a7f6a; border-radius: var(--r-sm); }
input:focus-visible, select:focus-visible { border-color: var(--focus); }
.names { list-style: none; padding: 0; margin: 0 0 0.6rem; display: grid; gap: 0.5rem; }
.names li { display: grid; grid-template-columns: 2rem 1fr 44px; gap: 0.5rem; align-items: center; }
.names .num { color: var(--ink-soft); font-size: var(--step--1); text-align: right; }
.names .remove { width: 44px; height: 44px; border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; font-size: 1.25rem; line-height: 1; }
.names .remove:hover { border-color: var(--ribbon); color: var(--ribbon); }
.excl summary { cursor: pointer; font-weight: 650; }
.excl-row { display: grid; grid-template-columns: 1fr auto 1fr; gap: 0.5rem; align-items: center; margin-top: 0.4rem; }
.excl-row .btn-secondary { grid-column: 1 / -1; justify-self: start; }
@media (min-width: 560px) { .excl-row { grid-template-columns: 1fr auto 1fr auto; } .excl-row .btn-secondary { grid-column: auto; } }
.excl-list { list-style: none; padding: 0; margin: 0.7rem 0 0; display: flex; flex-wrap: wrap; gap: 0.45rem; }
.excl-list li { display: inline-flex; align-items: center; gap: 0.4rem; background: var(--pine-tint); border-radius: var(--r-pill); padding: 0.25rem 0.35rem 0.25rem 0.8rem; font-size: var(--step--1); }
.excl-list button { border: 0; background: transparent; cursor: pointer; width: 32px; height: 32px; border-radius: 50%; font-size: 1.1rem; color: var(--ink-soft); }
.form-error { color: var(--ribbon); font-weight: 650; min-height: 1.2em; margin: 0 0 0.6rem; }
.result-list { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.6rem; }
.result-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line); border-radius: var(--r-md); background: #fff; }
.result-name { font-weight: 650; }
.result-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.result-actions .cta, .result-actions .btn-secondary { min-height: 40px; font-size: var(--step--1); padding: 0.4rem 0.8rem; }
.results-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.reveal { text-align: center; padding: 2rem 1.3rem; }
.reveal-hello { font: 600 var(--step-2)/1.25 var(--font-display); margin-bottom: 0.4rem; }
.reveal-meta { color: var(--ink-soft); }
.reveal-name { font: 600 var(--step-4)/1.1 var(--font-display); color: var(--ribbon); margin: 1rem 0; overflow-wrap: anywhere; }
@media (prefers-reduced-motion: no-preference) {
  .reveal-name:not([hidden]) { animation: pop 0.45s ease-out; }
  @keyframes pop { from { transform: scale(0.9); } to { transform: none; } }
}
.notice { background: #fff6e0; border: 1px solid var(--gold); border-radius: var(--r-md); padding: 0.9rem 1rem; }

/* Legal pages */
.page-text { padding: 1.5rem 0 3rem; }
.page-text h2 { font-size: var(--step-2); margin-top: 1.8rem; }

/* Footer */
.site-footer { background: var(--pine); color: var(--on-dark); margin-top: 3rem; padding: 2.2rem 0 2.6rem; font-size: var(--step--1); border-top: 5px solid var(--ribbon); }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: #f2c9a0; }
.footer-grid { display: grid; gap: 1.5rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr; } }
.footer-brand { font: 600 1.15rem var(--font-display); }
.footer-brand em { font-style: normal; color: #f2c9a0; }
.footer-note { opacity: 0.85; max-width: 70ch; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 0.45rem; }
