:root{
  /* Layout */
  --pl-radius: 14px;
  --pl-radius-sm: 12px;
  --pl-shadow: 0 6px 18px rgba(0,0,0,.08);
  --pl-border: 1px solid rgba(0,0,0,.08);

  /* Colors */
  --pl-bg: #fff;
  --pl-soft: rgba(0,0,0,.04);
  --pl-soft-2: rgba(0,0,0,.06);
  --pl-text: rgba(0,0,0,.85);
  --pl-muted: rgba(0,0,0,.8);
  --pl-muted-2: rgba(0,0,0,.55);

  /* Brand / States */
  --pl-blue: rgba(0,123,255,1);
  --pl-blue-soft: rgba(0,123,255,.10);
  --pl-blue-soft-hover: rgba(0,123,255,.16);

  --pl-green: #28a745;
  --pl-green-soft: rgba(40,167,69,.12);

  --pl-red: #dc3545;

  --pl-yellow: #ffc107;

  /* “igual” (azul claro) */
  --pl-equal: #0da6f0;
  --pl-equal-soft: rgba(13,166,240,.12);

  /* Chart legend colors */
  --pl-valle: rgba(40, 167, 69, 0.7);
  --pl-llano: rgba(255, 193, 7, 0.7);
  --pl-punta: rgba(220, 53, 69, 0.7);
}

/* ========================================
   PANELS (comparativa + chart)
   ======================================== */
.precio-luz-container,
.precio-luz-chart-container{
  background: var(--pl-bg);
  border: var(--pl-border);
  border-radius: var(--pl-radius);
  padding: 18px;
  margin: 20px 0;
  box-shadow: var(--pl-shadow);
  width: 100%;
  font-family: var(--e-global-typography-087b2df-font-family), Sans-serif;
  color: var(--pl-text);
}

.precio-luz-container{
  max-width: 420px;
}

/* Borde superior dinámico (comparativa) */
.precio-luz-container.precio-luz-baja{ border-top: 4px solid var(--pl-green); }
.precio-luz-container.precio-luz-sube{ border-top: 4px solid var(--pl-red); }
.precio-luz-container.precio-luz-igual{ border-top: 4px solid var(--pl-equal); }
/* opcional: cuando no hay datos de ayer */
.precio-luz-container.precio-luz-sin_datos{ border-top: 4px solid var(--pl-yellow); }

/* Comparativa cabecera */
.precio-luz-comparativa{
  text-align:center;
  margin-bottom: 14px;
  padding: 10px 12px;
  border-radius: var(--pl-radius-sm);
  background: var(--pl-soft);
}

.precio-luz-tendencia{
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .4px;
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--pl-soft-2);
  margin-bottom: 8px;
}

.precio-luz-diferencia{
  font-size: 14px;
  color: var(--pl-muted);
  display:block;
}

/* Estados (texto) */
.precio-luz-baja{ color: var(--pl-green); }
.precio-luz-sube{ color: var(--pl-red); }
.precio-luz-igual{ color: var(--pl-equal); }

/* Si quieres que el badge tenga fondo sutil por estado */
.precio-luz-tendencia.precio-luz-baja{ background: var(--pl-green-soft); }
.precio-luz-tendencia.precio-luz-sube{ background: rgba(220,53,69,.12); }
.precio-luz-tendencia.precio-luz-igual{ background: var(--pl-equal-soft); }

/* Precio actual / promedio */
.precio-luz-actual,
.precio-luz-promedio{
  display:flex;
  justify-content:space-between;
  align-items:baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

.precio-luz-actual{
  border-bottom: 2px solid rgba(0,123,255,.35);
  padding-bottom: 12px;
  margin-bottom: 10px;
}

.precio-luz-label{
  font-size: 15px;
  color: var(--pl-muted);
}

.precio-luz-valor{
  font-size: 22px;
  font-weight: 800;
  color: var(--pl-text);
}

/* Última actualización */
.precio-luz-actualizado{
  font-size: 13px;
  color: var(--pl-muted-2);
  text-align: center;
  margin-top: 10px;
  font-style: italic;
}

/* Error */
.precio-luz-error{
  background: #fff3cd;
  border: 1px solid #ffc107;
  color: #856404;
  padding: 15px;
  border-radius: 8px;
  margin: 20px 0;
}

/* ========================================
   CHART
   ======================================== */
.precio-luz-date-selector{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  background: var(--pl-soft);
  border-radius: var(--pl-radius-sm);
}

.precio-luz-nav-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  height: 40px;
  min-width: 40px;
  padding: 0 12px;
  background: var(--pl-blue-soft);
  color: var(--pl-blue);
  text-decoration:none;
  border-radius: 10px;
  font-weight: 800;
  font-size: 15px;
  transition: transform .15s ease, background .15s ease;
}

.precio-luz-nav-btn:hover:not(.disabled){
  background: var(--pl-blue-soft-hover);
  transform: translateY(-1px);
}

.precio-luz-nav-btn.disabled{
  opacity: .45;
  cursor: not-allowed;
  pointer-events: none;
}

.precio-luz-nav-hoy{
  background: var(--pl-green-soft);
  color: var(--pl-green);
}

.precio-luz-date-title{
  font-size: 16px;
  font-weight: 800;
  color: var(--pl-text);
}

.precio-luz-date-badge{
  background: var(--pl-green-soft);
  color: var(--pl-green);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .4px;
}

.precio-luz-chart-wrapper{
  position: relative;
  height: 350px;
  width: 100%;
  border-radius: var(--pl-radius-sm);
}

.precio-luz-chart-legend{
  display:flex;
  justify-content:center;
  gap: 14px;
  margin-top: 14px;
  flex-wrap:wrap;
}

.precio-luz-legend-item{
  display:flex;
  align-items:center;
  gap: 8px;
  font-size: 14px;
  color: var(--pl-muted);
}

.precio-luz-legend-color{
  display:inline-block;
  width: 20px;
  height: 20px;
  border-radius: 4px;
}

.precio-luz-valle{ background-color: var(--pl-valle); }
.precio-luz-llano{ background-color: var(--pl-llano); }
.precio-luz-punta{ background-color: var(--pl-punta); }

/* ===== Chart controls layout (pro) ===== */
.precio-luz-date-selector--pro{
  justify-content: space-between;
}

/* Flechas juntas a la izquierda */
.pl-nav-left{
  display:flex;
  gap: 8px;
  align-items:center;
}

/* Bloque central con date + botón */
.pl-date-input{
  display:flex;
  align-items:center;
  gap: 10px;
  flex: 1;
  justify-content: center;
}

/* ===== Fix styling input[type="date"] (cross-browser) ===== */
.pl-date-picker{
  height: 40px;
  padding: 0 12px;
  border-radius: 10px !important;
  border: 1px solid rgba(0,0,0,.12) !important;
  background: #fff !important;
  color: var(--pl-text);
  font-weight: 800;
  line-height: 40px;
  outline: none;

  /* clave para que respete border-radius */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;

  /* evita que “corte” las esquinas en algunos navegadores */
  overflow: hidden;
}

/* Ajustes internos del date input (Chrome/Safari) */
.pl-date-picker::-webkit-datetime-edit{
  padding: 0;
}
.pl-date-picker::-webkit-calendar-picker-indicator{
  opacity: .75;
  cursor: pointer;
  margin-left: 8px;
}
.pl-date-picker:focus{
  border-color: rgba(0,123,255,.45) !important;
  box-shadow: 0 0 0 3px rgba(0,123,255,.12);
}

/* Bloque derecho: fecha alineada a la derecha, pegada al HOY */
.pl-nav-right{
  display:flex;
  gap: 10px;
  align-items:center;
}

.precio-luz-date-display{
  display:flex;
  align-items:center;
  gap: 10px;
  justify-content: flex-end;
  text-align: right;
}

/* Responsive: apila, pero mantiene orden lógico */
@media (max-width: 768px){
  .precio-luz-date-selector--pro{
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .pl-nav-left, .pl-date-input, .pl-nav-right{
    justify-content: center;
  }
  .pl-date-picker{
    width: 100%;
    min-width: 0;
  }

  .precio-luz-chart-container{ padding: 15px; }
  .precio-luz-date-selector{
    flex-direction: column;
    align-items: stretch;
  }
  .precio-luz-nav-btn{
    width: 100%;
    justify-content:center;
  }
  .precio-luz-chart-wrapper{ height: 300px; }
}

/* ========================================
   CARDS (tarjetas rápidas)
   ======================================== */
.pl-card{
  background: var(--pl-bg);
  padding: 18px;
  border-radius: var(--pl-radius);
  box-shadow: var(--pl-shadow);
  text-align: center;
  color: var(--pl-text);
}

.pl-card-head{
  display:flex;
  align-items:center;
  justify-content:center;
  gap: 10px;
  margin-bottom: 10px;
}

.pl-icon{ font-size: 20px; }

.pl-card h3{
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.pl-card-big{
  margin: 8px 0 0;
  font-size: 22px;
  font-weight: 800;
}

.pl-card-sub{
  margin: 8px 0 0;
  font-size: 15px;
  color: var(--pl-muted);
}

.pl-badge{
  display:inline-block;
  margin: 2px 0 8px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .4px;
  background: var(--pl-soft-2);
  color: var(--pl-text);
}

.pl-mini{
  display:flex;
  gap: 10px;
  justify-content:center;
  flex-wrap:wrap;
  margin-top: 10px;
  font-size: 13px;
  color: var(--pl-muted);
}

/* Estados: borde superior */
.pl-cheap{ border-top: 4px solid var(--pl-green); }
.pl-expensive{ border-top: 4px solid var(--pl-red); }
.pl-neutral{ border-top: 4px solid var(--pl-yellow); }

/* Recomendación (bloque inferior) */
.pl-reco{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--pl-radius-sm);
  background: var(--pl-soft);
  font-size: 15px;
  line-height: 1.35;
  color: var(--pl-muted);
}

.pl-reco-link{
  display:inline-block;
  margin-left: 10px;
  font-weight: 800;
  text-decoration:none;
  color: var(--pl-green);
}

/* ✅ LISTAS (esto es lo que te faltaba y por eso “se rompieron”) */
.pl-list{
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: var(--pl-radius-sm);
  background: var(--pl-soft);
  text-align: left;
}

.pl-row{
  display:flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid rgba(0,0,0,.06);
  font-size: 14px;
  color: var(--pl-muted);
}

.pl-row strong{
  color: var(--pl-text);
  font-weight: 800;
}

.pl-row:last-child{
  border-bottom: none;
}

/* =========================================
   SOLO bloque de cards (scoped) - igualar alturas
   ========================================= */
.pl-cards-grid{
  align-items: stretch;
}

/* Estira SOLO los widgets shortcodes dentro de este bloque */
.pl-cards-grid .elementor-element.elementor-widget-shortcode{
  height: 100%;
  align-self: stretch;
}

.pl-cards-grid .elementor-element.elementor-widget-shortcode > .elementor-widget-container{
  height: 100%;
}

.pl-cards-grid .elementor-element.elementor-widget-shortcode .elementor-shortcode{
  height: 100%;
  display: block;
}

/* La card ocupa toda la altura del item */
.pl-cards-grid .pl-card{
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Empuja el bloque final al fondo (solo la card que lo tenga) */
.pl-cards-grid .pl-card .pl-reco{
  margin-top: auto;
}


/* =========================================
   ADS
   ========================================= */
.pl-ad-slot{
  background: var(--pl-bg);
  border: var(--pl-border);
  border-radius: var(--pl-radius);
  box-shadow: var(--pl-shadow);
  padding: 12px;
  margin: 20px 0;
  overflow: hidden;
}

/* Placeholder (solo mientras no haya anuncio real) */
.pl-ad-placeholder{
  background: var(--pl-soft);
  border-radius: var(--pl-radius-sm);
  padding: 14px 16px;
  text-align: center;
  color: var(--pl-muted);
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-height: 90px; /* típico “banner horizontal” */
  justify-content: center;
}

.pl-ad-placeholder strong{
  color: var(--pl-text);
}


/* ========================================
   Shortcodes embed
   ======================================== */

/* Precio actual simple */
.precio-luz-embed-simple {
    text-align: center;
    color: var(--pl-text);
}

.precio-luz-embed-simple .precio-luz-simple-inner {
    padding: 8px 0 6px;
}

.precio-luz-embed-simple .precio-luz-simple-label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--pl-text);
    margin-bottom: 4px;
}

.precio-luz-embed-simple .precio-luz-simple-precio {
    display: flex;
    justify-content: center;
    align-items: baseline;
    gap: 4px;
    color: var(--pl-text);
}

.precio-luz-embed-simple .precio-luz-simple-valor {
    font-size: 34px;
    font-weight: 700;
    line-height: 1;
    color: var(--pl-text);
}

.precio-luz-embed-simple .precio-luz-simple-unidad {
    font-size: 13px;
    color: var(--pl-muted-2);
}

.precio-luz-embed-simple .precio-luz-simple-tendencia {
    margin-top: 6px;
    font-size: 14px;
    font-weight: 600;
}

.precio-luz-embed-simple .precio-luz-simple-tendencia.precio-luz-baja {
    color: var(--pl-green);
}

.precio-luz-embed-simple .precio-luz-simple-tendencia.precio-luz-sube {
    color: var(--pl-red);
}

.precio-luz-embed-simple .precio-luz-simple-tendencia.precio-luz-igual {
    color: var(--pl-equal);
}

.precio-luz-embed-simple .precio-luz-simple-tendencia.precio-luz-sin_datos {
    color: var(--pl-muted-2);
}

.precio-luz-embed-simple .precio-luz-fuente,
.precio-luz-embed-simple .precio-luz-fuente a {
    color: var(--pl-text);
}

.precio-luz-embed-simple .precio-luz-fuente {
    margin-top: 8px;
    font-size: 12px;
}

/* Cards informativas */
.pl-source {
  margin-top: 14px;
  font-size: 13px;
  color: var(--pl-text);
  text-align: center;
}

.pl-source a {
  text-decoration: none;
}

/* Gráficas */
.precio-luz-chart-embed .precio-luz-embed-head {
    margin-bottom: 12px;
    text-align: center;
}

.precio-luz-chart-embed .precio-luz-date-title {
    color: var(--pl-text);
    font-weight: 700;
    font-size: 18px;
}

/* Botones de copiar código*/
.pl-widget-embed{
  text-align:center;
}

.pl-widget-embed textarea{
  position:absolute;
  left:-9999px;
  opacity:0;
}