/* Sementes Palácio: dark, gold and red, taken from the logo.
   Plain CSS on purpose: no build step, nothing to break. System fonts only
   (no Google Fonts requests, so no third-party tracking and faster pages). */

:root {
  --bg: #000;
  --surface: #14110e;
  --surface-2: #1d1812;
  --border: #2e261c;
  --text: #f4ecdb;
  --muted: #a99f8d;
  --gold: #d9a441;
  --gold-light: #f0c96b;
  --red: #d1281c;
  --red-dark: #a51d14;
  --radius: 14px;
  --serif: Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
/* Jump links (#mercados etc.) land below the sticky header, not under it. */
[id] { scroll-margin-top: 90px; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1rem/1.6 var(--sans);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--gold-light); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: #fff; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; margin: 0 0 .5em; color: var(--gold-light); }
h1 { font-size: clamp(1.9rem, 5vw, 3rem); letter-spacing: .01em; }
h2 { font-size: clamp(1.4rem, 3.5vw, 1.9rem); margin-top: 1.6em; }
.h3, h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
em { font-style: italic; }
.wrap { width: min(1120px, 100% - 2rem); margin-inline: auto; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.lead { font-size: 1.15rem; }

/* Header and navigation */
.site-header { border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; background: rgba(0,0,0,.92); backdrop-filter: blur(6px); }
.header-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .5rem; }
.brand { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--text); }
.brand-name { font-family: var(--serif); font-size: 1.15rem; letter-spacing: .04em; text-transform: uppercase; }
.brand-name strong { color: var(--gold-light); }

.menu summary { list-style: none; cursor: pointer; width: 44px; height: 44px; display: grid; place-items: center; }
.menu summary::-webkit-details-marker { display: none; }
.menu summary span, .menu summary span::before, .menu summary span::after { display: block; width: 22px; height: 2px; background: var(--gold-light); content: ""; position: relative; }
.menu summary span::before { position: absolute; top: -7px; }
.menu summary span::after { position: absolute; top: 7px; }
.nav { position: absolute; left: 0; right: 0; top: 100%; display: flex; flex-direction: column; gap: .25rem; padding: 1rem; background: #000; border-bottom: 1px solid var(--border); }
.nav a:not(.btn) { padding: .6rem .25rem; text-decoration: none; color: var(--text); font-weight: 500; }
.nav a[aria-current="page"] { color: var(--gold-light); }
.nav .btn { align-self: flex-start; margin-top: .25rem; }

/* Wide screens: keep this width in sync with the script at the end of base.html. */
@media (min-width: 1024px) {
  .menu summary { display: none; }
  .menu .nav, .menu:not([open]) .nav { display: flex; }
  .nav { position: static; flex-direction: row; align-items: center; gap: 1.25rem; padding: 0; background: none; border: 0; }
  .nav a, .brand-name { white-space: nowrap; }
  .nav a:not(.btn) { padding: .25rem 0; }
  .nav a:not(.btn):hover { color: var(--gold-light); }
  /* Underline instead of a border, so the active link keeps the same box as the others. */
  .nav a[aria-current="page"]:not(.btn) { text-decoration: underline 2px var(--gold); text-underline-offset: 8px; }
  .nav .btn { margin-top: 0; }
}
@media (min-width: 1024px) and (max-width: 1179px) {
  .nav { gap: .9rem; }
  .brand-name { font-size: 1rem; }
}

/* Language switch: one link to the same page in the other language, showing "PT EN" with the
   current language highlighted. Next to the menu button on phones, after the menu on wide screens. */
.lang-switch { display: inline-flex; flex-shrink: 0; margin-left: auto; border: 1px solid var(--border); border-radius: 999px; overflow: hidden; text-decoration: none; font-size: .8rem; font-weight: 600; letter-spacing: .06em; }
.lang-switch span { display: grid; place-items: center; min-width: 36px; min-height: 32px; padding: 0 .45rem; color: var(--muted); }
.lang-switch .is-current { background: var(--gold); color: #000; }
.lang-switch:hover span:not(.is-current) { color: var(--gold-light); }
@media (max-width: 1023px) {
  .lang-switch { order: 1; }
  .menu { order: 2; }
}
/* Small phones: a little less room around the logo, so the name, the switch and the menu fit side by side. */
@media (max-width: 400px) {
  .header-row { gap: .5rem; }
  .brand { gap: .45rem; }
  .brand img { width: auto; height: 46px; }
  .brand-name { font-size: 1rem; }
  .lang-switch span { min-width: 30px; padding: 0 .3rem; }
}
@media (min-width: 1024px) {
  .header-row .menu { margin-left: auto; }
  .lang-switch { margin-left: 0; }
}

/* Buttons */
.btn { display: inline-block; background: var(--red); color: #fff; border: 1px solid var(--red); border-radius: 999px; padding: .7rem 1.4rem; font: 600 1rem/1 var(--sans); text-decoration: none; cursor: pointer; transition: background .15s; }
.btn:hover { background: var(--red-dark); color: #fff; }
.btn-small { padding: .5rem 1rem; font-size: .9rem; }
.btn-ghost { background: transparent; color: var(--gold-light); border-color: var(--gold); }
.btn-ghost:hover { background: var(--gold); color: #000; }

/* Hero */
.hero { padding: 2rem 0 1.5rem; background: radial-gradient(ellipse at 30% 40%, rgba(209,40,28,.18), transparent 60%); }
.hero-inner { display: grid; gap: 1.5rem; align-items: center; }
.hero-logo { width: min(190px, 45vw); margin-inline: auto; } /* see-through logo, so the hero glow shows behind it */
.hero-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
@media (min-width: 800px) {
  .hero { padding: 3.5rem 0; }
  .hero-inner { grid-template-columns: 380px 1fr; gap: 3rem; }
  .hero-logo { width: 240px; }
}

/* Next market strip */
.next-market { background: var(--surface); border-block: 1px solid var(--border); padding: 1.25rem 0 .25rem; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .75rem; color: var(--gold); margin: 0 0 .25rem; }
.next-line { font-size: 1.15rem; margin-bottom: .5rem; }
.tasting { border-left: 3px solid var(--red); padding: .35rem 0 .35rem .8rem; margin-block: .75rem 1rem; }

/* Sections and grids */
.section { padding: 2rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.section-head h2 { margin-top: 0; }
.grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }

/* Cards */
.card { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; text-decoration: none; color: var(--text); transition: transform .15s, border-color .15s; }
a.card:hover { transform: translateY(-3px); border-color: var(--gold); color: var(--text); }
.card-media { position: relative; aspect-ratio: 1; background: var(--surface-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.ph { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3rem; background: linear-gradient(135deg, #2a1410, #0d0a08); }
.ph-large { aspect-ratio: 1; font-size: 6rem; border-radius: var(--radius); }
.card-body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .25rem; flex: 1; }
.card-body h3 { margin: 0; color: var(--text); font-size: 1.15rem; }
.card-body p { margin: 0; }
.card-body .btn { margin-top: auto; align-self: flex-start; }
.price { font-family: var(--serif); font-size: 1.25rem; color: var(--gold-light); margin-top: .35rem !important; }
.product.is-off .card-media img, .product.is-off .ph { filter: grayscale(.8) brightness(.6); }
.product.is-off .price { color: var(--muted); }

.badge { position: absolute; top: .6rem; left: .6rem; padding: .2rem .65rem; border-radius: 999px; font-size: .75rem; font-weight: 600; background: #143d1c; color: #a6f0b4; border: 1px solid #24632f; }
.badge-low { background: #4a3406; color: #ffd98a; border-color: #7a5710; }
.badge-sold_out, .badge-out_of_season { background: #2a2a2a; color: #cfcfcf; border-color: #444; }

/* Heat flames */
.heat { display: inline-flex; gap: 2px; vertical-align: middle; }
.flame { color: #3a3128; }
.flame.on { color: var(--red); }

/* Filters */
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1rem 0; }
.filters input[type=search], .filters select[name=species], .filters select[name=ordem] { grid-column: 1 / -1; }
.filters select { min-width: 0; }
@media (min-width: 760px) { .filters { display: flex; flex-wrap: wrap; } }
.filters input[type=search], .filters select { background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 999px; padding: .55rem 1rem; font: inherit; min-height: 44px; }
.filters input[type=search] { flex: 1 1 200px; }
.filters.auto button[type=submit] { display: none; }  /* choices apply by themselves (script in collection.html) */
.filters .btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.filter-check { grid-column: 1 / -1; white-space: nowrap; display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: 0 1rem; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); cursor: pointer; }
.filter-check input { width: 1.15rem; height: 1.15rem; accent-color: var(--gold); min-height: 0; margin: 0; }

/* Variety detail */
.detail-grid { display: grid; gap: 1.5rem; margin-top: .5rem; }
.detail-media img { width: 100%; border-radius: var(--radius); border: 1px solid var(--border); }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .35rem 1rem; margin: 1rem 0; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
@media (min-width: 800px) { .detail-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 3rem; } }

/* Footer and floating WhatsApp button */
.site-footer { margin-top: 3rem; border-top: 1px solid var(--border); padding: 1.5rem 0 5rem; color: var(--muted); font-size: .9rem; }
.footer-nav { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin-bottom: 1rem; }
.footer-nav a { color: var(--text); text-decoration: none; padding: .35rem 0; }
.footer-nav a:hover { color: var(--gold-light); }
.whatsapp-float { position: fixed; right: 1rem; bottom: 1rem; width: 54px; height: 54px; border-radius: 50%; background: #25a244; color: #fff; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(0,0,0,.6); z-index: 20; }
.whatsapp-float:hover { background: #1e8a39; color: #fff; }

:focus-visible { outline: 2px solid var(--gold-light); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* Accessibility: visible only when focused with the keyboard */
.skip-link { position: absolute; left: -9999px; top: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { left: 1rem; top: .5rem; z-index: 30; background: var(--gold); color: #000; padding: .5rem 1rem; border-radius: 999px; }

/* Shared bits for the content pages */
.narrow { max-width: 760px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem; }
.panel p:last-child { margin-bottom: 0; }
.about-actions, .contact-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.5rem; }
.messages { margin-top: 1rem; }
.message { background: #143d1c; color: #d8f7de; border: 1px solid #24632f; border-radius: var(--radius); padding: .75rem 1rem; }
.card-link { color: inherit; text-decoration: none; }
.card-link:hover { color: var(--gold-light); }
/* Makes the whole sauce card clickable while the WhatsApp button stays its own link. */
.card-link::after { content: ""; position: absolute; inset: 0; }
.product { position: relative; }
.product .btn, .product .card-body a:not(.card-link) { position: relative; z-index: 1; }
.badge-inline { position: static; display: inline-block; }
.price-large { font-size: 1.6rem; }
.pepper-list { list-style: none; padding: 0; margin: 0 0 1rem; display: grid; gap: .4rem; }
.pepper-list li { display: flex; align-items: center; gap: .6rem; }

/* Onde estamos */
.market-list { list-style: none; padding: 0; margin: 1.5rem 0; display: grid; gap: .75rem; }
.market { display: flex; gap: 1rem; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem; }
.market p { margin: 0; }
.market-date { flex: none; width: 64px; text-align: center; border: 1px solid var(--gold); border-radius: 10px; padding: .35rem 0; line-height: 1.1; }
.market-day { display: block; font-family: var(--serif); font-size: 1.6rem; color: var(--gold-light); }
.market-month { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.market-when { font-weight: 600; }

/* Gestão (the owner's phone screen) */
.gestao-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .5rem 1rem; }
.gestao-links { display: flex; gap: 1rem; align-items: baseline; margin-bottom: 1rem; }
.gestao-links form { margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--gold-light); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.gestao-jump { font-size: 1.05rem; }
.gestao-group { margin: 1.5rem 0 .5rem; color: var(--gold); font-family: var(--sans); text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; }
.stock-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.stock-item { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem; }
.stock-item.is-saved { border-color: #2f8a45; }
.stock-item p { margin: 0; }
.stock-info { display: flex; gap: .75rem; align-items: center; margin-bottom: .6rem; }
.stock-info img { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex: none; }
.stock-name { font-weight: 600; }
.saved { color: #7fe39a; }
/* Small "Editar" link with a finger-sized tap area (the padding is invisible, the negative margin keeps the layout). */
.edit-link { display: inline-block; padding: .7rem .6rem; margin: -.7rem -.6rem; }
.tag { font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; background: #333; color: #ddd; border-radius: 4px; padding: .1rem .4rem; vertical-align: middle; }
.stock-choices { display: grid; grid-template-columns: repeat(4, 1fr); gap: .35rem; margin: 0; }
.choice { min-height: 48px; padding: .35rem .25rem; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); font: 500 .8rem/1.15 var(--sans); cursor: pointer; }
.choice:hover { border-color: var(--gold); color: var(--text); }
.choice[aria-pressed="true"] { color: #fff; font-weight: 700; }
.choice-available[aria-pressed="true"] { background: #1f6b32; border-color: #2f8a45; }
.choice-low[aria-pressed="true"] { background: #8a5d0a; border-color: #b27a12; }
.choice-sold_out[aria-pressed="true"], .choice-out_of_season[aria-pressed="true"] { background: #555; border-color: #777; }
.visibility-choices { grid-template-columns: repeat(2, 1fr); }
.choice-visible[aria-pressed="true"] { background: #1f6b32; border-color: #2f8a45; }
.choice-hidden[aria-pressed="true"] { background: #555; border-color: #777; }
.market-row { display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
.market-form { display: grid; gap: .9rem; margin-top: .5rem; }
.field label { display: block; font-weight: 600; margin-bottom: .25rem; }
.field input { width: 100%; min-height: 48px; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .5rem .75rem; font: inherit; color-scheme: dark; }
.field p { margin: .25rem 0 0; }
.field-error, .form-errors { color: #ff9b91; }
.market-form .btn { justify-self: start; }

/* Gestão forms (add/edit varieties and products). Same pages on phone and laptop. */
.gestao-add { display: flex; flex-wrap: wrap; gap: .6rem; margin-bottom: 1rem; }
.gestao-add .btn { min-height: 48px; display: inline-flex; align-items: center; }
.gestao-form { display: grid; gap: 1.1rem; }
.gestao-form fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.gestao-form legend { font-weight: 600; margin-bottom: .35rem; padding: 0; }
.field textarea { width: 100%; background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: 10px; padding: .6rem .75rem; font: inherit; color-scheme: dark; }
.field input[type="file"] { padding: .6rem; }
.field input[type="checkbox"], .field .options input { width: 1.3rem; height: 1.3rem; min-height: 0; padding: 0; margin: 0; flex: none; accent-color: var(--gold); }
.options > div { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: .4rem; }
.options-stock > div { grid-template-columns: repeat(auto-fill, minmax(8rem, 1fr)); }
.field .options label, .field .check { display: flex; align-items: center; gap: .6rem; min-height: 48px; padding: .5rem .75rem; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); cursor: pointer; font-weight: 500; margin: 0; }
.options label:hover, .check:hover { border-color: var(--gold); }
.options label:has(:checked), .check:has(:checked) { border-color: var(--gold); background: #3a2c12; color: #fff; font-weight: 700; }
.photo-now { display: block; width: 120px; height: 120px; object-fit: cover; border-radius: 10px; border: 1px solid var(--border); margin-bottom: .4rem; }
.more { border: 1px solid var(--border); border-radius: var(--radius); padding: .8rem 1rem; }
.more summary { cursor: pointer; font-weight: 600; color: var(--gold-light); min-height: 32px; }
.more[open] summary { margin-bottom: 1rem; }
.more .field + .field { margin-top: 1.1rem; }
/* Save button stays in reach at the bottom of the screen on long forms. */
.form-actions { position: sticky; bottom: 0; display: flex; align-items: center; gap: 1.25rem; padding: .75rem 0; background: var(--bg); border-top: 1px solid var(--border); }
.form-actions .btn { min-height: 52px; padding-inline: 2.5rem; font-size: 1.1rem; }
.form-actions .btn:disabled { opacity: .6; cursor: wait; }
.big-choices { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr)); margin-top: 1rem; }
.big-choice { display: flex; align-items: center; justify-content: center; min-height: 96px; border: 1px solid var(--gold); border-radius: var(--radius); background: var(--surface); color: var(--gold-light); font: 600 1.25rem/1.2 var(--serif); text-decoration: none; text-align: center; padding: 1rem; }
.big-choice:hover { background: var(--surface-2); color: #fff; }
/* Phones: six types must fit on one screen without scrolling. */
@media (max-width: 600px) { .big-choices { gap: .5rem; } .big-choice { min-height: 64px; font-size: 1.1rem; } }

/* "Como comprar": orders are by message, there is no cart. */
.how-to-buy { max-width: 760px; }  /* readable line length on wide pages like Produtos */
.how-to-buy ol { margin: 0 0 1em; padding-left: 1.3rem; display: grid; gap: .35rem; }
.how-to-buy h2 { margin-top: 0; }

/* The one growing claim on the home page ("Cultivadas sem pesticidas nem adubos químicos"). */
.claim { color: var(--gold-light); font-weight: 600; letter-spacing: .02em; }

/* Galeria: square photos with a caption underneath. */
.gallery { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.gallery-item { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.gallery-item a { display: block; aspect-ratio: 1; background: var(--surface-2); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-item figcaption { padding: .75rem 1rem .9rem; }
.photo-large { margin: 0 0 1rem; text-align: center; }
.photo-large img { display: block; margin: 0 auto; max-width: 100%; max-height: 65vh; width: auto; height: auto; border-radius: var(--radius); }
.photo-large figcaption { margin-top: .9rem; }
.photo-large figcaption h1 { font: inherit; font-size: 1.1rem; color: var(--text); margin: 0; }
.photo-nav { display: flex; justify-content: space-between; align-items: center; gap: 1rem; border-top: 1px solid var(--border); padding-top: 1rem; }
.photo-nav a { text-decoration: none; padding: .5rem 0; }

/* Produtos: links to each section at the top. */
.jump-links { line-height: 2; }
.jump-links a { white-space: nowrap; }
