@font-face {
  font-family: "Sora";
  src: url("/fonts/sora-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("/fonts/jakarta-var.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f2f7fd;
  --panel: #ffffff;
  --ink: #0b1c2f;
  --muted: #5d7286;
  --line: #d6e4f5;
  --blue: #4a7ac9;
  --blue-2: #5d93dd;
  --blue-deep: #3560a8;
  --blue-soft: #dce9f9;
  --ok: #1f8a5f;
  --warn: #b07714;
  --danger: #b3403b;
  --radius: 20px;
  --display: "Sora", "Plus Jakarta Sans", system-ui, sans-serif;
  --accent-grad: linear-gradient(135deg, #5d93dd 0%, #4374c6 55%, #2f5aa0 100%);
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background:
    radial-gradient(900px 420px at 8% -8%, #e2eefc 0%, transparent 60%),
    radial-gradient(700px 380px at 96% 0%, #e8f2fd 0%, transparent 55%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--blue); }

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 16px;
  background: rgba(242, 247, 253, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center;
  background: var(--accent-grad, linear-gradient(135deg, #5d93dd 0%, #4374c6 55%, #2f5aa0 100%)); color: #fff; font-weight: 800; font-size: 21px;
  box-shadow: 0 1px 1px rgba(16, 38, 63, .10), 0 8px 16px -12px rgba(67, 116, 198, .9);
}
.mark svg { width: 21px; height: 21px; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-size: 13px; letter-spacing: .16em; }
.brand-text span { font-size: 11px; color: var(--muted); }

.top-actions { display: flex; align-items: center; gap: 10px; }
.link { font-size: 13px; color: var(--muted); text-decoration: none; }
.link:hover { color: var(--blue); }

.cart-btn {
  position: relative; width: 42px; height: 42px; border-radius: 13px;
  border: 1px solid var(--line); background: #fff; display: grid; place-items: center; cursor: pointer;
}
.cart-btn svg { width: 21px; height: 21px; fill: none; stroke: var(--ink); stroke-width: 1.7; stroke-linecap: round; }
.count {
  position: absolute; top: -6px; right: -6px; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 999px; background: var(--blue); color: #fff; font-size: 11px; font-weight: 700;
  display: grid; place-items: center;
}

.view { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 18px 16px 40px; }
.loading, .empty { text-align: center; color: var(--muted); padding: 40px 10px; font-size: 14px; }

.hero { margin: 6px 0 18px; }
.hero h1 { font-size: 27px; line-height: 1.15; margin: 0 0 8px; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.55; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 12px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  border: 1px solid var(--line); background: #fff; color: var(--muted);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--blue); border-color: var(--blue); color: #fff; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; text-decoration: none; color: inherit;
  transition: transform .15s ease, box-shadow .15s ease;
}
.card:active { transform: scale(.99); }
.shot { position: relative; aspect-ratio: 1 / 1; background: linear-gradient(160deg, #eef5fd, #dde9f8); display: grid; place-items: center; }
.shot img { width: 100%; height: 100%; object-fit: cover; }
.shot .fallback { font-size: 34px; font-weight: 800; color: #b7cde6; }
.card-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 3px; }
.card-body strong { font-size: 14px; line-height: 1.3; }
.card-body small { color: var(--muted); font-size: 11.5px; }
.price { font-size: 14px; font-weight: 700; margin-top: 2px; }
.badge {
  position: absolute; top: 8px; left: 8px; background: rgba(14, 28, 44, .78); color: #fff;
  font-size: 10.5px; letter-spacing: .04em; padding: 4px 8px; border-radius: 999px;
}

.product { display: grid; gap: 16px; }
.gallery { display: grid; gap: 8px; }
.gallery .main { aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: linear-gradient(160deg, #eef5fd, #dde9f8); display: grid; place-items: center; }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: 8px; }
.gallery .thumbs img { width: 66px; height: 66px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }

.product h1 { font-size: 24px; line-height: 1.2; margin: 0; }
.product .meta { color: var(--muted); font-size: 13px; }
.product .desc { font-size: 14px; line-height: 1.6; color: #2b4157; white-space: pre-wrap; }

.sizes { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.size-btn {
  min-width: 54px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; font-size: 14px; cursor: pointer;
}
.size-btn.active { border-color: var(--blue); box-shadow: 0 0 0 2px rgba(67, 116, 198, .18); }
.size-btn:disabled { opacity: .4; text-decoration: line-through; cursor: default; }

.qty { display: inline-flex; align-items: center; gap: 4px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.qty button { width: 40px; height: 42px; background: none; border: none; font-size: 18px; cursor: pointer; color: var(--ink); }
.qty span { min-width: 26px; text-align: center; font-weight: 600; }

.sticky-bar {
  position: sticky; bottom: 0; z-index: 15; display: flex; gap: 10px; align-items: center;
  padding: 12px 16px; margin: 18px -16px -40px;
  background: rgba(242, 247, 253, .9); backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: calc(12px + env(safe-area-inset-bottom));
}

button, .btn {
  font: inherit; border: none; border-radius: 13px; padding: 13px 18px; font-size: 15px;
  background: var(--blue-soft); color: var(--blue-deep); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
button.primary, .btn.primary { background: linear-gradient(135deg, #5d93dd, #3560a8); color: #fff; font-weight: 650; box-shadow: 0 8px 20px rgba(52, 104, 180, .22); }
button.primary:disabled { opacity: .55; box-shadow: none; }
button.wide, .btn.wide { width: 100%; }
button.ghost { background: transparent; color: var(--muted); padding: 10px 8px; }
button.danger { background: #fdeceb; color: var(--danger); }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.panel + .panel { margin-top: 12px; }
.panel h2 { font-size: 16px; margin: 0 0 10px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 11px; }
label { font-size: 12.5px; color: var(--muted); }
input, select, textarea {
  width: 100%; font: inherit; font-size: 15px; color: var(--ink); background: #fff;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(67, 116, 198, .14); }
textarea { min-height: 74px; resize: vertical; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.choice { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice label {
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: #fff;
  font-size: 13.5px; color: var(--ink); display: flex; gap: 8px; align-items: center; cursor: pointer;
}
.choice input { width: auto; }
.choice input:checked + span { font-weight: 650; }

.line { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); align-items: flex-start; }
.line:last-of-type { border-bottom: none; }
.line img, .line .thumb { width: 58px; height: 58px; border-radius: 12px; object-fit: cover; background: #eaf2fb; flex-shrink: 0; }
.line-info { flex: 1; min-width: 0; }
.line-info b { display: block; font-size: 14px; }
.line-info span { font-size: 12px; color: var(--muted); }
.line-total { font-weight: 700; font-size: 14px; white-space: nowrap; }

.totals { display: flex; justify-content: space-between; align-items: baseline; padding-top: 12px; }
.totals b { font-size: 20px; }
.totals small { color: var(--muted); font-size: 12px; display: block; }

.confirm { text-align: center; padding: 8px 4px 0; }
.code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace; letter-spacing: .16em; font-size: 26px;
  font-weight: 700; background: var(--blue-soft); color: var(--blue-deep); border-radius: 14px;
  padding: 14px; margin: 12px 0;
}

.status-pill { display: inline-block; padding: 6px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 650; }
.st-nuevo { background: #fdf0d6; color: var(--warn); }
.st-confirmado, .st-preparado { background: var(--blue-soft); color: var(--blue-deep); }
.st-enviado { background: #e3f1fb; color: #1a6a91; }
.st-entregado { background: #e2f5ec; color: var(--ok); }
.st-cancelado { background: #fdeceb; color: var(--danger); }

.note { font-size: 12.5px; color: var(--muted); line-height: 1.55; }

.foot { border-top: 1px solid var(--line); padding: 20px 16px 28px; text-align: center; font-size: 12px; color: var(--muted); }
.foot p { margin: 0 0 6px; line-height: 1.5; }
.foot .muted { max-width: 520px; margin: 0 auto 12px; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 14px; }
.foot-links a { font-size: 12.5px; color: var(--muted); text-decoration: none; }

.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 16px);
  background: #0e1c2c; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 13.5px;
  opacity: 0; pointer-events: none; transition: all .2s ease; max-width: calc(100vw - 32px); z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 720px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .product { grid-template-columns: 1fr 1fr; align-items: start; }
  .gallery { position: sticky; top: 78px; }
  .sticky-bar { margin: 22px 0 0; border-radius: 16px; position: static; border: 1px solid var(--line); background: #fff; }
}

/* Tipografía y detalles del monedero */
h1, h2, h3 { font-family: var(--display, "Sora", system-ui, sans-serif); letter-spacing: -0.02em; }
