/* viajatech.xyz — obsidiana + aurora tech. Mobile-first, ES/EN, dark siempre. */

/* Fuentes self-hosted (variables): cero requests a terceros, CSP 'self' */
@font-face {
  font-family: 'Sora';
  font-style: normal;
  font-weight: 600 800;
  font-display: swap;
  src: url('/fonts/sora-var.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 600;
  font-display: swap;
  src: url('/fonts/inter-var.woff2') format('woff2');
}

:root {
  --bg: #05070c;
  --bg-2: #0a0f1a;
  --panel: rgba(255, 255, 255, 0.035);
  --panel-2: rgba(255, 255, 255, 0.06);
  --line: rgba(255, 255, 255, 0.09);
  --line-2: rgba(255, 255, 255, 0.16);
  --text: #eef3fb;
  --dim: #96a7bf;
  --cyan: #37e0ff;
  --violet: #8b5cf6;
  --magenta: #f472b6;
  --amber: #fbbf24;
  --green: #34d399;
  --red: #fb7185;
  --grad: linear-gradient(120deg, var(--cyan), var(--violet) 55%, var(--magenta));
  --radius: 18px;
  --font-d: 'Sora', system-ui, sans-serif;
  --font-t: 'Inter', system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-t);
  font-size: 15.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}
::selection { background: rgba(139, 92, 246, 0.45); }
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
h1, h2, h3, h4, .price { font-family: var(--font-d); }

/* Fondo aurora fijo */
.bg-aurora {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background:
    radial-gradient(42% 34% at 12% 4%, rgba(55, 224, 255, 0.10), transparent 70%),
    radial-gradient(46% 38% at 88% 10%, rgba(139, 92, 246, 0.12), transparent 70%),
    radial-gradient(50% 42% at 50% 108%, rgba(244, 114, 182, 0.07), transparent 70%),
    var(--bg);
}

.wrap { width: min(1180px, 100% - 2rem); margin-inline: auto; }
.main { flex: 1; padding-bottom: 4rem; }
.dim { color: var(--dim); }
.sm-txt { font-size: 0.82rem; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 40;
  background: rgba(5, 7, 12, 0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.hdr-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.7rem 0; }
.brand { display: flex; align-items: center; gap: 0.6rem; }
.logo { width: 34px; height: 34px; flex: none; }
.brand-name {
  font-family: var(--font-d); font-weight: 800; letter-spacing: 0.06em; font-size: 1.02rem;
  display: flex; flex-direction: column; line-height: 1.05;
}
.brand-name b {
  background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-name em { font: 500 0.62rem var(--font-t); letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); font-style: normal; }
.hdr-actions { display: flex; align-items: center; gap: 0.55rem; }
.lang-pill {
  font: 600 0.72rem var(--font-d); letter-spacing: 0.12em; padding: 0.32rem 0.6rem;
  border: 1px solid var(--line-2); border-radius: 999px; color: var(--dim); transition: 0.18s;
}
.lang-pill:hover { color: var(--text); border-color: var(--cyan); }
.icon-btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--panel); transition: 0.18s;
}
.icon-btn:hover { border-color: var(--line-2); background: var(--panel-2); }
.icon-btn svg { width: 20px; height: 20px; }
.cart-count {
  position: absolute; top: -6px; right: -6px; min-width: 18px; height: 18px; padding: 0 4px;
  background: var(--grad); border-radius: 999px; font: 700 0.66rem var(--font-d);
  display: flex; align-items: center; justify-content: center; color: #04060a;
}

/* Tabs */
.tabs-nav { border-top: 1px solid transparent; }
.tabs-in { display: flex; gap: 0.25rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 0.55rem; }
.tabs-in::-webkit-scrollbar { display: none; }
.tab {
  flex: none; padding: 0.38rem 0.95rem; border-radius: 999px; font: 600 0.84rem var(--font-t);
  color: var(--dim); border: 1px solid transparent; transition: 0.18s; position: relative;
}
.tab:hover { color: var(--text); }
.tab.active {
  color: var(--text); border-color: var(--line-2); background: var(--panel-2);
  box-shadow: 0 0 18px rgba(139, 92, 246, 0.18);
}
.tab-admin { color: var(--amber); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  font: 600 0.88rem var(--font-t); padding: 0.62rem 1.15rem; border-radius: 12px;
  border: 1px solid var(--line-2); background: var(--panel); transition: 0.18s;
  white-space: nowrap;
}
.btn:hover { background: var(--panel-2); border-color: rgba(255, 255, 255, 0.28); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn.primary {
  background: var(--grad); border: 0; color: #04060a; font-weight: 700;
  box-shadow: 0 4px 24px rgba(139, 92, 246, 0.35);
}
.btn.primary:hover { filter: brightness(1.1); box-shadow: 0 6px 30px rgba(139, 92, 246, 0.5); }
.btn.ghost { background: transparent; }
.btn.solid { background: var(--panel-2); }
.btn.danger { border-color: rgba(251, 113, 133, 0.4); color: var(--red); }
.btn.danger:hover { background: rgba(251, 113, 133, 0.1); }
.btn.sm { padding: 0.38rem 0.75rem; font-size: 0.78rem; border-radius: 10px; }
.btn.lg { padding: 0.8rem 1.6rem; font-size: 0.98rem; border-radius: 14px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

/* ---------- Hero ---------- */
.hero { position: relative; padding: 4.5rem 0 3.5rem; text-align: center; overflow: hidden; }
#stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.hero-in { position: relative; }
.hero-title {
  font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.08;
  background: linear-gradient(120deg, #fff 30%, var(--cyan) 55%, var(--violet) 75%, var(--magenta));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-sub { max-width: 34rem; margin: 1rem auto 1.6rem; color: var(--dim); font-size: 1.05rem; }
.hero-cta { margin-bottom: 1.6rem; }
.trust { display: flex; flex-wrap: wrap; gap: 0.5rem 1.4rem; justify-content: center; color: var(--dim); font-size: 0.82rem; }
.trust-left { justify-content: flex-start; margin-top: 1.2rem; }

/* ---------- Catálogo ---------- */
.catalog { padding-top: 1rem; }
.catalog-page { padding-top: 2rem; }
.section-title {
  font-size: 1.5rem; font-weight: 700; margin: 1.6rem 0 1.1rem; display: flex; align-items: center; gap: 0.7rem;
}
.section-title::before { content: ''; width: 22px; height: 4px; border-radius: 4px; background: var(--grad); }
.section-title.sm { font-size: 1.1rem; margin-top: 2.2rem; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 1.1rem; }

.card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  display: flex; flex-direction: column;
}
.card:hover {
  transform: translateY(-4px); border-color: rgba(139, 92, 246, 0.5);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.45), 0 0 24px rgba(139, 92, 246, 0.12);
}
.card-media { position: relative; aspect-ratio: 16/10; background: var(--bg-2); overflow: hidden; }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.35s; }
.card:hover .card-media img { transform: scale(1.04); }
.badge {
  position: absolute; top: 10px; left: 10px; font: 700 0.64rem var(--font-d);
  letter-spacing: 0.1em; text-transform: uppercase; padding: 0.26rem 0.6rem; border-radius: 999px;
  backdrop-filter: blur(6px); border: 1px solid;
}
.type-video { color: var(--cyan); background: rgba(55, 224, 255, 0.12); border-color: rgba(55, 224, 255, 0.35); }
.type-ebook { color: #b7a4ff; background: rgba(139, 92, 246, 0.16); border-color: rgba(139, 92, 246, 0.4); }
.type-imagen { color: var(--magenta); background: rgba(244, 114, 182, 0.13); border-color: rgba(244, 114, 182, 0.4); }
.type-articulo { color: var(--amber); background: rgba(251, 191, 36, 0.12); border-color: rgba(251, 191, 36, 0.4); }
.chip-dur {
  position: absolute; bottom: 10px; right: 10px; font: 600 0.7rem var(--font-t);
  background: rgba(4, 6, 10, 0.72); padding: 0.2rem 0.55rem; border-radius: 8px; backdrop-filter: blur(4px);
}
.card-body { padding: 0.9rem 1rem 1rem; display: flex; flex-direction: column; gap: 0.65rem; flex: 1; }
.card-title { font-size: 0.98rem; font-weight: 600; line-height: 1.35; }
.card-title a:hover { color: var(--cyan); }
.card-foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.card-actions { display: inline-flex; gap: 0.4rem; }
.price { font-weight: 700; font-size: 1.02rem; }
.price.xl { font-size: 1.7rem; }
.owned-tag a { color: var(--green); font: 600 0.8rem var(--font-t); }
.card.is-owned .card-actions { display: none; }
.card.is-owned .owned-tag { display: block; }

.empty-state {
  text-align: center; padding: 3.5rem 1rem; color: var(--dim);
  border: 1px dashed var(--line-2); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
.empty-orb {
  width: 64px; height: 64px; border-radius: 50%;
  background: radial-gradient(circle at 32% 30%, rgba(55, 224, 255, 0.5), rgba(139, 92, 246, 0.35) 55%, transparent 75%);
  filter: blur(1px); animation: float 5s ease-in-out infinite;
}
@keyframes float { 50% { transform: translateY(-8px); } }

/* ---------- Producto ---------- */
.crumbs { padding: 1.2rem 0 0.4rem; color: var(--dim); font-size: 0.82rem; }
.crumbs a:hover { color: var(--cyan); }
.product { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 2.2rem; padding-top: 1rem; }
.product-media { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); align-self: start; }
.product-media img { width: 100%; }
.product-info h1 { font-size: clamp(1.4rem, 3.4vw, 2.1rem); font-weight: 700; letter-spacing: -0.01em; line-height: 1.2; }
.product-price { display: flex; align-items: baseline; gap: 0.6rem; margin: 0.9rem 0 0.3rem; }
.product-meta { font-size: 0.88rem; margin-bottom: 0.4rem; }
.product-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin: 1.2rem 0 0.4rem; }
.owned-note { color: var(--green); font-weight: 600; margin-top: 0.4rem; }
.product-desc { margin-top: 1.4rem; color: #c6d2e4; display: flex; flex-direction: column; gap: 0.8rem; }

/* ---------- Drawer carrito ---------- */
.drawer { position: fixed; inset: 0; z-index: 60; }
.drawer-bg, .modal-bg { position: absolute; inset: 0; background: rgba(2, 4, 8, 0.65); backdrop-filter: blur(3px); }
.drawer-panel {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(400px, 94vw);
  background: #0b101b; border-left: 1px solid var(--line-2);
  display: flex; flex-direction: column; animation: slideIn 0.22s ease;
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line); }
.drawer-head h3 { font-size: 1.05rem; }
.drawer-items { flex: 1; overflow-y: auto; padding: 0.6rem 1.2rem; display: flex; flex-direction: column; gap: 0.7rem; }
.cart-item { display: grid; grid-template-columns: 64px 1fr auto; gap: 0.7rem; align-items: center; padding: 0.55rem; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.cart-item img { width: 64px; height: 44px; object-fit: cover; border-radius: 8px; }
.cart-item .ci-title { font-size: 0.84rem; font-weight: 600; line-height: 1.3; }
.cart-item .ci-price { font-size: 0.8rem; color: var(--dim); }
.ci-remove { color: var(--dim); font-size: 1rem; padding: 0.3rem; }
.ci-remove:hover { color: var(--red); }
.drawer-foot { padding: 1rem 1.2rem 1.3rem; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.7rem; }
.cart-total-row { display: flex; justify-content: space-between; font-family: var(--font-d); font-size: 1.05rem; }
.cart-empty-msg { text-align: center; color: var(--dim); padding: 2.5rem 0; }

/* ---------- Modales ---------- */
.modal { position: fixed; inset: 0; z-index: 70; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.modal-panel {
  position: relative; width: min(420px, 100%); background: #0b101b; border: 1px solid var(--line-2);
  border-radius: 20px; padding: 1.6rem; animation: pop 0.2s ease; max-height: 92dvh; overflow-y: auto;
}
.modal-wide { width: min(680px, 100%); }
@keyframes pop { from { transform: scale(0.96); opacity: 0; } }
.modal-x { position: absolute; top: 0.8rem; right: 0.8rem; }
.auth-tabs { display: flex; gap: 0.4rem; margin-bottom: 1.1rem; }
.auth-tab { flex: 1; padding: 0.55rem; border-radius: 10px; border: 1px solid var(--line); color: var(--dim); font-weight: 600; }
.auth-tab.active { color: var(--text); background: var(--panel-2); border-color: var(--line-2); }
form label { display: flex; flex-direction: column; gap: 0.3rem; margin-bottom: 0.85rem; font-size: 0.82rem; color: var(--dim); }
form label span { font-weight: 600; }
input, select, textarea {
  font: 500 0.92rem var(--font-t); color: var(--text); background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line-2); border-radius: 10px; padding: 0.6rem 0.75rem; outline: none; transition: 0.18s;
  width: 100%;
}
input:focus, select:focus, textarea:focus { border-color: var(--violet); box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.22); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.check-row { flex-direction: row !important; align-items: center; gap: 0.5rem !important; }
.check-row input { width: auto; }
.form-actions { display: flex; gap: 0.6rem; margin-top: 0.4rem; flex-wrap: wrap; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 1.2rem; left: 50%; transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; gap: 0.5rem; align-items: center; width: min(94vw, 480px); }
.toast {
  background: #101725; border: 1px solid var(--line-2); border-radius: 12px; padding: 0.65rem 1.1rem;
  font-size: 0.86rem; box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5); animation: pop 0.2s ease; text-align: center;
}
.toast.ok { border-color: rgba(52, 211, 153, 0.5); }
.toast.err { border-color: rgba(251, 113, 133, 0.5); }

/* ---------- Player ---------- */
.player-page { padding-top: 1.4rem; }
.player-wrap {
  position: relative; background: #000; border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line-2); display: flex; justify-content: center;
}
.player-wrap video { width: 100%; max-height: 74dvh; background: #000; }
.wm {
  position: absolute; top: 8%; left: 8%; pointer-events: none; user-select: none;
  font: 600 0.72rem var(--font-d); letter-spacing: 0.08em; color: rgba(255, 255, 255, 0.30);
  text-shadow: 0 0 6px rgba(0, 0, 0, 0.6); transition: top 1.6s ease, left 1.6s ease; z-index: 5;
}
.player-title { margin-top: 1.1rem; font-size: 1.4rem; }
.is-player .main { max-width: 940px; }

/* ---------- Páginas varias ---------- */
.page-narrow { max-width: 640px; margin-inline: auto; padding-top: 1.6rem; }
.center-col { display: flex; flex-direction: column; align-items: center; gap: 1rem; text-align: center; padding-top: 3rem; }
.success-orb {
  width: 84px; height: 84px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font: 800 1.6rem var(--font-d); color: #04060a; background: var(--grad);
  box-shadow: 0 0 50px rgba(139, 92, 246, 0.45);
}
.success-orb.pending { background: linear-gradient(120deg, var(--amber), var(--magenta)); }
.success-orb.fail { background: linear-gradient(120deg, var(--red), var(--violet)); color: #fff; font-size: 1.2rem; }
.success-orb.lock { background: var(--panel-2); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }
.unlock-list { list-style: none; width: 100%; display: flex; flex-direction: column; gap: 0.6rem; margin: 0.6rem 0; }
.unlock-item {
  display: grid; grid-template-columns: 72px 1fr auto; gap: 0.8rem; align-items: center;
  background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 0.6rem; text-align: left;
}
.unlock-item img { width: 72px; height: 48px; object-fit: cover; border-radius: 8px; }

.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.88rem; min-width: 480px; }
.table th { text-align: left; font: 600 0.72rem var(--font-d); letter-spacing: 0.08em; text-transform: uppercase; color: var(--dim); padding: 0.75rem 1rem; border-bottom: 1px solid var(--line-2); }
.table td { padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); }
.table tr:last-child td { border-bottom: 0; }
.status { font: 600 0.72rem var(--font-t); padding: 0.2rem 0.6rem; border-radius: 999px; }
.status-paid { color: var(--green); background: rgba(52, 211, 153, 0.12); }
.status-pending { color: var(--amber); background: rgba(251, 191, 36, 0.12); }
.status-failed { color: var(--red); background: rgba(251, 113, 133, 0.12); }

.cart-page-items { display: flex; flex-direction: column; gap: 0.7rem; margin-bottom: 1.2rem; }
.cart-page-foot { max-width: 380px; display: flex; flex-direction: column; gap: 0.8rem; }

.legal p { margin-bottom: 0.9rem; color: #c6d2e4; }

/* ---------- Admin ---------- */
.stats-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0.9rem; margin-bottom: 1.4rem; }
.stat {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1rem 1.2rem; display: flex; flex-direction: column; gap: 0.2rem;
}
.stat span { font: 700 1.4rem var(--font-d); background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.stat label { font-size: 0.74rem; color: var(--dim); text-transform: uppercase; letter-spacing: 0.1em; }
.admin-toolbar { margin-bottom: 1rem; display: flex; gap: 0.6rem; }
.upload-box { display: flex; flex-direction: column; gap: 0.4rem; margin-bottom: 0.85rem; font-size: 0.82rem; color: var(--dim); }
.upload-box > span { font-weight: 600; }
.upload-status { font-size: 0.76rem; word-break: break-all; }
.upload-status.ok { color: var(--green); }
.progress { height: 8px; border-radius: 99px; background: var(--panel-2); overflow: hidden; }
.progress-bar { height: 100%; width: 0%; background: var(--grad); border-radius: 99px; transition: width 0.2s; }
.row-actions { display: flex; gap: 0.4rem; }
.pub-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 0.4rem; }
.pub-on { background: var(--green); box-shadow: 0 0 8px var(--green); }
.pub-off { background: var(--dim); }

/* ---------- Footer ---------- */
.ftr { border-top: 1px solid var(--line); background: rgba(255, 255, 255, 0.015); margin-top: 3rem; }
.ftr-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding: 2.4rem 0 1.4rem; }
.ftr-col { display: flex; flex-direction: column; gap: 0.5rem; align-items: flex-start; }
.ftr-col h4 { font-size: 0.8rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--dim); margin-bottom: 0.3rem; }
.ftr-col a { color: var(--dim); font-size: 0.88rem; transition: 0.15s; }
.ftr-col a:hover { color: var(--cyan); }
.brand-foot { display: flex; align-items: center; gap: 0.5rem; font: 800 1rem var(--font-d); letter-spacing: 0.06em; }
.brand-foot .logo { width: 26px; height: 26px; }
.brand-foot b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ftr-trust { padding: 0 0 1.6rem; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .product { grid-template-columns: 1fr; gap: 1.4rem; }
  .ftr-in { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .hero { padding: 3rem 0 2.4rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 0.8rem; }
  .card-actions .add-cart { display: none; } /* en móvil: comprar desde la página del producto */
  .drawer-panel { top: auto; height: min(82dvh, 100%); width: 100%; border-left: 0; border-top: 1px solid var(--line-2); border-radius: 20px 20px 0 0; animation: slideUp 0.24s ease; }
  @keyframes slideUp { from { transform: translateY(40px); opacity: 0; } }
  .form-grid { grid-template-columns: 1fr; }
  .ftr-in { grid-template-columns: 1fr; }
  .modal { padding: 0.6rem; align-items: flex-end; }
  .modal-panel { max-height: 88dvh; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
