/* ==================================================
   BASE
================================================== */
:root{
  --halo-boost: 1.25; /* prueba 1.25 – 1.5 */
}

/* ==================================================
   CONTENIDO PRINCIPAL
================================================== */
.luminosidad-v16{
  background:#fff;
  border-radius:18px;
  padding:40px;
  box-shadow:0 18px 45px rgba(0,0,0,.08);
}

.lumi-header{
  max-width:900px;
  margin-bottom:35px;
}
.lumi-header h2{
  font-size:26px;
  font-weight:800;
  margin:0 0 10px;
}
.lumi-header .intro{
  font-size:15.5px;
  line-height:1.6;
  color:#475569;
  margin:0;
}

/* ==================================================
   CARRUSEL
================================================== */
.lumi-scroll{
  display:flex;
  gap:12px;
  overflow-x:auto;
  overflow-y:hidden;
  padding:25px 0 34px;
  margin-top:10px;
  border-top:1px solid #e5e7eb;
  border-bottom:1px solid #e5e7eb;
  -webkit-overflow-scrolling:touch;
}
.lumi-scroll::-webkit-scrollbar{ display:none; }

/* ==================================================
   TARJETAS — BASE ESTABLE (COMO AYER)
================================================== */
.lumi-card{
  position:relative;
  min-width:150px;
  height:230px;
  padding:16px 12px;
  border-radius:16px;
  text-align:center;
  background:linear-gradient(
  180deg,
  #e8f2ff 0%,
  #ffffff 65%
);
  border:2px solid rgba(0,0,0,.08);
  box-shadow:0 10px 26px rgba(0,0,0,.10);
  overflow:visible;
  transform:scale(1);
  transition:transform .25s ease;
}

/* ==================================================
   HALO REAL — FUERA DE LA TARJETA (CLAVE)
================================================== */
.baliza-img,
.lumi-card h4,
.lumi-card .cd,
.rating{
  position:relative;
  z-index:2;
}

.lumi-card{
  position:relative;
  isolation:isolate;   /* 🔑 CLAVE ABSOLUTA */
}

.lumi-card::before{
  content:"";
  position:absolute;
  inset:-26px;
  border-radius:26px;
  pointer-events:none;

  background:radial-gradient(
    circle at 50% 38%,
    rgba(255,245,130, calc((0.35 + 0.65 * var(--intensity)) * var(--halo-boost))) 0%,
    rgba(255,220,90,  calc((0.25 + 0.75 * var(--intensity)) * var(--halo-boost))) 35%,
    rgba(255,190,40,  calc((0.15 + 0.85 * var(--intensity)) * var(--halo-boost))) 55%,
    transparent 72%
  );

  filter:blur(
    calc(
      (12px + 26px * var(--intensity)) * var(--halo-boost)
    )
  );

  opacity:0;
  z-index:1;
}

.lumi-card:hover::before,
.lumi-card.active::before{
  opacity:1;
  animation:haloPulse .9s infinite;
}


/* ==================================================
   ANIMACIÓN
================================================== */
@keyframes haloPulse{
  0%{ opacity:.4 }
  45%{ opacity:1 }
  100%{ opacity:.4 }
}

/* ==================================================
   CONTENIDO TARJETA
================================================== */
.baliza-img{
  max-height:85px;
  margin:10px auto;
  border-radius:50%;
  display:block;
}

/* Animación de la imagen SOLO cuando hay halo */
.lumi-card:hover .baliza-img,
.lumi-card.active .baliza-img{
  animation:beaconImg .75s infinite steps(1,end);
}

/* TÍTULO: máximo 2 líneas */
.lumi-card h4{
  font-size:15px;
  font-weight:800;
  margin:0 0 6px;
  line-height:1.15;

  display:-webkit-box;
  -webkit-box-orient:vertical;
  -webkit-line-clamp:2;
  overflow:hidden;

  white-space:normal;
  word-break:break-word;
}

.lumi-card .cd{
  font-weight:800;
  font-size:13px;
  color:#334155;
}

/* Texto en noche */
.lumi-card.active h4,
.lumi-card.active .cd{
  color:#e5e7eb;
}

/* ==================================================
   RATING
================================================== */
.rating{
  margin-top:6px;
  font-size:14px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
}
.stars{ color:#f59e0b; }
.val{ color:#64748b; font-weight:800; font-size:13px; }
.lumi-card.active .val{ color:#cbd5e1; }

/* ==================================================
   ANIMACIONES
================================================== */
@keyframes beaconFlash{
  0%{ opacity:1; }
  50%{ opacity:0; }
  100%{ opacity:1; }
}
@keyframes beaconImg{
  0%{ filter:brightness(1.25); }
  50%{ filter:brightness(.9); }
  100%{ filter:brightness(1.25); }
}

/* ===============================
   MODO NOCHE (SOLO ACTIVE)
================================ */

/* fondo noche SOLO cuando está activa */
.lumi-card.active{
  background:radial-gradient(
    circle at center,
    #0b1d2d 0%,
    #020617 75%
  );
}

/* texto claro en noche */
.lumi-card.active h4,
.lumi-card.active .cd,
.lumi-card.active .val{
  color:#e5e7eb;
}



/* ==================================================
   BLOQUES RANKING
================================================== */
.ranking-grid{
  display:grid;
  grid-template-columns:1.2fr 1fr;
  gap:40px;
  margin-top:40px;
}

.titu{
  display:flex;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}
.step{
  background:#2563eb;
  color:#fff;
  font-size:13px;
  font-weight:900;
  padding:4px 8px;
  border-radius:6px;
}

.bloque-calidad h3,
.bloque-coste h3{
  font-size:18px;
  font-weight:900;
  margin:0;
}

.bloque-calidad p,
.bloque-coste p{
  font-size:14.5px;
  line-height:1.6;
  color:#475569;
}

/* ==================================================
   ESCUDOS RANKING
================================================== */
.rank-arrow{
  width:90px;
  height:55px;
  background:linear-gradient(135deg,#195b78,#0f4c5c);
  color:#fff;
  font-weight:800;
  font-size:.85rem;
  text-align:center;
  padding-top:6px;
  clip-path:polygon(0 0,100% 0,100% 75%,50% 100%,0 75%);
  flex-shrink:0;
}
.rank-arrow span{
  display:block;
  font-size:1.2rem;
}
.rank-arrow.gold{
  background:linear-gradient(135deg,#f97316,#fb923c);
}

/* ==================================================
   FUENTES
================================================== */
.fuentes{
  margin-top:26px;
  font-size:13px;
  color:#475569;
}
.fuentes ul{ margin:8px 0 0 18px; }

/* =====================================
   ENLACE "CÓMO SE CALCULA"
===================================== */
.ranking-more{
  margin-top:8px;
}

.ranking-more a{
  font-size:13px;
  font-weight:800;
  color:#f97316;
  text-decoration:none;
  cursor: pointer; /* Añadido para mejor UX */
}

.ranking-more a:hover{
  text-decoration:underline;
}

/* =====================================
   MODALES - ESTILOS ESENCIALES
===================================== */
.ranking-modal {
  /* IMPORTANTE: Estos estilos deben aplicarse */
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 20, 40, 0.85);
  z-index: 999999; /* Número alto para estar por encima de todo */
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
}

.ranking-modal-box {
  position: relative;
  max-width: 900px;
  width: 90%;
  max-height: 85vh;
  background: white;
  border-radius: 16px;
  padding: 30px;
  overflow-y: auto;
  box-shadow: 0 30px 70px rgba(0,0,0,0.45);
}

.ranking-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 24px;
  cursor: pointer;
  color: #0f4c5c;
  background: none;
  border: none;
  padding: 5px;
  z-index: 10;
}

.ranking-modal-close:hover {
  color: #f97316;
}

.ranking-modal-content{
  padding: 10px 0;
}

/* Estilos para el contenido de los modales */
.modal-ranking h2 {
  color: #0f4c5c;
  margin-top: 0;
  font-size: 24px;
}

.modal-ranking h3 {
  color: #195b78;
  margin-top: 25px;
  font-size: 20px;
}

.modal-ranking h4 {
  color: #2563eb;
  margin-top: 20px;
  font-size: 18px;
}

.modal-ranking table {
  width: 100%;
  border-collapse: collapse;
  margin: 15px 0;
}

.modal-ranking th, .modal-ranking td {
  padding: 10px;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
}

.modal-ranking th {
  background-color: #f8fafc;
  font-weight: 600;
}

.modal-ranking ul, .modal-ranking ol {
  padding-left: 20px;
  margin: 15px 0;
}

.modal-ranking li {
  margin-bottom: 8px;
}

.legal-note {
  font-style: italic;
  color: #64748b;
  border-left: 3px solid #f97316;
  padding-left: 15px;
  margin-top: 25px;
}

/* Tabla especial para TCO */
.tco-table {
  font-size: 14px;
}

.tco-table th {
  white-space: nowrap;
  font-size: 13px;
}

.tco-table td {
  font-size: 13px;
}

/* ===============================
   RANKING GRID: 50/50 real + mismo arranque
================================ */
.ranking-grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:32px;
  align-items:start;
}

.bloque-coste,
.bloque-calidad{
  min-width:0;
}

.bloque-coste .titu,
.bloque-calidad .titu{
  min-height:52px; /* fuerza mismo alto del título */
  display:flex;
  align-items:flex-start;
  gap:10px;
}

/* ===============================
   BOTONES
================================ */
.ranking-actions{
  margin:10px 0 6px;
}

.btn-primary{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:10px 14px;
  border-radius:12px;
  font-weight:800;
  text-decoration:none;
  border:1px solid rgba(15,23,42,.12);
  box-shadow:0 10px 18px rgba(0,0,0,.08);
  transition:transform .18s ease, box-shadow .18s ease;
}

.btn-primary:hover{
  transform:translateY(-1px);
  box-shadow:0 14px 22px rgba(0,0,0,.12);
}

/* variantes por bloque */
.bloque-coste .btn-primary{
  background:linear-gradient(180deg,#0b1d2d 0%, #0f2a40 100%);
  color:#fff;
}

.bloque-calidad .btn-primary{
  background:linear-gradient(180deg,#ff7a18 0%, #ff5a00 100%);
  color:#fff;
}

/* link del modal dentro del bloque ranking */
.ranking-more.inline{
  margin:0 0 6px;
}

.ranking-more.inline a{
  font-weight:800;
  text-decoration:none;
  border-bottom:1px solid rgba(0,0,0,.18);
  padding-bottom:2px;
}
/* =========================
   FILA BOTÓN + RANKING
========================= */
.ranking-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 14px 0 8px;
}

/* =========================
   BOTÓN TCO (AZUL)
========================= */
.btn-outline-blue {
  background: #ffffff;
  color: #0b4d6e;
  border: 2px solid #0b4d6e;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-outline-blue:hover {
  background: #0b4d6e;
  color: #ffffff;
}

/* =========================
   BOTÓN COMPARAR (NARANJA)
========================= */
.btn-outline-orange {
  background: #ffffff;
  color: #ff7a18;
  border: 2px solid #ff7a18;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.btn-outline-orange:hover {
  background: #ff7a18;
  color: #ffffff;
}

/* =========================
   ENLACES MODAL (INFO)
========================= */
.ranking-more a {
  color: #6b6b6b;
  font-size: 0.9rem;
  text-decoration: none;
  border-bottom: 1px dashed #bdbdbd;
}

.ranking-more a:hover {
  color: #000;
  border-bottom-color: #000;
}

.blnz-dual-header {
  text-align:center;
  max-width:900px;
  margin:0 auto 50px;
}

.blnz-dual-inner {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:48px;
}

/* === FIX CARRUSEL LUMINOSIDAD: SCROLL REAL === */
#lumiScroll{
  display:flex !important;
  flex-wrap:nowrap !important;
  gap:16px !important;

  overflow-x:auto !important;
  overflow-y:hidden !important;

  -webkit-overflow-scrolling:touch;
  scroll-behavior:smooth;

  padding:14px 10px !important;
}
#lumiScroll .lumi-card{
  flex:0 0 auto !important;
}

/* si algún padre está cortando el scroll */
#lumiScroll,
#lumiScroll *{
  pointer-events:auto !important;
}


.lumi-card {
  flex: 0 0 auto;   /* CRÍTICO */
}
/* ===== FIX SCROLL LUMINOSIDAD ===== */
#lumiScroll {
  overflow-x: auto !important;
  overflow-y: hidden !important;
  display: flex;
  gap: 12px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* Evita que padres bloqueen el scroll */
#lumiScroll,
#lumiScroll * {
  pointer-events: auto;
}

@media(max-width:900px){
  .blnz-dual-inner {
    grid-template-columns:1fr;
  }
}

.blnz-col img {
  width:100%;
  aspect-ratio: 4 / 3;
  object-fit:cover;
  border-radius:16px;
  margin-bottom:20px;
}

.blnz-col ul {
  padding-left:18px;
}

.blnz-col li {
  margin-bottom:14px;
}
/* Padres del carrusel NO deben cortar overflow */
.blzn-embed,
.blzn-item-body,
.blzn-col {
  overflow: visible !important;
}
/* Solo texto largo, no layout */
.blzn-col p,
.blzn-col li,
.blzn-col span {
  white-space: normal;
  overflow-wrap: break-word;
}

/* Responsive para modales */
@media (max-width: 768px){
  .ranking-modal-box{
    width: 95%;
    margin: 10px auto;
    padding: 20px 15px;
    max-height: 90vh;
  }
  
  .modal-ranking h2 {
    font-size: 20px;
  }
  
  .modal-ranking h3 {
    font-size: 18px;
  }
  
  .modal-ranking h4 {
    font-size: 16px;
  }
  
  .tco-table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
  }
}

@media (max-width: 480px){
  .ranking-modal-box{
    padding: 15px 12px;
    border-radius: 12px;
  }
}

/* ==================================================
   IFRAME (PADRE)
   ⛔ SIN ALTURAS ⛔ SIN OVERFLOW ⛔ SIN MEDIA QUERIES
================================================== */
#iframe-luminosidad{
  width:100%;
  border:0;
  display:block;
}

/* ==================================================
   RESPONSIVE
================================================== */
@media (max-width:768px){
  .luminosidad-v16{ padding:25px 20px; }
  .ranking-grid{ grid-template-columns:1fr; gap:30px; }
  .lumi-card{ min-width:135px; height:210px; }
}

@media (max-width:480px){
  .wrap{ padding:16px 12px 40px; }
  .luminosidad-v16{ padding:20px 16px; }
  .lumi-card{ min-width:120px; height:190px; }
}

#iframe-bottom-spacer{
  width:100%;
  height:220px;
}

@media (min-width:769px){
  #iframe-bottom-spacer{
    height:40px;
  }
}