/* Final interface pass: legibility, responsive composition and checkout states. */
:root {
  --purple: #b5122f;
  --purple-dark: #790b20;
  --purple-soft: #fff1f3;
  --ink: #201d20;
  --muted: #686369;
  --line: #e7e3e7;
  --soft: #f7f5f7;
  --shadow: 0 18px 48px rgba(55, 18, 31, .14);
}

html { scrollbar-color: #c9c1c8 #f4f1f3; }
body { font-size: 16px; line-height: 1.45; }
button, a, input, textarea { -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
.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; }
.shell { width: min(1200px, calc(100% - 40px)); }

.header-grid { min-height: 78px; height: auto; }
.brand { letter-spacing: -.035em; }
.brand-mark { width: 43px; height: 43px; display: grid; place-items: center; flex: none; }
.brand-mark svg { width: 43px; height: 43px; overflow: visible; fill: var(--acai); stroke: none; }
.brand-mark .mark-leaf { fill: #23824b; }
.brand-mark .mark-stem { fill: none; stroke: #23824b; stroke-width: 3; stroke-linecap: round; }
.brand-mark .mark-band { fill: #cf1635; }
.brand-mark .mark-shine { fill: rgba(255,255,255,.9); }
.brand-copy strong { display: block; color: var(--purple); font-size: 1.17rem; line-height: 1; letter-spacing: -.04em; }
.brand-copy em { color: var(--acai); font-style: normal; }
.brand small { font-size: .58rem; }
.location-trigger small { font-size: .68rem; }
.location-trigger strong, .bag-button { font-size: .78rem; }
.location-trigger > svg { width: 36px; height: 36px; padding: 8px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); }
.bag-button { border: 1px solid color-mix(in srgb, var(--purple) 18%, #fff); background: #fff; }
.bag-button > svg { width: 19px; }
.global-search input { font-size: .85rem; }

.marketplace { padding-top: 26px; }
.para-identity { min-height: 320px; height: auto; border-radius: 16px; }
.hero-copy { padding: 36px 42px; }
.hero-kicker { font-size: .72rem; }
.hero-copy h1 { margin: 14px 0 10px; font-size: clamp(2.2rem, 4vw, 3.25rem); letter-spacing: -.04em; }
.hero-note { font-size: .82rem; }
.hero-points span { font-size: .68rem; }
.hero-actions a { min-height: 44px; font-size: .72rem; }
.delivery-context { min-height: 76px; display: grid; grid-template-columns: minmax(150px, .65fr) minmax(320px, 1.5fr) auto; align-items: center; gap: 16px; padding: 12px 16px; font-size: .76rem; }
.delivery-copy b, .delivery-copy span { display: block; }
.delivery-copy span { min-width: 0; margin-top: 3px; color: var(--muted); }
.delivery-form { min-width: 0; display: flex; align-items: center; gap: 8px; }
.delivery-form input { min-width: 0; width: 100%; height: 46px; padding: 0 14px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: var(--ink); font-size: .78rem; outline: 0; }
.delivery-form input:focus { border-color: var(--purple); box-shadow: 0 0 0 3px color-mix(in srgb, var(--purple) 12%, transparent); }
.delivery-form button { flex: none; min-height: 46px; padding: 0 16px; border: 0; border-radius: 9px; background: var(--purple); color: #fff; font-size: .72rem; font-weight: 800; cursor: pointer; }
.delivery-context > button { min-height: 44px; padding: 0 8px; border: 0; background: transparent; color: var(--purple); font-size: .72rem; font-weight: 800; cursor: pointer; }

.section-heading { margin-bottom: 19px; }
.section-heading h1 { font-size: 1.65rem; }
.section-heading h2 { font-size: 1.5rem; }
.section-heading p { margin-top: 6px; font-size: .78rem; }
.text-button { min-height: 44px; padding: 0 4px; font-size: .78rem; }
.category-list { gap: 12px; padding: 3px 2px 10px; }
.category { flex-basis: 132px; min-height: 70px; padding: 8px; border-radius: 12px; }
.category span { width: 52px; height: 52px; }
.category b { font-size: .73rem; }

.offer-grid { gap: 18px; }
.product-card { min-height: 196px; grid-template-columns: minmax(0, 1fr) 184px; border-radius: 14px; }
.product-photo { min-height: 196px; }
.product-copy { padding: 20px; }
.product-copy small { font-size: .65rem; }
.product-copy h3 { margin: 8px 0 7px; font-size: .88rem; line-height: 1.35; }
.product-copy p { font-size: .7rem; line-height: 1.55; }
.product-copy strong { font-size: .86rem; }
.product-photo > span { font-size: .6rem; }
.add-product { min-height: 42px; display: inline-flex; flex-direction: row; align-items: center; justify-content: center; gap: 6px; border-radius: 9px; line-height: 1; white-space: nowrap; }
.add-product span { font-size: .68rem; }

.store-card { min-height: 152px; border-radius: 14px; }
.store-cover { min-height: 152px; }
.store-info h3 { font-size: .86rem; }
.store-info p, .store-info > div { font-size: .68rem; }
.favorite { width: 42px; height: 42px; }

.cart-panel { width: min(440px, 100vw); padding: 24px; overscroll-behavior: contain; }
.cart-head h2 { font-size: 1.35rem; }
.cart-head p { font-size: .75rem; }
.cart-close { width: 44px; height: 44px; }
.cart-empty strong { font-size: .9rem; }
.cart-empty span { font-size: .72rem; }
.cart-item { grid-template-columns: 68px minmax(0, 1fr); gap: 13px; padding: 16px 0; }
.cart-thumb { width: 68px; height: 68px; }
.cart-item-info > strong, .cart-item-info > span { font-size: .77rem; }
.quantity button { width: 36px; height: 36px; }
.quantity b { font-size: .72rem; }
.cart-summary > div { font-size: .78rem; }
.cart-summary > button { min-height: 52px; font-size: .82rem; }
.cart-summary > small { font-size: .64rem; }
.mobile-cart { display: none; }

.pix-payment { padding-top: 26px; }
.pix-payment h3 { font-size: 1.35rem; }
.pix-payment > p { font-size: .75rem; }
.pix-payment img { width: min(240px, 72vw); height: auto; aspect-ratio: 1; padding: 8px; background: #fff; }
.pix-payment label, .pix-wait { font-size: .7rem; }
.pix-payment textarea { height: 80px; font-size: .65rem; }
.pix-payment > button { min-height: 50px; font-size: .76rem; }
.pix-payment > small { font-size: .62rem; }
.toast { max-width: calc(100vw - 32px); font-size: .75rem; text-align: center; white-space: normal; }

.address-dialog label > span, .address-options strong, .locate-button strong { font-size: .75rem; }
.dialog-head p, .locate-button small, .address-options small { font-size: .68rem; }
.address-options button { min-height: 48px; }

@media (max-width: 900px) {
  .shell { width: min(100% - 32px, 1200px); }
  .header-grid { padding: 12px 0; }
  .store-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 650px) {
  .shell { width: min(100% - 24px, 1200px); }
  .app-header { position: sticky; }
  .header-grid { min-height: 0; padding: 10px 0 12px; }
  .brand { font-size: 1.16rem; }
  .brand-mark, .brand-mark svg { width: 38px; height: 38px; }
  .brand-copy strong { font-size: 1.08rem; }
  .location-trigger { min-height: 44px; }
  .global-search { height: 48px; }
  .global-search input { font-size: 1rem; }
  .marketplace { padding-top: 14px; padding-bottom: 94px; }
  .para-identity { min-height: 214px; height: 214px; grid-template-columns: 68% 32%; }
  .hero-copy { padding: 20px; }
  .hero-copy h1 { font-size: clamp(1.55rem, 8vw, 2rem); }
  .hero-kicker { font-size: .62rem; }
  .hero-note { font-size: .68rem; line-height: 1.45; }
  .hero-actions a { min-height: 40px; font-size: .67rem; }
  .delivery-context { grid-template-columns: 1fr; gap: 10px; margin-bottom: 30px; padding: 16px; font-size: .75rem; }
  .delivery-form { width: 100%; }
  .delivery-form input { height: 48px; font-size: 1rem; }
  .delivery-form button { min-height: 48px; padding: 0 13px; }
  .delivery-context > button { min-height: 32px; padding: 0; justify-self: start; }
  .section-heading h1, .section-heading h2 { font-size: 1.32rem; }
  .section-heading p { font-size: .75rem; }
  .category-list { margin-right: -12px; }
  .category { flex-basis: 124px; min-height: 66px; }
  .category span { width: 48px; height: 48px; }
  .offer-grid { gap: 14px; }
  .product-card { width: 100%; min-height: 174px; grid-template-columns: minmax(0, 1fr) 116px; }
  .product-photo { min-height: 174px; }
  .product-copy { padding: 16px 14px; }
  .product-copy small { font-size: .61rem; }
  .product-copy h3 { font-size: .8rem; }
  .product-copy p { max-height: 3.2em; margin-bottom: 10px; font-size: .67rem; }
  .product-copy > div { align-items: flex-end; gap: 8px; }
  .product-copy strong { font-size: .76rem; line-height: 1.25; }
  .add-product { min-width: 44px; width: 44px; padding: 0; }
  .add-product span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .store-grid { display: grid; grid-template-columns: 1fr; margin-right: 0; padding-right: 0; overflow: visible; }
  .store-card { width: 100%; min-height: 142px; }
  .store-cover { min-height: 142px; }
  .cart-panel { padding: 20px 18px max(24px, env(safe-area-inset-bottom)); }
  .mobile-cart:not(.hidden) { display: flex; }
  .mobile-cart { bottom: max(12px, env(safe-area-inset-bottom)); min-height: 60px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

@media (max-width: 380px) {
  .hero-copy { padding: 16px; }
  .hero-copy h1 { font-size: 1.45rem; }
  .hero-note { display: none; }
  .product-card { grid-template-columns: minmax(0, 1fr) 104px; }
  .product-copy { padding: 14px 12px; }
}

@media (hover: hover) and (pointer: fine) {
  .add-product:hover, .cart-summary > button:hover, .pix-payment > button:hover { background: var(--purple-dark); }
}

@media (prefers-reduced-motion: reduce) {
  .pix-wait i { animation: none; }
}

/* Final mobile geometry: loaded after app.css */
@media (max-width:650px){
  .delivery-context{display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;gap:10px;width:100%;padding:15px}
  .delivery-copy{min-width:0}
  .delivery-copy b,.delivery-copy span{display:block}
  .delivery-form{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;width:100%;min-width:0}
  .delivery-form input{width:100%;min-width:0;height:46px;border-radius:10px;font-size:.88rem}
  .delivery-form button{width:100%;min-width:0;min-height:46px;margin:0;border-radius:10px}
  .delivery-context>button{width:auto;min-height:40px;margin:0;justify-self:start}
  .category-list{gap:9px;margin-right:-12px;padding-right:24px}
  .category{flex-basis:120px;min-height:62px}
  .product-card{grid-template-columns:minmax(0,1fr) 110px;min-height:158px}
  .product-photo{min-height:158px}
}
@media (max-width:350px){
  .category{flex-basis:112px}
  .product-card{grid-template-columns:minmax(0,1fr) 96px}
}
