/* ======================================================================
   Portal de descarga OrbiTV — pensado para control remoto (Android TV /
   Downloader), pero responsive para móvil y escritorio.
   ====================================================================== */

:root {
  --navy: #102030;
  --navy-deep: #0A0E14;
  --orange: #F06000;
  --orange-light: #FF7A1A;
  --cyan: #30B0D0;
  --surface: #131924;
  --surface-2: #1A2230;
  --border: #262F3F;
  --text: #EDF1F7;
  --text-dim: #97A2B5;
  --focus-ring: #30E0FF;
  --radius: 18px;
  --safe-zone: 4vw;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--navy-deep);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

body {
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(48,176,208,0.14), transparent 60%),
    radial-gradient(1200px 700px at 100% 0%, rgba(240,96,0,0.10), transparent 55%),
    var(--navy-deep);
  min-height: 100vh;
}

img { max-width: 100%; display: block; }

a { color: inherit; text-decoration: none; }

/* ---------- Topbar ---------- */
.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 20px var(--safe-zone);
}
.topbar-logo { width: 40px; height: 40px; border-radius: 10px; }
.topbar-name {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.back-link {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 600;
  color: var(--text-dim);
  border: 2px solid transparent;
}
.back-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.back-link:focus, .back-link:focus-visible {
  outline: none;
  color: var(--text);
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 4px rgba(48,224,255,0.35);
}
@media (max-width: 680px) {
  .back-link span, .back-link { font-size: 0.82rem; padding: 8px 10px; }
}

/* ---------- Layout ---------- */
.wrap {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 var(--safe-zone) 40px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(20px, 3vw, 34px);
}

.section-title {
  margin: 0 0 14px;
  font-size: clamp(1.15rem, 1.6vw, 1.4rem);
  font-weight: 700;
}

/* ---------- Store card ---------- */
.store-card {
  display: flex;
  gap: clamp(18px, 3vw, 34px);
  align-items: flex-start;
}

.app-icon {
  width: clamp(96px, 14vw, 168px);
  height: clamp(96px, 14vw, 168px);
  border-radius: 26px;
  flex-shrink: 0;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}

.store-info { flex: 1; min-width: 0; }

.app-name {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3.2vw, 2.4rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}

.badges { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.badge {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(240,96,0,0.16);
  color: var(--orange-light);
  border: 1px solid rgba(240,96,0,0.35);
}
.badge-outline {
  background: rgba(48,176,208,0.12);
  color: var(--cyan);
  border-color: rgba(48,176,208,0.35);
}

.meta-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0,1fr));
  gap: 14px;
  margin: 0 0 18px;
  max-width: 480px;
}
.meta-item dt {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  margin-bottom: 3px;
}
.meta-item dd {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.short-desc {
  color: var(--text-dim);
  font-size: 1.05rem;
  max-width: 60ch;
  margin: 0 0 24px;
}

/* ---------- Botones (grandes, pensados para control remoto) ---------- */
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 18px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 64px;
  padding: 0 32px;
  border-radius: 14px;
  font-size: 1.15rem;
  font-weight: 700;
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform 0.12s ease, filter 0.12s ease;
}
.btn-icon { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  color: #FFFFFF;
  box-shadow: 0 10px 24px rgba(240,96,0,0.35);
}
.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
}

.btn:hover { filter: brightness(1.08); }

.btn:focus,
.btn:focus-visible {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 4px rgba(48,224,255,0.35), 0 10px 24px rgba(0,0,0,0.35);
  transform: scale(1.035);
}

.unknown-sources-note {
  font-size: 0.92rem;
  color: var(--text-dim);
  max-width: 60ch;
  margin: 0;
}

/* ---------- Descripción / requisitos ---------- */
.full-desc { color: var(--text-dim); font-size: 1.02rem; max-width: 72ch; margin: 0; }

.req-list { margin: 0; padding-left: 1.3em; color: var(--text-dim); font-size: 1.02rem; }
.req-list li { margin-bottom: 8px; }
.req-list li:last-child { margin-bottom: 0; }

/* ---------- Footer ---------- */
.footer {
  max-width: 980px;
  margin: 10px auto 30px;
  padding: 0 var(--safe-zone);
  text-align: center;
  color: var(--text-dim);
  font-size: 0.85rem;
}
.footer-logo { width: 34px; height: 34px; border-radius: 8px; margin: 0 auto 10px; }
.footer p { margin: 4px 0; }
.footer-privacy { opacity: 0.75; }

/* ---------- Selector de dispositivo ---------- */
.selector-hero {
  text-align: center;
  max-width: 640px;
  margin: clamp(20px, 5vh, 60px) auto 8px;
}
.selector-icon { width: 88px; height: 88px; border-radius: 22px; margin: 0 auto 22px; box-shadow: 0 12px 30px rgba(0,0,0,0.35); }
.selector-title {
  font-size: clamp(1.7rem, 4vw, 2.5rem);
  font-weight: 800;
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}
.selector-subtitle { color: var(--text-dim); font-size: 1.05rem; margin: 0 0 40px; }

.device-grid {
  max-width: 1180px;
  margin: 0 auto 40px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.device-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 14px;
  padding: clamp(28px, 4vw, 40px) 22px;
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.device-icon {
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 18px;
  background: rgba(240,96,0,0.14);
  color: var(--orange-light);
}
.device-icon svg { width: 34px; height: 34px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.device-card:nth-child(2) .device-icon {
  background: rgba(48,176,208,0.14);
  color: var(--cyan);
}
.device-card:nth-child(3) .device-icon {
  background: rgba(240,96,0,0.14);
  color: var(--orange-light);
}
.device-card:nth-child(4) .device-icon {
  background: rgba(48,176,208,0.14);
  color: var(--cyan);
}
.device-card:nth-child(5) .device-icon {
  background: rgba(240,96,0,0.14);
  color: var(--orange-light);
}

.device-name { font-size: 1.3rem; font-weight: 800; margin: 0; }
.device-desc { color: var(--text-dim); font-size: 0.95rem; margin: 0; }

.device-cta {
  margin-top: 6px;
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--orange-light);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.device-card:nth-child(2) .device-cta { color: var(--cyan); }
.device-card:nth-child(3) .device-cta { color: var(--orange-light); }
.device-card:nth-child(4) .device-cta { color: var(--cyan); }
.device-card:nth-child(5) .device-cta { color: var(--orange-light); }
.device-cta svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.device-card:hover { border-color: var(--border); filter: brightness(1.05); }

.device-card:focus,
.device-card:focus-visible {
  outline: none;
  border-color: var(--focus-ring);
  box-shadow: 0 0 0 4px rgba(48,224,255,0.35), 0 10px 24px rgba(0,0,0,0.35);
  transform: scale(1.03);
}

@media (max-width: 1080px) {
  .device-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 620px) {
  .device-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
  .device-card { transition: none; }
  .device-card:focus, .device-card:focus-visible { transform: none; }
}

/* ---------- Panel de instrucciones ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(6,9,14,0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--safe-zone);
  z-index: 50;
}
.overlay[hidden] { display: none; }

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px);
  max-width: 560px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
}
.panel h2 { margin: 0 0 18px; font-size: 1.5rem; }

.steps { margin: 0 0 26px; padding-left: 1.4em; font-size: 1.05rem; }
.steps li { margin-bottom: 12px; }
.steps li:last-child { margin-bottom: 0; }

.btn-close { width: 100%; }

/* ---------- Responsive ---------- */
@media (max-width: 680px) {
  .store-card { flex-direction: column; align-items: center; text-align: center; }
  .meta-grid { max-width: none; }
  .actions { flex-direction: column; }
  .btn { width: 100%; }
  .short-desc, .unknown-sources-note { max-width: none; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .btn { transition: none; }
  .btn:focus, .btn:focus-visible { transform: none; }
}

/* ---------- Manual de instalación en Roku ---------- */
.roku-hero {
  display: flex;
  align-items: center;
  gap: clamp(18px, 3vw, 32px);
  flex-wrap: wrap;
}
.roku-hero-icon {
  width: 96px;
  height: 96px;
  border-radius: 22px;
  flex-shrink: 0;
  box-shadow: 0 12px 30px rgba(0,0,0,0.35);
}
.roku-hero-text { flex: 1; min-width: 240px; }
.roku-hero-title {
  margin: 10px 0 10px;
  font-size: clamp(1.35rem, 2.6vw, 1.9rem);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.roku-hero-sub { margin: 0; color: var(--text-dim); font-size: 1.02rem; max-width: 62ch; }

.roku-steps {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 22px;
}

.roku-step {
  display: flex;
  flex-direction: column;
  gap: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(18px, 2.6vw, 28px);
}

.roku-illus {
  width: 100%;
  max-width: 640px;
  margin: 0 auto;
}
.roku-illus img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
  box-shadow: 0 10px 26px rgba(0,0,0,0.35);
}

.roku-step-body { flex: 1; min-width: 0; position: relative; }
.roku-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(240,96,0,0.16);
  color: var(--orange-light);
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 10px;
}
.roku-step-body h2 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 800; }
.roku-step-lead { margin: 0 0 10px; color: var(--text-dim); font-size: 0.98rem; }
.roku-step-what { margin: 0 0 6px; font-size: 0.98rem; }
.roku-step-note {
  margin: 10px 0 0;
  font-size: 0.88rem;
  color: var(--cyan);
  padding-left: 12px;
  border-left: 3px solid rgba(48,176,208,0.4);
}

@media (max-width: 680px) {
  .roku-hero { flex-direction: column; text-align: center; }
}
