/* Tienda web de Importados Sandra (https://tienda.importadossandra.cloud).
   Boutique de barrio: crema del logo, lila que acompaña, petróleo para lo que
   se toca y se paga. Títulos en Marcellus (como el logo), textos en Mulish.
   Mobile-first: la mayoría llega desde WhatsApp o Instagram en el celular. */
:root {
  --cream: #fbf5ef;
  --surface: #ffffff;
  --lilac: #b79ad5;
  --lilac-soft: #efe7f7;
  --lilac-deep: #8565ad;
  --petrol: #284b63;
  --petrol-dark: #1b3344;
  --ink: #253347;
  --muted: #66738a;
  --line: #eadfe6;
  --rose: #c0507a;
  --rose-soft: #fbeef3;
  --ok: #2f8a5b;
  --danger: #c0392b;
  --display: "Marcellus", Georgia, serif;
  --body: "Mulish", "Segoe UI", system-ui, -apple-system, sans-serif;
  --radius: 14px;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--cream);
  color: var(--ink);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--petrol); outline-offset: 2px; border-radius: 6px; }
h1, h2, h3 { text-wrap: balance; margin: 0; font-weight: 400; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Encabezado */
header.top {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--cream) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top-row { display: flex; align-items: center; gap: 14px; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); flex-shrink: 0; }
.brand img { width: 46px; height: 46px; border-radius: 50%; }
.brand span { font-family: var(--display); font-size: 22px; letter-spacing: .01em; color: var(--lilac-deep); white-space: nowrap; }
.search { flex: 1; position: relative; max-width: 460px; margin-left: auto; }
.search input {
  width: 100%; height: 44px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface);
  padding: 0 16px 0 42px; font-size: 15px;
}
.search input::placeholder { color: #94a0b2; }
.search svg { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.cart-btn {
  position: relative; display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px;
  border-radius: 999px; border: 0; background: var(--petrol); color: #fff; font-weight: 600; flex-shrink: 0;
}
.cart-btn:hover { background: var(--petrol-dark); }
.cart-count {
  min-width: 22px; height: 22px; border-radius: 999px; background: var(--lilac); color: var(--ink);
  font-size: 12px; font-weight: 700; display: grid; place-items: center; padding: 0 6px;
}
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.08); } }
.search-mobile { display: none; padding: 0 0 12px; }

/* Portada */
.hero { padding-top: 40px; padding-bottom: 28px; display: grid; grid-template-columns: 1.25fr 1fr; gap: 40px; align-items: end; }
.hero h1 { font-family: var(--display); font-size: clamp(34px, 5vw, 58px); line-height: 1.08; letter-spacing: -.01em; color: var(--ink); }
.hero h1 em { font-style: normal; color: var(--lilac-deep); }
.hero p.lead { margin: 16px 0 0; font-size: 17px; color: var(--muted); max-width: 46ch; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li {
  display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px;
}
.steps b { font-weight: 600; display: block; }
.steps small { color: var(--muted); font-size: 14px; }
.steps .n {
  width: 34px; height: 34px; border-radius: 50%; background: var(--lilac-soft); color: var(--lilac-deep);
  display: grid; place-items: center; font-family: var(--display); font-size: 20px;
}

/* Promos */
.section-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 12px; margin: 8px 0 14px; }
.section-head h2 { font-family: var(--display); font-size: 32px; }
.section-head span { color: var(--muted); font-size: 14px; white-space: nowrap; }
.promos { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(280px, 1fr); gap: 14px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.promos-wrap[hidden] { display: none; }
.promo {
  scroll-snap-align: start; display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center;
  background: var(--surface); border: 1px solid #f0d3df; border-radius: var(--radius); padding: 12px;
}
.promo .ph { width: 96px; height: 96px; border-radius: 10px; }
.promo .tag { display: inline-block; background: var(--rose); color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: 2px 8px; border-radius: 6px; }
.promo h3 { font-family: var(--body); font-size: 16px; font-weight: 700; margin: 6px 0 2px; }
.promo .until { font-size: 13px; color: var(--muted); }
.promo .row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; }
.promo .price { font-size: 19px; font-weight: 700; color: var(--rose); }
.promo .btn { height: 38px; padding: 0 14px; font-size: 14px; }

/* Categorías */
.cats-bar { position: sticky; top: 68px; z-index: 20; background: var(--cream); border-bottom: 1px solid var(--line); margin-top: 34px; }
.cats { display: flex; gap: 6px; overflow-x: auto; padding-top: 10px; padding-bottom: 10px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat {
  flex-shrink: 0; border: 1px solid transparent; background: transparent; border-radius: 999px;
  padding: 7px 16px; font-size: 15px; font-weight: 600; color: var(--muted); display: flex; gap: 6px; align-items: baseline;
}
.cat small { font-size: 12px; color: #94a0b2; }
.cat:hover { color: var(--ink); background: var(--surface); }
.cat[aria-pressed="true"] { background: var(--lilac-soft); color: var(--ink); border-color: #dccbee; }
.cat[aria-pressed="true"] small { color: var(--lilac-deep); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 18px 0 14px; }
.toolbar h2 { font-family: var(--display); font-size: 30px; }
.toolbar select { height: 38px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); padding: 0 10px; font-size: 14px; }

/* Fotos */
.ph { position: relative; aspect-ratio: 1 / 1; overflow: hidden; background: linear-gradient(135deg, #f3ecf8, #eef1f5); }
.ph img { width: 100%; height: 100%; object-fit: cover; }
.ph .badge {
  position: absolute; left: 10px; top: 10px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px;
  background: rgba(255, 255, 255, .92); color: var(--lilac-deep);
}
.ph.noimg::after {
  content: ""; position: absolute; inset: 30%; opacity: .25;
  background: url("logo.png") center / contain no-repeat;
}

/* Grilla */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; padding-bottom: 40px; }
.card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden;
  display: flex; flex-direction: column; text-align: left; padding: 0; transition: transform .2s ease, box-shadow .2s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -14px rgba(40, 75, 99, .35); }
.card .body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; width: 100%; }
.card .name { font-size: 15px; font-weight: 600; line-height: 1.3; }
.card .opts { font-size: 13px; color: var(--muted); }
.card .foot { margin-top: auto; padding-top: 8px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.price { font-weight: 800; font-size: 18px; color: var(--petrol); }
.price small { font-size: 12px; font-weight: 600; color: var(--muted); margin-right: 3px; }
.add-mini {
  width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--cream);
  display: grid; place-items: center; color: var(--petrol); flex-shrink: 0;
}
.card:hover .add-mini { background: var(--petrol); color: #fff; border-color: var(--petrol); }
.empty { grid-column: 1 / -1; text-align: center; padding: 48px 16px; color: var(--muted); }
.empty b { display: block; font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--ink); }
.empty .btn { margin-top: 16px; }
.more { display: flex; justify-content: center; padding-bottom: 40px; }

/* Cargando */
.skel { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); overflow: hidden; }
.skel .ph { animation: pulse 1.4s ease-in-out infinite; }
.skel .l { height: 12px; margin: 12px 14px 0; border-radius: 6px; background: #f0ebf3; }
.skel .l.s { width: 40%; margin-bottom: 14px; }
@keyframes pulse { 50% { opacity: .55; } }

/* Pie */
footer { background: var(--surface); border-top: 1px solid var(--line); padding: 36px 0 110px; }
.foot-grid { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 28px; }
.foot-grid h3 { font-family: var(--display); font-size: 24px; margin-bottom: 8px; }
.foot-grid p { margin: 0 0 6px; color: var(--muted); }
.foot-grid a { color: var(--petrol); font-weight: 700; text-decoration: none; }
.foot-grid a:hover { text-decoration: underline; }
.foot-brand { display: flex; gap: 14px; align-items: center; }
.foot-brand img { width: 72px; height: 72px; border-radius: 50%; }
.hours { display: grid; grid-template-columns: auto 1fr; gap: 2px 14px; color: var(--muted); }
.hours b { color: var(--ink); font-weight: 600; }
.social { display: flex; flex-direction: column; gap: 6px; }

/* Capas: ficha de producto y pedido */
.scrim { position: fixed; inset: 0; background: rgba(27, 51, 68, .45); z-index: 40; opacity: 0; pointer-events: none; transition: opacity .2s; }
.scrim.on { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; z-index: 50; background: var(--surface); display: flex; flex-direction: column;
  left: 50%; top: 50%; width: min(880px, calc(100% - 32px)); max-height: calc(100% - 48px);
  border-radius: 20px; transform: translate(-50%, -46%); opacity: 0; pointer-events: none; transition: transform .25s ease, opacity .2s;
}
.sheet.on { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
.sheet-inner { display: grid; grid-template-columns: 1fr 1fr; overflow: auto; }
.gallery { padding: 16px; }
.gallery > .ph { border-radius: 14px; background: #fff; }
.gallery > .ph img { object-fit: contain; }
.thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.thumbs button { width: 56px; height: 56px; padding: 0; border-radius: 10px; border: 2px solid transparent; overflow: hidden; background: none; }
.thumbs button[aria-current="true"] { border-color: var(--petrol); }
.detail { padding: 28px 28px 24px 12px; display: flex; flex-direction: column; gap: 14px; }
.detail .cat-label { font-size: 13px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--lilac-deep); }
.detail h2 { font-family: var(--display); font-size: 36px; line-height: 1.1; }
.detail .price { font-size: 26px; }
.detail .stock { font-size: 14px; color: var(--ok); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.detail .stock.low { color: var(--lilac-deep); }
.detail .stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.field-label { font-size: 14px; font-weight: 700; margin-bottom: 6px; display: block; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 14px; font-size: 14px; }
.chip[aria-pressed="true"] { border-color: var(--petrol); background: var(--petrol); color: #fff; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: transparent; font-size: 20px; color: var(--petrol); }
.qty button:hover { background: var(--lilac-soft); }
.qty button:disabled { color: #c5cdd8; cursor: not-allowed; background: transparent; }
.qty output { min-width: 32px; text-align: center; font-weight: 700; }
.btn {
  height: 50px; border-radius: 999px; border: 0; background: var(--petrol); color: #fff; font-weight: 700; font-size: 16px;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 0 24px; text-decoration: none;
}
.btn:hover { background: var(--petrol-dark); }
.btn:disabled { opacity: .6; cursor: wait; }
.btn.ghost { background: transparent; color: var(--petrol); border: 1px solid var(--line); }
.btn.ghost:hover { background: var(--cream); }
.btn.wa { background: #1f8f5f; }
.btn.wa:hover { background: #18734c; }
.close {
  position: absolute; right: 12px; top: 12px; width: 40px; height: 40px; border-radius: 50%; border: 0;
  background: rgba(255, 255, 255, .9); display: grid; place-items: center; z-index: 2; color: var(--ink);
}
.close:hover { background: var(--lilac-soft); }
.desc { color: var(--muted); font-size: 15px; margin: 0; white-space: pre-line; }

/* Pedido (cajón) */
.drawer {
  position: fixed; z-index: 50; top: 0; right: 0; bottom: 0; width: min(440px, 100%); background: var(--surface);
  display: flex; flex-direction: column; transform: translateX(100%); transition: transform .25s ease;
}
.drawer.on { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-family: var(--display); font-size: 30px; }
.drawer-head .close { position: static; background: var(--cream); }
.drawer-body { flex: 1; overflow: auto; padding: 8px 20px 20px; }
.drawer-foot { border-top: 1px solid var(--line); padding: 16px 20px 20px; display: grid; gap: 12px; }
.line { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line .ph { border-radius: 10px; }
.line .t { font-size: 15px; font-weight: 600; line-height: 1.3; }
.line .s { font-size: 13px; color: var(--muted); }
.line .r { display: grid; justify-items: end; gap: 6px; }
.line .qty button { width: 30px; height: 30px; font-size: 16px; }
.line .qty output { min-width: 22px; font-size: 14px; }
.ptag { background: var(--rose); color: #fff; font-size: 11px; font-weight: 800; padding: 1px 6px; border-radius: 5px; margin-right: 6px; }
.total { display: flex; justify-content: space-between; align-items: baseline; }
.total span { color: var(--muted); }
.total b { font-size: 24px; color: var(--petrol); }
.hint { font-size: 13px; color: var(--muted); margin: 0; }
.notice { background: var(--lilac-soft); color: var(--ink); border-radius: 12px; padding: 10px 12px; font-size: 14px; margin-top: 12px; }
.notice.bad { background: #fbeceb; color: #8a2a20; }
.form { display: grid; gap: 14px; padding-top: 14px; }
.form input {
  width: 100%; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: #f9f6fb; padding: 0 14px; font-size: 16px;
}
.form input:focus { background: var(--surface); border-color: var(--lilac); outline: none; box-shadow: 0 0 0 3px var(--lilac-soft); }
.form .err { color: var(--danger); font-size: 13px; margin-top: 4px; display: none; }
.form .bad input { border-color: var(--danger); }
.form .bad .err { display: block; }
.trap { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.done { text-align: center; padding: 20px 0 8px; display: grid; gap: 12px; justify-items: center; }
.done .code { font-family: var(--display); font-size: 52px; color: var(--lilac-deep); letter-spacing: .04em; line-height: 1; }
.bubble {
  text-align: left; background: #e7f6ee; border-radius: 14px 14px 14px 4px; padding: 12px 14px; font-size: 14px;
  white-space: pre-wrap; width: 100%; color: #1f3a2d; border: 1px solid #cfe9db;
}
.clear-row { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 10px; }
.clear-row span { font-size: 13px; color: var(--muted); }
.link-btn { border: 0; background: transparent; padding: 6px 4px; font-size: 14px; font-weight: 700; color: var(--muted); display: inline-flex; align-items: center; gap: 6px; }
.link-btn:hover { color: var(--danger); }
.link-btn.danger { color: var(--danger); }
.empty-cart { text-align: center; color: var(--muted); padding: 60px 10px; }
.empty-cart b { display: block; font-family: var(--display); font-weight: 400; font-size: 28px; color: var(--ink); margin-bottom: 4px; }

/* Barra fija en el celular */
.bar {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 35; display: none;
  background: var(--petrol); color: #fff; border: 0; border-radius: 16px; height: 58px; padding: 0 18px;
  align-items: center; justify-content: space-between; box-shadow: 0 12px 30px -12px rgba(27, 51, 68, .6);
}
.bar b { font-size: 17px; }

@media (max-width: 960px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .hero { grid-template-columns: 1fr; gap: 24px; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-grid > :first-child { grid-column: 1 / -1; }
}
@media (max-width: 680px) {
  .top-row { height: 62px; }
  .top-row .search { display: none; }
  .search-mobile { display: block; }
  .search-mobile .search { max-width: none; }
  .brand span { font-size: 19px; }
  .brand img { width: 40px; height: 40px; }
  .cart-btn .label { display: none; }
  .cart-btn { margin-left: auto; padding: 0 14px; }
  .cats-bar { top: 118px; }
  .hero { padding-top: 24px; }
  .section-head h2 { font-size: 26px; }
  .promos { grid-auto-columns: 88%; }
  .promo { grid-template-columns: 84px 1fr; }
  .promo .ph { width: 84px; height: 84px; }
  .toolbar h2 { font-size: 26px; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .card .body { padding: 10px 11px 12px; }
  .card .name { font-size: 14px; }
  .price { font-size: 16px; }
  .add-mini { width: 32px; height: 32px; }
  .foot-grid { grid-template-columns: 1fr; }
  .sheet { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 92%; border-radius: 20px 20px 0 0; transform: translateY(100%); opacity: 1; }
  .sheet.on { transform: none; }
  .sheet-inner { grid-template-columns: 1fr; }
  .gallery > .ph { aspect-ratio: 1 / 1; }
  .detail { padding: 4px 18px 22px; }
  .detail h2 { font-size: 30px; }
  .bar.show { display: flex; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
