/* Style 3D — estilos (pensado primero para celular) */
:root {
  --vino: #5C1A47; --vino-2: #3E0F30; --rosa: #E79BB0; --rosa-l: #F6D6DF;
  --lila: #9D6FB8; --lila-l: #E6D9F0; --menta-l: #D6EDE3; --crema: #FBF5EF; --crema-2: #F3E6EC;
  --texto: #3A1530; --suave: #6E4A62; --muted: #7A5A6E; --borde: #EBDCE3; --blanco: #FFFFFF;
  --wa: #157A42; --rojo: #B3261E;
  --serif: 'DM Serif Display', Georgia, serif;
  --sans: Poppins, system-ui, -apple-system, 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: #EFE4E9; font-family: var(--sans); color: var(--texto); line-height: 1.45; }
img { max-width: 100%; display: block; }
a { color: var(--vino); }
button, input, select, textarea { font: inherit; color: inherit; }
.app { max-width: 560px; margin: 0 auto; min-height: 100vh; background: var(--crema); position: relative; overflow-x: hidden; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.display { font-family: var(--serif); font-weight: 400; color: var(--vino); margin: 0; line-height: 1.08; }
.small { font-size: 12px; } .muted { color: var(--muted); } .center { text-align: center; }
.eyebrow { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: #6E3F8C; }
.eyebrow.muted { color: var(--muted); }
.tone-lila { background: var(--lila-l); } .tone-rosa { background: var(--rosa-l); }
.tone-menta { background: var(--menta-l); } .tone-crema { background: var(--crema-2); }

/* Barra superior */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 8px 16px; padding-top: max(8px, env(safe-area-inset-top)); background: rgba(251,245,239,.94);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-bottom: 1px solid #EFE2E8; }
.topbar-logo img { width: 56px; height: 56px; object-fit: contain; }
.topbar-title { flex: 1; font-weight: 600; color: var(--vino); font-size: 15px; text-align: center; }
.topbar-actions { display: flex; gap: 8px; }
.icon-btn { position: relative; width: 44px; height: 44px; border-radius: 22px; border: 0; display: inline-flex; align-items: center;
  justify-content: center; cursor: pointer; text-decoration: none; flex: 0 0 auto; }
.icon-btn.soft { background: var(--crema-2); color: var(--vino); }
.icon-btn.solid { background: var(--vino); color: #fff; }
.icon-btn.white { background: #fff; color: var(--vino); box-shadow: 0 2px 10px rgba(62,15,48,.12); }
.icon-btn.outline { border: 2px solid var(--vino); color: var(--vino); background: transparent; }
.icon-btn.big { width: 56px; height: 56px; border-radius: 28px; }
.badge { position: absolute; top: -3px; right: -3px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--rosa);
  color: var(--vino-2); font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.badge[hidden] { display: none; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 0 22px; border-radius: 26px;
  background: var(--vino); color: #fff; border: 2px solid var(--vino); font-weight: 600; font-size: 15px; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--vino-2); color: #fff; }
.btn.outline { background: transparent; color: var(--vino); }
.btn.outline:hover { background: var(--crema-2); }
.btn.light { background: var(--rosa-l); border-color: var(--rosa-l); color: var(--vino); }
.btn.wa { background: var(--wa); border-color: var(--wa); width: 100%; min-height: 58px; font-size: 16px; }
.btn.wa:hover { background: #0F6335; }
.btn.danger { background: transparent; color: var(--rojo); border-color: #E7B7B3; }
.btn.small { min-height: 40px; font-size: 13px; padding: 0 14px; }
.btn.wide { width: 100%; margin-top: 20px; }
.btn.grow { flex: 1; padding: 0 12px; }
.btn[disabled] { opacity: .6; pointer-events: none; }
.stack { display: flex; flex-direction: column; gap: 10px; width: 100%; }

/* Inicio */
.hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 14px; padding: 16px 24px 28px; }
.hero-logo { width: 230px; height: 230px; object-fit: contain; }
.hero h1 { font-size: 40px; }
.hero p { margin: 0; color: var(--suave); font-size: 14px; }
.hero .stack { margin-top: 6px; }
.searchbox { padding: 0 16px 8px; }
.searchbox label { display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 26px; background: #fff;
  border: 1px solid var(--borde); color: #8A6A7E; }
.searchbox input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--texto); }
.block { padding: 22px 0 6px; }
.block.pad { padding-left: 16px; padding-right: 16px; }
.block.tight { padding-top: 14px; padding-bottom: 10px; }
.block h2 { font-size: 26px; margin-bottom: 14px; }
.block h1 { font-size: 32px; }
.block-head { display: flex; justify-content: space-between; align-items: baseline; padding: 0 16px 12px; }
.block-head h2 { margin: 0; }
.block-head a { font-size: 13px; font-weight: 600; }
.hscroll { display: flex; gap: 12px; padding: 0 16px 4px; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.ccard { flex: 0 0 132px; display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; scroll-snap-align: start; }
.ccard-img { height: 132px; border-radius: 24px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.ccard-img img { width: 100%; height: 100%; object-fit: cover; }
.ccard-name { font-size: 14px; font-weight: 600; padding-left: 4px; }
img.ph { width: 55% !important; height: 55% !important; object-fit: contain !important; opacity: .35; }
.chips { display: flex; gap: 8px; padding: 14px 16px 4px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: 0 0 auto; height: 38px; padding: 0 16px; border-radius: 19px; background: #fff; border: 1px solid var(--borde); color: var(--vino);
  font-size: 13px; font-weight: 500; display: flex; align-items: center; text-decoration: none; white-space: nowrap; }
.chip.on { background: var(--vino); border-color: var(--vino); color: #fff; font-weight: 600; }

/* Tarjetas de producto */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
@media (min-width: 520px) { .grid { gap: 22px 16px; } }
.pcard { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pcard-img { position: relative; aspect-ratio: 1 / 1.05; border-radius: 22px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.pcard-img img { width: 100%; height: 100%; object-fit: cover; }
.tag { position: absolute; top: 10px; left: 10px; max-width: calc(100% - 20px); padding: 4px 10px; border-radius: 12px; background: #fff;
  color: var(--vino); font-size: 11px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tag-nuevo, .tag-oferta { background: var(--vino); color: #fff; }
.pcard-name { font-size: 14px; font-weight: 600; padding: 6px 2px 0; color: var(--texto); text-decoration: none; }
.pcard-sub { font-size: 12px; color: var(--muted); padding: 0 2px; }
.pcard-foot { display: flex; align-items: center; justify-content: space-between; padding: 2px 2px 0; }
.price { font-family: var(--serif); font-size: 22px; color: var(--vino); }
.price.big { font-size: 30px; white-space: nowrap; }
.add-btn { width: 42px; height: 42px; border-radius: 21px; background: var(--vino); color: #fff; border: 0; display: flex; align-items: center;
  justify-content: center; font-size: 24px; line-height: 1; text-decoration: none; cursor: pointer; }
.add-btn:active { transform: scale(.92); }
.empty { color: var(--suave); text-align: center; padding: 24px 8px; }

.promo { margin: 28px 16px 8px; padding: 26px 22px; border-radius: 28px; background: var(--vino); color: #fff; display: flex; flex-direction: column; gap: 12px; }
.promo .eyebrow { color: var(--rosa-l); }
.promo h2 { color: #fff; font-size: 30px; }
.promo p { margin: 0; font-size: 14px; color: var(--crema-2); }
.promo .btn { margin-top: 6px; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.steps li { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 20px; background: #fff; border: 1px solid #EFE2E8; font-size: 14px; }
.steps .n { flex: 0 0 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--vino); }
.n.rosa { background: var(--rosa-l); } .n.lila { background: var(--lila-l); } .n.menta { background: var(--menta-l); }
.footer { margin-top: 28px; padding: 28px 16px 40px; background: var(--crema-2); display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; font-size: 12px; color: var(--muted); }
.footer img { width: 110px; height: 110px; object-fit: contain; }
.footer-wa { display: inline-flex; align-items: center; gap: 6px; font-size: 15px; font-weight: 600; text-decoration: none; min-height: 44px; }
body.has-cartbar .footer { padding-bottom: 110px; }

/* Barra flotante del carrito y aviso */
.cartbar { position: fixed; left: 50%; transform: translateX(-50%); bottom: max(16px, env(safe-area-inset-bottom)); width: calc(100% - 32px);
  max-width: 528px; height: 60px; border-radius: 30px; background: var(--vino-2); color: #fff; text-decoration: none; z-index: 30;
  display: flex; align-items: center; justify-content: space-between; padding: 0 8px 0 22px; box-shadow: 0 10px 30px rgba(62,15,48,.35); font-size: 14px; }
.cartbar[hidden] { display: none; }
.cartbar:hover { color: #fff; }
.cartbar-btn { height: 44px; padding: 0 18px; border-radius: 22px; background: var(--rosa); color: var(--vino-2); font-weight: 600; display: flex; align-items: center; }
.toast { position: fixed; left: 50%; top: 18px; transform: translate(-50%, -80px); background: var(--vino-2); color: #fff; padding: 12px 20px;
  border-radius: 24px; font-size: 14px; font-weight: 500; z-index: 50; transition: transform .25s ease; pointer-events: none; box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.show { transform: translate(-50%, 0); }

/* Catálogo */
.cat-hero { position: relative; margin: 6px 16px 0; height: 220px; border-radius: 28px; overflow: hidden; display: flex; align-items: flex-end; }
.cat-hero > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-hero > img + .cat-hero-text { background: linear-gradient(transparent, rgba(62,15,48,.75)); }
.cat-hero > img + .cat-hero-text .display, .cat-hero > img + .cat-hero-text .eyebrow { color: #fff; }
.cat-hero-text { position: relative; width: 100%; padding: 60px 22px 20px; display: flex; flex-direction: column; gap: 4px; }
.cat-hero h1 { font-size: 40px; }
.lead { margin: 0; padding: 14px 20px 6px; font-size: 14px; color: var(--suave); }
.listbar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 16px 0; font-size: 13px; color: var(--muted); }
.sortform label { display: flex; align-items: center; gap: 4px; height: 40px; padding: 0 12px; border-radius: 20px; background: #fff; border: 1px solid var(--borde); color: var(--vino); }
.sortform select { border: 0; background: transparent; font-weight: 600; color: var(--vino); font-size: 13px; }

/* Producto */
.gallery { position: relative; }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; aspect-ratio: 1 / 1; max-height: 560px; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track img { flex: 0 0 100%; width: 100%; height: 100%; object-fit: cover; scroll-snap-align: center; }
.gallery-track img.ph { flex-basis: 100%; margin: auto; width: 45% !important; height: 45% !important; }
.gallery-top { position: absolute; top: max(12px, env(safe-area-inset-top)); left: 16px; right: 16px; display: flex; justify-content: space-between; }
.gallery-top-r { display: flex; gap: 8px; }
.dots { position: absolute; bottom: 36px; left: 0; right: 0; display: flex; justify-content: center; gap: 6px; }
.dots span { width: 6px; height: 6px; border-radius: 3px; background: rgba(255,255,255,.75); box-shadow: 0 0 0 1px rgba(62,15,48,.15); transition: width .2s; }
.dots span.on { width: 22px; background: var(--vino); }
.pdetail { position: relative; margin-top: -24px; border-radius: 28px 28px 0 0; background: var(--crema); padding: 24px 20px 120px; display: flex; flex-direction: column; gap: 14px; }
.pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { padding: 5px 12px; border-radius: 14px; background: var(--lila-l); color: var(--vino); font-size: 12px; font-weight: 600; text-decoration: none; }
.pill.dark { background: var(--vino); color: #fff; }
.ptitle { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.ptitle h1 { font-size: 34px; }
.pdesc { margin: 0; font-size: 14px; color: var(--suave); line-height: 1.55; }
.specs { display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); gap: 8px; }
.specs div { padding: 12px; border-radius: 18px; background: #fff; border: 1px solid #EFE2E8; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.specs span { font-size: 11px; color: var(--muted); }
.specs b { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.buy { display: flex; flex-direction: column; gap: 14px; }
.colors { border: 0; padding: 0; margin: 0; }
.colors legend { font-size: 14px; font-weight: 600; padding: 0 0 10px; }
.colors legend span { font-weight: 400; color: var(--suave); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; width: 48px; height: 48px; border-radius: 24px; padding: 4px; border: 2px solid transparent; cursor: pointer; }
.swatch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.swatch span:not(.sr) { display: block; width: 100%; height: 100%; border-radius: 50%; border: 1px solid #D9C6D1; }
.swatch:has(input:checked) { border-color: var(--vino); }
.swatch input:focus-visible + span { outline: 2px solid var(--lila); outline-offset: 3px; }
.qtyrow { display: flex; align-items: center; justify-content: space-between; font-size: 14px; font-weight: 600; }
.stepper { display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 26px; background: #fff; border: 1px solid var(--borde); }
.stepper button { width: 44px; height: 44px; border-radius: 22px; border: 0; background: var(--crema-2); color: var(--vino); font-size: 22px; cursor: pointer; }
.stepper button.plus { background: var(--vino); color: #fff; }
.stepper output { min-width: 36px; text-align: center; font-size: 17px; }
.note { padding: 14px 16px; border-radius: 20px; background: var(--crema-2); display: flex; gap: 12px; align-items: center; font-size: 13px; color: var(--vino); }
.note svg { flex: 0 0 auto; }
.note a { font-weight: 600; }
.buybar { position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 560px; z-index: 30;
  padding: 12px 16px; padding-bottom: max(16px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid #EFE2E8; display: flex; gap: 10px; }

/* Carrito */
.cart-empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 30px 20px 60px; text-align: center; color: var(--suave); }
.cart-empty img { opacity: .5; }
.cart-list { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.citem { display: flex; gap: 12px; align-items: center; padding: 10px; border-radius: 22px; background: #fff; border: 1px solid #EFE2E8; }
.citem-img { flex: 0 0 72px; height: 72px; border-radius: 16px; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.citem-img img { width: 100%; height: 100%; object-fit: cover; }
.citem-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; font-size: 14px; }
.citem-info .price { font-size: 19px; }
.citem-qty { display: flex; flex-direction: column; align-items: center; gap: 2px; font-weight: 600; }
.citem-qty button { width: 38px; height: 38px; border-radius: 19px; border: 0; background: var(--crema-2); color: var(--vino); font-size: 18px; cursor: pointer; }
.citem-qty button.plus { background: var(--vino); color: #fff; }
.card { background: #fff; border: 1px solid #EFE2E8; border-radius: 24px; }
.form { margin: 18px 16px 0; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
.field input[type=text], .field input[type=password], .field input[type=number], .field input:not([type]), .field select, .field textarea {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: 14px; border: 1px solid #E0CDD7; background: var(--crema); font-size: 15px; font-weight: 400; color: var(--texto); }
.field textarea { resize: vertical; line-height: 1.45; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 2px solid var(--lila); outline-offset: 1px; }
.field .hint { font-size: 11px; font-weight: 400; color: var(--muted); }
.seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 4px 8px; border-radius: 14px; border: 2px solid #E0CDD7;
  background: #fff; color: var(--vino); font-size: 14px; font-weight: 500; text-align: center; }
.seg input:checked + span { background: var(--vino); border-color: var(--vino); color: #fff; font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--lila); outline-offset: 2px; }
.hint-box { margin: 2px 0 0; padding: 10px 12px; border-radius: 12px; background: var(--crema-2); font-size: 12px; font-weight: 400; color: var(--suave); }
.hint-box[hidden] { display: none; }
.preview { margin: 18px 16px 0; display: flex; flex-direction: column; gap: 8px; }
.bubble { align-self: flex-end; max-width: 92%; padding: 12px 14px; border-radius: 18px 18px 4px 18px; background: #DCF3D9; color: #1F3A1C;
  font-size: 13px; white-space: pre-line; min-height: 40px; }
.checkout-bar { margin-top: 20px; padding: 16px 16px 24px; padding-bottom: max(24px, env(safe-area-inset-bottom)); background: #fff;
  border-top: 1px solid #EFE2E8; display: flex; flex-direction: column; gap: 12px; position: sticky; bottom: 0; }
.checkout-total { display: flex; justify-content: space-between; align-items: baseline; font-size: 14px; color: var(--suave); }
[hidden] { display: none !important; }
