:root {
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --bg: #ffffff;
  --surface: #f5f5f7;
  --surface-2: #e8e8ed;
  --line: #d2d2d7;
  --accent: #0071e3;
  --brand: #5a2ee0;
  --wa: #25a35a;
  --radius: 18px;
  --sans: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--sans); color: var(--ink); background: var(--bg); font-size: 16px; line-height: 1.47; -webkit-font-smoothing: antialiased; letter-spacing: -.01em; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; letter-spacing: inherit; }
a { color: var(--accent); text-decoration: none; }
h1, h2 { font-family: var(--display); letter-spacing: -.015em; font-weight: 500; font-variation-settings: "opsz" 72, "SOFT" 30; }

/* barra superior */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 6px 18px; padding-top: max(6px, env(safe-area-inset-top));
  background: rgba(255,255,255,.82); backdrop-filter: saturate(180%) blur(20px); -webkit-backdrop-filter: saturate(180%) blur(20px); border-bottom: 1px solid transparent; transition: border-color .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-brand { display: flex; align-items: center; gap: 8px; color: var(--ink); opacity: 0; transition: opacity .25s; }
.topbar.scrolled .topbar-brand { opacity: 1; }
.topbar-brand img { width: 32px; height: 32px; border-radius: 50%; }
.topbar-brand span { font-family: var(--display); font-size: 18px; font-weight: 500; letter-spacing: -.01em; }
.topbar-brand em { font-style: normal; color: var(--faint); font-weight: 500; }
.bag-btn { position: relative; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-items: center; color: var(--ink); }
.bag-count { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--ink); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.bag-btn.bump { animation: bump .4s ease; }
@keyframes bump { 40% { transform: scale(1.12); } }

/* portada */
.hero { text-align: center; padding: 22px 24px 10px; }
.hero-glow { display: none; }
.hero-logo { width: 96px; height: 96px; margin: 0 auto 14px; border-radius: 50%; }
.hero-tag { font-family: var(--display); font-size: 34px; font-weight: 500; letter-spacing: -.02em; line-height: 1.08; margin: 0 0 6px; color: var(--ink); }
.hero-sub { margin: 0; color: var(--muted); font-size: 16px; }

/* herramientas */
.toolbar { position: sticky; top: 52px; z-index: 10; background: rgba(255,255,255,.92); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); padding-top: 10px; }
.search-box { display: flex; align-items: center; gap: 10px; margin: 0 18px 10px; padding: 0 14px; min-height: 44px; border-radius: 12px; background: var(--surface); color: var(--faint); }
.search-box input { flex: 1; border: 0; background: none; font: inherit; font-size: 16px; color: var(--ink); min-width: 0; outline: none; padding: 10px 0; }
.search-box input::placeholder { color: var(--faint); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 18px 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px; border: 0; background: var(--surface); font-weight: 500; font-size: 14px; color: var(--ink); transition: background .15s, color .15s; }
.chip[aria-pressed="true"] { background: var(--ink); color: #fff; }
.chip small { font-weight: 500; opacity: .6; font-size: 13px; }
.chip-ic { font-size: 15px; line-height: 1; }
.result-count { margin: 4px 18px 12px; color: var(--muted); font-size: 14px; }
.result-count a { font-weight: 600; }

/* cuadrícula */
main { padding: 4px 18px 36px; max-width: 1180px; margin: 0 auto; }
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px 14px; }
@media (min-width: 700px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 32px 20px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { position: relative; background: none; border: 0; padding: 0; text-align: left; display: flex; flex-direction: column; gap: 10px; transition: transform .2s ease; }
.card:active { transform: scale(.98); }
.card-img { position: relative; aspect-ratio: 4 / 5; background: var(--surface); border-radius: 16px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
@media (hover: hover) { .card:hover .card-img img { transform: scale(1.03); } }
.card-img .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--line); font-family: var(--display); font-size: 28px; font-weight: 600; }
.badge { position: absolute; left: 10px; top: 10px; padding: 4px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; background: rgba(255,255,255,.9); color: var(--ink); backdrop-filter: blur(8px); }
.badge.new { background: var(--ink); color: #fff; }
.fav { position: absolute; right: 8px; top: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--ink); font-size: 18px; line-height: 1; display: grid; place-items: center; backdrop-filter: blur(8px); }
.fav.on { color: #ff375f; }
.card-body { display: grid; gap: 2px; padding: 0 2px; }
.card-row { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.card-name { font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { font-weight: 400; color: var(--muted); font-size: 15px; }
.card-size { font-size: 13px; color: var(--faint); white-space: nowrap; }
.card.is-apartado .card-img img { opacity: .5; }
.card.is-apartado .card-img::after { content: 'Apartada'; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 6px 12px; border-radius: 999px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(29,29,31,.75); }
.card.in-bag .card-img { outline: 2px solid var(--ink); outline-offset: 2px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, #fafafa 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 16px; aspect-ratio: 4/6; }
@keyframes sk { to { background-position: -200% 0; } }

.empty { text-align: center; padding: 50px 20px; color: var(--muted); }
.empty-ic { font-size: 40px; margin-bottom: 8px; }
.empty-title { font-family: var(--display); font-size: 24px; font-weight: 500; letter-spacing: -.02em; color: var(--ink); margin: 0 0 6px; }

/* cómo comprar */
.how { background: var(--surface); margin: 16px 18px 0; border-radius: 24px; padding: 28px 24px; max-width: 1144px; }
@media (min-width: 1180px) { .how { margin: 16px auto 0; } }
.how h2 { margin: 0 0 18px; font-size: 26px; font-style: italic; }
.how ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
@media (min-width: 700px) { .how ol { grid-template-columns: repeat(3, 1fr); gap: 24px; } }
.how li { display: flex; gap: 12px; align-items: flex-start; }
.how .n { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--ink); color: #fff; font-weight: 600; font-size: 14px; display: grid; place-items: center; }
.how b { font-weight: 600; }
.how p { margin: 2px 0 0; color: var(--muted); font-size: 15px; }
.how .pay { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 15px; }
.how .pay b { color: var(--ink); font-weight: 600; }

.foot { text-align: center; color: var(--faint); font-size: 13px; padding: 36px 20px 120px; }
.foot img { width: 44px; height: 44px; margin: 0 auto 10px; border-radius: 50%; opacity: .9; }
.foot p { margin: 0; }
.foot-sub { margin-top: 2px; }

/* WhatsApp flotante y barra de bolsa */
.wa-float { position: fixed; right: 18px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 15; width: 54px; height: 54px; border-radius: 50%; background: var(--wa); color: #fff; display: grid; place-items: center; box-shadow: 0 8px 24px rgba(0,0,0,.14); }
.bag-bar { position: fixed; left: 18px; right: 86px; bottom: max(18px, env(safe-area-inset-bottom)); z-index: 15; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 10px 8px 18px; border: 0; border-radius: 999px; background: var(--ink); color: #fff; font-weight: 600; font-size: 15px; box-shadow: 0 10px 30px rgba(0,0,0,.18); animation: up .25s ease; }
.bag-bar-count { width: 26px; height: 26px; border-radius: 50%; background: #fff; color: var(--ink); display: grid; place-items: center; font-size: 13px; font-weight: 700; order: 3; }
.bag-bar-text { flex: 1; text-align: left; }
.bag-bar b { font-weight: 500; opacity: .85; }
@media (min-width: 700px) { .bag-bar { left: auto; right: 90px; width: 320px; } }

/* hojas */
.sheet { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.4); animation: fade .2s; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 94vh; overflow-y: auto; background: #fff; border-radius: 22px 22px 0 0; animation: up .28s cubic-bezier(.2,.8,.2,1); padding-bottom: env(safe-area-inset-bottom); }
@media (min-width: 700px) { .sheet-panel { left: 50%; right: auto; bottom: auto; top: 50%; width: min(520px, 94vw); transform: translate(-50%, -50%); border-radius: 22px; animation: fade .2s; } }
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes fade { from { opacity: 0; } }
.sheet-close { position: sticky; top: 12px; float: right; margin: 12px 12px -54px 0; z-index: 3; width: 36px; height: 36px; border-radius: 50%; border: 0; background: rgba(255,255,255,.9); color: var(--ink); font-size: 22px; line-height: 1; backdrop-filter: blur(8px); box-shadow: 0 1px 4px rgba(0,0,0,.12); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--surface); }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; scroll-snap-align: center; }
@media (min-height: 800px) { .gallery img { aspect-ratio: 4 / 5; } }
.dots { display: flex; justify-content: center; gap: 6px; padding: 12px 0 0; }
.dots span { width: 6px; height: 6px; border-radius: 50%; background: var(--line); }
.dots span.on { background: var(--ink); }
.sheet-body { padding: 14px 22px 24px; }
.p-cat { margin: 0; color: var(--faint); font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: .06em; }
.sheet-body h2 { font-size: 28px; margin: 4px 0 2px; line-height: 1.12; }
.p-price { font-size: 20px; font-weight: 400; color: var(--muted); margin: 0; }
.p-meta { display: flex; align-items: center; gap: 10px; margin-top: 10px; }
.p-size { margin: 0; color: var(--muted); font-size: 15px; }
.p-unique { font-size: 12px; font-weight: 500; color: var(--ink); background: var(--surface); padding: 4px 10px; border-radius: 999px; }
.p-desc { margin: 14px 0 0; white-space: pre-line; color: var(--ink); font-size: 16px; }
.p-status { margin: 12px 0 0; padding: 12px 14px; border-radius: 12px; background: var(--surface); color: var(--ink); font-weight: 500; font-size: 15px; }
.sheet-actions { display: grid; gap: 10px; margin-top: 22px; }
.btn { font-family: var(--sans); display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 50px; padding: 12px 20px; border-radius: 999px; font-weight: 600; font-size: 16px; border: 0; letter-spacing: -.01em; transition: transform .12s, opacity .15s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary.added { background: var(--surface); color: var(--ink); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line); }
.btn-link { background: none; color: var(--accent); min-height: 40px; font-weight: 500; }
.btn-wa { background: var(--wa); color: #fff; }
.p-trust { margin: 2px 0 0; text-align: center; color: var(--faint); font-size: 13px; }
.p-row { display: flex; justify-content: center; gap: 6px; }
.p-row .btn-link { width: auto; padding: 8px 14px; }
.p-row .btn-link.on { color: #ff375f; }

.bag-panel { padding: 20px 22px 24px; }
.bag-panel h2 { margin: 6px 0 16px; font-size: 26px; }
.bag-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.bag-list li { display: flex; align-items: center; gap: 12px; }
.bag-list img, .bag-list .ph { width: 60px; height: 72px; border-radius: 12px; object-fit: cover; background: var(--surface); flex: 0 0 auto; }
.bag-list .info { flex: 1; min-width: 0; }
.bag-list .info b { display: block; font-size: 15px; font-weight: 500; }
.bag-list .info span { color: var(--muted); font-size: 14px; }
.bag-list .rm { border: 0; background: none; color: var(--accent); font-size: 14px; padding: 8px; }
.bag-empty { color: var(--muted); }
.bag-total { display: flex; justify-content: space-between; align-items: baseline; margin: 20px 0 14px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 16px; color: var(--muted); }
.bag-total b { color: var(--ink); font-size: 22px; font-weight: 600; letter-spacing: -.02em; }
.bag-note { text-align: center; color: var(--faint); font-size: 13px; margin: 12px 0 0; }

.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 80; background: rgba(29,29,31,.92); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 500; font-size: 14px; backdrop-filter: blur(10px); max-width: 90vw; text-align: center; }
