/* Liquid CPM Store — estilos comunes de la tienda (pensados primero para celular) */
:root {
  --bg: #ffffff;
  --surface: #ffffff;
  --surface-2: #f4f6fa;
  --line: #e3e8ef;
  --text: #0f172a;
  --muted: #64748b;
  --accent: #2563eb;
  --accent-strong: #1d4ed8;
  --accent-soft: #eff4ff;
  --hot: #e11d48;
  --green: #059669;
  --yellow: #b45309;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .05), 0 4px 14px rgba(15, 23, 42, .05);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { background: var(--bg); }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--text); min-height: 100vh; font-size: 15px; line-height: 1.45;
  background: var(--bg);
}
a { color: inherit; text-decoration: none; }
button { font: inherit; }
[hidden] { display: none !important; }
img { display: block; }

.test-banner { background: #fde68a; color: #422006; text-align: center; font-size: 12px; font-weight: 700; padding: 7px 12px; }

/* ---------- Encabezado ---------- */
.header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.header-in { max-width: 1180px; margin: 0 auto; height: 58px; padding: 0 16px; display: flex; align-items: center; gap: 12px; }
.logo { font-weight: 900; letter-spacing: 2.5px; font-size: 15px; white-space: nowrap; }
.logo b { color: var(--accent); font-weight: 900; }
.header-sp { flex: 1; }
.icon-btn { position: relative; width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--text); display: grid; place-items: center; cursor: pointer; }
.icon-btn svg { width: 20px; height: 20px; }
.cart-count { position: absolute; top: -5px; right: -5px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px; background: var(--hot); color: #fff; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

.wrap { max-width: 1180px; margin: 0 auto; padding: 0 16px 56px; }

/* ---------- Botones y campos ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 20px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-weight: 800; font-size: 14px; letter-spacing: .3px; cursor: pointer; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
@media (hover: hover) { .btn.primary:hover { background: var(--accent-strong); } .btn.outline:hover { background: var(--accent-soft); } }
.btn.primary:active { background: var(--accent-strong); }
.btn.outline { background: transparent; border-color: var(--accent); color: var(--accent); }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.input, .select, .textarea { width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--text); border-radius: 12px; padding: 0 14px; height: 48px; font: inherit; font-size: 15px; outline: none; }
.textarea { height: auto; min-height: 92px; padding: 12px 14px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.label { display: block; font-size: 12px; font-weight: 700; color: var(--muted); margin: 0 0 7px; letter-spacing: .3px; }
.hint { color: var(--muted); font-size: 12.5px; margin-top: 6px; }
.msg { border-radius: 12px; padding: 11px 14px; margin-top: 12px; font-size: 13.5px; }
.msg.err { background: #fff1f2; color: #be123c; border: 1px solid #fecdd3; }
.msg.warn { background: #fffbeb; color: #92400e; border: 1px solid #fde68a; }
.msg.ok { background: #ecfdf5; color: #047857; border: 1px solid #a7f3d0; }

/* ---------- Precios y etiquetas ---------- */
.price { font-weight: 800; }
.strike { text-decoration: line-through; color: var(--muted); font-weight: 600; font-size: .85em; margin-right: 6px; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 800; letter-spacing: .4px; text-transform: uppercase; padding: 4px 8px; border-radius: 8px; }
.tag.hot { background: var(--hot); color: #fff; }
.tag.dark { background: rgba(15,23,42,.78); color: #fff; }
.tag.low { background: #fff7ed; color: #c2410c; }
.tag.out { background: #f1f5f9; color: #475569; }
.tag.blue { background: var(--accent-soft); color: var(--accent-strong); }

/* ---------- Tarjetas de producto ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 720px) { .grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1000px) { .grid { grid-template-columns: repeat(4, 1fr); } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s, box-shadow .15s; box-shadow: var(--shadow); }
.card:active { transform: scale(.985); }
@media (hover: hover) { .card:hover { border-color: #bfd3fb; transform: translateY(-2px); box-shadow: 0 10px 28px rgba(37,99,235,.12); } }
.card.out { opacity: .55; }
.card-pic { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); }
.card-pic img { width: 100%; height: 100%; object-fit: cover; }
.card-pic .ph { position: absolute; inset: 0; display: grid; place-items: center; font-size: 38px; }
.card-tags { position: absolute; left: 8px; top: 8px; right: 8px; display: flex; gap: 5px; flex-wrap: wrap; }
.card-info { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card-name { font-weight: 700; font-size: 13.5px; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-price { margin-top: auto; font-size: 15px; color: var(--text); }
.card-price small { color: var(--muted); font-weight: 600; font-size: 11px; margin-right: 3px; }
@media (min-width: 720px) { .card-name { font-size: 14.5px; } .card-price { font-size: 16.5px; } }

.section-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 26px 0 12px; }
.section-title h2 { margin: 0; font-size: 18px; letter-spacing: .2px; }
.section-title a, .section-title span { color: var(--muted); font-size: 13px; }

.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.skeleton { background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: var(--radius); }
@keyframes sk { to { background-position: -200% 0; } }

/* ---------- Avisos flotantes ---------- */
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%) translateY(20px); opacity: 0; transition: .25s; background: #0f172a; border: 1px solid #0f172a; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 600; z-index: 100; display: flex; gap: 12px; align-items: center; box-shadow: 0 12px 40px rgba(15,23,42,.25); max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast a { color: #93c5fd; font-weight: 800; white-space: nowrap; }

.footer { border-top: 1px solid var(--line); background: var(--surface-2); margin-top: 40px; padding: 26px 16px 34px; text-align: center; color: var(--muted); font-size: 12.5px; line-height: 1.9; }
.footer a { color: var(--accent); font-weight: 600; }
