/* ============================================================
   PABS BOAT · WEATHER OUTLOOK PANEL
   Panel de clima debajo de los filtros de "availability".
   Misma familia visual que .filter-pill: vidrio + blur, líneas de 1px, Inter/Bodoni.
   ============================================================ */
.weather[hidden] { display: none !important; }
.availability.is-wizard-open .weather { display: none !important; }

.weather {
  width: 100%;
  max-width: 1200px;
  margin-top: 16px;
  color: var(--ivory);
}

.weather__card {
  position: relative;
  background: var(--glass-bg);
  backdrop-filter: blur(24px) saturate(1.4);
  -webkit-backdrop-filter: blur(24px) saturate(1.4);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 32px 36px 24px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.4s var(--ease-out), transform 0.4s var(--ease-out);
}
.weather__card.is-entering {
  opacity: 0;
  transform: translateY(12px);
}

/* ---------- Cabecera ---------- */
.weather__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
}
.weather__intro { min-width: 0; }

.weather__kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(245, 241, 234, 0.7);
}
.weather__kicker-line {
  display: inline-block;
  width: 28px;
  height: 1px;
  background: currentColor;
  opacity: 0.8;
}

.weather__verdict {
  margin: 14px 0 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.04;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--ivory);
  text-wrap: balance;
}

.weather__summary {
  margin: 12px 0 0;
  max-width: 620px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 15px;
  line-height: 1.6;
  color: var(--ivory);
  opacity: 0.85;
}

/* Medidor de 4 segmentos: ideal = 4, complicado = 1 */
.weather__meter {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  padding-bottom: 6px;
}
.weather__meter-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 241, 234, 0.6);
}
.weather__scale {
  display: flex;
  gap: 6px;
}
.weather__scale span {
  width: 28px;
  height: 2px;
  background: rgba(245, 241, 234, 0.22);
}
.weather__scale span.is-on { background: var(--ivory); }

/* ---------- Datos ---------- */
.weather__stats {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  display: grid;
  grid-auto-columns: minmax(0, 1fr);
  grid-auto-flow: column;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}
.weather__stat {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  padding: 22px 20px 4px;
  border-left: 1px solid rgba(255, 255, 255, 0.16);
}
.weather__stat:first-child { border-left: 0; padding-left: 0; }

.weather__icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.85;
  margin-top: 1px;
}
.weather__stat-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.weather__stat-label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(245, 241, 234, 0.6);
  white-space: nowrap;
}
.weather__stat-value {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 18px;
  line-height: 1.2;
  color: var(--ivory);
  white-space: nowrap;
}
.weather__stat-value small {
  font-weight: 400;
  font-size: 12px;
  opacity: 0.65;
  margin-left: 2px;
}
.weather__stat-sub {
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 12px;
  color: rgba(245, 241, 234, 0.65);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Pie ---------- */
.weather__foot {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 24px;
  font-family: var(--font-body);
  font-weight: 300;
  font-size: 11px;
  line-height: 1.5;
  letter-spacing: 0.02em;
  color: rgba(245, 241, 234, 0.6);
}

/* ---------- Error ---------- */
.weather--error .weather__card { padding-top: 22px; padding-bottom: 22px; }
.weather--error .weather__summary { margin-top: 8px; font-size: 14px; opacity: 0.75; }

/* ---------- Cargando (esqueleto) ---------- */
.weather__sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.weather__skel {
  display: block;
  background: rgba(245, 241, 234, 0.12);
  border-radius: 2px;
  animation: weather-pulse 1.6s ease-in-out infinite;
}
.weather__skel--title { width: min(340px, 70%); height: 34px; margin-top: 16px; }
.weather__skel--text { width: min(460px, 90%); height: 12px; margin-top: 16px; }
.weather__skel--icon { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; }
.weather__skel--label { width: 64px; height: 8px; }
.weather__skel--value { width: 90px; height: 16px; margin-top: 6px; }
.weather__stats--skel .weather__stat { padding-bottom: 18px; }

@keyframes weather-pulse {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
  .weather__stat { padding-left: 14px; padding-right: 12px; gap: 10px; }
  .weather__stat:first-child { padding-left: 0; }
}

@media (max-width: 768px) {
  .weather { margin-top: 12px; }
  .weather__card { padding: 24px 20px 18px; border-radius: 22px; }
  .weather__head { flex-direction: column; align-items: flex-start; gap: 18px; }
  .weather__meter { flex-direction: row; align-items: center; gap: 14px; padding-bottom: 0; }
  .weather__scale span { width: 22px; }
  .weather__verdict { font-size: clamp(28px, 8.4vw, 36px); margin-top: 12px; }
  .weather__summary { font-size: 14px; }
  .weather__kicker { letter-spacing: 0.18em; }

  .weather__stats {
    margin-top: 20px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .weather__stats { grid-auto-flow: row; }
  .weather__stat,
  .weather__stat:first-child {
    padding: 16px 0 14px 14px;
    gap: 10px;
    border-left: 1px solid rgba(255, 255, 255, 0.16);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
  }
  .weather__stat:nth-child(2n+1) { padding-left: 0; border-left: 0; }
  .weather__stat:nth-child(-n+2) { border-top: 0; }
  /* Cantidad impar de datos: el último ocupa la fila entera (sin huecos). */
  .weather__stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .weather__icon { width: 18px; height: 18px; }
  .weather__stat-value { font-size: 16px; }
  .weather__stat-sub { font-size: 11px; }
  .weather__foot { flex-direction: column; margin-top: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  .weather__card,
  .weather__card.is-entering {
    transition: none;
    opacity: 1;
    transform: none;
  }
  .weather__skel { animation: none; opacity: 0.8; }
}

/* El popover del calendario (dentro de los filtros) tiene que quedar por encima del panel:
   el vidrio con backdrop-filter crea su propio contexto de apilamiento. */
.availability__filters { position: relative; z-index: 3; }
.weather { position: relative; z-index: 1; }
