:root {
  --bg: #0b0b0c;
  --surface: #151517;
  --surface-2: #1d1d20;
  --line: #2a2a2e;
  --ink: #f5f5f2;
  --muted: #9a9aa0;
  --yellow: #f5c518;
  --yellow-press: #e0b10c;
  --on-yellow: #111;
  --danger: #ff5d5d;
  --ok: #46d17c;
  --radius: 14px;
  --gutter: 16px;
  /* Curvas de movimiento: las nativas son demasiado débiles */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
}
* { box-sizing: border-box; margin: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg); color: var(--ink);
  font-family: "Archivo", system-ui, sans-serif; font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; min-height: 100vh; overflow-x: hidden;
}
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; touch-action: manipulation; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--yellow); outline-offset: 2px; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* Botones */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 22px; border-radius: 999px; border: 1px solid transparent;
  font-weight: 800; letter-spacing: .02em; text-transform: uppercase; font-size: 14px;
  transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--yellow); color: var(--on-yellow); }
@media (hover:hover) and (pointer:fine) { .btn-primary:hover { background: var(--yellow-press); } }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
@media (hover:hover) and (pointer:fine) { .btn-ghost:hover { border-color: var(--yellow); color: var(--yellow); } }
.btn-danger { background: transparent; border-color: #5a2a2a; color: var(--danger); }
@media (hover:hover) and (pointer:fine) { .btn-danger:hover { background: #2a1414; } }
.btn-wa { background: #25d366; color: #05210f; }
@media (hover:hover) and (pointer:fine) { .btn-wa:hover { background: #1fbd5a; } }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: 12px; }

/* Header */
.top { position: sticky; top: 0; z-index: 30; background: rgba(11,11,12,.88); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { font-weight: 900; font-size: 22px; letter-spacing: .06em; text-decoration: none; text-transform: uppercase; }
.logo b { color: var(--yellow); }
.cart-btn { position: relative; background: transparent; border: 1px solid var(--line); border-radius: 999px; min-height: 44px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; font-weight: 700; }
@media (hover:hover) and (pointer:fine) { .cart-btn:hover { border-color: var(--yellow); } }
.cart-count { background: var(--yellow); color: var(--on-yellow); font-size: 12px; font-weight: 900; min-width: 22px; height: 22px; border-radius: 11px; display: grid; place-items: center; padding: 0 6px; }
.cart-count:empty, .cart-count[data-n="0"] { display: none; }

/* Hero */
.hero { padding: 56px 0 28px; }
.eyebrow { color: var(--yellow); font-weight: 800; font-size: 13px; letter-spacing: .18em; text-transform: uppercase; }
.hero h1 { font-weight: 900; font-size: clamp(44px, 11vw, 112px); line-height: .92; letter-spacing: -.02em; text-transform: uppercase; margin: 12px 0 18px; }
.hero h1 span { color: var(--yellow); }
.hero p { color: var(--muted); max-width: 52ch; font-size: 17px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 22px; color: var(--muted); font-size: 14px; }
.hero-meta strong { color: var(--ink); font-weight: 700; }

/* Filtros */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 18px var(--gutter) 6px; margin: 0 calc(var(--gutter) * -1); scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 18px; border-radius: 999px; background: transparent; border: 1px solid var(--line); font-weight: 700; font-size: 14px; }
@media (hover:hover) and (pointer:fine) { .chip:hover { border-color: var(--yellow); } }
.chip[aria-pressed="true"] { background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }

/* Grilla */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; padding: 18px 0 56px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 20px; } }
@media (min-width: 1020px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { background: transparent; border: 0; text-align: left; padding: 0; display: block; width: 100%; }
.card-img { aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; background: var(--surface); position: relative; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 420ms var(--ease-out); }
@media (hover:hover) and (pointer:fine) { .card:hover .card-img img { transform: scale(1.04); } }
.tag { position: absolute; left: 10px; top: 10px; background: var(--yellow); color: var(--on-yellow); font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 999px; }
.tag.out { background: #333; color: var(--ink); }
.card h3 { font-size: 15px; font-weight: 700; margin-top: 10px; line-height: 1.3; }
.card .price { font-weight: 900; color: var(--yellow); font-size: 18px; margin-top: 2px; }
.card .cat { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .1em; }
.empty { grid-column: 1/-1; text-align: center; color: var(--muted); padding: 60px 0; }

/* Modales y panel lateral */
/* Entrada lenta y deliberada, salida rápida. La visibilidad se corta recién cuando termina la salida. */
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,.7); z-index: 50; opacity: 0; visibility: hidden; transition: opacity 200ms ease, visibility 0s linear 200ms; }
.overlay.open { opacity: 1; visibility: visible; transition: opacity 260ms ease, visibility 0s; }
.sheet {
  position: fixed; z-index: 60; background: var(--surface); border: 1px solid var(--line);
  left: 0; right: 0; bottom: 0; max-height: 92vh; overflow-y: auto; border-radius: 20px 20px 0 0; padding: 22px var(--gutter) 28px;
  transform: translateY(100%); visibility: hidden;
  transition: transform 220ms var(--ease-drawer), visibility 0s linear 220ms;
}
.sheet.open { transform: none; visibility: visible; transition: transform 380ms var(--ease-drawer), visibility 0s; }
@media (min-width: 720px) {
  /* Modal: se queda centrado (no tiene un disparador de origen), entra con escala sutil + opacidad */
  .sheet.center { left: 50%; right: auto; bottom: auto; top: 50%; width: min(860px, 94vw); max-height: 90vh; border-radius: 20px; transform: translate(-50%, -50%) scale(.96); opacity: 0; padding: 26px; transition: transform 180ms var(--ease-out), opacity 180ms var(--ease-out), visibility 0s linear 180ms; }
  .sheet.center.open { transform: translate(-50%, -50%); opacity: 1; transition: transform 280ms var(--ease-out), opacity 220ms var(--ease-out), visibility 0s; }
  .sheet.side { left: auto; top: 0; width: 440px; max-height: none; border-radius: 0; transform: translateX(100%); padding: 22px; }
  .sheet.side.open { transform: none; }
}
.sheet.side { top: auto; }
@media (min-width: 720px) { .sheet.side { top: 0; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.sheet-head h2 { font-size: 22px; font-weight: 900; text-transform: uppercase; }
.x { background: transparent; border: 1px solid var(--line); border-radius: 50%; width: 40px; height: 40px; font-size: 18px; line-height: 1; }
@media (hover:hover) and (pointer:fine) { .x:hover { border-color: var(--yellow); color: var(--yellow); } }

.detail { display: grid; gap: 18px; }
@media (min-width: 720px) { .detail { grid-template-columns: 1fr 1fr; } }
.detail .card-img { aspect-ratio: 4/5; }
.detail h2 { font-size: 26px; font-weight: 900; line-height: 1.1; }
.detail .price { font-size: 28px; font-weight: 900; color: var(--yellow); margin: 8px 0 12px; }
.detail p { color: var(--muted); margin-bottom: 16px; }
.label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 8px; display: block; }
.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.size { min-width: 52px; min-height: 46px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font-weight: 800; }
@media (hover:hover) and (pointer:fine) { .size:hover { border-color: var(--yellow); } }
.size[aria-pressed="true"] { background: var(--yellow); border-color: var(--yellow); color: var(--on-yellow); }
.size[disabled] { opacity: .35; text-decoration: line-through; pointer-events: none; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; }
.qty button { width: 44px; height: 44px; background: transparent; border: 0; font-size: 20px; border-radius: 50%; }
@media (hover:hover) and (pointer:fine) { .qty button:hover { color: var(--yellow); } }
.qty span { min-width: 30px; text-align: center; font-weight: 800; }
.note { font-size: 13px; color: var(--muted); margin-top: 12px; }
.error { color: var(--danger); font-size: 14px; min-height: 20px; margin-top: 6px; }

/* Carrito */
.line { display: grid; grid-template-columns: 72px 1fr auto; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); align-items: center; }
.line img { width: 72px; height: 90px; object-fit: cover; border-radius: 10px; background: var(--surface-2); }
.line h4 { font-size: 14px; font-weight: 700; line-height: 1.3; }
.line small { color: var(--muted); display: block; }
.line .lp { font-weight: 900; color: var(--yellow); text-align: right; }
.line .rm { background: none; border: 0; color: var(--muted); font-size: 12px; text-decoration: underline; padding: 6px 0; }
.total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 900; padding: 18px 0 14px; }

/* Formularios */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 6px; }
.input { width: 100%; min-height: 46px; padding: 10px 14px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.input:focus { border-color: var(--yellow); outline: none; }
textarea.input { min-height: 80px; resize: vertical; }
.radios { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.radio { position: relative; }
.radio input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.radio span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 46px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 10px; font-weight: 700; font-size: 14px; }
.radio input:checked + span { background: var(--yellow); color: var(--on-yellow); border-color: var(--yellow); }
.radio input:focus-visible + span { outline: 2px solid var(--yellow); outline-offset: 2px; }

/* Footer */
.foot { border-top: 1px solid var(--line); padding: 36px 0 48px; color: var(--muted); font-size: 14px; }
.foot .wrap { display: grid; gap: 24px; }
@media (min-width: 720px) { .foot .wrap { grid-template-columns: 1.4fr 1fr 1fr; } }
.foot h4 { color: var(--ink); font-size: 13px; text-transform: uppercase; letter-spacing: .14em; margin-bottom: 8px; }
@media (hover:hover) and (pointer:fine) { .foot a:hover { color: var(--yellow); } }

.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--yellow); color: var(--on-yellow); font-weight: 800; padding: 12px 22px; border-radius: 999px; z-index: 90; opacity: 0; transition: opacity 200ms var(--ease-out), transform 280ms var(--ease-out); pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.demo-bar { background: var(--yellow); color: var(--on-yellow); text-align: center; font-size: 13px; font-weight: 700; padding: 6px var(--gutter); }

/* Feedback de presión en todo lo que se toca (rápido, sutil) */
.chip, .size, .cart-btn, .x, .card, .radio span, .qty button { transition: transform 140ms var(--ease-out), background-color 160ms ease, border-color 160ms ease, color 160ms ease; }
.chip:active, .size:active, .cart-btn:active, .x:active, .qty button:active { transform: scale(.96); }
.card:active { transform: scale(.985); }
.radio input:active + span { transform: scale(.97); }

/* Entrada escalonada del catálogo: decorativa, solo en la tienda (el mostrador y el admin se usan todo el día: sin adornos) */
.grid.stagger .card { animation: rise 460ms var(--ease-out) backwards; animation-delay: calc(min(var(--i, 0), 8) * 45ms); }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* Confirma que el producto entró al carrito */
.cart-count.bump { animation: bump 320ms var(--ease-out); }
@keyframes bump { 40% { transform: scale(1.3); } }

/* Movimiento reducido: se quitan los desplazamientos, se mantienen los fundidos que ayudan a entender */
@media (prefers-reduced-motion: reduce) {
  .card:hover .card-img img, .chip:active, .size:active, .cart-btn:active, .x:active, .btn:active, .card:active, .qty button:active { transform: none !important; }
  .grid.stagger .card { animation: fade 200ms ease backwards; }
  .cart-count.bump { animation: none; }
  .sheet, .sheet.side { transform: none; opacity: 0; transition: opacity 160ms ease, visibility 0s linear 160ms; }
  .sheet.open { opacity: 1; transition: opacity 160ms ease, visibility 0s; }
  @keyframes fade { from { opacity: 0; } }
}
@media (prefers-reduced-motion: reduce) and (min-width: 720px) {
  .sheet.center { transform: translate(-50%, -50%); transition: opacity 160ms ease, visibility 0s linear 160ms; }
  .sheet.center.open { transition: opacity 160ms ease, visibility 0s; }
}

/* Admin */
.admin-wrap { max-width: 1000px; margin: 0 auto; padding: 24px var(--gutter) 80px; }
.login-box { max-width: 380px; margin: 14vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; }
.login-box h1 { font-size: 26px; font-weight: 900; text-transform: uppercase; margin-bottom: 4px; }
.tabs { display: flex; gap: 8px; margin: 18px 0; flex-wrap: wrap; }
.bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.plist { display: grid; gap: 10px; margin-top: 8px; }
.prow { display: grid; grid-template-columns: 64px 1fr; gap: 12px; padding: 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; align-items: center; }
.prow img { width: 64px; height: 80px; object-fit: cover; border-radius: 8px; background: var(--surface-2); }
.prow h3 { font-size: 15px; font-weight: 700; }
.prow .meta { color: var(--muted); font-size: 13px; }
.prow .actions { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; }
@media (min-width: 720px) { .prow { grid-template-columns: 64px 1fr auto; } .prow .actions { grid-column: auto; } }
.badge { display: inline-block; font-size: 11px; font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); text-transform: uppercase; letter-spacing: .06em; }
.badge.on { background: #12331f; color: var(--ok); }
.badge.off { background: #3a1818; color: var(--danger); }
.badge.new { background: #3a3010; color: var(--yellow); }
.size-rows { display: grid; gap: 8px; }
.size-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.preview { width: 120px; aspect-ratio: 4/5; object-fit: cover; border-radius: 10px; background: var(--surface-2); margin-bottom: 8px; }
.order { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin-top: 10px; }
.order ul { margin: 8px 0 8px 18px; color: var(--muted); font-size: 14px; }
.form-grid { display: grid; gap: 0 14px; }
@media (min-width: 720px) { .form-grid { grid-template-columns: 1fr 1fr; } }
