/* =========================================================
   Intratecbol — Tienda Online (DEMO) · mobile-first
   ========================================================= */
:root {
  --navy: #00033c;
  --navy-2: #0a1052;
  --blue: #2563eb;
  --blue-2: #38bdf8;
  --violet: #7c3aed;
  --ink: #141a2e;
  --muted: #6b7896;
  --line: #e8edf5;
  --bg: #f5f7fc;
  --green: #16a34a;
  --red: #ef4444;
  --amber: #f59e0b;
  --grad: linear-gradient(120deg, #38bdf8, #2563eb 55%, #7c3aed);
  --radius: 16px;
  --shadow: 0 10px 30px -12px rgba(15, 23, 50, 0.18);
}
* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); line-height: 1.5;
  -webkit-font-smoothing: antialiased; padding-bottom: 70px;
}
img { display: block; max-width: 100%; }
h1, h2, h3 { font-family: "Sora", sans-serif; letter-spacing: -.02em; }

/* Promo */
.t-promo { background: var(--grad); color: #fff; text-align: center; font-size: .76rem; font-weight: 500; padding: 7px 12px; }

/* Header */
.t-header {
  position: sticky; top: 0; z-index: 30;
  background: var(--navy); color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; box-shadow: 0 6px 20px -10px rgba(0,0,0,.5);
}
.t-brand img { height: 26px; width: auto; }
.ic { position: relative; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); border-radius: 11px; width: 42px; height: 42px; display: grid; place-items: center; cursor: pointer; }
.ic svg { width: 21px; height: 21px; fill: none; stroke: #fff; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cart-count { position: absolute; top: -6px; right: -6px; background: var(--blue-2); color: var(--navy); font-size: .68rem; font-weight: 800; min-width: 19px; height: 19px; border-radius: 10px; display: grid; place-items: center; padding: 0 4px; }

/* Buscador */
.t-search { position: relative; padding: 12px 16px; background: var(--navy); }
.t-search svg { position: absolute; left: 28px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; }
.t-search input { width: 100%; padding: 12px 14px 12px 40px; border-radius: 12px; border: 0; background: #fff; color: var(--ink); font-size: .95rem; }
.t-search input:focus { outline: 2px solid var(--blue-2); }

/* Hero */
.hero { position: relative; height: 380px; overflow: hidden; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,3,60,.25), rgba(0,3,60,.82)); }
.hero-in { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; gap: 10px; padding: 22px 18px 26px; color: #fff; }
.hero-badge { align-self: flex-start; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); padding: 5px 12px; border-radius: 20px; font-size: .74rem; font-weight: 600; backdrop-filter: blur(6px); }
.hero-in h1 { font-size: 2rem; line-height: 1.1; }
.hero-in h1 span { background: linear-gradient(90deg, #7dd3fc, #c4b5fd); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.hero-in p { font-size: .95rem; opacity: .92; max-width: 42ch; }

/* Botones */
.btn-primary {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  background: var(--grad); color: #fff; border: 0; cursor: pointer;
  padding: 13px 22px; border-radius: 12px; font-weight: 700; font-size: .95rem;
  text-decoration: none; box-shadow: 0 12px 26px -12px rgba(37,99,235,.9);
  transition: transform .15s, filter .2s; font-family: "Inter", sans-serif;
}
.btn-primary:hover:not(:disabled) { transform: translateY(-2px); filter: brightness(1.06); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-primary.block { width: 100%; }

/* Categorías */
.cats { display: flex; gap: 9px; overflow-x: auto; padding: 16px; scrollbar-width: none; }
.cats::-webkit-scrollbar { display: none; }
.cat { flex-shrink: 0; padding: 9px 17px; border-radius: 22px; background: #fff; border: 1px solid var(--line); color: var(--muted); font-size: .86rem; font-weight: 600; cursor: pointer; white-space: nowrap; transition: all .2s; }
.cat.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* Sección */
.section { padding: 4px 16px 26px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.section-head h2 { font-size: 1.3rem; }
.muted { color: var(--muted); font-size: .82rem; }

/* Grid productos (mobile: 2 col) */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.card {
  background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow);
  display: flex; flex-direction: column; position: relative;
  transition: transform .2s, box-shadow .2s; animation: rise .4s ease both;
}
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
.card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px -16px rgba(15,23,50,.28); }
.card-media { position: relative; aspect-ratio: 1 / 1; background: #eef2f9; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.disc-badge { position: absolute; top: 10px; left: 10px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 800; padding: 4px 9px; border-radius: 20px; }
.card-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-cat { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .03em; }
.card-name { font-size: .92rem; font-weight: 600; line-height: 1.25; }
.card-rate { font-size: .76rem; color: var(--amber); font-weight: 600; }
.card-rate span { color: var(--muted); }
.card-price { margin-top: auto; display: flex; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.card-price b { font-family: "Sora", sans-serif; font-size: 1.1rem; color: var(--navy); }
.card-price s { color: var(--muted); font-size: .82rem; }
.add-btn {
  margin-top: 10px; width: 100%; padding: 10px; border-radius: 11px; cursor: pointer;
  background: rgba(37,99,235,.1); color: var(--blue); border: 1px solid rgba(37,99,235,.25);
  font-weight: 700; font-size: .85rem; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: background .2s, color .2s;
}
.add-btn:hover { background: var(--blue); color: #fff; }
.add-btn.added { background: var(--green); color: #fff; border-color: var(--green); }

.empty-grid { text-align: center; color: var(--muted); padding: 30px 0; }

/* Confianza */
.trust { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 6px 16px 28px; }
.trust div { background: #fff; border-radius: 14px; padding: 16px 12px; text-align: center; box-shadow: var(--shadow); }
.t-ic { font-size: 1.5rem; }
.trust b { display: block; margin-top: 6px; font-size: .9rem; }
.trust p { color: var(--muted); font-size: .76rem; }

/* Footer */
.t-footer { background: var(--navy); color: #cbd6f5; text-align: center; padding: 24px 16px; }
.t-footer b { color: #fff; }
.t-footer a { display: inline-block; margin-top: 8px; color: var(--blue-2); text-decoration: none; font-weight: 600; }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 25;
  background: #fff; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(4, 1fr);
  box-shadow: 0 -6px 20px -10px rgba(15,23,50,.2);
}
.bottom-nav a, .bottom-nav button {
  background: none; border: 0; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 10px; color: var(--muted); font-size: .68rem; text-decoration: none; font-weight: 500;
}
.bottom-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.bottom-nav .active { color: var(--navy); }
.bn-badge { position: absolute; top: 4px; right: 22%; background: var(--red); color: #fff; font-size: .6rem; font-weight: 800; min-width: 16px; height: 16px; border-radius: 9px; display: grid; place-items: center; }

/* Overlay + drawer */
.overlay { position: fixed; inset: 0; background: rgba(4,8,20,.55); backdrop-filter: blur(2px); z-index: 40; animation: fade .25s ease; }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 45;
  width: min(420px, 90vw); background: #fff; display: flex; flex-direction: column;
  transform: translateX(100%); transition: transform .3s cubic-bezier(.22,1,.36,1);
  box-shadow: -20px 0 50px -20px rgba(0,0,0,.4);
}
.cart-drawer.open { transform: translateX(0); }
.cd-head { display: flex; align-items: center; justify-content: space-between; padding: 18px; border-bottom: 1px solid var(--line); }
.cd-head h3 { font-size: 1.2rem; }
.ic-dark { width: 36px; height: 36px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; font-size: 1rem; }
.ic-dark:hover { color: var(--red); border-color: var(--red); }
.cd-items { flex: 1; overflow-y: auto; padding: 14px 18px; display: flex; flex-direction: column; gap: 12px; }
.cd-empty { color: var(--muted); text-align: center; margin: auto; }
.ci { display: grid; grid-template-columns: 64px 1fr auto; gap: 12px; align-items: center; animation: rise .25s ease; }
.ci-img { width: 64px; height: 64px; border-radius: 11px; object-fit: cover; background: #eef2f9; }
.ci-name { font-size: .88rem; font-weight: 600; line-height: 1.2; }
.ci-price { color: var(--muted); font-size: .8rem; margin-top: 2px; }
.ci-qty { display: inline-flex; align-items: center; gap: 9px; margin-top: 6px; }
.ci-qty button { width: 24px; height: 24px; border-radius: 7px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 1rem; line-height: 1; color: var(--ink); }
.ci-qty button:hover { border-color: var(--blue); color: var(--blue); }
.ci-line { text-align: right; font-family: "Sora", sans-serif; font-weight: 700; color: var(--navy); white-space: nowrap; }
.ci-remove { display: block; margin-top: 8px; background: none; border: 0; color: var(--muted); font-size: .74rem; cursor: pointer; }
.ci-remove:hover { color: var(--red); }
.cd-foot { padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.cd-row { display: flex; justify-content: space-between; color: var(--muted); padding: 3px 0; font-size: .9rem; }
.cd-total { color: var(--ink); font-size: 1rem; margin: 6px 0 12px; }
.cd-total b { font-family: "Sora", sans-serif; font-size: 1.4rem; color: var(--navy); }

/* Modales */
.modal { position: fixed; inset: 0; z-index: 60; background: rgba(4,8,20,.6); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .25s ease; }
.modal-card { position: relative; background: #fff; border-radius: 22px; padding: 26px 24px; width: 100%; max-width: 340px; text-align: center; box-shadow: 0 40px 80px -30px #000; }
.modal-card h3 { font-size: 1.3rem; margin-bottom: 4px; }
.modal-card > p { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.modal-close { position: absolute; top: 12px; right: 14px; width: 32px; height: 32px; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer; }
.modal-close:hover { color: var(--red); border-color: var(--red); }
.qr-box { width: 200px; height: 200px; margin: 0 auto 12px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.qr-box svg { width: 100%; height: 100%; }
.qr-amount { font-family: "Sora", sans-serif; font-size: 1.7rem; color: var(--navy); display: block; }
.qr-wait { display: block; color: var(--amber); font-size: .8rem; font-weight: 600; margin: 4px 0 16px; }
/* Detalle de producto: bottom-sheet en móvil */
.modal.sheet { align-items: flex-end; padding: 0; }
.sheet-card {
  position: relative; background: #fff; width: 100%; max-height: 92vh; overflow-y: auto;
  border-radius: 22px 22px 0 0; padding: 18px 18px calc(20px + env(safe-area-inset-bottom));
  animation: sheetUp .3s cubic-bezier(.22,1,.36,1);
}
@keyframes sheetUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.pd { display: flex; flex-direction: column; gap: 14px; }
.pd-media { position: relative; aspect-ratio: 1 / 1; border-radius: 16px; overflow: hidden; background: #eef2f9; max-height: 46vh; }
.pd-media img { width: 100%; height: 100%; object-fit: cover; }
.pd-info { display: flex; flex-direction: column; gap: 7px; }
.pd-info h3 { font-size: 1.4rem; }
.pd-desc { color: var(--muted); font-size: .9rem; }
.pd-feats { list-style: none; display: flex; flex-direction: column; gap: 5px; font-size: .84rem; color: var(--ink); margin: 4px 0; }
.pd-feats li { color: var(--green); }
.pd-qty { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 4px; font-weight: 600; }
.qsel { display: inline-flex; align-items: center; gap: 14px; background: #f1f4fa; border-radius: 12px; padding: 6px 10px; }
.qsel button { width: 32px; height: 32px; border-radius: 9px; border: 0; background: #fff; cursor: pointer; font-size: 1.2rem; line-height: 1; color: var(--navy); box-shadow: var(--shadow); }
.qsel span { min-width: 26px; text-align: center; font-size: 1.05rem; }

.ok-check { width: 76px; height: 76px; border-radius: 50%; margin: 0 auto 16px; display: grid; place-items: center; background: radial-gradient(circle, rgba(22,163,74,.18), transparent 70%); }
.ok-check svg { width: 44px; height: 44px; fill: none; stroke: var(--green); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw .5s .1s ease forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
  .ok-check svg { stroke-dashoffset: 0; }
}

/* ===== Tablet / Desktop ===== */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .trust { grid-template-columns: repeat(4, 1fr); }
  .hero { height: 440px; }
  .hero-in h1 { font-size: 2.6rem; }

  /* Detalle como modal centrado de 2 columnas */
  .modal.sheet { align-items: center; padding: 20px; }
  .sheet-card { max-width: 760px; border-radius: 22px; max-height: 88vh; padding: 26px; animation: fade .25s ease; }
  .pd { flex-direction: row; align-items: stretch; }
  .pd-media { flex: 1; max-height: none; }
  .pd-info { flex: 1; justify-content: center; }
}
@media (min-width: 900px) {
  body { padding-bottom: 0; }
  .bottom-nav { display: none; }
  .t-promo, .t-header, .t-search { padding-left: max(16px, calc((100vw - 1160px) / 2)); padding-right: max(16px, calc((100vw - 1160px) / 2)); }
  .cats, .section, .trust { max-width: 1160px; margin-inline: auto; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .hero { height: 520px; }
  .hero-in { max-width: 1160px; margin-inline: auto; padding-bottom: 48px; }
  .hero-in h1 { font-size: 3rem; }
}
