/* ==========================================================================
   PokéGrading Investor - TCG Analytics & Collector Stylesheet
   Incluye Mejora 1 (Horizontal Trending Chips) y Mejora 2 (One-Hand Mobile UX)
   ========================================================================== */

:root {
  --bg-base: #070b12;
  --bg-surface: #0e1525;
  --bg-surface-elevated: #141e33;
  --bg-input: #090e1a;
  
  --border-subtle: rgba(148, 163, 184, 0.14);
  --border-highlight: rgba(56, 189, 248, 0.35);
  
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  
  --accent-emerald: #10b981;
  --accent-emerald-glow: rgba(16, 185, 129, 0.22);
  --accent-gold: #f59e0b;
  --accent-gold-glow: rgba(245, 158, 11, 0.2);
  --accent-cyan: #38bdf8;
  --accent-purple: #a855f7;
  --accent-danger: #ef4444;
  
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 20px 45px -15px rgba(0, 0, 0, 0.65);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  scroll-padding-bottom: 6rem;
  color-scheme: dark;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-base);
  background-image:
    radial-gradient(circle at 12% 8%, rgba(16, 185, 129, 0.11), transparent 36%),
    radial-gradient(circle at 88% 14%, rgba(245, 158, 11, 0.09), transparent 34%),
    radial-gradient(circle at 50% 60%, rgba(56, 189, 248, 0.06), transparent 45%);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-inline: 1.5rem;
}

@media (max-width: 767px) {
  body {
    padding-bottom: 88px; /* Espacio para la Sticky Bottom Bar */
  }
  .container {
    padding-inline: 1rem;
  }
}

/* ==========================================================================
   1. Cabecera Principal (Hero Header)
   ========================================================================== */
.site-header {
  border-bottom: 1px solid var(--border-subtle);
  background: rgba(7, 11, 18, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 2rem 0 1.75rem;
}

.header-inner {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.brand-logo {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.14), rgba(245, 158, 11, 0.12));
  border: 1px solid rgba(245, 158, 11, 0.35);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  box-shadow: 0 0 25px rgba(16, 185, 129, 0.15);
}

.brand-logo svg {
  width: 34px;
  height: 34px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.eyebrow-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  color: var(--accent-emerald);
  text-transform: uppercase;
  margin-bottom: 0.2rem;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background-color: var(--accent-emerald);
  box-shadow: 0 0 10px var(--accent-emerald);
}

.site-title {
  font-family: var(--font-display);
  font-size: clamp(1.65rem, 3.2vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.15;
  background: linear-gradient(95deg, #ffffff 0%, #e2e8f0 55%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-subtitle {
  color: var(--text-secondary);
  font-size: 1rem;
  max-width: 78ch;
  line-height: 1.6;
}

.site-subtitle strong {
  color: var(--text-primary);
  font-weight: 600;
}

.main-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  padding-top: 0.25rem;
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0.42rem 0.9rem;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  border: 1px solid var(--border-subtle);
  background: rgba(20, 30, 51, 0.45);
  transition: all 0.2s ease;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
}

/* ==========================================================================
   Barra Fija Flotante en Scroll (Slide-Down sin alterar el flujo del DOM)
   ========================================================================== */
.floating-sticky-bar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  z-index: 150;
  background: rgba(7, 11, 18, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(245, 158, 11, 0.35);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.85);
  padding: 0.45rem 1rem;
  transform: translateY(-115%);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
}

.floating-sticky-bar.visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.floating-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  box-sizing: border-box;
}

.floating-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  text-decoration: none;
  color: inherit;
  flex-shrink: 0;
}

.floating-logo {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  background: linear-gradient(135deg, rgba(16, 185, 129, 0.15), rgba(245, 158, 11, 0.15));
  border: 1px solid rgba(245, 158, 11, 0.4);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.floating-logo svg {
  width: 20px;
  height: 20px;
}

.floating-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  background: linear-gradient(95deg, #ffffff 0%, #f59e0b 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.floating-card-changer {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

/* --- Botón Píldora de Selección de Carta en Header --- */
.header-card-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(20, 30, 51, 0.92) 0%, rgba(14, 21, 37, 0.98) 100%);
  border: 1px solid rgba(245, 158, 11, 0.45);
  color: var(--text-primary);
  cursor: pointer;
  font-family: var(--font-sans);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 320px;
}

.header-card-pill:hover {
  border-color: var(--accent-gold);
  background: linear-gradient(135deg, rgba(30, 42, 70, 0.95) 0%, rgba(18, 28, 48, 1) 100%);
  box-shadow: 0 4px 20px rgba(245, 158, 11, 0.3);
  transform: translateY(-1px);
}

.header-card-pill:active {
  transform: translateY(0);
}

.header-card-pill .pill-spark {
  font-size: 0.85rem;
  filter: drop-shadow(0 0 6px rgba(245, 158, 11, 0.6));
}

.header-card-pill .pill-label {
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--accent-gold);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.header-card-pill .pill-card-name {
  font-size: 0.84rem;
  font-weight: 600;
  color: #ffffff;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 170px;
}

.header-card-pill .pill-action-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: #070b12;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  padding: 0.16rem 0.5rem;
  border-radius: 999px;
  white-space: nowrap;
  margin-left: 0.1rem;
}

/* --- Botón Buscar Carta en Header --- */
.header-quick-search-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 36px;
  padding: 0.38rem 0.85rem;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
  color: var(--accent-cyan);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.header-quick-search-btn:hover {
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-cyan);
  box-shadow: 0 0 15px rgba(56, 189, 248, 0.25);
  transform: translateY(-1px);
}

/* --- Popover Flotante de Selección Rápida de Cartas (Quick Switcher) --- */
.header-quick-switcher {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 480px;
  max-width: calc(100vw - 2rem);
  background: rgba(12, 18, 32, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: var(--radius-md);
  box-shadow: 0 25px 60px -10px rgba(0, 0, 0, 0.9), 0 0 30px rgba(245, 158, 11, 0.15);
  z-index: 150;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  animation: quickSwitcherDrop 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

.header-quick-switcher[hidden] {
  display: none !important;
}

@keyframes quickSwitcherDrop {
  from {
    opacity: 0;
    transform: translateY(-10px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.quick-switcher-arrow {
  position: absolute;
  top: -7px;
  right: 90px;
  width: 13px;
  height: 13px;
  background: rgba(12, 18, 32, 0.98);
  border-top: 1px solid rgba(245, 158, 11, 0.45);
  border-left: 1px solid rgba(245, 158, 11, 0.45);
  transform: rotate(45deg);
}

.quick-switcher-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-subtle);
}

.quick-switcher-title {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.quick-switcher-close {
  background: transparent;
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s ease;
}

.quick-switcher-close:hover {
  border-color: var(--accent-danger);
  color: var(--accent-danger);
  background: rgba(239, 68, 68, 0.1);
}

.quick-search-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.quick-switcher-input {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: 0.88rem;
  padding: 0.65rem 0.8rem 0.65rem 2.25rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
  font-family: var(--font-sans);
}

.quick-switcher-input:focus {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.quick-switcher-spinner {
  right: 0.75rem;
}

.quick-switcher-results {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.4rem 0;
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
}

.quick-switcher-section-title {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-muted);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}

.quick-presets-chips-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 0.45rem;
  max-height: 210px;
  overflow-y: auto;
  padding-right: 0.2rem;
}

.quick-preset-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.15rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  transition: all 0.18s ease;
}

.quick-preset-chip:hover {
  border-color: rgba(245, 158, 11, 0.55);
  background: rgba(20, 30, 51, 0.85);
  transform: translateY(-1px);
}

.quick-preset-chip.active {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(245, 158, 11, 0.1));
  border-color: var(--accent-gold);
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}

.quick-chip-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: #ffffff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.quick-chip-sub {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  color: var(--accent-gold);
  opacity: 0.9;
}

.quick-switcher-footer {
  display: flex;
  justify-content: center;
  padding-top: 0.15rem;
}

.quick-switcher-scroll-up-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: transparent;
  border: none;
  color: var(--accent-cyan);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.2s ease;
  padding: 0.3rem 0.6rem;
  border-radius: 6px;
}

.quick-switcher-scroll-up-btn:hover {
  color: #ffffff;
  background: rgba(56, 189, 248, 0.1);
}

/* ==========================================================================
   MEJORA 1: Barra Deslizable Horizontal de "Cartas en Tendencia"
   ========================================================================== */
.main-content {
  padding-top: 1.5rem;
  padding-bottom: 4rem;
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.presets-bar {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: 1rem 1.2rem;
  background: linear-gradient(90deg, rgba(14, 21, 37, 0.92) 0%, rgba(20, 30, 51, 0.82) 100%);
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: var(--radius-md);
  box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.6);
}

.presets-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.presets-label {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}

.presets-swipe-hint {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--accent-gold);
  opacity: 0.85;
}

@media (min-width: 1100px) {
  .presets-swipe-hint {
    display: none;
  }
}

.preset-chips-scroller {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 0.2rem;
}

.preset-chips-scroller::-webkit-scrollbar {
  display: none;
}

.chip-btn {
  scroll-snap-align: start;
  flex: 0 0 auto;
  cursor: pointer;
  min-height: 48px;
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 0.12rem;
  font-family: var(--font-sans);
  text-align: left;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.5rem 1rem;
  border-radius: 999px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.chip-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

.chip-set {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.chip-btn:hover {
  border-color: rgba(245, 158, 11, 0.55);
  transform: translateY(-1px);
}

.chip-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #fbbf24 100%);
  border-color: transparent;
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.35);
}

.chip-btn.active .chip-name {
  color: #070b12;
  font-weight: 700;
}

.chip-btn.active .chip-set {
  color: rgba(7, 11, 18, 0.78);
  font-weight: 600;
}

/* Animación suave al rellenar campos con una píldora */
@keyframes presetPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.55);
    border-color: var(--accent-gold);
  }
  100% {
    box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
  }
}

.preset-updated .input-wrapper,
.preset-updated.results-panel {
  animation: presetPulse 0.65s ease-out;
}

/* ==========================================================================
   1.B Buscador Inteligente Híbrido (Scrydex API v1 + TCGdex v2 Fallback)
   ========================================================================== */
.api-search-bar-section {
  background: linear-gradient(180deg, rgba(20, 30, 51, 0.85) 0%, rgba(14, 21, 37, 0.96) 100%);
  border: 1px solid rgba(56, 189, 248, 0.32);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: 0 18px 40px -15px rgba(0, 0, 0, 0.7), 0 0 25px rgba(56, 189, 248, 0.08);
  position: relative;
  z-index: 40;
}

.search-top-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.search-title-group {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.api-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.search-main-label {
  font-family: var(--font-display);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-primary);
}

.search-header-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.search-lang-selector {
  display: inline-flex;
  align-items: center;
  background: rgba(14, 21, 37, 0.88);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}

.lang-pill {
  cursor: pointer;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.22rem 0.62rem;
  border-radius: 6px;
  transition: all 0.16s ease;
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  user-select: none;
}

.lang-pill:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.lang-pill.active {
  background: rgba(56, 189, 248, 0.16);
  border-color: rgba(56, 189, 248, 0.42);
  color: #38bdf8;
  box-shadow: 0 0 10px rgba(56, 189, 248, 0.2);
}

.lang-pill[data-lang="es"].active {
  background: rgba(245, 158, 11, 0.18);
  border-color: rgba(245, 158, 11, 0.45);
  color: #fbbf24;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.22);
}

.cache-status-pill {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.search-autocomplete-container {
  position: relative;
}

.search-input-wrapper {
  background: #060a13;
  border: 1.5px solid rgba(56, 189, 248, 0.38);
  border-radius: var(--radius-md);
  transition: all 0.2s ease;
}

.search-input-wrapper:focus-within {
  border-color: var(--accent-emerald);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.16);
}

.search-lupa-icon {
  color: var(--accent-cyan);
  margin-left: 1rem;
}

.search-input-wrapper input[type="search"] {
  font-size: 1rem;
  font-weight: 500;
  padding: 0.88rem 2.6rem 0.88rem 0.8rem;
}

.search-input-wrapper input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.clear-search-btn {
  cursor: pointer;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  margin-right: 0.75rem;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  flex-shrink: 0;
  transition: all 0.15s ease;
}

.clear-search-btn:hover {
  color: var(--text-primary);
  background: rgba(239, 68, 68, 0.2);
  border-color: rgba(239, 68, 68, 0.45);
}

.search-spinner {
  width: 18px;
  height: 18px;
  border: 2.2px solid rgba(56, 189, 248, 0.22);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  margin-right: 0.65rem;
  flex-shrink: 0;
  animation: spinLoader 0.7s linear infinite;
}

@keyframes spinLoader {
  to { transform: rotate(360deg); }
}

.search-dropdown {
  position: absolute;
  top: calc(100% + 0.55rem);
  left: 0;
  right: 0;
  background: rgba(11, 17, 30, 0.98);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(56, 189, 248, 0.42);
  border-radius: var(--radius-md);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.88);
  max-height: 430px;
  overflow-y: auto;
  z-index: 100;
  padding: 0.45rem;
}

.search-dropdown-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.4rem 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 0.3rem;
}

.search-result-item {
  width: 100%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.9rem;
  padding: 0.6rem 0.75rem;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  text-align: left;
  color: var(--text-primary);
  font-family: var(--font-sans);
  transition: all 0.16s ease;
}

.search-result-item:hover,
.search-result-item:focus-visible {
  background: rgba(56, 189, 248, 0.11);
  border-color: rgba(56, 189, 248, 0.35);
  outline: none;
}

.search-result-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  min-width: 0;
}

.search-result-thumb {
  width: 44px;
  height: 61px;
  object-fit: contain;
  border-radius: 5px;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.12);
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.search-result-info {
  display: flex;
  flex-direction: column;
  gap: 0.18rem;
  min-width: 0;
}

.search-result-name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.search-result-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.search-meta-lang {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.05rem 0.42rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  line-height: 1.3;
}

.search-meta-lang.lang-es {
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.16);
  border: 1px solid rgba(245, 158, 11, 0.38);
}

.search-meta-lang.lang-en {
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.32);
}

.search-meta-year {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  padding: 0.05rem 0.4rem;
  border-radius: 4px;
}

.search-meta-rarity {
  font-size: 0.7rem;
  color: var(--accent-cyan);
}

.search-result-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  flex-shrink: 0;
}

.search-result-price {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.12);
  border: 1px solid rgba(16, 185, 129, 0.32);
  padding: 0.22rem 0.55rem;
  border-radius: 6px;
}

.search-result-price-label {
  font-size: 0.65rem;
  color: var(--text-muted);
  margin-top: 0.15rem;
}

.search-empty-state {
  padding: 1.25rem 1rem;
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.5;
  text-align: left;
}

.search-empty-title {
  font-weight: 700;
  color: #f87171;
  margin-bottom: 0.65rem;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.search-empty-reasons {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.95rem;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.search-empty-reasons p {
  margin: 0 0 0.4rem 0;
  color: var(--text-primary);
  font-weight: 600;
}

.search-empty-reasons ul {
  margin: 0 0 0 1.2rem;
  padding: 0;
}

.search-empty-reasons li {
  margin-bottom: 0.35rem;
  line-height: 1.45;
}

.search-helper-hint {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 0.45rem;
  padding: 0 0.25rem;
  line-height: 1.4;
}

.search-helper-hint strong {
  color: var(--accent-cyan);
}


/* ==========================================================================
   2 & 3. Grid Principal de la Calculadora (Inputs + Carta Visual + Resultados)
   ========================================================================== */
.calculator-grid {
  display: grid;
  grid-template-columns: 1.18fr 1fr;
  gap: 1.5rem;
  align-items: start;
}

@media (max-width: 1080px) {
  .calculator-grid {
    grid-template-columns: 1fr;
  }
}

.inputs-and-showcase-layout {
  display: grid;
  grid-template-columns: 215px 1fr;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 720px) {
  .inputs-and-showcase-layout {
    grid-template-columns: 1fr;
  }
}

.selected-card-showcase {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.8rem;
  background: rgba(7, 11, 18, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 0.9rem;
}

.holo-card-wrapper {
  position: relative;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 63 / 88;
  border-radius: 12px;
  overflow: hidden;
  perspective: 900px;
  transform-style: preserve-3d;
  transition: transform 0.18s ease, box-shadow 0.25s ease;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.75), 0 0 18px rgba(56, 189, 248, 0.14);
  cursor: pointer;
}

.holo-card-wrapper:hover {
  transform: perspective(900px) rotateX(var(--rx, 4deg)) rotateY(var(--ry, -6deg)) scale(1.03);
  box-shadow:
    0 20px 42px rgba(0, 0, 0, 0.85),
    0 0 28px rgba(16, 185, 129, 0.32),
    0 0 42px rgba(245, 158, 11, 0.22);
}

.selected-card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  border-radius: 11px;
  background: #060911;
}

.holo-shine-layer {
  position: absolute;
  inset: 0;
  border-radius: 11px;
  pointer-events: none;
  opacity: 0;
  mix-blend-mode: color-dodge;
  background:
    radial-gradient(
      circle at var(--mx, 50%) var(--my, 50%),
      rgba(255, 255, 255, 0.55) 0%,
      rgba(56, 189, 248, 0.32) 25%,
      rgba(245, 158, 11, 0.26) 50%,
      rgba(168, 85, 247, 0.2) 72%,
      transparent 90%
    ),
    linear-gradient(
      125deg,
      transparent 20%,
      rgba(255, 255, 255, 0.22) 45%,
      rgba(56, 189, 248, 0.25) 50%,
      transparent 75%
    );
  transition: opacity 0.25s ease;
}

.holo-card-wrapper:hover .holo-shine-layer {
  opacity: 0.85;
}

.card-meta-tags {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
}

.meta-tag-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.4rem;
  padding: 0.36rem 0.55rem;
  background: rgba(14, 21, 37, 0.9);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  font-size: 0.72rem;
}

.meta-tag-label {
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  text-transform: uppercase;
}

.meta-tag-value {
  color: var(--text-primary);
  font-weight: 600;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 120px;
}

#card-meta-lang.lang-es {
  color: #fbbf24;
}

#card-meta-lang.lang-en {
  color: #38bdf8;
}

.meta-cardmarket-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 100%;
  padding: 0.44rem 0.6rem;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.32);
  text-decoration: none;
  transition: all 0.18s ease;
}

.meta-cardmarket-link:hover {
  color: #070b12;
  background: var(--accent-cyan);
  border-color: var(--accent-cyan);
}

.psa-estimation-box {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: var(--radius-sm);
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.psa-estimation-note {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.era-pill {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 700;
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.32);
  padding: 0.12rem 0.48rem;
  border-radius: 4px;
}

.ebay-sold-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  font-family: var(--font-sans);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  background: rgba(56, 189, 248, 0.13);
  border: 1px solid rgba(56, 189, 248, 0.38);
  text-decoration: none;
  transition: all 0.18s ease;
}

.ebay-sold-btn:hover {
  background: rgba(56, 189, 248, 0.24);
  border-color: var(--accent-cyan);
  transform: translateY(-1px);
}

.card-panel {
  background: linear-gradient(180deg, rgba(20, 30, 51, 0.72) 0%, rgba(14, 21, 37, 0.92) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.65rem;
  box-shadow: var(--shadow-card);
  position: relative;
  overflow: hidden;
}

@media (max-width: 767px) {
  .card-panel {
    padding: 1.2rem;
  }
}

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.95rem;
  border-bottom: 1px solid var(--border-subtle);
}

.panel-kicker {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  text-transform: uppercase;
  margin-bottom: 0.25rem;
}

.panel-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ghost-btn {
  cursor: pointer;
  min-height: 44px;
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.45rem 0.85rem;
  transition: all 0.2s ease;
}

.ghost-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.07);
}

/* ==========================================================================
   MEJORA 2.1: Formulario de Entradas + Controles One-Hand (48x48px + Sliders)
   ========================================================================== */
.roi-form {
  display: flex;
  flex-direction: column;
  gap: 1.35rem;
}

/* Regla de proximidad Gestalt: margen vertical label->input menor que entre grupos */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.price-control-group {
  background: rgba(7, 11, 18, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: var(--radius-md);
  padding: 0.9rem 1rem;
}

.field-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.field-hint {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--text-muted);
}

.field-badge {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.12);
  color: var(--accent-cyan);
}

.grade-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
}

.tag-psa10 {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tag-psa9 {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.35);
}

/* Fila con Input Numérico + Botones Rápidos (-5€, +5€, +50€) */
.one-hand-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

@media (max-width: 460px) {
  .one-hand-row {
    flex-wrap: wrap;
  }
  .one-hand-row .currency-input-wrapper {
    flex: 1 1 100%;
  }
  .one-hand-row .quick-step-btns {
    width: 100%;
    justify-content: space-between;
  }
  .one-hand-row .step-btn {
    flex: 1;
  }
}

.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1;
  min-height: 48px;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.input-wrapper:focus-within {
  border-color: var(--accent-cyan);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.15);
}

.input-wrapper.highlight-psa10:focus-within {
  border-color: var(--accent-gold);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.18);
}

.input-icon {
  margin-inline-start: 0.85rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* Font-size >= 1rem (16px) para evitar auto-zoom en iOS y facilitar lectura */
.input-wrapper input {
  width: 100%;
  min-height: 48px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1rem;
  padding: 0.65rem 0.85rem;
  outline: none;
}

@media (pointer: coarse) {
  .input-wrapper,
  .input-wrapper input {
    min-height: 52px;
  }
}

.currency-input-wrapper input {
  font-family: var(--font-mono);
  font-size: 1.12rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding-inline-end: 2.1rem;
}

.currency-suffix {
  position: absolute;
  right: 0.8rem;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-secondary);
  pointer-events: none;
}

/* Botones rápidos táctiles >= 48x48px */
.quick-step-btns {
  display: flex;
  align-items: center;
  gap: 0.38rem;
  flex-shrink: 0;
}

.step-btn {
  cursor: pointer;
  min-width: 48px;
  min-height: 48px;
  padding: 0 0.6rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-elevated);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  touch-action: manipulation;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s ease;
}

@media (pointer: coarse) {
  .step-btn {
    min-height: 52px;
    min-width: 52px;
  }
}

.step-btn:hover {
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.14);
}

.step-btn:active {
  transform: scale(0.95);
}

.step-btn-accent {
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.35);
  background: rgba(245, 158, 11, 0.1);
}

.step-btn-accent:hover {
  border-color: var(--accent-gold);
  background: rgba(245, 158, 11, 0.22);
}

/* Control deslizante táctil grueso (Slider) */
.slider-wrap {
  padding: 0.25rem 0 0.1rem;
  display: flex;
  align-items: center;
}

.touch-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    var(--slider-color, #38bdf8) 0%,
    var(--slider-color, #38bdf8) var(--slider-pct, 0%),
    rgba(148, 163, 184, 0.18) var(--slider-pct, 0%),
    rgba(148, 163, 184, 0.18) 100%
  );
  outline: none;
  cursor: pointer;
  touch-action: pan-y;
}

.touch-slider.slider-gold {
  --slider-color: #f59e0b;
}

.touch-slider.slider-purple {
  --slider-color: #a855f7;
}

.touch-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f8fafc;
  border: 3px solid var(--slider-color, #38bdf8);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
  cursor: grab;
  transition: transform 0.15s ease;
}

.touch-slider::-webkit-slider-thumb:active {
  transform: scale(1.18);
  cursor: grabbing;
}

.touch-slider::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #f8fafc;
  border: 3px solid var(--slider-color, #38bdf8);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.65);
  cursor: grab;
}

.touch-slider::-moz-range-track {
  background: transparent;
  height: 10px;
  border-radius: 999px;
  border: none;
}

.touch-slider::-moz-range-progress {
  background: transparent;
}

/* Botones rápidos de tarifa de grading */
.tier-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.tier-pill {
  cursor: pointer;
  min-height: 38px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  transition: all 0.15s ease;
}

.tier-pill:hover {
  color: var(--text-primary);
  border-color: var(--accent-cyan);
}

.tier-pill.active {
  color: var(--accent-cyan);
  border-color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.12);
}

.formula-note {
  margin-top: 1.15rem;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: rgba(56, 189, 248, 0.06);
  border: 1px solid rgba(56, 189, 248, 0.18);
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.formula-note svg {
  color: var(--accent-cyan);
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.formula-note code {
  font-family: var(--font-mono);
  color: var(--accent-cyan);
}

/* ==========================================================================
   3. Panel de Resultados Instantáneos
   ========================================================================== */
.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent-emerald);
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.3);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-emerald);
  animation: pulseGlow 2s infinite;
}

@keyframes pulseGlow {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.45; transform: scale(1.25); }
}

.kpi-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 640px) {
  .kpi-grid {
    grid-template-columns: 1fr;
  }
}

.kpi-card {
  background: rgba(9, 14, 26, 0.78);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.kpi-primary {
  border-color: rgba(245, 158, 11, 0.35);
  background: linear-gradient(145deg, rgba(245, 158, 11, 0.08) 0%, rgba(9, 14, 26, 0.85) 100%);
}

.kpi-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.slab-pill {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  letter-spacing: 0.04em;
}

.slab-gold {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.slab-cyan {
  background: rgba(56, 189, 248, 0.15);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.kpi-value-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.15rem;
}

.kpi-main-value {
  font-family: var(--font-mono);
  font-size: clamp(1.55rem, 2.5vw, 1.95rem);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.kpi-roi-badge {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  background: rgba(16, 185, 129, 0.18);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.kpi-roi-badge.negative {
  background: rgba(239, 68, 68, 0.18);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.35);
}

.kpi-multiplier {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.kpi-subtext {
  font-size: 0.77rem;
  color: var(--text-muted);
}

/* Strip comparativo PSA 9 & Spread */
.scenario-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.8rem 1.1rem;
  background: rgba(9, 14, 26, 0.6);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
}

@media (max-width: 640px) {
  .scenario-strip {
    flex-direction: column;
    align-items: flex-start;
  }
  .scenario-divider {
    display: none;
  }
}

.scenario-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex: 1;
  width: 100%;
}

.scenario-name {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.scenario-metrics {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  display: flex;
  gap: 0.35rem;
}

.scenario-divider {
  width: 1px;
  height: 22px;
  background: var(--border-subtle);
}

/* Semáforo de Riesgo / Recomendación Automática */
.semaphore-box {
  display: flex;
  align-items: center;
  gap: 1.15rem;
  padding: 1.15rem 1.25rem;
  border-radius: var(--radius-md);
  background: linear-gradient(
    135deg,
    hsla(var(--semaphore-hue, 152), 80%, 45%, 0.13) 0%,
    rgba(9, 14, 26, 0.9) 100%
  );
  border: 1px solid hsla(var(--semaphore-hue, 152), 80%, 50%, 0.42);
  margin-bottom: 1.15rem;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.semaphore-lights {
  display: flex;
  flex-direction: column;
  gap: 0.42rem;
  padding: 0.5rem;
  background: #060911;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  flex-shrink: 0;
}

.light {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  opacity: 0.22;
  transition: opacity 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.light-red { background-color: #ef4444; }
.light-amber { background-color: #f59e0b; }
.light-green { background-color: #10b981; }

.light.active {
  opacity: 1;
  transform: scale(1.1);
}

.light-red.active { box-shadow: 0 0 12px #ef4444; }
.light-amber.active { box-shadow: 0 0 12px #f59e0b; }
.light-green.active { box-shadow: 0 0 12px #10b981; }

.semaphore-content {
  flex: 1;
}

.semaphore-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.semaphore-tag {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: hsl(var(--semaphore-hue, 152), 85%, 62%);
}

.safety-cushion {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.05);
  padding: 0.12rem 0.5rem;
  border-radius: 4px;
}

.semaphore-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.2rem;
}

.semaphore-desc {
  font-size: 0.83rem;
  color: var(--text-secondary);
}

/* Barra de composición de capital */
.visual-meter-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.meter-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.capital-bar {
  display: flex;
  width: 100%;
  height: 26px;
  border-radius: 6px;
  overflow: hidden;
  background: #070b12;
  border: 1px solid var(--border-subtle);
}

.bar-segment {
  width: var(--seg-width, 33%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: #060911;
  overflow: hidden;
  white-space: nowrap;
  transition: width 0.3s ease;
}

.seg-raw {
  background: #38bdf8;
}

.seg-grading {
  background: #a855f7;
  color: #ffffff;
}

.seg-profit {
  background: #10b981;
}

/* ==========================================================================
   5.A Banner CTA Partners de Grading (Oculto temporalmente: sin partners)
   ========================================================================== */
#bloque-afiliacion,
.cta-partner-banner,
.sticky-send-btn,
#modal-partner-grading {
  display: none !important;
}

.cta-partner-banner {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  padding: 2rem;
  background: linear-gradient(125deg, rgba(16, 185, 129, 0.14) 0%, rgba(14, 21, 37, 0.96) 55%, rgba(245, 158, 11, 0.12) 100%);
  border: 1px solid rgba(16, 185, 129, 0.4);
  box-shadow: var(--shadow-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
}

@media (max-width: 900px) {
  .cta-partner-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 1.4rem;
  }
}

.cta-banner-content {
  max-width: 64ch;
}

.cta-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.partner-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.partner-badge.badge-insured {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.cta-banner-title {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2.2vw, 1.65rem);
  font-weight: 700;
  margin-bottom: 0.45rem;
}

.cta-banner-text {
  color: var(--text-secondary);
  font-size: 0.92rem;
}

.cta-banner-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.55rem;
  flex-shrink: 0;
}

.cta-primary-btn {
  cursor: pointer;
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  font-family: var(--font-sans);
  font-size: 0.94rem;
  font-weight: 700;
  color: #04130d;
  background: linear-gradient(135deg, #10b981 0%, #34d399 50%, #fbbf24 100%);
  border: none;
  border-radius: var(--radius-md);
  padding: 0.95rem 1.35rem;
  box-shadow: 0 10px 28px -6px rgba(16, 185, 129, 0.5);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.cta-primary-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px -6px rgba(16, 185, 129, 0.65);
}

.cta-microcopy {
  font-size: 0.76rem;
  color: var(--text-secondary);
}

.cta-microcopy code {
  font-family: var(--font-mono);
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
}

/* ==========================================================================
   4. Sección de Gráfico Histórico de Precios (12 Meses) + Modo Móvil Simplificado
   ========================================================================== */
.chart-section {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.text-accent {
  color: #fbbf24;
}

.chart-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-top: 0.25rem;
  max-width: 72ch;
}

.chart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.legend-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.series-toggle {
  cursor: pointer;
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  transition: all 0.18s ease;
}

.series-toggle.active {
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.24);
  background: rgba(255, 255, 255, 0.06);
}

.dot {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.dot-psa10 { background-color: #10b981; box-shadow: 0 0 8px #10b981; }
.dot-psa9 { background-color: #f59e0b; box-shadow: 0 0 8px #f59e0b; }
.dot-raw { background-color: #38bdf8; box-shadow: 0 0 8px #38bdf8; }

.timeframe-group {
  display: inline-flex;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2px;
}

.range-btn {
  cursor: pointer;
  min-height: 36px;
  min-width: 44px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  padding: 0.3rem 0.65rem;
  border-radius: 6px;
}

.range-btn.active {
  color: var(--text-primary);
  background: var(--bg-surface-elevated);
}

/* Leyenda compacta solo para móvil (<768px) */
.mobile-chart-legend {
  display: none;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.85rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-secondary);
  background: rgba(9, 14, 26, 0.6);
  padding: 0.55rem 0.8rem;
  border-radius: var(--radius-sm);
}

.mobile-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.mobile-touch-tip {
  margin-inline-start: auto;
  color: var(--accent-gold);
  font-size: 0.72rem;
}

@media (max-width: 767px) {
  .chart-controls .legend-pills {
    display: none; /* Ocultar leyendas secundarias en móvil */
  }
  .mobile-chart-legend {
    display: flex;
  }
}

.chart-canvas-container {
  position: relative;
  width: 100%;
  height: 360px;
}

@media (max-width: 767px) {
  .chart-canvas-container {
    height: 265px;
  }
}

.chart-stats-footer {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.85rem;
  padding-top: 0.5rem;
}

@media (max-width: 767px) {
  .chart-stats-footer {
    grid-template-columns: repeat(2, 1fr);
  }
}

.stat-pill {
  background: rgba(9, 14, 26, 0.65);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.stat-pill-label {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.stat-pill-val {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}

.stat-pill-val.positive {
  color: var(--accent-emerald);
}

/* ==========================================================================
   5.B Productos Recomendados de Protección (Afiliación Contextual)
   ========================================================================== */
.section-heading-block {
  margin-bottom: 1.5rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 2.4vw, 1.85rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.section-desc {
  color: var(--text-secondary);
  max-width: 75ch;
  font-size: 0.95rem;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.35rem;
}

@media (max-width: 960px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  background: linear-gradient(180deg, rgba(20, 30, 51, 0.7) 0%, rgba(11, 17, 30, 0.95) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.15rem;
  position: relative;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.product-card:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
}

.product-card.featured-product {
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 20px 45px -15px rgba(245, 158, 11, 0.15);
}

.product-badge {
  align-self: flex-start;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent-cyan);
  border: 1px solid rgba(56, 189, 248, 0.3);
}

.product-badge.badge-gold {
  background: rgba(245, 158, 11, 0.18);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.4);
}

.product-visual {
  height: 92px;
  border-radius: var(--radius-md);
  background: rgba(7, 11, 18, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.05);
  display: grid;
  place-items: center;
}

.product-visual svg {
  width: 64px;
  height: 64px;
}

.product-category {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.product-title {
  font-family: var(--font-display);
  font-size: 1.12rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.product-description {
  font-size: 0.86rem;
  color: var(--text-secondary);
  margin-bottom: 0.85rem;
}

.product-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.product-features li::before {
  content: "✓ ";
  color: var(--accent-emerald);
  font-weight: 700;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
}

.product-price-wrap {
  display: flex;
  flex-direction: column;
}

.price-label {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.product-price {
  font-family: var(--font-mono);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.affiliate-btn {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-primary);
  text-decoration: none;
  background: rgba(56, 189, 248, 0.14);
  border: 1px solid rgba(56, 189, 248, 0.4);
  padding: 0.6rem 0.95rem;
  border-radius: var(--radius-sm);
  transition: all 0.18s ease;
}

.affiliate-btn:hover {
  background: rgba(56, 189, 248, 0.25);
}

.affiliate-btn-gold {
  color: #070b12;
  background: linear-gradient(135deg, #f59e0b, #fbbf24);
  border-color: transparent;
}

.affiliate-btn-gold:hover {
  background: linear-gradient(135deg, #fbbf24, #fcd34d);
}

/* ==========================================================================
   6.A Sección FAQ con <details> y <summary> Nativos
   ========================================================================== */
.faq-accordion-group {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.faq-item {
  background: rgba(14, 21, 37, 0.85);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: border-color 0.2s ease;
}

.faq-item[open] {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(20, 30, 51, 0.88);
}

.faq-question {
  cursor: pointer;
  list-style: none;
  padding: 1.15rem 1.35rem;
  font-family: var(--font-display);
  font-size: 1.02rem;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  user-select: none;
}

.faq-question::-webkit-details-marker {
  display: none;
}

/* Indicador direccional explícito (cumpliendo guía HTML para <summary>) */
.faq-question::after {
  content: "+";
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--accent-cyan);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.3);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  transition: transform 0.2s ease, background 0.2s ease;
}

.faq-item[open] .faq-question::after {
  content: "−";
  color: #fbbf24;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.4);
}

.faq-answer {
  padding: 0 1.35rem 1.25rem;
  color: var(--text-secondary);
  font-size: 0.92rem;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  padding-top: 0.95rem;
}

.faq-answer ul {
  margin-top: 0.65rem;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.faq-answer strong {
  color: var(--text-primary);
}

/* ==========================================================================
   5.1, 5.2 & 5.3 Bloque Documental de Autoridad (Anti Thin-Content AdSense)
   ========================================================================== */
.authority-docs-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2.25rem;
}

/* Optimización de renderizado bajo el pliegue inicial (defer-rendering-heavy-content) */
.doc-block {
  content-visibility: auto;
  contain-intrinsic-size: auto none auto 520px;
}

.guide-article {
  padding: 2rem;
  background: linear-gradient(180deg, rgba(16, 24, 42, 0.92) 0%, rgba(10, 16, 29, 0.98) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
}

@media (max-width: 640px) {
  .guide-article {
    padding: 1.35rem;
  }
}

.guide-lead {
  color: var(--text-secondary);
  font-size: 0.96rem;
  line-height: 1.65;
  max-width: 82ch;
}

.guide-lead strong {
  color: var(--text-primary);
}

/* Grid de pasos 5.2 Mini-Guía 1 */
.guide-steps-grid {
  list-style: none;
  padding: 0;
  margin: 1.5rem 0 0;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .guide-steps-grid {
    grid-template-columns: 1fr;
  }
}

.guide-step-card {
  background: rgba(8, 13, 24, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.guide-step-card:hover {
  border-color: rgba(56, 189, 248, 0.4);
  transform: translateY(-2px);
}

.step-badge-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.step-number {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: #34d399;
  background: rgba(16, 185, 129, 0.15);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
}

.step-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.25);
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
}

.step-title {
  font-family: var(--font-display);
  font-size: 1.06rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.35;
}

.step-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.step-text strong,
.step-sublist strong {
  color: var(--text-primary);
}

.step-sublist {
  margin: 0.25rem 0 0;
  padding-left: 1.2rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

/* ==========================================================================
   Comparativa 5.3 Mini-Guía 2 (PSA vs BGS vs CGC): Grid de Tarjetas ROI
   ========================================================================== */
.grading-comparison-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.company-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.95) 0%, rgba(8, 13, 24, 0.98) 100%);
  border-radius: var(--radius-md);
  padding: 1.4rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.company-card:hover {
  transform: translateY(-3px);
}

.company-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
}

/* Colores de marca y bordes visibles directos (esenciales para móviles) */
.company-card-psa {
  border: 1.5px solid rgba(239, 68, 68, 0.45);
  box-shadow: 0 4px 20px -6px rgba(239, 68, 68, 0.18);
}
.company-card-psa::before {
  background: linear-gradient(90deg, #ef4444, #f87171);
}
.company-card-psa:hover {
  border-color: rgba(239, 68, 68, 0.7);
  box-shadow: 0 12px 30px -10px rgba(239, 68, 68, 0.35);
}

.company-card-bgs {
  border: 1.5px solid rgba(245, 158, 11, 0.45);
  box-shadow: 0 4px 20px -6px rgba(245, 158, 11, 0.18);
}
.company-card-bgs::before {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}
.company-card-bgs:hover {
  border-color: rgba(245, 158, 11, 0.7);
  box-shadow: 0 12px 30px -10px rgba(245, 158, 11, 0.35);
}

.company-card-cgc {
  border: 1.5px solid rgba(56, 189, 248, 0.45);
  box-shadow: 0 4px 20px -6px rgba(56, 189, 248, 0.18);
}
.company-card-cgc::before {
  background: linear-gradient(90deg, #06b6d4, #38bdf8);
}
.company-card-cgc:hover {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 12px 30px -10px rgba(56, 189, 248, 0.35);
}

.company-card-header {
  margin-bottom: 1.15rem;
}

.company-badge-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.company-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  padding: 0.2rem 0.6rem;
  border-radius: 6px;
  letter-spacing: 0.05em;
}

.badge-psa {
  background: rgba(239, 68, 68, 0.16);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.4);
}

.badge-bgs {
  background: rgba(245, 158, 11, 0.16);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.4);
}

.badge-cgc {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.company-tagline {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-subtle);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

.company-fullname {
  font-family: var(--font-display);
  font-size: 0.96rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.35;
}

.company-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  padding: 0.75rem 0.85rem;
  background: rgba(7, 11, 20, 0.7);
  border: 1px solid rgba(148, 163, 184, 0.08);
  border-radius: 8px;
  margin-bottom: 1.1rem;
}

.company-stat-item {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.company-stat-item .stat-label {
  font-family: var(--font-mono);
  font-size: 0.64rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.company-stat-item .stat-value {
  font-family: var(--font-mono);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
  white-space: nowrap;
}

.company-roi-verdict {
  margin-top: auto;
  padding: 0.9rem;
  background: rgba(15, 23, 42, 0.6);
  border-radius: 8px;
  border-left: 3px solid;
}

.company-card-psa .company-roi-verdict {
  border-left-color: #ef4444;
}

.company-card-bgs .company-roi-verdict {
  border-left-color: #f59e0b;
}

.company-card-cgc .company-roi-verdict {
  border-left-color: #38bdf8;
}

.verdict-header {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.company-card-psa .verdict-header svg {
  color: #f87171;
}

.company-card-bgs .verdict-header svg {
  color: #fbbf24;
}

.company-card-cgc .verdict-header svg {
  color: #38bdf8;
}

.verdict-text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

.verdict-text strong {
  color: var(--text-primary);
  font-weight: 600;
}

@media (max-width: 768px) {
  .grading-comparison-grid {
    display: flex;
    flex-direction: column;
    gap: 1.6rem;
    margin-top: 1.25rem;
  }

  .company-card {
    padding: 1.35rem 1.15rem;
    border-radius: 14px;
  }

  .company-stats-grid {
    padding: 0.85rem 1rem;
    margin-bottom: 1.15rem;
  }

  .company-roi-verdict {
    padding: 1rem;
  }
}

/* ==========================================================================
   6.B Footer (Aviso Legal y Política de Privacidad)
   ========================================================================== */
.site-footer {
  border-top: 1px solid var(--border-subtle);
  background: #05080e;
  padding: 2.75rem 0 2rem;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--border-subtle);
}

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
  }
}

.footer-brand-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.footer-disclaimer {
  font-size: 0.82rem;
  color: var(--text-muted);
  max-width: 65ch;
}

.footer-col-title {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.footer-links-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.footer-link-btn {
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.86rem;
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.25rem 0;
}

.footer-link-btn:hover {
  color: #fbbf24;
}

.footer-bottom {
  padding-top: 1.25rem;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* ==========================================================================
   MEJORA 2.2: Barra Inferior Fija (Sticky Bottom Bar en Móvil <768px)
   ========================================================================== */
.mobile-sticky-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: rgba(8, 13, 24, 0.94);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(56, 189, 248, 0.32);
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.75);
  padding: 0.65rem 1rem;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

@media (max-width: 767px) {
  .mobile-sticky-bar {
    display: flex;
  }
}

.sticky-bar-info {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-width: 0;
  flex: 1;
  cursor: pointer;
  border-radius: var(--radius-sm);
  padding: 0.2rem 0.35rem;
  transition: background-color 0.2s ease;
}

.sticky-bar-info:hover,
.sticky-bar-info:focus-visible {
  background: rgba(255, 255, 255, 0.05);
  outline: none;
}

.sticky-card-line {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.sticky-card-change-hint {
  font-size: 0.64rem;
  font-weight: 700;
  color: #070b12;
  background: var(--accent-gold);
  padding: 0.08rem 0.38rem;
  border-radius: 4px;
  line-height: 1.2;
}

.sticky-semaphore-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 8px rgba(16, 185, 129, 0.4));
}

.sticky-metrics {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sticky-card-mini {
  font-size: 0.68rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 767px) {
  .site-header {
    padding: 1.5rem 0 1.25rem;
  }
  .brand-logo {
    width: 44px;
    height: 44px;
  }
  .brand-logo svg {
    width: 28px;
    height: 28px;
  }
  .site-title {
    font-size: 1.45rem;
  }
  .floating-sticky-bar {
    padding: 0.35rem 0.6rem;
  }
  .floating-title {
    font-size: 0.88rem;
  }
  .header-card-pill {
    max-width: 160px;
    padding: 0.3rem 0.55rem;
  }
  .header-card-pill .pill-card-name {
    font-size: 0.76rem;
    max-width: 85px;
  }
  .header-card-pill .pill-action-tag {
    font-size: 0.62rem;
    padding: 0.1rem 0.35rem;
  }
  .header-quick-search-btn {
    padding: 0.3rem 0.5rem;
  }
  .header-quick-search-btn .header-search-btn-text {
    display: none;
  }
  .header-quick-switcher {
    top: calc(100% + 6px);
    right: 0.5rem;
    left: 0.5rem;
    width: auto;
    max-width: none;
    padding: 0.95rem;
  }
  .quick-switcher-arrow {
    right: 50px;
  }
  .quick-presets-chips-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 380px) {
  .floating-title {
    display: none;
  }
}

.sticky-profit-text {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sticky-profit-text strong {
  color: #34d399;
}

.sticky-profit-text.negative strong {
  color: #f87171;
}

.sticky-send-btn {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 0.95rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #10b981 0%, #fbbf24 100%);
  color: #04130d;
  font-family: var(--font-sans);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.4);
}

/* ==========================================================================
   Modales Nativos <dialog>
   ========================================================================== */
.app-dialog {
  margin: auto;
  width: min(92vw, 600px);
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.85);
}

.app-dialog::backdrop {
  background: rgba(4, 7, 13, 0.78);
  backdrop-filter: blur(6px);
}

.dialog-content {
  padding: 1.65rem;
}

.dialog-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 1.15rem;
}

.dialog-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.dialog-close-btn {
  cursor: pointer;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.dialog-close-btn:hover {
  color: var(--text-primary);
  border-color: var(--text-secondary);
}

.dialog-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.partner-options-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.partner-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
}

.partner-option strong {
  color: var(--text-primary);
  display: block;
}

.partner-option p {
  font-size: 0.8rem;
}

.dialog-input {
  width: 100%;
  min-height: 48px;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-size: 1rem;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.legal-copy p {
  margin-bottom: 0.6rem;
}

.legal-copy strong {
  color: var(--text-primary);
}

/* Toast Notification */
.app-toast {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 95;
  background: #0e1726;
  color: var(--text-primary);
  border: 1px solid var(--accent-emerald);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.65);
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  max-width: 380px;
}

@media (max-width: 767px) {
  .app-toast {
    bottom: 5.5rem;
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

/* ==========================================================================
   SISTEMA COMPLETO DE MONETIZACIÓN (VÍA 1, VÍA 2 Y VÍA 3)
   ========================================================================== */

/* Layout Principal con Soporte para Sticky Sidebar en Escritorio (>1024px) */
.container {
  max-width: 1420px;
}

.page-layout-shell {
  display: block;
}

.desktop-sticky-sidebar {
  display: none;
}

@media (min-width: 1025px) {
  .page-layout-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 300px;
    gap: 1.75rem;
    align-items: start;
  }

  .desktop-sticky-sidebar {
    display: block;
    width: 300px;
    position: sticky;
    top: 1.5rem;
    padding-top: 1.75rem;
  }
}

/* Cabecera del Panel de Resultados con Píldora de Ventas eBay (AFFILIATE_CONFIG.ebayCampId) */
.panel-header-right {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  flex-wrap: wrap;
}

.ebay-comps-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--accent-cyan);
  background: rgba(56, 189, 248, 0.1);
  border: 1px solid rgba(56, 189, 248, 0.32);
  padding: 0.28rem 0.65rem;
  border-radius: 999px;
  text-decoration: none;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.ebay-comps-pill:hover {
  color: var(--text-primary);
  background: rgba(56, 189, 248, 0.22);
  border-color: var(--accent-cyan);
}

/* ==========================================================================
   VÍA 1: CTA Dinámico de Afiliación con Intermediarios de Grading
   - .cta-emerald (ROI > 30%): Borde brillante Esmeralda
   - .cta-blue (ROI <= 30%): Borde brillante Azul
   ========================================================================== */
.cta-partner-banner {
  transition: border-color 0.3s ease, box-shadow 0.3s ease, background 0.3s ease;
}

.cta-partner-banner.cta-emerald {
  border: 1.5px solid rgba(16, 185, 129, 0.65);
  background: linear-gradient(
    125deg,
    rgba(16, 185, 129, 0.16) 0%,
    rgba(14, 21, 37, 0.96) 55%,
    rgba(245, 158, 11, 0.12) 100%
  );
  box-shadow:
    0 0 28px rgba(16, 185, 129, 0.22),
    inset 0 0 20px rgba(16, 185, 129, 0.06);
}

.cta-partner-banner.cta-blue {
  border: 1.5px solid rgba(56, 189, 248, 0.65);
  background: linear-gradient(
    125deg,
    rgba(56, 189, 248, 0.16) 0%,
    rgba(14, 21, 37, 0.96) 55%,
    rgba(59, 130, 246, 0.14) 100%
  );
  box-shadow:
    0 0 28px rgba(56, 189, 248, 0.22),
    inset 0 0 20px rgba(56, 189, 248, 0.06);
}

.cta-partner-banner.cta-blue .partner-badge {
  background: rgba(56, 189, 248, 0.18);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.45);
}

.cta-partner-banner.cta-blue .partner-badge.badge-insured {
  background: rgba(96, 165, 250, 0.16);
  color: #93c5fd;
  border-color: rgba(96, 165, 250, 0.4);
}

.cta-primary-btn {
  text-decoration: none;
}

.cta-partner-banner.cta-blue .cta-primary-btn {
  color: #04101f;
  background: linear-gradient(135deg, #38bdf8 0%, #60a5fa 55%, #93c5fd 100%);
  box-shadow: 0 10px 28px -6px rgba(56, 189, 248, 0.48);
}

.cta-partner-banner.cta-blue .cta-primary-btn:hover {
  box-shadow: 0 14px 32px -6px rgba(56, 189, 248, 0.65);
}

/* ==========================================================================
   VÍA 2: Grid de 4 Tarjetas Compactas de Amazon ("Kit de Preparación PSA")
   ========================================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.1rem;
}

@media (max-width: 1200px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: 1fr;
  }
}

.product-card {
  padding: 1.25rem;
  gap: 1rem;
}

.product-card-top {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.product-visual {
  height: 78px;
}

.product-visual svg {
  width: 54px;
  height: 54px;
}

.product-title {
  font-size: 1rem;
  line-height: 1.35;
  margin-bottom: 0;
}

.product-description {
  font-size: 0.82rem;
  line-height: 1.5;
  margin-bottom: 0;
}

.product-badge.badge-emerald {
  background: rgba(16, 185, 129, 0.16);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.product-badge.badge-cyan {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
  border: 1px solid rgba(56, 189, 248, 0.4);
}

.product-badge.badge-purple {
  background: rgba(168, 85, 247, 0.16);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.4);
}

.product-footer {
  padding-top: 0.85rem;
}

.product-footer .affiliate-btn {
  width: 100%;
  justify-content: center;
}

/* ==========================================================================
   VÍA 3: Espacios Reservados para Google AdSense (Optimización RPM y CLS = 0)
   ========================================================================== */
.ad-slot-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  width: 100%;
}

.ad-slot-label {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  user-select: none;
}

.ad-slot-box {
  width: 100%;
  background: rgba(9, 14, 26, 0.62);
  border: 1px dashed rgba(148, 163, 184, 0.18);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 0.75rem;
  overflow: hidden;
}

.ad-placeholder-text {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: rgba(148, 163, 184, 0.45);
  line-height: 1.45;
}

/* 1. Leaderboard Horizontal (728x90 en escritorio / 320x100 en móvil) encima de FAQ */
.ad-box-leaderboard {
  max-width: 728px;
  min-height: 90px;
}

@media (max-width: 767px) {
  .ad-box-leaderboard {
    max-width: 320px;
    min-height: 100px;
  }
}

/* 2. Bloque Adaptable (In-Content) entre Kit de Preparación de Amazon y FAQ */
.ad-box-incontent {
  min-height: 250px;
}

/* 3. Banner Lateral Fijo (Sticky Sidebar 300x250) exclusivo en escritorio (>1024px) */
.ad-box-sidebar {
  width: 300px;
  min-height: 250px;
}

/* ==========================================================================
   BANNER DE CONSENTIMIENTO DE COOKIES (RGPD / DARK FINTECH)
   ========================================================================== */
.cookie-banner {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  max-width: 460px;
  width: calc(100% - 3rem);
  z-index: 1000;
  background: rgba(14, 21, 37, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(56, 189, 248, 0.28);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.8), 0 0 25px rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.cookie-banner[hidden] {
  display: none !important;
}

.cookie-banner.closing {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

.cookie-banner-content {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.cookie-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cookie-icon {
  font-size: 1.75rem;
  line-height: 1;
  filter: drop-shadow(0 2px 8px rgba(245, 158, 11, 0.3));
}

.cookie-title-group {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cookie-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--accent-cyan);
  text-transform: uppercase;
}

.cookie-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.25;
}

.cookie-desc {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--text-secondary);
  margin: 0;
}

.cookie-inline-link {
  background: none;
  border: none;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
  color: var(--accent-cyan);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  display: inline;
  transition: color 0.2s ease;
}

.cookie-inline-link:hover {
  color: var(--text-primary);
}

.cookie-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.75rem;
  padding-top: 0.35rem;
}

.cookie-btn {
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  padding: 0.55rem 1.05rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cookie-btn-ghost {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.cookie-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.25);
}

.cookie-btn-primary {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
  color: #ffffff;
  border: 1px solid rgba(16, 185, 129, 0.5);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.28);
}

.cookie-btn-primary:hover {
  background: linear-gradient(135deg, #34d399 0%, #10b981 100%);
  box-shadow: 0 6px 18px rgba(16, 185, 129, 0.42);
  transform: translateY(-1px);
}

@media (max-width: 767px) {
  .cookie-banner {
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding: 1.15rem 1rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
    z-index: 1000;
  }

  .cookie-actions {
    flex-direction: column-reverse;
    gap: 0.5rem;
  }

  .cookie-btn {
    width: 100%;
    padding: 0.75rem 1rem;
    text-align: center;
  }
}


