/* ---------- Tienda ---------- */
body { padding-bottom: 24px; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(251, 247, 240, .9);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(230, 220, 203, .7);
}
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
.brand-sub { display: none; }
@media (min-width: 420px) { .brand-sub { display: block; } }
.topnav { display: none; gap: 28px; }
.topnav a { color: var(--ink-2); text-decoration: none; font-weight: 500; }
.topnav a:hover { color: var(--sage-700); }
@media (min-width: 960px) { .topnav { display: flex; } }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.cart-btn {
  position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px 0 12px;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); font-weight: 600; color: var(--sage-800);
}
.cart-btn svg { width: 22px; height: 22px; }
.cart-label { display: none; }
@media (min-width: 600px) { .cart-label { display: inline; } }
.cart-count {
  min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: #fff;
  font-size: .78rem; display: inline-grid; place-items: center;
}
.cart-count.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.35); } }

.eyebrow {
  font-size: .8rem; font-weight: 600; letter-spacing: .06em; color: var(--accent-ink); margin-bottom: 12px;
}
.eyebrow.light { color: #f6c9b0; }

/* Hero */
.hero { padding: 28px 0 8px; overflow: hidden; }
.hero-grid { display: grid; gap: 8px; align-items: center; }
@media (min-width: 900px) { .hero { padding: 64px 0 40px; } .hero-grid { grid-template-columns: 1.1fr .9fr; gap: 40px; } }
.hero h1 { font-size: clamp(2.05rem, 7.4vw, 3.7rem); line-height: 1.06; letter-spacing: -.02em; color: var(--sage-900); }
.hero h1 em { font-style: italic; font-weight: 500; color: var(--sage-600); display: block; }
.lead { font-size: 1.08rem; color: var(--ink-2); margin-top: 18px; max-width: 34em; }
@media (min-width: 900px) { .lead { font-size: 1.16rem; } }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
@media (max-width: 480px) { .hero-cta .btn { flex: 1 1 100%; } }
.hero-rating { margin-top: 18px; display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .92rem; font-weight: 500; }
.stars { color: #d79a2b; letter-spacing: 2px; }

.hero-art { position: relative; height: 300px; margin-top: 8px; }
@media (min-width: 900px) { .hero-art { height: 440px; } }
.blob {
  position: absolute; inset: 6% 4% 8% 8%;
  background: radial-gradient(circle at 30% 30%, var(--sage-100), var(--sage-200) 70%);
  border-radius: 46% 54% 52% 48% / 52% 44% 56% 48%;
}
.float {
  position: absolute; border-radius: 30px; background: var(--paper); box-shadow: var(--shadow-2); padding: 10px;
  animation: floaty 7s ease-in-out infinite;
}
.float svg { width: 100%; height: 100%; }
.f1 { width: 42%; aspect-ratio: 1; left: 6%; top: 10%; background: #f6e6da; }
.f2 { width: 36%; aspect-ratio: 1; right: 6%; top: 2%; background: #f8edc9; animation-delay: -2s; }
.f3 { width: 34%; aspect-ratio: 1; right: 16%; bottom: 6%; background: #e3ecf0; animation-delay: -4s; }
@keyframes floaty { 50% { transform: translateY(-8px); } }
.hero-note {
  position: absolute; left: 0; bottom: 4%; display: flex; gap: 10px; align-items: center; max-width: 250px;
  background: var(--paper); border-radius: 18px; padding: 12px 14px; box-shadow: var(--shadow-2);
  font-size: .82rem; color: var(--muted); line-height: 1.35;
}
.hero-note b { display: block; color: var(--sage-800); font-size: .88rem; }

.avatar {
  flex: none; display: inline-grid; place-items: center; border-radius: 50%;
  background: linear-gradient(140deg, var(--sage-600), var(--sage-800)); color: #fff;
  font-family: var(--font-serif); font-weight: 600; letter-spacing: .02em;
}
.avatar.sm { width: 36px; height: 36px; font-size: .82rem; }
.avatar.md { width: 46px; height: 46px; font-size: 1rem; }
.avatar.lg { width: 76px; height: 76px; font-size: 1.5rem; margin-bottom: 16px; box-shadow: 0 0 0 6px var(--sage-100); }

/* Trust */
.trust { padding: 28px 0; }
.trust-grid { display: grid; gap: 12px; }
@media (min-width: 768px) { .trust-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.trust-item { display: flex; gap: 14px; align-items: flex-start; background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px; }
.ti-icon { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--sage-100); color: var(--sage-700); }
.ti-icon svg { width: 22px; height: 22px; }
.trust-item h2 { font-family: var(--font-sans); font-size: 1rem; font-weight: 600; margin-bottom: 2px; }
.trust-item p { font-size: .92rem; color: var(--muted); }

/* Section head */
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head h2 { font-size: clamp(1.5rem, 4.6vw, 2.1rem); color: var(--sage-900); }
.section-head p { color: var(--muted); font-size: .92rem; }

/* Categorías */
.cats { padding: 24px 0 8px; }
.cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 900px) { .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 18px; } }
.cat-tile {
  display: flex; flex-direction: column; justify-content: space-between; gap: 6px; text-align: left;
  border: 0; border-radius: var(--r-lg); padding: 16px; min-height: 168px; color: var(--ink);
  transition: transform .2s ease, box-shadow .2s ease;
}
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.cat-tile .ill { width: 74px; height: 74px; align-self: flex-end; }
.cat-tile b { font-family: var(--font-serif); font-size: 1.08rem; font-weight: 600; line-height: 1.2; }
.cat-tile small { color: var(--muted); font-size: .84rem; }

/* Catálogo */
.catalog { padding: 40px 0 24px; scroll-margin-top: 64px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; }
.search {
  flex: 1 1 260px; display: flex; align-items: center; gap: 10px; height: 50px; padding: 0 16px;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: 999px;
}
.search:focus-within { border-color: var(--sage-600); box-shadow: 0 0 0 4px var(--sage-100); }
.search svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.search input { border: 0; outline: 0; background: transparent; width: 100%; height: 100%; font-size: 1rem; }
.sort select {
  height: 50px; padding: 0 40px 0 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper);
  appearance: none; -webkit-appearance: none; font-weight: 500;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a483f' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; background-size: 18px;
}
.chips {
  display: flex; gap: 8px; margin: 14px calc(var(--gutter) * -1) 18px; padding: 2px var(--gutter);
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chips::-webkit-scrollbar { display: none; }
@media (min-width: 900px) { .chips { flex-wrap: wrap; overflow: visible; } }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; } }
@media (min-width: 1080px) { .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px; } }

.card {
  position: relative; display: flex; flex-direction: column; background: var(--paper);
  border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.card-media { position: relative; aspect-ratio: 1 / .92; display: grid; place-items: center; padding: 14%; }
.card-media svg { width: 100%; height: 100%; }
.badge {
  position: absolute; top: 10px; left: 10px; padding: 4px 9px; border-radius: 999px;
  background: var(--paper); color: var(--accent-ink); font-size: .72rem; font-weight: 700; letter-spacing: .02em;
}
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 14px; flex: 1; }
@media (min-width: 720px) { .card-body { padding: 14px 16px 16px; } }
.card-age { font-size: .74rem; font-weight: 600; color: var(--sage-600); }
.card-title { font-size: .95rem; font-weight: 600; line-height: 1.3; color: var(--ink); text-decoration: none; }
.card-title::after { content: ""; position: absolute; inset: 0; }
.card-size { font-size: .82rem; color: var(--muted); }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 8px; }
.price { font-weight: 700; font-size: 1.05rem; color: var(--sage-900); }
.add-btn {
  position: relative; z-index: 2; width: 42px; height: 42px; border-radius: 50%; border: 0;
  background: var(--sage-700); color: #fff; display: grid; place-items: center; transition: background .15s ease, transform .15s ease;
}
.add-btn:hover { background: var(--sage-800); }
.add-btn:active { transform: scale(.92); }
.add-btn svg { width: 20px; height: 20px; }
.add-btn.added { background: var(--accent); }

.empty { text-align: center; padding: 40px 16px; background: var(--paper); border: 1px dashed var(--cream-3); border-radius: var(--r-lg); display: grid; gap: 10px; justify-items: center; }
.empty p { color: var(--muted); max-width: 30em; }
.empty b { color: var(--ink); }

/* Pickup */
.pickup { padding: 32px 0; scroll-margin-top: 64px; }
.pickup-card {
  display: grid; gap: 24px; background: var(--sage-800); color: #fff; border-radius: var(--r-xl);
  padding: 28px 22px; max-width: calc(var(--maxw) - var(--gutter) * 2); margin: 0 var(--gutter);
  background-image: radial-gradient(circle at 100% 0, rgba(217, 130, 91, .28), transparent 45%);
}
@media (min-width: 1216px) { .pickup-card { margin: 0 auto; } }
@media (min-width: 900px) { .pickup-card { grid-template-columns: .9fr 1.1fr; padding: 48px; align-items: center; } }
.pickup-card h2 { font-size: clamp(1.6rem, 5vw, 2.3rem); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }
.steps li { display: flex; gap: 14px; align-items: flex-start; background: rgba(255, 255, 255, .07); border-radius: var(--r-md); padding: 14px; color: #e4ece1; }
.steps b { color: #fff; }
.steps span { flex: none; width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; font-weight: 700; }

/* Farmacéutica */
.pharmacist { padding: 32px 0 48px; scroll-margin-top: 64px; }
.ph-grid { display: grid; gap: 16px; }
@media (min-width: 900px) { .ph-grid { grid-template-columns: 1.3fr 1fr; gap: 22px; } }
.ph-card, .visit { background: var(--paper); border: 1px solid var(--line); border-radius: var(--r-xl); padding: 26px 22px; }
@media (min-width: 900px) { .ph-card, .visit { padding: 40px; } }
.ph-card h2 { font-size: clamp(1.6rem, 5vw, 2.2rem); color: var(--sage-900); margin-bottom: 10px; }
.ph-card > p:not(.eyebrow) { color: var(--ink-2); max-width: 34em; }
.ph-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.visit { background: var(--cream-2); border-color: transparent; }
.visit h3 { font-size: 1.35rem; margin-bottom: 14px; }
.visit dl { margin: 0; display: grid; gap: 14px; }
.visit dt { font-size: .78rem; font-weight: 600; letter-spacing: .05em; color: var(--accent-ink); }
.visit dd { margin: 2px 0 0; font-weight: 500; }
.visit a { color: var(--sage-800); }

/* Ficha de producto */
#viewProduct { padding: 16px 0 56px; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--sage-700); font-weight: 600; text-decoration: none; padding: 10px 0; }
.back svg { width: 18px; height: 18px; }
.pd { display: grid; gap: 22px; margin-top: 6px; }
@media (min-width: 900px) { .pd { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; } }
.pd-media { border-radius: var(--r-xl); aspect-ratio: 1 / .9; display: grid; place-items: center; padding: 18%; position: relative; }
@media (min-width: 900px) { .pd-media { position: sticky; top: 84px; } }
.pd-media svg { width: 100%; height: 100%; }
.crumb { font-size: .84rem; color: var(--muted); margin-bottom: 8px; }
.crumb a { color: var(--muted); }
.pd h1 { font-size: clamp(1.6rem, 5.4vw, 2.4rem); color: var(--sage-900); }
.pd-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.pill { font-size: .8rem; font-weight: 600; padding: 5px 11px; border-radius: 999px; background: var(--sage-100); color: var(--sage-800); }
.pill.warm { background: var(--accent-soft); color: var(--accent-ink); }
.pd-price { font-size: 1.8rem; font-weight: 700; color: var(--sage-900); margin-top: 18px; }
.pd-desc { color: var(--ink-2); margin-top: 10px; font-size: 1.04rem; }
.buy { display: flex; gap: 10px; margin-top: 20px; }
.buy .btn { flex: 1; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: var(--paper); height: 48px; }
.qty button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 1.3rem; color: var(--sage-800); border-radius: 50%; }
.qty button:hover { background: var(--sage-100); }
.qty output { min-width: 28px; text-align: center; font-weight: 700; }
.qty.sm { height: 38px; }
.qty.sm button { width: 34px; height: 34px; font-size: 1.1rem; }
.pickup-note { display: flex; align-items: center; gap: 10px; margin-top: 14px; font-size: .92rem; color: var(--sage-800); background: var(--sage-50); border-radius: var(--r-md); padding: 12px 14px; }
.pickup-note svg { width: 22px; height: 22px; flex: none; color: var(--sage-600); }

.recommend {
  position: relative; margin-top: 24px; padding: 22px 20px 20px; border-radius: var(--r-lg);
  background: var(--accent-soft); border: 1px solid #f0cdb8;
}
.recommend-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.recommend-head b { display: block; font-family: var(--font-serif); font-size: 1.12rem; color: var(--accent-ink); line-height: 1.2; }
.recommend-head small { color: #85543c; font-size: .82rem; }
.recommend blockquote { margin: 0; font-family: var(--font-serif); font-size: 1.08rem; line-height: 1.5; color: #4a2f22; }
.recommend .sig { margin-top: 10px; font-size: .86rem; color: #85543c; font-weight: 500; }
.recommend .ask { display: inline-flex; margin-top: 14px; gap: 8px; font-weight: 600; color: var(--accent-ink); background: none; border: 0; padding: 0; text-decoration: underline; text-underline-offset: 3px; }

.points { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 8px; }
.points li { display: flex; gap: 10px; align-items: center; color: var(--ink-2); }
.points svg { width: 20px; height: 20px; flex: none; color: var(--sage-600); }

.pairs { margin-top: 44px; }
.pairs h2 { font-size: 1.4rem; margin-bottom: 14px; color: var(--sage-900); }

/* Footer */
.footer { border-top: 1px solid var(--line); padding: 28px 0 70px; background: var(--cream-2); }
.footer-inner { display: grid; gap: 10px; }
.footer .brand-name { margin-bottom: 2px; }
.footer p { color: var(--muted); font-size: .9rem; }
.footer a { color: var(--sage-800); }
.fine { font-size: .82rem !important; color: var(--muted); }

/* FAB */
.fab { position: fixed; right: 14px; bottom: 14px; z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.fab-btn {
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 18px 0 16px; border: 0; border-radius: 999px;
  background: var(--sage-700); color: #fff; font-weight: 600; box-shadow: var(--shadow-3);
}
.fab-btn svg { width: 24px; height: 24px; }
.fab-btn[aria-expanded="true"] { background: var(--sage-900); }
.fab-menu {
  width: min(280px, calc(100vw - 28px)); background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-3);
  padding: 14px; display: grid; gap: 8px; border: 1px solid var(--line);
}
.fab-menu[hidden] { display: none; }
.fab-menu p { font-size: .9rem; color: var(--muted); padding: 2px 4px 4px; }
.fab-opt {
  display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--r-md); text-decoration: none;
  color: var(--ink); background: var(--sage-50); border: 0; text-align: left; width: 100%;
}
.fab-opt:hover { background: var(--sage-100); }
.fab-opt svg { width: 22px; height: 22px; color: var(--sage-700); flex: none; }
.fab-opt b { display: block; }
.fab-opt span { font-size: .85rem; color: var(--muted); }
.fab-opt span b { color: var(--ink); font-size: .95rem; }

/* Carrito */
dialog.drawer {
  border: 0; padding: 0; margin: 0; background: transparent; max-width: none; max-height: none;
  width: 100%; height: 100%;
}
dialog.drawer::backdrop { background: rgba(35, 56, 43, .45); }
.drawer-inner {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92dvh; display: flex; flex-direction: column;
  background: var(--paper); border-radius: var(--r-xl) var(--r-xl) 0 0; box-shadow: var(--shadow-3);
  animation: up .25s ease;
}
@media (min-width: 720px) {
  .drawer-inner { left: auto; top: 0; width: 440px; max-height: none; border-radius: var(--r-xl) 0 0 var(--r-xl); animation: left .25s ease; }
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
@keyframes left { from { transform: translateX(40px); opacity: 0; } }
.drawer-body { overflow-y: auto; padding: 4px 22px 22px; display: flex; flex-direction: column; gap: 18px; flex: 1; }
.cart-empty { text-align: center; padding: 30px 0; color: var(--muted); display: grid; gap: 14px; justify-items: center; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; }
.line-media { width: 64px; height: 64px; border-radius: 16px; padding: 8px; }
.line-name { font-weight: 600; font-size: .92rem; line-height: 1.3; }
.line-sub { font-size: .82rem; color: var(--muted); }
.line-right { display: grid; justify-items: end; gap: 6px; }
.lines { display: grid; gap: 14px; }
.fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 10px; }
.fieldset legend { font-weight: 700; margin-bottom: 8px; font-size: 1rem; }
.opt {
  position: relative; display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
  border: 1.5px solid var(--line); border-radius: var(--r-md); padding: 14px; cursor: pointer; background: var(--paper);
}
.opt:has(input:checked) { border-color: var(--sage-600); background: var(--sage-50); box-shadow: 0 0 0 3px var(--sage-100); }
.opt input { width: 20px; height: 20px; accent-color: var(--sage-700); margin: 0; }
.opt b { display: block; }
.opt small { color: var(--muted); font-size: .84rem; display: block; line-height: 1.35; }
.opt .tag { position: absolute; top: -10px; right: 12px; font-size: .7rem; font-weight: 700; background: var(--accent); color: #fff; padding: 3px 8px; border-radius: 999px; letter-spacing: .03em; }
.opt-price { font-weight: 700; color: var(--sage-800); }
.totals { border-top: 1px solid var(--line); padding-top: 14px; display: grid; gap: 6px; }
.totals div { display: flex; justify-content: space-between; color: var(--ink-2); }
.totals .grand { font-size: 1.15rem; font-weight: 700; color: var(--ink); margin-top: 4px; }

.done-body { display: grid; gap: 14px; text-align: center; justify-items: center; }
.done-icon { width: 64px; height: 64px; border-radius: 50%; background: var(--sage-100); color: var(--sage-700); display: grid; place-items: center; }
.done-icon svg { width: 32px; height: 32px; }

/* Ajustes tras prueba en móvil */
[tabindex="-1"]:focus { outline: none; }
.cat-tile .ill { width: 96px; height: 96px; margin: -6px -6px 0 0; }
@media (max-width: 899px) { .pd-media { aspect-ratio: 4 / 3; padding: 10% 22%; } }
@media (max-width: 599px) {
  .fab-btn { width: 56px; padding: 0; justify-content: center; }
  .fab-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
}
main > div > section > .wrap > *, .catalog .wrap > * { min-width: 0; }
