:root {
  --bg: #f8f6f1;
  --surface: #ffffff;
  --ink: #191816;
  --muted: #6d6963;
  --line: #dedad2;
  --accent: #b65332;
  --accent-dark: #8d3f27;
  --soft: #eee8df;
  --danger: #9f2f2f;
  --radius: 18px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body { margin: 0; min-height: 100vh; overflow-x: hidden; background: var(--bg); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
button[aria-busy="true"] { cursor: wait; }
a { color: inherit; }

.site-header {
  min-height: 76px;
  padding: 14px clamp(18px, 4vw, 56px);
  display: flex;
  align-items: center;
  gap: 24px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(12px);
}

.wordmark { display: inline-flex; width: 164px; flex: 0 0 auto; text-decoration: none; }
.wordmark img { display: block; width: 100%; height: auto; }
.location { color: var(--muted); font-size: .9rem; margin: 0; }
.site-nav { margin-left: auto; display: flex; align-items: center; gap: 20px; white-space: nowrap; }
.site-nav a { color: var(--muted); font-size: .86rem; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: var(--ink); text-decoration: underline; text-underline-offset: 5px; }
.cart-trigger { margin-left: 0; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 10px 14px; align-items: center; gap: 7px; }
.cart-count { display: inline-grid; place-items: center; min-width: 24px; height: 24px; border-radius: 999px; background: var(--ink); color: white; font-size: .75rem; margin-left: 5px; }
.button-icon { width: 18px; height: 18px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.setup-banner { background: #fff4d8; color: #654a13; padding: 10px 18px; text-align: center; font-size: .9rem; border-bottom: 1px solid #ead59d; }
.referral-banner { padding: 9px 18px; text-align: center; background: #efe9df; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .82rem; }
.store-layout { max-width: 1440px; margin: 0 auto; padding: clamp(24px, 4vw, 56px); display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: clamp(28px, 4vw, 64px); align-items: start; }
.catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.eyebrow { margin: 0 0 6px; color: var(--accent-dark); font-size: .75rem; font-weight: 750; letter-spacing: .13em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 0; font: 500 clamp(2rem, 4vw, 3.75rem)/1.02 Georgia, serif; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font: 500 1.5rem/1.2 Georgia, serif; }
.catalog-note { color: var(--muted); margin: 0; max-width: 270px; line-height: 1.5; }
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.loading { color: var(--muted); }

.product-card { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); overflow: hidden; display: grid; min-width: 0; }
.product-image { aspect-ratio: 1; display: grid; place-items: center; background: white; color: #8c8478; font-family: Georgia, serif; font-size: 1rem; letter-spacing: .04em; }
.product-image picture { display: contents; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-content { min-width: 0; padding: 18px; display: grid; gap: 14px; }
.product-title-row { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.product-title-row h2 { font-size: 1.18rem; }
.product-price { white-space: nowrap; font-weight: 750; }
.product-description { margin: -5px 0 0; overflow-wrap: anywhere; color: var(--muted); font-size: .9rem; line-height: 1.45; }
.product-controls { min-width: 0; display: grid; }
select, input, textarea { width: 100%; border: 1px solid #cbc5bc; border-radius: 10px; background: white; color: var(--ink); padding: 11px 12px; min-height: 44px; }
textarea { resize: vertical; }
select:focus, input:focus, textarea:focus { outline: 3px solid color-mix(in srgb, var(--accent) 22%, transparent); border-color: var(--accent); }
.add-button { min-height: 44px; border: 0; border-radius: 10px; padding: 10px 16px; background: var(--ink); color: white; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 9px; }
.add-button:hover:not(:disabled) { background: var(--accent-dark); }
.add-button:disabled { opacity: .72; }

.cart-panel { position: sticky; top: 108px; }
.cart-panel-inner { border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius); padding: 22px; box-shadow: 0 18px 60px rgba(26, 20, 13, .06); }
.cart-heading { display: flex; justify-content: space-between; align-items: center; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.cart-heading > span { color: var(--muted); font-size: .85rem; }
.cart-items { display: grid; gap: 0; }
.cart-item { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item h3 { margin: 0 0 4px; font: 600 1rem/1.2 inherit; }
.cart-item p { color: var(--muted); font-size: .82rem; margin-bottom: 10px; }
.quantity-control { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.quantity-control button { width: 32px; height: 30px; border: 0; background: transparent; }
.quantity-control span { min-width: 26px; text-align: center; font-size: .85rem; }
.remove-item { border: 0; background: transparent; color: var(--muted); padding: 0; font-size: .78rem; text-decoration: underline; }
.cart-empty { padding: 40px 12px; text-align: center; color: var(--muted); }
.cart-empty p { color: var(--ink); margin-bottom: 4px; }
.cart-empty span { font-size: .85rem; }
.cart-summary { padding-top: 18px; display: grid; gap: 14px; }
.cart-summary > div, .checkout-total { display: flex; justify-content: space-between; align-items: center; }
.cart-summary strong, .checkout-total strong { font-size: 1.2rem; }
.cart-summary p { color: var(--muted); font-size: .78rem; line-height: 1.4; margin: 0; }
.primary-button { min-height: 50px; width: 100%; border: 0; border-radius: 12px; background: var(--accent); color: white; padding: 13px 18px; font-weight: 750; }
.primary-button:hover:not(:disabled) { background: var(--accent-dark); }
.primary-button:disabled { cursor: not-allowed; opacity: .42; }

.desktop-hidden { display: none; }
.mobile-cart-bar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 25; border: 0; border-radius: 14px; background: var(--ink); color: white; padding: 12px 16px; align-items: center; justify-content: space-between; box-shadow: 0 12px 30px rgba(0,0,0,.25); }
.mobile-cart-bar > span:first-child { display: grid; text-align: left; }
.mobile-cart-bar small { color: #d7d1c8; }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(20, 18, 16, .56); backdrop-filter: blur(4px); }
.sheet-dialog, .checkout-dialog { border: 0; background: var(--surface); box-shadow: 0 30px 80px rgba(0,0,0,.25); }
.sheet-dialog { width: min(100%, 520px); max-height: 86vh; margin: auto 0 0 auto; border-radius: 22px 22px 0 0; padding: 22px; overflow-y: auto; overscroll-behavior: contain; }
.checkout-dialog { width: min(760px, calc(100% - 32px)); max-height: calc(100vh - 32px); border-radius: 22px; padding: clamp(20px, 4vw, 38px); }
.dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.icon-button { width: 42px; height: 42px; border: 1px solid var(--line); background: white; border-radius: 999px; font-size: 1.5rem; line-height: 1; }
.checkout-form { display: grid; gap: 17px; }
.checkout-form label { display: grid; gap: 7px; font-size: .88rem; font-weight: 650; }
.checkout-form label small { color: var(--muted); font-weight: 400; }
.checkout-form .reminder-consent { display: grid; grid-template-columns: 20px 1fr; align-items: start; gap: 10px; padding: 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--muted); font-size: .8rem; font-weight: 500; line-height: 1.45; }
.checkout-form .reminder-consent input { width: 18px; min-height: 18px; margin: 1px 0 0; accent-color: var(--accent); }
.checkout-extras { display: flex; align-items: flex-start; flex-wrap: wrap; gap: 10px 18px; }
.checkout-disclosure { flex: 1 1 220px; min-width: 0; }
.checkout-disclosure summary { width: max-content; max-width: 100%; color: var(--muted); cursor: pointer; font-size: .8rem; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.checkout-disclosure summary:hover { color: var(--ink); }
.checkout-disclosure[open] { flex-basis: 100%; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--bg); }
.checkout-disclosure[open] summary { margin-bottom: 13px; color: var(--ink); font-weight: 650; }
.coupon-field { display: grid; gap: 7px; }
.coupon-field > label { display: block; }
.coupon-field > div { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; }
.coupon-button { min-height: 44px; border: 1px solid var(--ink); border-radius: 10px; padding: 0 16px; background: var(--ink); color: white; font-weight: 700; }
.coupon-button:disabled { opacity: .6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-row.compact { grid-template-columns: minmax(130px, .45fr) 1fr; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-size: .88rem; font-weight: 650; margin-bottom: 9px; }
.fulfillment-options { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fulfillment-option { display: flex !important; grid-template-columns: auto 1fr; align-items: start; gap: 10px !important; border: 1px solid var(--line); border-radius: 12px; padding: 13px; cursor: pointer; }
.fulfillment-option:has(input:checked) { border-color: var(--accent); box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 18%, transparent); }
.fulfillment-option input { width: 18px; min-height: 18px; margin: 2px 0 0; }
.fulfillment-option span { display: grid; gap: 3px; }
.fulfillment-option small { color: var(--muted); font-weight: 400; line-height: 1.3; }
.address-fields { display: grid; gap: 14px; padding: 15px; background: var(--bg); border-radius: 14px; }
.field-status { min-height: 1.2em; color: var(--muted); font-size: .78rem; line-height: 1.35; }
.field-status[data-state="success"] { color: #397247; }
.field-status[data-state="warning"] { color: #8a5b12; }
.field-status[data-state="error"] { color: var(--danger); }
.checkout-breakdown { border-top: 1px solid var(--line); padding-top: 16px; display: grid; gap: 9px; }
.checkout-breakdown > div { display: flex; justify-content: space-between; align-items: center; gap: 18px; }
.checkout-breakdown > div:not(.checkout-total) { color: var(--muted); font-size: .9rem; }
.checkout-total { border-top: 1px solid var(--line); margin-top: 5px; padding-top: 13px; }
.form-error { min-height: 1.3em; margin: 0; color: var(--danger); font-size: .87rem; }
.back-button { border: 0; background: transparent; color: var(--muted); padding: 0 0 18px; }
.payment-heading h3 { margin-bottom: 5px; font: 500 1.4rem Georgia, serif; }
.payment-heading p { color: var(--muted); }
.payment-result { padding: 18px; border-radius: 14px; background: var(--bg); }
.payment-result img { display: block; width: min(240px, 100%); margin: 16px auto; }
.pix-code { width: 100%; min-height: 90px; font-size: .72rem; word-break: break-all; }

.site-footer { padding: 34px clamp(18px, 4vw, 56px); border-top: 1px solid var(--line); background: var(--surface); display: grid; grid-template-columns: minmax(220px, 1fr) auto; gap: 28px 60px; color: var(--muted); font-size: .86rem; }
.footer-brand p { max-width: 360px; margin: 10px 0 0; line-height: 1.55; }
.footer-wordmark { width: 142px; }
.footer-nav { display: grid; grid-template-columns: repeat(2, auto); align-content: start; gap: 10px 28px; }
.footer-nav a { text-decoration: none; }
.footer-nav a:hover { color: var(--ink); text-decoration: underline; }
.footer-meta { grid-column: 1 / -1; padding-top: 18px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; font-size: .78rem; }
.developer-credit { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); text-decoration: none; }
.developer-credit img { width: 24px; height: 24px; filter: grayscale(1); opacity: .62; transition: filter .22s ease, opacity .22s ease, transform .22s ease; }
.developer-credit:hover { color: var(--ink); }
.developer-credit:hover img { filter: none; opacity: 1; transform: rotate(-7deg); }

.legal-page { max-width: 780px; min-height: calc(100vh - 310px); margin: 0 auto; padding: clamp(42px, 7vw, 88px) 22px; font-size: 1rem; line-height: 1.72; }
.legal-page h1 { margin-bottom: 12px; }
.legal-page h2 { margin: 30px 0 10px; }
.legal-page h3 { margin: 22px 0 8px; }
.legal-page ul, .legal-page ol { padding-left: 1.25rem; }
.legal-page li + li { margin-top: 8px; }
.legal-intro, .legal-updated { color: var(--muted); }
.legal-updated { margin-bottom: 30px; font-size: .88rem; }
.legal-page .draft-note { background: #fff4d8; border: 1px solid #ead59d; padding: 14px; border-radius: 10px; }
.legal-sources { margin-top: 40px; padding-top: 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: .88rem; }
#faqList { display: grid; gap: 10px; margin-top: 32px; }
#faqList details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 16px; }
#faqList summary { padding: 16px 28px 16px 0; cursor: pointer; font-weight: 700; }
#faqList details p { margin: 0; padding: 0 0 17px; color: var(--muted); }

@media (max-width: 900px) {
  .desktop-hidden { display: inline-flex; }
  .location, .cart-trigger-label { display: none; }
  .site-nav { gap: 14px; }
  .store-layout { display: block; padding: 24px 18px 110px; }
  .cart-panel { display: none; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mobile-cart-bar:not([hidden]) { display: flex; }
  .catalog-heading { align-items: start; }
}

@media (max-width: 620px) {
  .site-header { min-height: 62px; padding: 9px 14px; gap: 10px; flex-wrap: nowrap; }
  .wordmark { width: 145px; }
  .footer-wordmark { width: 132px; }
  .cart-trigger { width: 44px; height: 44px; padding: 0; justify-content: center; flex: 0 0 auto; }
  .cart-trigger .button-icon { display: none; }
  .cart-trigger .cart-count { margin: 0; }
  .site-nav { display: none; }
  .cart-trigger { margin-left: auto; }
  .store-layout { padding: 18px 14px 96px; }
  .catalog-heading { display: block; margin-bottom: 16px; }
  .catalog-heading .eyebrow, .catalog-note { display: none; }
  .catalog-heading h1 { font-size: 1.85rem; }
  .product-grid { grid-template-columns: 1fr; gap: 12px; }
  .product-card { grid-template-columns: 116px minmax(0, 1fr); min-height: 146px; }
  .product-image { aspect-ratio: auto; min-height: 146px; height: 100%; border-right: 1px solid var(--line); }
  .product-image img { object-fit: contain; }
  .product-content { align-content: center; padding: 12px; gap: 9px; }
  .product-title-row { display: grid; gap: 3px; }
  .product-title-row h2 { font-size: 1.05rem; }
  .product-price { font-size: .92rem; }
  .product-description { display: none; }
  .add-button { width: 100%; min-height: 40px; padding: 8px 12px; font-size: .9rem; }
  .mobile-cart-bar { left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); padding: 10px 14px; }
  .sheet-dialog { width: 100vw; max-width: none; max-height: calc(100dvh - env(safe-area-inset-top)); margin: auto 0 0; border-radius: 20px 20px 0 0; padding: 18px 16px calc(18px + env(safe-area-inset-bottom)); }
  .sheet-dialog .dialog-header { margin-bottom: 12px; }
  .sheet-dialog .cart-item { padding: 13px 0; }
  .sheet-dialog .cart-summary { padding-top: 14px; gap: 11px; }
  .checkout-dialog { width: 100vw; max-width: none; max-height: 100dvh; height: 100dvh; margin: 0; border-radius: 0; padding: calc(18px + env(safe-area-inset-top)) 16px calc(22px + env(safe-area-inset-bottom)); overflow-y: auto; overscroll-behavior: contain; }
  .form-row, .form-row.compact, .fulfillment-options { grid-template-columns: 1fr; }
  .site-footer { grid-template-columns: 1fr; padding-bottom: 100px; }
  .footer-nav { grid-template-columns: 1fr; }
  .footer-meta { grid-column: auto; flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .developer-credit img { transition: none; }
}
