:root {
  --ink: #17324d;
  --muted: #5f6f7f;
  --red: #e33b3b;
  --yellow: #f4c84b;
  --green: #138a5b;
  --blue: #1769aa;
  --surface: #ffffff;
  --soft: #f4f7f8;
  --line: #dbe3e8;
  --shadow: 0 16px 38px rgba(23, 50, 77, 0.14);
  --dock-height: 84px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 70px; }
body { margin: 0; min-width: 320px; min-height: 100vh; padding-bottom: calc(var(--dock-height) + 24px + env(safe-area-inset-bottom)); color: var(--ink); background: var(--soft); font-family: Inter, "Segoe UI", Arial, sans-serif; letter-spacing: 0; }
body:has(dialog[open]) { overflow: hidden; }
button, input, select { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid rgba(23, 105, 170, 0.28); outline-offset: 2px; }
.hidden { display: none !important; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.site-header { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid rgba(219, 227, 232, 0.94); background: rgba(255,255,255,0.95); backdrop-filter: blur(14px); }
.header-inner, .catalog-intro, .toolbar-inner, .gift-strip, .catalog-section { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }
.header-inner { min-height: 66px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 7px; color: white; background: var(--red); font-weight: 900; font-size: 1.2rem; }
.brand strong, .brand small { display: block; line-height: 1.05; }
.brand strong { font-size: .96rem; }
.brand small { margin-top: 3px; color: var(--blue); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.store-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; padding: 3px; background: var(--soft); }
.store-switch a { min-height: 34px; display: inline-flex; align-items: center; padding: 0 11px; border-radius: 5px; color: var(--muted); text-decoration: none; font-size: .78rem; font-weight: 900; }
.store-switch a.active { color: white; background: var(--blue); }

.catalog-intro { min-height: 174px; display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, .5fr); align-items: center; gap: 36px; padding-block: 26px 22px; }
.eyebrow { display: block; color: var(--red); font-size: .72rem; font-weight: 900; text-transform: uppercase; }
.catalog-intro h1 { max-width: 720px; margin: 5px 0 8px; font-size: clamp(2rem, 4vw, 3.1rem); line-height: 1; }
.catalog-intro p { max-width: 660px; margin: 0; color: var(--muted); line-height: 1.5; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 0; padding: 0; list-style: none; }
.steps li { display: grid; justify-items: center; gap: 5px; color: var(--muted); font-size: .74rem; font-weight: 900; text-transform: uppercase; }
.steps span { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; color: var(--ink); background: var(--yellow); font-size: .9rem; }

.catalog-toolbar { position: sticky; top: 66px; z-index: 20; border-block: 1px solid var(--line); background: rgba(255,255,255,.97); backdrop-filter: blur(14px); }
.toolbar-inner { display: grid; gap: 10px; padding-block: 12px; }
.toolbar-inner > *, .search-field, .filter-row, .category-filters, .results-row { min-width: 0; }
.search-field { width: 100%; min-height: 44px; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; border: 1px solid var(--line); border-radius: 7px; padding: 0 10px; background: white; }
.search-field input { min-width: 0; border: 0; outline: 0; color: var(--ink); }
.icon-button, .text-button, .secondary-button, .primary-button, .whatsapp-button, .close-button, .filter-chip { border: 0; cursor: pointer; }
.icon-button { width: 32px; height: 32px; border-radius: 5px; background: var(--soft); font-size: 1.2rem; }
.filter-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.category-filters { max-width: 100%; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.filter-chip { min-height: 36px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 999px; padding: 0 12px; color: var(--muted); background: white; font-size: .79rem; font-weight: 900; }
.filter-chip[aria-pressed="true"] { border-color: var(--blue); color: var(--blue); background: #edf6fc; }
.price-filter { flex: 0 0 auto; display: flex; align-items: center; gap: 7px; color: var(--muted); font-size: .78rem; font-weight: 800; }
.price-filter select { min-height: 36px; border: 1px solid var(--line); border-radius: 6px; color: var(--ink); background: white; }
.results-row { min-height: 24px; display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: .82rem; }
.text-button { padding: 0; color: var(--blue); background: transparent; font-weight: 900; }

.gift-strip { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 18px; margin-block: 18px; border: 1px solid #ead892; border-left: 5px solid var(--yellow); border-radius: 8px; padding: 14px 16px; background: #fffdf4; }
.gift-strip h2 { margin: 4px 0 0; font-size: 1.05rem; }
.gift-thumbs { display: flex; }
.gift-thumbs img { width: 46px; height: 46px; margin-left: -8px; border: 3px solid white; border-radius: 50%; object-fit: contain; background: white; }
.gift-thumbs img:first-child { margin-left: 0; }
.secondary-button, .primary-button, .whatsapp-button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 7px; padding: 0 16px; font-weight: 900; text-decoration: none; }
.secondary-button { border: 1px solid var(--line); color: var(--ink); background: white; }
.primary-button { color: white; background: var(--blue); }
.whatsapp-button { color: white; background: var(--green); }
.whatsapp-button.disabled { pointer-events: none; opacity: .48; }

.catalog-section { padding-block: 18px 44px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 12px; }
.section-heading h2 { margin: 4px 0 0; font-size: 1.45rem; }
.availability-note { color: var(--muted); font-size: .78rem; }
.product-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; transition: opacity .18s ease; }
.product-grid.is-filtering { opacity: .4; }
.product-card { position: relative; display: grid; grid-template-rows: auto 1fr; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: white; }
.product-card.sold-out { opacity: .74; }
.product-image-button { position: relative; width: 100%; border: 0; padding: 0; background: #eef2f1; cursor: pointer; }
.product-image-button img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; mix-blend-mode: multiply; }
.product-labels { position: absolute; top: 8px; left: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.product-labels span, .sold-out-label { border-radius: 4px; padding: 4px 6px; color: white; background: var(--red); font-size: .66rem; font-weight: 900; text-transform: uppercase; }
.sold-out-label { background: var(--ink); }
.product-copy { display: grid; align-content: space-between; gap: 10px; padding: 11px; }
.product-copy h3 { margin: 0; font-size: .94rem; line-height: 1.25; }
.product-category { color: var(--blue); font-size: .7rem; font-weight: 900; text-transform: uppercase; }
.price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 7px; }
.price strong { font-size: 1rem; }
.price del { color: var(--muted); font-size: .76rem; }
.view-button { min-height: 40px; border: 1px solid var(--blue); border-radius: 6px; color: var(--blue); background: white; font-weight: 900; cursor: pointer; }
.product-card.sold-out .view-button { border-color: var(--line); color: var(--muted); }
.skeleton { aspect-ratio: .78; border-radius: 8px; background: linear-gradient(90deg, #e9eef0 25%, #f6f8f8 50%, #e9eef0 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.empty-state, .error-state { border: 1px dashed var(--line); border-radius: 8px; padding: 36px 18px; text-align: center; background: white; }
.empty-state h3, .error-state h3 { margin: 0 0 5px; }
.empty-state p, .error-state p { color: var(--muted); }

.order-dock { position: fixed; z-index: 35; left: 50%; bottom: max(12px, env(safe-area-inset-bottom)); transform: translateX(-50%); width: min(620px, calc(100% - 24px)); min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border: 1px solid rgba(255,255,255,.18); border-radius: 8px; padding: 10px 12px; color: white; background: var(--ink); box-shadow: var(--shadow); }
.order-dock div { display: grid; gap: 3px; min-width: 0; }
.order-dock span { overflow: hidden; color: #cad5df; font-size: .78rem; text-overflow: ellipsis; white-space: nowrap; }

dialog { width: min(920px, calc(100% - 24px)); max-height: min(88vh, 820px); overflow: auto; border: 0; border-radius: 8px; padding: 0; color: var(--ink); background: white; box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(12, 25, 38, .68); backdrop-filter: blur(3px); }
.close-button { position: sticky; z-index: 2; top: 10px; float: right; width: 38px; height: 38px; margin: 10px 10px -48px 0; border-radius: 50%; color: var(--ink); background: rgba(255,255,255,.92); font-size: 1.4rem; }
.product-dialog-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr); min-height: 530px; }
.gallery { display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px; min-width: 0; padding: 18px; background: #eff3f2; }
.gallery > img { width: 100%; height: min(56vh, 520px); object-fit: contain; mix-blend-mode: multiply; }
.gallery-thumbs { display: flex; gap: 7px; overflow-x: auto; }
.gallery-thumbs button { flex: 0 0 58px; border: 2px solid transparent; border-radius: 6px; padding: 2px; background: white; cursor: pointer; }
.gallery-thumbs button.active { border-color: var(--blue); }
.gallery-thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: contain; }
.product-dialog-copy { display: grid; align-content: center; gap: 13px; padding: 34px 26px; }
.product-dialog-copy h2 { margin: 0; font-size: clamp(1.45rem, 3vw, 2.25rem); line-height: 1.05; }
.dialog-price { display: flex; align-items: baseline; gap: 9px; }
.dialog-price strong { font-size: 1.35rem; }
.dialog-price del { color: var(--muted); }
.product-description { max-height: 150px; overflow: auto; margin: 0; color: var(--muted); line-height: 1.5; white-space: pre-line; }
.product-dialog-copy label { display: grid; gap: 5px; color: var(--muted); font-size: .8rem; font-weight: 800; }
.product-dialog-copy select { min-height: 44px; border: 1px solid var(--line); border-radius: 6px; padding: 0 9px; color: var(--ink); background: white; }
.stock-message { min-height: 20px; margin: 0; color: var(--red); font-size: .82rem; font-weight: 800; }
.dialog-header { padding: 26px 26px 10px; }
.dialog-header h2 { margin: 4px 0 0; }
.dialog-header p { color: var(--muted); }
.order-list { display: grid; max-height: 48vh; overflow: auto; padding: 6px 26px; }
.order-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 11px; align-items: center; border-bottom: 1px solid var(--line); padding: 10px 0; }
.order-item img { width: 64px; height: 64px; object-fit: contain; border-radius: 6px; background: #eff3f2; }
.order-item-copy { display: grid; gap: 4px; }
.order-item-copy span { color: var(--muted); font-size: .78rem; }
.remove-button { width: 34px; height: 34px; border: 0; border-radius: 50%; color: var(--red); background: #fff0f0; cursor: pointer; }
.order-total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding: 15px 26px; font-size: 1.05rem; }
.order-actions { display: flex; justify-content: flex-end; gap: 9px; padding: 0 26px 24px; }
.gift-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 6px 26px 26px; }
.gift-item { border: 1px solid var(--line); border-radius: 8px; padding: 9px; text-align: center; }
.gift-item img { width: 100%; aspect-ratio: 1; object-fit: contain; }
.toast { position: fixed; z-index: 60; left: 50%; bottom: 100px; transform: translate(-50%, 20px); max-width: calc(100% - 32px); border-radius: 6px; padding: 10px 14px; color: white; background: var(--ink); opacity: 0; pointer-events: none; transition: .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 820px) {
  .catalog-intro { grid-template-columns: 1fr; gap: 20px; }
  .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product-dialog-layout { grid-template-columns: 1fr; }
  .gallery > img { height: min(42vh, 420px); }
}

@media (max-width: 620px) {
  .header-inner, .catalog-intro, .toolbar-inner, .gift-strip, .catalog-section { width: min(100% - 20px, 1180px); }
  .header-inner { min-height: 58px; gap: 8px; }
  .brand-mark { width: 34px; height: 34px; }
  .brand strong { font-size: .86rem; }
  .store-switch a { min-height: 32px; padding: 0 8px; font-size: .7rem; }
  .catalog-intro { min-height: auto; padding-block: 20px 16px; }
  .catalog-intro h1 { font-size: 2rem; }
  .steps { max-width: 280px; }
  .catalog-toolbar { top: 58px; }
  .filter-row { align-items: stretch; flex-direction: column; }
  .price-filter { justify-content: space-between; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .product-copy { padding: 9px; }
  .product-copy h3 { font-size: .86rem; }
  .gift-strip { grid-template-columns: 1fr auto; }
  .gift-thumbs { display: none; }
  .availability-note { display: none; }
  dialog { width: 100%; max-width: none; max-height: 94vh; margin: auto 0 0; border-radius: 8px 8px 0 0; }
  .product-dialog-copy { padding: 22px 16px; }
  .gallery { padding: 12px; }
  .gallery > img { height: 38vh; }
  .dialog-header, .order-list, .gift-grid { padding-inline: 16px; }
  .gift-grid { grid-template-columns: repeat(2, 1fr); }
  .order-actions { position: sticky; bottom: 0; padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: white; }
  .order-actions > * { flex: 1; padding-inline: 8px; }
}
