/* ==========================================================
   Aestheramed · tienda pública (móvil primero)
   ========================================================== */

/* ---------- Aviso superior ---------- */
.announce { background: var(--plum); color: #fff; text-align: center; font-size: 13.5px; padding: 8px 16px; letter-spacing: .01em; }

/* ---------- Barra superior ---------- */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--ivory) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-in { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; padding: 6px 4px; }
.brand img { width: 54px; height: auto; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.top-wa { color: var(--plum); }
.cart-btn { position: relative; width: 46px; height: 46px; border-radius: 50%; border: 0; background: var(--white); color: var(--plum);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-sm); transition: transform .15s; }
.cart-btn:active { transform: scale(.95); }
.cart-btn .ico { width: 23px; height: 23px; }
.cart-count { position: absolute; top: -3px; right: -3px; min-width: 21px; height: 21px; padding: 0 6px; border-radius: 99px;
  background: var(--plum); color: #fff; font-size: 12px; font-weight: 700; display: grid; place-items: center; border: 2px solid var(--ivory); }
.cart-count.bump { animation: bump .45s var(--ease); }
@keyframes bump { 30% { transform: scale(1.35); } }
@media (max-width: 520px) { .hide-sm { display: none; } .top-wa { width: 44px; padding: 0; } }

/* ---------- Portada ---------- */
.hero { position: relative; overflow: hidden; padding: 22px 0 30px; }
.hero-ribbon { position: absolute; inset: auto -10% -70px -10%; height: 150px; pointer-events: none; opacity: .8; }
@media (min-width: 900px) { .hero-ribbon { height: 220px; bottom: -40px; right: 45%; } }
.hero-in { position: relative; display: grid; gap: 26px; align-items: center; }
.hero-logo { width: 196px; margin: 4px auto 22px; }
@media (max-width: 899px) { .hero .eyebrow { display: none; } }
.hero-copy { text-align: center; }
.eyebrow { font-size: 12.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--plum); font-weight: 700; }
.hero h1 { font-size: clamp(34px, 9vw, 64px); color: var(--plum); margin: 10px 0 12px; letter-spacing: -.02em; }
.hero p.lead { color: #5A5157; font-size: 17px; max-width: 34ch; margin-inline: auto; }
.hero-ctas { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 22px; }
.hero-ctas .btn { flex: 1 1 160px; max-width: 260px; }
.trust { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin-top: 22px; font-size: 14px; color: #5A5157; }
.trust span { display: inline-flex; align-items: center; gap: 7px; }
.trust .ico { width: 18px; height: 18px; color: var(--plum); }
.hero-card { display: none; }

@media (min-width: 900px) {
  .hero { padding: 56px 0 72px; }
  .hero-in { grid-template-columns: 1.05fr .95fr; gap: 56px; }
  .hero-copy { text-align: left; }
  .hero-logo { display: none; }
  .hero p.lead { margin-inline: 0; font-size: 19px; }
  .hero-ctas { justify-content: flex-start; }
  .trust { justify-content: flex-start; }
  .hero-card { display: grid; place-items: center; aspect-ratio: 5 / 4; border-radius: 32px; background: var(--white); box-shadow: var(--shadow); position: relative; overflow: hidden; }
  .hero-card img { width: 64%; position: relative; }
  .hero-card::before { content: ""; position: absolute; width: 150%; height: 46%; bottom: -32%; left: -25%; border-radius: 50%; background: var(--rose-200); }
}

/* ---------- Herramientas de catálogo ---------- */
.catalog { padding-bottom: 40px; scroll-margin-top: 64px; }
.toolbar { position: sticky; top: 64px; z-index: 30; background: var(--ivory); padding: 12px 0 10px; }
.toolbar-in { display: grid; gap: 10px; }
.search { position: relative; }
.search .ico { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); width: 20px; height: 20px; }
.search input { padding-left: 46px; border-radius: 999px; background: var(--white); border-color: transparent; box-shadow: var(--shadow-sm); }
.search button { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; padding: 2px 16px; margin: 0 -16px; scroll-snap-type: x proximity; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; scroll-snap-align: start; height: 40px; padding: 0 16px; border-radius: 99px; border: 1.5px solid var(--line); background: var(--white);
  font-size: 14.5px; font-weight: 700; color: var(--graphite); cursor: pointer; transition: all .15s; }
.chip:hover { border-color: color-mix(in srgb, var(--plum) 40%, transparent); }
.chip[aria-pressed="true"] { background: var(--plum); border-color: var(--plum); color: #fff; }
@media (min-width: 900px) {
  .toolbar-in { grid-template-columns: 360px 1fr; align-items: center; gap: 18px; }
  .chips { margin: 0; padding: 2px 0; flex-wrap: wrap; overflow: visible; }
}
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 18px 0 14px; }
.section-head h2 { font-size: 24px; color: var(--plum); }
.section-head .count { font-size: 14px; color: var(--muted); }

/* ---------- Tarjetas de producto ---------- */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 700px) { .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 { display: flex; flex-direction: column; background: var(--white); border-radius: var(--r); overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease); min-width: 0; }
@media (hover: hover) { .card:hover { box-shadow: var(--shadow); transform: translateY(-2px); } }
.card-media { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--rose-200); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
@media (hover: hover) { .card:hover .card-media img { transform: scale(1.03); } }
.card-media .tag { position: absolute; left: 10px; top: 10px; }
.tag { display: inline-block; padding: 5px 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--white); color: var(--plum); box-shadow: var(--shadow-sm); }
.tag-dark { background: var(--graphite); color: #fff; }
.card.is-out .card-media img { filter: grayscale(.4) opacity(.7); }
.card-body { display: flex; flex-direction: column; gap: 4px; padding: 12px 12px 14px; flex: 1; }
.card-brand { font-size: 11.5px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
.card h3 { font-size: 15.5px; font-weight: 700; line-height: 1.25; }
.card h3 a { text-decoration: none; }
.card-pres { font-size: 13.5px; color: var(--muted); line-height: 1.35; }
.card-meta { margin-top: auto; padding-top: 10px; display: grid; gap: 10px; }
.price { font-size: 19px; font-weight: 700; color: var(--plum); font-variant-numeric: tabular-nums; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.price s { font-size: 13.5px; color: var(--muted); font-weight: 400; }
.price-quote { font-size: 14.5px; }
.card .btn, .card .qty { width: 100%; }
.card .qty { justify-content: space-between; }
.card .btn { --h: 44px; font-size: 15px; padding: 0 12px; }
.avail { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; flex: none; }
.dot-in { background: var(--ok); } .dot-low { background: #C98A2B; } .dot-order { background: var(--plum); } .dot-out { background: #A79CA2; }
@media (min-width: 700px) { .card-body { padding: 16px 16px 18px; } .card h3 { font-size: 16.5px; } .price { font-size: 20px; } }

.empty { text-align: center; padding: 48px 16px; color: var(--muted); background: var(--white); border-radius: var(--r); }
.empty h3 { color: var(--graphite); font-weight: 700; margin-bottom: 6px; font-size: 18px; }

/* ---------- Cómo comprar ---------- */
.steps { padding: 44px 0 56px; }
.steps h2 { font-size: clamp(26px, 6vw, 38px); color: var(--plum); text-align: center; margin-bottom: 24px; }
.steps-grid { display: grid; gap: 12px; counter-reset: s; }
@media (min-width: 800px) { .steps-grid { grid-template-columns: repeat(3, 1fr); gap: 18px; } }
.step { background: var(--white); border-radius: var(--r); padding: 20px; display: grid; grid-template-columns: 44px 1fr; gap: 4px 14px; align-items: start; }
.step::before { counter-increment: s; content: counter(s); grid-row: span 2; width: 44px; height: 44px; border-radius: 50%; background: var(--rose); color: var(--plum); font-weight: 700; display: grid; place-items: center; font-size: 18px; }
.step h3 { font-size: 17px; font-weight: 700; }
.step p { color: var(--muted); font-size: 15px; }

/* ---------- Ficha de producto ---------- */
.pdp { padding: 8px 0 48px; }
.crumb { display: inline-flex; align-items: center; gap: 4px; color: var(--plum); font-weight: 700; text-decoration: none; font-size: 15px; padding: 10px 0; }
.crumb .ico { width: 20px; height: 20px; }
.pdp-grid { display: grid; gap: 22px; }
@media (min-width: 900px) { .pdp-grid { grid-template-columns: 1.1fr 1fr; gap: 56px; align-items: start; } .pdp-info { position: sticky; top: 88px; } }
.gallery { margin: 0 -16px; }
@media (min-width: 900px) { .gallery { margin: 0; } }
.slides { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: var(--rose-200); }
.slides::-webkit-scrollbar { display: none; }
.slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 4 / 5; }
.slide img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .slides { border-radius: var(--r-lg); } }
.dots { display: flex; justify-content: center; gap: 7px; padding: 12px 0 0; }
.dots button { width: 8px; height: 8px; border-radius: 99px; border: 0; padding: 0; background: #D7C6CE; cursor: pointer; transition: width .2s, background .2s; }
.dots button[aria-current="true"] { width: 22px; background: var(--plum); }
.thumbs { display: none; }
@media (min-width: 900px) {
  .dots { display: none; }
  .thumbs { display: flex; gap: 10px; margin-top: 12px; }
  .thumbs button { width: 76px; aspect-ratio: 4 / 5; border-radius: 12px; overflow: hidden; border: 2px solid transparent; padding: 0; cursor: pointer; background: var(--rose-200); }
  .thumbs button[aria-current="true"] { border-color: var(--plum); }
  .thumbs img { width: 100%; height: 100%; object-fit: cover; }
}
.pdp-info .card-brand { font-size: 12.5px; }
.pdp h1 { font-size: clamp(28px, 7vw, 42px); color: var(--plum); margin: 6px 0 8px; }
.pdp-pres { font-size: 17px; color: #5A5157; }
.pdp .price { font-size: 28px; margin: 18px 0 14px; }
.pdp .price s { font-size: 17px; }
.facts { display: grid; gap: 10px; padding: 16px; background: var(--white); border-radius: var(--r); margin-bottom: 18px; }
.fact { display: flex; align-items: center; gap: 12px; font-size: 15px; }
.fact .ico { color: var(--plum); width: 22px; height: 22px; }
.buy { display: grid; grid-template-columns: auto 1fr; gap: 10px; }
.buy .qty { height: 56px; } .buy .qty button { width: 50px; height: 56px; }
.buy .btn-outline { grid-column: 1 / -1; }
.desc { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--line); }
.desc h2 { font-size: 15px; letter-spacing: .12em; text-transform: uppercase; color: var(--plum); font-weight: 700; margin-bottom: 10px; }
.desc p { white-space: pre-line; color: #463F45; font-size: 16px; }
.disclaimer { font-size: 13px; color: var(--muted); margin-top: 18px; }
.related { margin-top: 48px; }

/* ---------- Barra flotante del pedido ---------- */
.cartbar { position: fixed; left: 12px; right: 12px; bottom: calc(12px + var(--safe-b)); z-index: 45;
  display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 10px 0 10px; border: 0; border-radius: 20px;
  background: var(--plum); color: #fff; box-shadow: var(--shadow-lg); font-weight: 700; font-size: 16px; cursor: pointer;
  transform: translateY(0); transition: transform .35s var(--ease); }
.cartbar[hidden] { display: flex; transform: translateY(160%); pointer-events: none; visibility: hidden; transition: transform .35s var(--ease), visibility 0s .35s; }
.cartbar-n { min-width: 40px; height: 40px; border-radius: 13px; background: rgba(255, 255, 255, .16); display: grid; place-items: center; }
.cartbar-t { flex: 1; text-align: left; }
.cartbar-total { padding-right: 8px; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) { .cartbar { left: auto; right: 24px; bottom: 24px; width: 360px; } }
body.has-cartbar .footer { padding-bottom: calc(96px + var(--safe-b)); }

/* ---------- Panel del pedido (bottom sheet en móvil, lateral en escritorio) ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(48, 43, 48, .42); opacity: 0; transition: opacity .3s; }
.sheet-backdrop.open { opacity: 1; }
.sheet { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; max-height: 92dvh; height: 92dvh;
  display: flex; flex-direction: column; background: var(--ivory); border-radius: 26px 26px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(105%); transition: transform .42s var(--ease); visibility: hidden; }
.sheet.open { transform: none; visibility: visible; }
.sheet-grip { width: 42px; height: 5px; border-radius: 9px; background: #D6C9CF; margin: 9px auto 0; flex: none; }
@media (min-width: 760px) {
  .sheet { left: auto; top: 0; width: 460px; height: 100dvh; max-height: none; border-radius: 0; transform: translateX(105%); }
  .sheet-grip { display: none; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px 6px 22px; flex: none; }
.sheet-head h2 { font-size: 24px; color: var(--plum); }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 4px 16px 24px; }
.sheet-foot[hidden] + *, .sheet-body:last-child { padding-bottom: calc(24px + var(--safe-b)); }
.lines { display: grid; gap: 10px; }
.line { display: grid; grid-template-columns: 64px 1fr; gap: 12px; background: var(--white); border-radius: 14px; padding: 10px; }
.line-img { width: 64px; aspect-ratio: 4 / 5; border-radius: 10px; overflow: hidden; background: var(--rose-200); }
.line-img img { width: 100%; height: 100%; object-fit: cover; }
.line-info { min-width: 0; display: grid; gap: 2px; }
.line-name { font-weight: 700; font-size: 15px; line-height: 1.25; }
.line-pres { font-size: 13px; color: var(--muted); }
.line-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.line-price { font-weight: 700; color: var(--plum); font-variant-numeric: tabular-nums; }
.line-warn { font-size: 12.5px; color: var(--warn); font-weight: 700; }
.summary { margin: 16px 0 6px; padding: 16px; background: var(--white); border-radius: 14px; display: grid; gap: 8px; }
.sum-row { display: flex; justify-content: space-between; gap: 12px; font-size: 15px; }
.sum-row.total { font-size: 20px; font-weight: 700; color: var(--plum); padding-top: 8px; border-top: 1px dashed var(--line); }
.sum-note { font-size: 13px; color: var(--muted); }
.checkout { margin-top: 18px; display: grid; gap: 14px; }
.checkout h3 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.phone-row { display: grid; grid-template-columns: 112px 1fr; gap: 8px; }
.saved-phone { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 14px; background: var(--white); border-radius: 12px; border: 1.5px solid var(--line); }
.saved-phone b { font-variant-numeric: tabular-nums; }
.linkbtn { border: 0; background: none; color: var(--plum); font-weight: 700; cursor: pointer; padding: 6px; text-decoration: underline; text-underline-offset: 3px; }
.sheet-foot { flex: none; padding: 12px 16px calc(12px + var(--safe-b)); background: var(--white); border-top: 1px solid var(--line); display: grid; gap: 10px; box-shadow: 0 -8px 24px -16px rgba(48, 43, 48, .25); }
.foot-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 15px; }
.foot-total b { font-size: 20px; color: var(--plum); font-variant-numeric: tabular-nums; }
.foot-total small { font-size: 12.5px; color: var(--muted); font-weight: 400; }
.reassure { font-size: 13px; color: var(--muted); text-align: center; }
.empty-cart { text-align: center; padding: 40px 10px; display: grid; gap: 14px; justify-items: center; }
.empty-cart img { width: 84px; opacity: .9; }
.done { text-align: center; padding: 28px 8px; display: grid; gap: 14px; justify-items: center; }
.done-ico { width: 72px; height: 72px; border-radius: 50%; background: var(--ok-bg); color: var(--ok); display: grid; place-items: center; }
.done-ico svg { width: 36px; height: 36px; }
.done h3 { font-size: 24px; color: var(--plum); }
.done .code { font-weight: 700; color: var(--graphite); }
.done .btn { width: 100%; max-width: 360px; }

/* ---------- Pie ---------- */
.footer { background: var(--plum); color: #F3E9EE; padding: 44px 0 28px; }
.footer-in { display: grid; gap: 28px; }
.footer-brand img { width: 190px; height: auto; }
.footer-claim { margin-top: 14px; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; opacity: .85; }
.footer-cols { display: grid; gap: 24px; }
.footer h3 { font-size: 13px; letter-spacing: .14em; text-transform: uppercase; font-weight: 700; margin-bottom: 10px; color: #fff; }
.footer a { display: flex; align-items: center; gap: 10px; text-decoration: none; padding: 6px 0; color: #fff; }
.footer a .ico { width: 20px; height: 20px; }
.footer p { font-size: 15px; opacity: .9; max-width: 42ch; }
.footer-legal { font-size: 13px !important; opacity: .75 !important; max-width: none !important; border-top: 1px solid rgba(255, 255, 255, .18); padding-top: 18px; }
.footer-copy { display: block; margin-top: 4px; }
@media (min-width: 800px) { .footer-in { grid-template-columns: 1fr 1.4fr; } .footer-cols { grid-template-columns: 1fr 1fr; } .footer-legal { grid-column: 1 / -1; } }

/* ---------- Carga ---------- */
.sk-card { aspect-ratio: 4 / 6.4; }
.demo-badge { position: fixed; left: 12px; top: 74px; z-index: 35; font-size: 12px; font-weight: 700; padding: 6px 10px; border-radius: 99px; background: var(--graphite); color: #fff; opacity: .85; }
body.has-cartbar .toast, body.has-cartbar .toast[popover] { bottom: calc(86px + var(--safe-b)); }
@media (min-width: 900px) { body.has-cartbar .toast, body.has-cartbar .toast[popover] { bottom: 24px; } }

/* Foto de portada (opcional, se sube desde el panel) */
.hero-photo { border-radius: 24px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--rose-200); box-shadow: var(--shadow); position: relative; }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 900px) { .hero-photo { aspect-ratio: 5 / 4; border-radius: 32px; } }
