:root {
  --bg: #fff5f7;
  --surface: #ffffff;
  --text: #3b2430;
  --muted: #7a5364;
  --primary: #8e3a5b;
  --on-primary: #ffffff;
  --line: #f3c6d4;
  --radius: 22px;
  --font-display: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --font-body: "Segoe UI", system-ui, sans-serif;
  --accent: #166534;
  --glow: rgba(244, 114, 182, 0.45);
  --scene: linear-gradient(135deg, #fde68a, #fb7185 52%, #e879f9);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(ellipse at 0% -10%, var(--glow), transparent 46%),
    radial-gradient(ellipse at 100% 0%, color-mix(in srgb, var(--accent) 42%, transparent), transparent 38%),
    var(--bg);
}

button, input, textarea, select { font: inherit; color: inherit; }

button { cursor: pointer; }

.stack { position: sticky; top: 0; z-index: 5; }

.wrap {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding-bottom: 48px;
}

.top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 28px 0 8px;
}

.brand { display: flex; gap: 14px; align-items: center; min-width: 0; }

.logo {
  width: 64px;
  height: 64px;
  object-fit: cover;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  box-shadow: 4px 4px 0 var(--glow);
}

html[data-niche="floreria"] .logo { border-radius: 50%; }

h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

html[data-niche="floreria"] h1,
html[data-niche="cafeteria"] h1,
html[data-niche="belleza"] h1 { font-style: italic; }

html[data-niche="tecnologia"] h1 {
  font-weight: 800;
  letter-spacing: -0.05em;
  text-shadow: 0 0 22px var(--glow);
}

html[data-niche="moda"] h1,
html[data-niche="deportes"] h1 {
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

html[data-niche="deportes"] h1 { font-style: italic; }

.muted, .clock, .today { color: var(--muted); }

.tagline { margin: 6px 0 0; }

.cart-link, .ghost {
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  min-height: 42px;
  padding: 0 14px;
  font-weight: 750;
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--accent) 70%, transparent);
}

html[data-niche="tecnologia"] .cart-link,
html[data-niche="tecnologia"] .ghost {
  background: transparent;
  color: var(--text);
  box-shadow: 0 0 16px var(--glow);
}

html[data-niche="moda"] .cart-link {
  box-shadow: none;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 13px;
}

.pill {
  display: inline-block;
  margin: 8px 0 0;
  padding: 4px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 14%, var(--surface));
  border: 1px solid var(--accent);
  font-size: 14px;
  font-weight: 750;
}

html[data-open="yes"] .pill { color: var(--primary); }

html[data-niche="moda"] .pill { border-radius: 0; }

.today, .clock { margin: 6px 0; }

.hero {
  position: relative;
  margin: 18px 0 26px;
  border-radius: calc(var(--radius) + 6px);
  overflow: hidden;
  box-shadow: 0 18px 40px color-mix(in srgb, var(--primary) 28%, transparent);
}

.hero img {
  display: block;
  width: 100%;
  height: 260px;
  object-fit: cover;
}

.scene {
  position: relative;
  height: 248px;
  overflow: hidden;
  background: var(--scene);
}

html[data-cover="yes"] .scene { display: none; }

html[data-hero="grid"] .scene {
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.18) 1px, transparent 1px),
    var(--scene);
  background-size: 28px 28px, 28px 28px, auto;
}

html[data-hero="sprinkle"] .scene {
  background-image:
    radial-gradient(circle, #f472b6 2.5px, transparent 3px),
    radial-gradient(circle, #facc15 2.5px, transparent 3px),
    radial-gradient(circle, #34d399 2.5px, transparent 3px),
    var(--scene);
  background-size: 28px 28px, 36px 36px, 44px 44px, auto;
  background-position: 0 0, 12px 8px, 6px 18px, 0 0;
}

.orb, .ribbon { position: absolute; display: block; }

.orb {
  border-radius: 50%;
  animation: floaty 8s ease-in-out infinite;
}

.orb.a {
  width: 150px;
  height: 150px;
  left: 6%;
  bottom: -36px;
  background: color-mix(in srgb, var(--accent) 72%, white);
}

.orb.b {
  width: 96px;
  height: 96px;
  right: 10%;
  top: 22px;
  background: color-mix(in srgb, white 28%, var(--primary));
  animation-delay: -2.4s;
}

.orb.c {
  width: 52px;
  height: 52px;
  left: 44%;
  top: 30px;
  background: #fff8;
  animation-delay: -4.2s;
}

.ribbon {
  left: -8%;
  right: -8%;
  bottom: 36px;
  height: 16px;
  background: color-mix(in srgb, var(--accent) 80%, white);
  transform: rotate(-7deg);
  opacity: 0.9;
}

html[data-hero="flora"] .orb.a { border-radius: 62% 38% 56% 44%; background: #f472b6; }
html[data-hero="flora"] .orb.b { border-radius: 42% 58% 40% 60%; background: #4ade80; }
html[data-hero="flora"] .orb.c { background: #fde68a; }
html[data-hero="flora"] .ribbon { background: #166534; }

html[data-hero="sprinkle"] .orb.a { background: #fb7185; }
html[data-hero="sprinkle"] .orb.b { background: #facc15; }
html[data-hero="sprinkle"] .orb.c { background: #6ee7b7; }
html[data-hero="sprinkle"] .ribbon { background: #f472b6; }

html[data-hero="steam"] .orb.a { background: #fdba74; }
html[data-hero="steam"] .orb.b { background: #fff7ed; }
html[data-hero="steam"] .orb.c { background: #fde68a; }
html[data-hero="steam"] .ribbon { background: #7c2d12; }

html[data-hero="paw"] .orb.a { border-radius: 46% 54% 42% 58%; background: #fb923c; }
html[data-hero="paw"] .orb.b { background: #2dd4bf; }
html[data-hero="paw"] .orb.c { background: #fde68a; }
html[data-hero="paw"] .ribbon { background: #0f766e; }

html[data-hero="market"] .orb.a { background: #facc15; }
html[data-hero="market"] .orb.b { background: #fb923c; }
html[data-hero="market"] .orb.c { background: #4ade80; }
html[data-hero="market"] .ribbon { background: #166534; }

html[data-hero="flame"] .orb.a { background: #ef4444; }
html[data-hero="flame"] .orb.b { background: #facc15; }
html[data-hero="flame"] .orb.c { background: #4ade80; }
html[data-hero="flame"] .ribbon { background: #b91c1c; }

html[data-hero="glow"] .orb.a { background: #f9a8d4; }
html[data-hero="glow"] .orb.b { background: #fde68a; }
html[data-hero="glow"] .orb.c { background: #e9d5ff; }
html[data-hero="glow"] .ribbon { background: #fbcfe8; }

html[data-hero="grid"] .orb {
  border-radius: 8px;
  box-shadow: 0 0 24px var(--glow);
}
html[data-hero="grid"] .ribbon {
  left: 0;
  right: 0;
  height: 2px;
  bottom: auto;
  transform: none;
  background: #67e8f9;
  box-shadow: 0 0 18px var(--glow);
  animation: scan 3.8s linear infinite;
}

html[data-hero="editorial"] .orb { display: none; }
html[data-hero="editorial"] .ribbon { display: none; }

html[data-hero="bolt"] .orb { display: none; }
html[data-hero="bolt"] .ribbon {
  height: 28px;
  background: #052e16;
  opacity: 0.35;
  animation: dash 2.8s linear infinite;
}

html[data-hero="glow"] .orb { filter: blur(2px); }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-14px) rotate(7deg); }
}

@keyframes scan {
  0% { top: 10%; }
  100% { top: 88%; }
}

@keyframes dash {
  0% { transform: translateX(-6%) rotate(-7deg); }
  100% { transform: translateX(6%) rotate(-7deg); }
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.card {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 10%, var(--surface)), var(--surface) 42%);
  border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  border-radius: var(--radius);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 180px;
  overflow: hidden;
  box-shadow: 0 12px 28px color-mix(in srgb, var(--primary) 14%, transparent);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

@media (hover: hover) {
  .card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 34px color-mix(in srgb, var(--primary) 24%, transparent);
  }
  html[data-niche="tecnologia"] .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 0 0 1px var(--accent), 0 0 26px var(--glow);
  }
  html[data-niche="pasteleria"] .card:hover,
  html[data-niche="mascotas"] .card:hover { transform: translateY(-8px) rotate(-0.6deg); }
  html[data-niche="moda"] .card:hover { transform: none; box-shadow: 8px 8px 0 var(--accent); }
}

.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.photo, .media-empty {
  width: 100%;
  height: 168px;
  object-fit: cover;
  display: block;
}

.media-empty {
  background:
    radial-gradient(circle at 18% 80%, color-mix(in srgb, var(--accent) 75%, white), transparent 46%),
    radial-gradient(circle at 84% 16%, color-mix(in srgb, var(--primary) 55%, white), transparent 42%),
    var(--scene);
}

.media { position: relative; }

.badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  align-self: flex-start;
}

.badge-inline { position: static; }
.badge-oferta { background: #8c1d18; color: #ffffff; }
.badge-agotado { background: #3f3f46; color: #ffffff; }
.badge-nuevo { background: #0c3d6e; color: #ffffff; }
.badge-otro { background: #1c1917; color: #fff8e8; }

.card h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

html[data-niche="tecnologia"] .card h2 { font-size: 18px; font-weight: 800; }
html[data-niche="moda"] .card h2 { letter-spacing: 0.06em; text-transform: uppercase; font-size: 16px; }
html[data-niche="deportes"] .card h2 { font-style: italic; text-transform: uppercase; }

.card p { margin: 0; color: var(--muted); flex: 1; }

.price {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  font-size: 18px;
  color: var(--accent);
}

html[data-niche="tecnologia"] .price { text-shadow: 0 0 12px var(--glow); }

.btn {
  background: linear-gradient(180deg, color-mix(in srgb, white 16%, var(--primary)), var(--primary));
  color: var(--on-primary);
  border: 0;
  border-radius: max(4px, calc(var(--radius) - 8px));
  min-height: 44px;
  padding: 0 14px;
  font-weight: 800;
  width: 100%;
  box-shadow: 0 8px 16px color-mix(in srgb, var(--primary) 32%, transparent);
}

.panel .btn { width: auto; }

.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.week {
  margin-top: 36px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px 16px;
}

.week div {
  border-top: 3px solid var(--accent);
  padding-top: 8px;
  background: color-mix(in srgb, var(--surface) 86%, transparent);
  border-radius: 0 0 var(--radius) var(--radius);
  padding-left: 8px;
  padding-bottom: 8px;
}

.week dt { font-size: 13px; color: var(--muted); }
.week dd { margin: 2px 0 0; font-variant-numeric: tabular-nums; font-weight: 650; }

.dock { display: none !important; }

.drawer {
  position: fixed;
  inset: 0;
  z-index: 20;
}

.scrim { position: absolute; inset: 0; background: rgba(20, 16, 16, 0.45); }

.panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--line);
  padding: 18px 16px 24px;
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel header, .line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.panel h2 { margin: 0; font-family: var(--font-display); font-weight: 700; }

.line { border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.line-photo {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: max(4px, calc(var(--radius) - 8px));
  flex: none;
}
.line b { font-variant-numeric: tabular-nums; }

.qty { display: flex; gap: 6px; align-items: center; }
.qty button, .linkish {
  background: transparent;
  border: 0;
  min-width: 32px;
  min-height: 32px;
  color: var(--primary);
  font-weight: 700;
  box-shadow: none;
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.checkout { display: flex; flex-direction: column; gap: 8px; }
.checkout label { font-weight: 650; font-size: 14px; }
.field {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: max(4px, calc(var(--radius) - 8px));
  padding: 8px;
  background: var(--surface);
  color: var(--text);
}
textarea.field { min-height: 72px; resize: vertical; }

.total { font-size: 20px; font-variant-numeric: tabular-nums; font-weight: 750; color: var(--accent); }

.flash {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  padding: 8px 12px;
  border-radius: var(--radius);
  z-index: 15;
}

.empty { color: var(--muted); }

:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .orb, .ribbon, .card { animation: none; transition: none; }
}

@media (max-width: 640px) {
  h1 { font-size: 32px; }
  .top { padding-top: 20px; align-items: flex-start; }
  .week { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .scene, .hero img { height: 190px; }
}
