:root {
  --bg: #0b1220;
  --bg-2: #0d1626;
  --surface: #121e34;
  --surface-2: #172641;
  --line: rgba(146, 168, 219, .14);
  --line-strong: rgba(146, 168, 219, .28);
  --ink: #e9eef9;
  --muted: #93a2c3;
  --accent: #4f8cff;
  --accent-soft: rgba(79, 140, 255, .14);
  --gold: #ffc766;
  --wa: #22c55e;
  --wa-dark: #16a34a;
  --danger: #ff7b72;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(2, 6, 16, .45);
  --shadow-lg: 0 24px 60px rgba(2, 6, 16, .65);
  --glow: 0 10px 34px rgba(79, 140, 255, .22);
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(79, 140, 255, .10), transparent 60%),
    radial-gradient(700px 400px at -10% 15%, rgba(124, 77, 255, .07), transparent 60%),
    var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

::selection { background: rgba(79, 140, 255, .35); }

/* ---------- Anuncio ---------- */
.announce {
  background: linear-gradient(90deg, #14244a, #1b2f5e 50%, #14244a);
  border-bottom: 1px solid var(--line);
  color: #cdd9f2;
  text-align: center;
  font-size: .82rem;
  padding: .55rem 1rem;
  letter-spacing: .02em;
}
.announce strong { color: var(--gold); }

/* ---------- Hero ---------- */
.hero { border-bottom: 1px solid var(--line); }
.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2rem 1.25rem 1.6rem;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
}
.hero-logo {
  width: 88px;
  height: 88px;
  border-radius: 24px;
  border: 2px solid var(--line-strong);
  box-shadow: var(--shadow), var(--glow);
  object-fit: cover;
  background: #0e1830;
}
.hero-text { flex: 1; min-width: 240px; }
.hero h1 {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  letter-spacing: -.01em;
  line-height: 1.1;
  background: linear-gradient(120deg, #fff, #b9cdf5);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero-tag { color: var(--muted); margin-top: .3rem; max-width: 54ch; font-size: .92rem; }
.hero-meta { display: flex; gap: .45rem; flex-wrap: wrap; margin-top: .8rem; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  font-size: .74rem;
  font-weight: 600;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .32rem .72rem;
  color: var(--ink);
}
.badge.open { color: #6ee7a0; border-color: rgba(110, 231, 160, .35); background: rgba(34, 197, 94, .08); }
.badge.closed { color: #f8a5a5; border-color: rgba(248, 165, 165, .3); background: rgba(248, 113, 113, .07); }
.hero-social { display: flex; gap: .5rem; }
.hero-social a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink);
  transition: .18s;
}
.hero-social a:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  transform: translateY(-2px);
  box-shadow: var(--glow);
}

/* ---------- Toolbar ---------- */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(11, 18, 32, .84);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.toolbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: .65rem 1.25rem;
  display: flex;
  align-items: center;
  gap: .7rem;
}
.back-btn {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: .5rem .9rem;
  font-size: .84rem;
  font-weight: 600;
  white-space: nowrap;
  transition: .18s;
}
.back-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow); }
.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: .5rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: .5rem .9rem;
  color: var(--muted);
  transition: .18s;
}
.search:focus-within { border-color: var(--accent); box-shadow: var(--glow); }
.search input {
  border: 0;
  outline: 0;
  background: transparent;
  font: inherit;
  font-size: .88rem;
  width: 100%;
  color: var(--ink);
}
.search input::placeholder { color: var(--muted); }
.cart-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 13px;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  color: var(--ink);
  transition: .18s;
}
.cart-btn:hover { border-color: var(--accent); color: var(--accent); box-shadow: var(--glow); }
.cart-count {
  position: absolute;
  top: -7px;
  right: -7px;
  background: var(--accent);
  color: #fff;
  font-size: .68rem;
  font-weight: 700;
  min-width: 19px;
  height: 19px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  padding: 0 4px;
  border: 2px solid var(--bg);
  box-shadow: 0 2px 8px rgba(79, 140, 255, .5);
}

/* ---------- Layout principal ---------- */
.main { max-width: 1120px; margin: 0 auto; padding: 1.8rem 1.25rem 4rem; min-height: 55vh; }

/* ---------- Portada: categorías ---------- */
.home-head { text-align: center; margin: .4rem 0 1.6rem; }
.home-head h2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 600;
}
.home-head p { color: var(--muted); font-size: .9rem; margin-top: .25rem; }

.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.1rem;
}
.cat-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--surface);
  aspect-ratio: 4 / 3;
  cursor: pointer;
  transition: transform .22s, box-shadow .22s, border-color .22s;
  box-shadow: var(--shadow);
}
.cat-card:hover {
  transform: translateY(-5px);
  border-color: rgba(79, 140, 255, .55);
  box-shadow: var(--shadow-lg), var(--glow);
}
.cat-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s;
}
.cat-card:hover img { transform: scale(1.06); }
.cat-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 18, 32, 0) 30%, rgba(9, 14, 26, .55) 62%, rgba(7, 11, 22, .92) 100%);
}
.cat-card .cat-info {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  bottom: 0;
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.cat-card h3 {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.25;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .6);
}
.cat-card .cat-sub { display: flex; align-items: center; gap: .5rem; font-size: .76rem; color: #c3cfe8; }
.cat-card .cat-off {
  background: var(--gold);
  color: #3a2703;
  font-weight: 800;
  font-size: .68rem;
  border-radius: 999px;
  padding: .14rem .55rem;
  letter-spacing: .03em;
}

/* ---------- Vista de categoría ---------- */
.cat-header { display: flex; align-items: baseline; gap: .8rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.cat-header h2 {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 3vw, 1.9rem);
  font-weight: 600;
}
.cat-header .count { color: var(--muted); font-size: .85rem; }
.cat-header .cat-off {
  background: var(--gold);
  color: #3a2703;
  font-weight: 800;
  font-size: .7rem;
  border-radius: 999px;
  padding: .2rem .6rem;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(215px, 1fr));
  gap: 1rem;
}

.card {
  background: linear-gradient(170deg, var(--surface-2), var(--surface) 55%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform .2s, box-shadow .2s, border-color .2s;
  cursor: pointer;
  box-shadow: var(--shadow);
}
.card:hover {
  transform: translateY(-4px);
  border-color: rgba(79, 140, 255, .5);
  box-shadow: var(--shadow-lg), var(--glow);
}
.card-img {
  position: relative;
  aspect-ratio: 1;
  background: #0e1830;
  overflow: hidden;
}
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.card:hover .card-img img { transform: scale(1.05); }
.off-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--gold);
  color: #3a2703;
  font-size: .7rem;
  font-weight: 800;
  border-radius: 999px;
  padding: .25rem .6rem;
  box-shadow: 0 4px 14px rgba(0, 0, 0, .45);
}
.card-body {
  padding: .8rem .9rem .95rem;
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
}
.card-group {
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--accent);
}
.card-name { font-size: .9rem; font-weight: 600; line-height: 1.3; color: var(--ink); }
.card-price { margin-top: auto; padding-top: .45rem; display: flex; align-items: baseline; gap: .5rem; flex-wrap: wrap; }
.price { font-size: 1.1rem; font-weight: 700; color: var(--ink); }
.price.sale { color: var(--gold); }
.price-old { font-size: .8rem; color: var(--muted); text-decoration: line-through; }
.card-add {
  margin-top: .55rem;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  font-size: .8rem;
  font-weight: 700;
  padding: .48rem;
  transition: .18s;
}
.card-add:hover { background: var(--accent); border-color: var(--accent); color: #fff; box-shadow: var(--glow); }

.no-results { text-align: center; color: var(--muted); padding: 3rem 1rem; font-size: 1rem; }

/* ---------- Overlays ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(4, 8, 16, .72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.overlay[hidden] { display: none; }

/* ---------- Modal producto ---------- */
.modal {
  position: relative;
  background: linear-gradient(170deg, var(--surface-2), var(--surface) 60%);
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  width: min(880px, 100%);
  max-height: 92vh;
  overflow: hidden auto;
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 5;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: rgba(13, 22, 38, .9);
  color: var(--ink);
  font-size: .95rem;
  transition: .18s;
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); }
.modal-body { display: grid; grid-template-columns: 1fr 1fr; }
.gallery { padding: 1rem; }
.gallery-main {
  aspect-ratio: 1;
  border-radius: 14px;
  overflow: hidden;
  background: #0e1830;
  border: 1px solid var(--line);
}
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; }
.gallery-thumbs img {
  width: 58px;
  height: 58px;
  object-fit: cover;
  border-radius: 10px;
  cursor: pointer;
  border: 2px solid transparent;
  opacity: .6;
  transition: .15s;
}
.gallery-thumbs img.active { border-color: var(--accent); opacity: 1; }

.pinfo { padding: 1.6rem 1.4rem 1.4rem .4rem; display: flex; flex-direction: column; gap: .7rem; }
.pinfo .card-group { font-size: .7rem; }
.pinfo h3 { font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; line-height: 1.2; }
.pinfo-price { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; }
.pinfo-price .price { font-size: 1.5rem; }
.pinfo-price .off-badge { position: static; }
.pdesc {
  font-size: .85rem;
  color: #b4c1dd;
  white-space: pre-line;
  max-height: 170px;
  overflow-y: auto;
  padding-right: .4rem;
}
.opt-block { border-top: 1px dashed var(--line-strong); padding-top: .7rem; }
.opt-block h4 {
  font-size: .76rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--muted);
  margin-bottom: .5rem;
}
.opt-chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.opt-chip {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  border-radius: 999px;
  padding: .34rem .72rem;
  font-size: .76rem;
  font-weight: 600;
  transition: .15s;
}
.opt-chip:hover { border-color: var(--accent); color: var(--accent); }
.opt-chip.active { background: var(--accent); color: #fff; border-color: var(--accent); box-shadow: var(--glow); }
.promo-card {
  border: 1.5px dashed rgba(255, 199, 102, .55);
  background: rgba(255, 199, 102, .07);
  border-radius: 12px;
  padding: .7rem .8rem;
  display: flex;
  align-items: center;
  gap: .7rem;
  justify-content: space-between;
}
.promo-card .promo-name { font-size: .8rem; font-weight: 700; }
.promo-card .promo-price { font-size: .8rem; display: flex; gap: .45rem; align-items: baseline; }
.promo-add {
  border: 0;
  background: var(--gold);
  color: #3a2703;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 800;
  padding: .45rem .85rem;
  white-space: nowrap;
  transition: .15s;
}
.promo-add:hover { filter: brightness(1.1); box-shadow: 0 6px 20px rgba(255, 199, 102, .3); }

.buy-row { display: flex; gap: .7rem; align-items: stretch; margin-top: .4rem; }
.qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  overflow: hidden;
}
.qty button {
  width: 38px;
  height: 44px;
  border: 0;
  background: transparent;
  font-size: 1.1rem;
  color: var(--ink);
}
.qty button:hover { background: var(--accent-soft); color: var(--accent); }
.qty span { min-width: 30px; text-align: center; font-weight: 700; }
.add-btn {
  flex: 1;
  border: 0;
  background: linear-gradient(135deg, var(--accent), #3f6fe0);
  color: #fff;
  border-radius: 999px;
  font-size: .95rem;
  font-weight: 700;
  padding: .7rem 1rem;
  transition: .18s;
  box-shadow: var(--glow);
}
.add-btn:hover { filter: brightness(1.12); transform: translateY(-1px); }
.stock-note { font-size: .74rem; color: var(--muted); }

/* ---------- Carrito ---------- */
#cartOverlay { justify-content: flex-end; padding: 0; }
.drawer {
  background: var(--bg-2);
  border-left: 1px solid var(--line-strong);
  width: min(430px, 100vw);
  height: 100dvh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
  animation: slideIn .25s ease;
}
@keyframes slideIn { from { transform: translateX(40px); opacity: .4; } }
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.2rem;
  border-bottom: 1px solid var(--line);
}
.drawer-head h2 { font-family: var(--font-display); font-size: 1.3rem; font-weight: 600; }
.drawer-head .modal-close { position: static; }
.drawer-items { flex: 1; overflow-y: auto; padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: .9rem; }
.cart-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }
.cart-item { display: flex; gap: .8rem; }
.cart-item img {
  width: 62px;
  height: 62px;
  border-radius: 10px;
  object-fit: cover;
  background: #0e1830;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.ci-body { flex: 1; min-width: 0; }
.ci-name { font-size: .85rem; font-weight: 600; line-height: 1.25; }
.ci-opt { font-size: .74rem; color: var(--accent); }
.ci-row { display: flex; align-items: center; justify-content: space-between; margin-top: .4rem; }
.ci-qty { display: flex; align-items: center; gap: .1rem; border: 1px solid var(--line-strong); border-radius: 999px; }
.ci-qty button { width: 26px; height: 26px; border: 0; background: transparent; color: var(--ink); font-size: .9rem; border-radius: 999px; }
.ci-qty button:hover { background: var(--accent-soft); color: var(--accent); }
.ci-qty span { min-width: 22px; text-align: center; font-size: .82rem; font-weight: 700; }
.ci-price { font-size: .88rem; font-weight: 700; color: var(--gold); }
.ci-del { border: 0; background: none; color: var(--danger); font-size: .72rem; text-decoration: underline; margin-top: .2rem; }

.drawer-foot {
  border-top: 1px solid var(--line);
  padding: 1rem 1.2rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: .7rem;
  background: var(--surface);
}
.min-note {
  font-size: .78rem;
  color: var(--gold);
  background: rgba(255, 199, 102, .08);
  border: 1px solid rgba(255, 199, 102, .3);
  border-radius: 10px;
  padding: .55rem .7rem;
  text-align: center;
}
.total-row { display: flex; justify-content: space-between; align-items: baseline; }
.total-row .label { color: var(--muted); font-size: .9rem; }
.total-row .value { font-size: 1.35rem; font-weight: 800; }
.wa-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  border: 0;
  background: linear-gradient(135deg, #25d366, var(--wa-dark));
  color: #fff;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  padding: .85rem 1rem;
  transition: .18s;
  box-shadow: 0 10px 30px rgba(34, 197, 94, .25);
}
.wa-btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.wa-btn:disabled { background: #26334d; color: #6d7c9c; cursor: not-allowed; box-shadow: none; }

/* ---------- FAB móvil ---------- */
.cart-fab {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 16px;
  z-index: 60;
  display: none;
  align-items: center;
  gap: .8rem;
  border: 1px solid var(--line-strong);
  background: linear-gradient(160deg, var(--surface-2), var(--surface));
  color: var(--ink);
  border-radius: 999px;
  padding: .8rem 1.4rem;
  font-size: .92rem;
  font-weight: 700;
  box-shadow: var(--shadow-lg), var(--glow);
}
.cart-fab .fab-total { background: var(--accent); color: #fff; border-radius: 999px; padding: .15rem .6rem; font-size: .82rem; }

/* ---------- Footer ---------- */
.footer { background: #070c17; border-top: 1px solid var(--line); color: #aab7d4; }
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.8rem;
}
.footer h3 { font-family: var(--font-display); color: #fff; font-size: 1.05rem; font-weight: 600; margin-bottom: .7rem; }
.footer p, .footer li { font-size: .85rem; line-height: 1.7; }
.footer ul { list-style: none; }
.footer a { color: #7aa8ff; text-decoration: none; }
.footer a:hover { text-decoration: underline; }
.footer-credit {
  text-align: center;
  font-size: .75rem;
  color: #5d6b8c;
  padding: 1rem;
  border-top: 1px solid var(--line);
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--accent);
  color: #fff;
  border-radius: 999px;
  padding: .6rem 1.2rem;
  font-size: .85rem;
  font-weight: 600;
  box-shadow: var(--shadow-lg), var(--glow);
  z-index: 200;
  opacity: 0;
  transition: .25s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero-inner { padding: 1.4rem 1rem 1.2rem; gap: 1rem; }
  .hero-logo { width: 64px; height: 64px; border-radius: 18px; }
  .hero-tag { font-size: .84rem; }
  .hero-social { position: absolute; right: 1rem; top: 1.2rem; }
  .hero-inner { position: relative; }
  .toolbar-inner { padding: .55rem .8rem; gap: .5rem; }
  .back-btn { padding: .5rem .7rem; font-size: .8rem; }
  .main { padding: 1.2rem .8rem 5.5rem; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .cat-card { aspect-ratio: 1; }
  .cat-card h3 { font-size: .92rem; }
  .cat-card .cat-sub { font-size: .68rem; flex-wrap: wrap; gap: .3rem; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: .7rem; }
  .card-body { padding: .6rem .65rem .75rem; }
  .modal-body { grid-template-columns: 1fr; }
  .pinfo { padding: .2rem 1.1rem 1.3rem; }
  .gallery { padding: 1rem 1rem 0; }
  .cart-fab.visible { display: flex; }
}
