/* Catálogo público — María Market */
:root {
  --brand: #0075C5;
  --ink: #0B1420;
  --ink-2: #4B5868;
  --line: #DAE2EA;
  --bg: #EEF2F6;
  --card: #FFFFFF;
  --night: #000000;
  --night-2: #9AA8B8;
  --tag: var(--brand);
  --tag-ink: #FFFFFF;
  --wa: #1FAF54;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Figtree", system-ui, sans-serif;
  --gut: clamp(16px, 4vw, 40px);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 140px; }
body { margin: 0; font: 16px/1.5 var(--body); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3 { font-family: var(--display); margin: 0; line-height: 1.08; }
[hidden] { display: none !important; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg .fill { fill: currentColor; stroke: none; }

/* Barra superior */
.bar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px;
  padding: 12px var(--gut); background: var(--night); color: #fff;
}
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: #fff; font: 700 1.12rem var(--display); white-space: nowrap; }
.logo img { width: 44px; height: 44px; object-fit: contain; }
.mark { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand); color: #fff; font-size: 1.15rem; }
.search { flex: 1; max-width: 520px; margin-left: auto; display: flex; align-items: center; gap: 8px; background: #fff; border: 1.5px solid #fff; border-radius: 999px; padding: 0 14px; transition: border-color .15s; }
.search:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 45%, transparent); }
.search svg { color: var(--ink-2); }
.search input { flex: 1; min-width: 0; border: 0; background: none; font: inherit; padding: 10px 0; outline: none; color: var(--ink); }
.cart-btn { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; }
.cart-btn b { position: absolute; top: -4px; right: -4px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: #fff; color: var(--ink); font-size: .78rem; display: grid; place-items: center; border: 2px solid var(--night); }
.cart-btn.bump { animation: bump .45s cubic-bezier(.3,1.6,.6,1); }
@keyframes bump { 40% { transform: scale(1.18); } }

/* Portada */
.hero { background: var(--night); color: #fff; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(20px, 4vw, 56px); align-items: center; padding: clamp(12px, 3vw, 40px) var(--gut) clamp(28px, 4vw, 48px); border-radius: 0 0 clamp(24px, 4vw, 44px) clamp(24px, 4vw, 44px); margin-bottom: 8px; }
.hero h1 { font-size: clamp(2.8rem, 8vw, 6.2rem); font-weight: 800; letter-spacing: -.035em; line-height: .92; color: #fff; text-wrap: balance; }
.hero-logo { margin: 0 0 0 -12px; }
.hero-logo img { width: min(100%, 540px); height: auto; }
.hero-text > p { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: #DCE4EC; max-width: 32ch; margin: 10px 0 20px; }
.facts { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; font-size: .95rem; color: var(--night-2); }
.facts li { display: flex; align-items: center; gap: 10px; }
.facts svg { color: #3BA3EA; width: 18px; height: 18px; }

/* Vitrina de destacados */
.showcase { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 2px 14px; scrollbar-width: none; }
.showcase::-webkit-scrollbar { display: none; }
.showcase:empty { display: none; }
.show-card { flex: 0 0 min(260px, 70%); scroll-snap-align: start; position: relative; aspect-ratio: 3 / 4; border-radius: 22px; overflow: hidden; background: #1A2330; color: #fff; border: 0; padding: 0; text-align: left; }
.show-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.show-card:hover img { transform: scale(1.04); }
.show-card .cap { position: absolute; inset: auto 0 0; padding: 50px 16px 16px; color: #fff; background: linear-gradient(transparent, rgba(10,20,14,.82)); }
.show-card .cap b { display: block; font: 600 1.05rem/1.2 var(--display); }
.show-card .price-tag { position: absolute; top: 14px; left: 14px; }

/* Etiqueta de precio: el sello del catálogo */
.price-tag { display: inline-flex; align-items: baseline; gap: 4px; background: var(--tag); color: var(--tag-ink); font: 700 1.02rem var(--display); padding: 5px 12px 5px 18px; border-radius: 6px 99px 99px 6px; position: relative; letter-spacing: -.01em; }
.price-tag::before { content: ""; position: absolute; left: 7px; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--tag-ink); opacity: .7; }
.price-tag small { font-size: .72em; font-weight: 600; }

/* Categorías */
.chips { position: sticky; top: 70px; z-index: 15; display: flex; gap: 8px; overflow-x: auto; padding: 10px var(--gut); background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); padding: 8px 16px; border-radius: 999px; font-weight: 600; font-size: .93rem; white-space: nowrap; transition: background .15s, color .15s, border-color .15s; }
.chip:hover { border-color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip span { margin-right: 4px; }

/* Grilla */
.wrap { padding: 8px var(--gut) 120px; }
.list-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 6px 0 14px; }
.list-head p { margin: 0; color: var(--ink-2); font-size: .93rem; }
.sort { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); }
.sort select { font: 600 .9rem var(--body); color: var(--ink); background: var(--card); border: 1.5px solid var(--line); border-radius: 99px; padding: 7px 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: clamp(12px, 2vw, 22px); }
.card { position: relative; display: flex; flex-direction: column; background: var(--card); border-radius: 18px; overflow: hidden; }
.card .ph { position: relative; aspect-ratio: 1; background: #fff; border: 0; padding: 0; width: 100%; overflow: hidden; }
.card .ph img { width: 100%; height: 100%; object-fit: contain; padding: 6px; background: #fff; transition: opacity .3s; }
.card .ph img + img { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) { .card .ph:hover img + img { opacity: 1; } }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; font: 800 3rem var(--display); color: color-mix(in srgb, var(--brand) 35%, #fff); }
.badge { position: absolute; top: 10px; left: 10px; background: var(--ink); color: #fff; font-size: .76rem; font-weight: 700; padding: 3px 9px; border-radius: 99px; }
.badge.out { background: #fff; color: #912018; }
.badge.low { background: #fff; color: #7A4B00; }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font: 600 1rem/1.3 var(--body); }
.card h3 button { all: unset; cursor: pointer; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card h3 button:focus-visible { outline: 2.5px solid var(--brand); }
.card .row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; flex-wrap: wrap; }
.card .row > div { display: flex; flex-direction: column; align-items: flex-start; gap: 3px; }
.card s { color: var(--ink-2); font-size: .82rem; }
.add { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; display: grid; place-items: center; transition: transform .15s; }
.add:hover { transform: scale(1.08); }
.add:disabled { background: var(--line); color: var(--ink-2); cursor: not-allowed; transform: none; }
.add.added { background: var(--ink); }
.out-card .ph img { filter: grayscale(.7); opacity: .7; }

.empty { text-align: center; padding: 60px 16px; }
.empty p { color: var(--ink-2); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); padding: 12px 20px; border-radius: 999px; font-weight: 700; font-size: .98rem; text-decoration: none; transition: filter .15s, border-color .15s; }
.btn:hover { border-color: var(--ink-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover, .btn.wa:hover { filter: brightness(1.08); }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn:disabled { opacity: .55; cursor: wait; }
.grow { flex: 1; }
.link { background: none; border: 0; padding: 0; color: var(--brand); font-weight: 600; text-decoration: underline; text-underline-offset: 3px; font-size: .93rem; }

/* Pie */
.foot { background: var(--night) !important; display: flex; flex-wrap: wrap; gap: 20px 40px; justify-content: space-between; align-items: flex-start; padding: 36px var(--gut) 110px; background: var(--ink); color: #C9D6CE; }
.foot b { color: #fff; font: 700 1.3rem var(--display); }
.foot p { margin: 4px 0 0; }
.social { display: flex; gap: 18px; flex-wrap: wrap; }
.social a { color: #3BA3EA; font-weight: 600; text-decoration: none; }
.staff { color: #8DA196; font-size: .85rem; width: 100%; }

/* Barra del carrito en celular */
.cart-bar { position: fixed; z-index: 25; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); display: flex; justify-content: space-between; align-items: center; gap: 10px; background: var(--ink); color: #fff; border: 0; border-radius: 18px; padding: 14px 18px; box-shadow: 0 14px 40px -12px rgba(20,35,27,.6); font-size: .95rem; animation: rise .35s ease-out; }
.cart-bar #cart-bar-count { background: var(--brand); color: #fff; font-weight: 700; border-radius: 99px; padding: 1px 10px; }
.cart-bar #cart-bar-total { font-weight: 700; }
@keyframes rise { from { transform: translateY(120%); } }
@media (min-width: 900px) { .cart-bar { display: none !important; } }

/* Diálogos */
dialog { border: 0; padding: 0; color: var(--ink); background: var(--card); max-width: none; max-height: none; }
dialog::backdrop { background: rgba(12,22,16,.5); backdrop-filter: blur(3px); }
dialog[open] { animation: pop .28s cubic-bezier(.2,.9,.3,1); }
@keyframes pop { from { opacity: 0; transform: translateY(24px); } }
.close { position: absolute; top: 12px; right: 12px; z-index: 3; width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92); display: grid; place-items: center; box-shadow: 0 2px 10px rgba(0,0,0,.12); }

.product { width: min(980px, calc(100% - 32px)); max-height: calc(100dvh - 48px); margin: auto; border-radius: 24px; overflow: auto; }
.pd { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
.pd-media { position: sticky; top: 0; background: #fff; min-width: 0; border-right: 1px solid var(--line); }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; aspect-ratio: 1; width: 100%; scrollbar-width: none; }
.slides::-webkit-scrollbar { display: none; }
.slides img, .slides .noimg { flex: 0 0 100%; width: 100%; min-width: 0; height: 100%; object-fit: contain; padding: 16px; background: #fff; scroll-snap-align: center; }
.dots { position: absolute; bottom: 12px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: rgba(11,20,32,.25); transition: width .2s; }
.dots button[aria-current="true"] { width: 22px; background: var(--brand); }
.pd-info { padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 12px; }
.pd-cat { margin: 0; color: var(--brand); font-weight: 600; font-size: .9rem; }
.pd-info h2:focus { outline: none; }
.pd-info h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.015em; padding-right: 36px; }
.pd-price { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pd-price .price-tag { font-size: 1.35rem; }
.pd-price s { color: var(--ink-2); }
.save { font-size: .85rem; font-weight: 700; color: var(--brand); }
.pd-stock { margin: 0; }
.stock { display: inline-flex; align-items: center; gap: 6px; width: max-content; font-size: .8rem; font-weight: 700; padding: 3px 10px 3px 8px; border-radius: 99px; }
.stock i { width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.stock.available { background: #E3F6EA; color: #137A3A; }
.stock.out { background: #FDECEC; color: #C0262D; }
.pd-stock .stock { font-size: .9rem; padding: 5px 12px 5px 10px; }
.pd-stock.out { color: #912018; } .pd-stock.low { color: #7A4B00; } .pd-stock.order { color: #1D4ED8; } .pd-stock.available { color: var(--brand); }
.pd-desc { color: var(--ink-2); white-space: pre-line; max-width: 60ch; }
.pd-feat { display: grid; grid-template-columns: auto 1fr; margin: 0; border-top: 1px solid var(--line); }
.pd-feat dt, .pd-feat dd { padding: 9px 0; border-bottom: 1px solid var(--line); margin: 0; font-size: .93rem; }
.pd-feat dt { color: var(--ink-2); padding-right: 18px; }
.pd-feat dd { font-weight: 600; }
.pd-feat dd.solo { grid-column: 1 / -1; font-weight: 500; }
.pd-buy { display: flex; gap: 10px; margin-top: 6px; position: sticky; bottom: 0; background: var(--card); padding: 8px 0; }
.stepper { display: flex; align-items: center; border: 1.5px solid var(--line); border-radius: 99px; }
.stepper button { width: 40px; height: 44px; border: 0; background: none; font-size: 1.25rem; }
.stepper output { min-width: 26px; text-align: center; font-weight: 700; }
.pd-more { display: flex; gap: 20px; flex-wrap: wrap; }

/* Carrito */
.drawer { margin: 0 0 0 auto; height: 100dvh; width: min(440px, 100%); display: flex; flex-direction: column; border-radius: 24px 0 0 24px; }
.drawer[open] { display: flex; animation: slide .3s cubic-bezier(.2,.9,.3,1); }
@keyframes slide { from { transform: translateX(100%); } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 20px 20px 12px; }
.drawer-head h2 { font-size: 1.5rem; }
.drawer-head .close { position: static; box-shadow: none; background: var(--bg); }
.drawer-body { flex: 1; overflow-y: auto; padding: 0 20px; }
.cart-items { list-style: none; padding: 0; margin: 0; }
.ci { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.ci img, .ci .noimg { width: 64px; height: 64px; border-radius: 12px; object-fit: contain; background: #fff; border: 1px solid var(--line); font-size: 1.4rem; }
.ci b { display: block; font-weight: 600; font-size: .95rem; line-height: 1.3; }
.ci small { color: var(--ink-2); }
.ci .stepper { margin-top: 6px; width: max-content; }
.ci .stepper button { width: 32px; height: 32px; font-size: 1.05rem; }
.ci .sub { font-weight: 700; text-align: right; }
.ci .rm { display: block; margin-top: 6px; font-size: .82rem; color: var(--ink-2); font-weight: 500; }
.cart-empty { text-align: center; padding: 40px 10px; }
.cart-empty p { color: var(--ink-2); }
.checkout { padding: 18px 0 8px; }
.checkout h3 { font-size: 1.05rem; margin-bottom: 12px; }
.checkout label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.checkout small { font-weight: 400; color: var(--ink-2); }
.checkout input, .checkout textarea { font: inherit; font-weight: 400; border: 1.5px solid var(--line); border-radius: 12px; padding: 11px 13px; color: var(--ink); background: #fff; resize: vertical; }
.checkout input:focus, .checkout textarea:focus { outline: none; border-color: var(--brand); }
.drawer-foot { padding: 14px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.total-row { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.total-row b { font: 700 1.5rem var(--display); }
.drawer-foot .btn { width: 100%; }
.fine { text-align: center; color: var(--ink-2); font-size: .82rem; margin: 8px 0 0; }

.toast { position: fixed; z-index: 50; left: 50%; bottom: 90px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px; font-weight: 600; font-size: .92rem; transition: opacity .2s, transform .2s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Responsive */
@media (max-width: 860px) {
  .hero { grid-template-columns: 1fr; }
  .hero-text > p { margin-bottom: 16px; }
  .pd { grid-template-columns: minmax(0, 1fr); }
  .pd-media { position: relative; border-right: 0; border-bottom: 1px solid var(--line); }
  .slides { max-height: 52dvh; }
  .product { width: 100%; max-height: 94dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .product[open] { animation: up .3s cubic-bezier(.2,.9,.3,1); }
  .pd-info { padding: 20px 18px calc(16px + env(safe-area-inset-bottom)); }
  .drawer { width: 100%; height: 92dvh; margin: auto 0 0; border-radius: 24px 24px 0 0; }
  .drawer[open] { animation: up .3s cubic-bezier(.2,.9,.3,1); }
}
@keyframes up { from { transform: translateY(100%); } }
@media (max-width: 600px) {
  .bar { flex-wrap: wrap; gap: 10px; padding-bottom: 8px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .cart-btn { margin-left: auto; width: 42px; height: 42px; }
  .chips { top: 118px; }
  .hero-logo { margin-left: -8px; }
  .hero-logo img { width: min(100%, 380px); }
  html { scroll-padding-top: 180px; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { border-radius: 14px; }
  .card .body { padding: 10px 10px 12px; }
  .card h3 { font-size: .92rem; }
  .card .price-tag { font-size: .92rem; padding: 4px 10px 4px 15px; }
  .add { width: 36px; height: 36px; }
  .sort span { display: none; }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; transition: none !important; } }
