/* ─────────────────────────────────────────────────────────────────
   IMMAC — Clima de tu obra (inicio, debajo de la calculadora)
   Ubicación de la obra (mi ubicación, departamento o municipio) →
   pronóstico de 7 días con un veredicto para pavimentar.
   Mismo lenguaje que la calculadora: vidrio claro + tinta IMMAC para
   lo más importante (el día de hoy).
   Datos: Open-Meteo (gratis, sin llave ni cookies). Lógica: js/clima.js
───────────────────────────────────────────────────────────────── */
.wx {
  --wx-ink: #0E1318;
  --wx-txt: #4A5562;
  --wx-mut: #5F6B78;
  --wx-blue: #0A5F9A;
  --wx-sky: #3FB4E6;
  --wx-lime: #B6CD20;
  --wx-line: rgba(14, 19, 24, 0.08);
  --wx-dark: linear-gradient(160deg, #142233 0%, #0A121B 100%);
  --wx-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: 1080px;
  margin: 8px auto 40px;
  text-align: left;
  color: var(--wx-ink);
}
.wx-card {
  position: relative;
  padding: clamp(24px, 3.4vw, 44px);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.78) 0%, rgba(255, 255, 255, 0.56) 100%);
  -webkit-backdrop-filter: blur(28px) saturate(1.6);
  backdrop-filter: blur(28px) saturate(1.6);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    inset 0 0 0 1px rgba(255, 255, 255, 0.5),
    0 0 0 1px rgba(14, 19, 24, 0.05),
    0 50px 100px -50px rgba(10, 40, 70, 0.45);
}
.wx-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; align-items: end; }
/* Etiqueta con punto "en vivo": son datos actualizados */
.wx-k { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--wx-blue); }
.wx-k::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: #1FA855; box-shadow: 0 0 0 0 rgba(31, 168, 85, 0.45); animation: wx-live 2.4s ease-out infinite; }
@keyframes wx-live { 70% { box-shadow: 0 0 0 7px rgba(31, 168, 85, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 168, 85, 0); } }
.wx-title { margin-top: 12px; font-size: clamp(26px, 3vw, 40px); font-weight: 700; line-height: 1.05; letter-spacing: -0.035em; text-wrap: balance; }
.wx-desc { margin-top: 10px; max-width: 56ch; font-size: 15.5px; line-height: 1.6; color: var(--wx-txt); }

/* ── Buscador: una sola barra con "Mi ubicación" adentro ── */
.wx-pick {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 26px;
  padding: 6px;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(14, 19, 24, 0.09), 0 1px 2px rgba(14, 19, 24, 0.04), 0 20px 40px -30px rgba(10, 40, 70, 0.5);
  transition: box-shadow 0.25s ease;
}
.wx-pick:focus-within { box-shadow: 0 0 0 1.5px var(--wx-blue), 0 0 0 5px rgba(10, 95, 154, 0.12), 0 20px 40px -30px rgba(10, 40, 70, 0.5); }
.wx-btn, .wx-trig {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 0 16px;
  border: 0;
  border-radius: 14px;
  font: 600 14px/1 'Inter', sans-serif;
  color: var(--wx-ink);
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s var(--wx-ease);
}
.wx-dd { position: static; order: 1; flex: 1; min-width: 0; }
.wx-btn { order: 2; flex: none; color: var(--wx-blue); background: rgba(10, 95, 154, 0.08); }
.wx-btn:active { transform: scale(0.97); }
.wx-btn:disabled { opacity: 0.6; cursor: progress; }
.wx-trig { width: 100%; font-size: 15px; font-weight: 500; }
/* lupa al inicio del campo */
.wx-trig::before {
  content: '';
  flex: none;
  width: 18px;
  height: 18px;
  background: var(--wx-mut);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.wx-trig span { flex: 1; overflow: hidden; text-align: left; text-overflow: ellipsis; white-space: nowrap; color: var(--wx-mut); }
.wx-trig.has-value span { font-weight: 600; color: var(--wx-ink); }
.wx-trig.has-value::before { background: var(--wx-blue); }
.wx-trig svg { flex: none; color: var(--wx-mut); transition: transform 0.3s var(--wx-ease); }
.wx-dd.is-open .wx-trig svg { transform: rotate(180deg); }
.wx-btn:focus-visible, .wx-trig:focus-visible { outline: 2px solid var(--wx-blue); outline-offset: 0; }
@media (hover: hover) and (pointer: fine) {
  .wx-btn:hover { background: rgba(10, 95, 154, 0.14); }
  .wx-trig:hover { background: rgba(14, 19, 24, 0.035); }
}

/* Lista desplegable: ocupa el ancho de toda la barra */
.wx-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  z-index: 30;
  padding: 10px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.97);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 0 0 1px rgba(14, 19, 24, 0.08), 0 30px 60px -20px rgba(10, 40, 70, 0.45);
  opacity: 0;
  transform: translateY(-6px) scale(0.99);
  transform-origin: top center;
  transition: opacity 0.2s ease, transform 0.3s var(--wx-ease);
}
.wx-dd.is-up .wx-panel { top: auto; bottom: calc(100% + 10px); transform: translateY(6px) scale(0.99); transform-origin: bottom center; }
.wx-dd.is-open .wx-panel { opacity: 1; transform: none; }
.wx-panel[hidden] { display: none; }
.wx-search { display: flex; align-items: center; gap: 10px; padding: 0 14px; border-radius: 14px; background: rgba(14, 19, 24, 0.045); color: var(--wx-mut); box-shadow: inset 0 0 0 1px rgba(14, 19, 24, 0.04); }
.wx-search:focus-within { background: #fff; box-shadow: inset 0 0 0 1.5px var(--wx-blue); color: var(--wx-blue); }
.wx-search input { flex: 1; min-width: 0; height: 46px; border: 0; background: none; font: 500 16px/1 'Inter', sans-serif; color: var(--wx-ink); outline: none; }
.wx-search input::placeholder { color: #8A94A0; }
.wx-list { list-style: none; margin: 8px 0 0; padding: 0; max-height: 300px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.wx-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-radius: 12px; font-size: 14.5px; cursor: pointer; transition: background 0.12s ease; }
.wx-o { display: flex; flex-direction: column; min-width: 0; }
.wx-o > span { font-weight: 600; }
.wx-list li small { margin-top: 2px; font-size: 12.5px; color: var(--wx-mut); }
.wx-list li > svg { flex: none; color: var(--wx-mut); }
.wx-list .wx-back { justify-content: flex-start; gap: 8px; font-weight: 700; color: var(--wx-blue); }
.wx-list .wx-back svg { color: currentColor; }
.wx-list .wx-dep.is-act svg { color: var(--wx-blue); }
.wx-list li.is-act { background: rgba(10, 95, 154, 0.08); color: var(--wx-blue); }
.wx-list li.is-act small { color: rgba(10, 95, 154, 0.75); }
.wx-list li.is-sel { font-weight: 700; }
.wx-list .wx-grp { position: sticky; top: 0; z-index: 1; padding: 12px 12px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--wx-mut); background: rgba(255, 255, 255, 0.97); cursor: default; }
.wx-list .wx-empty { color: var(--wx-mut); cursor: default; }

/* ── Resultado ── */
.wx-out { margin-top: 24px; transition: opacity 0.35s ease; }
.wx-out.is-busy { opacity: 0.45; }
.wx-now {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  padding: 22px 24px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(14, 19, 24, 0.06);
}
.wx-temp { display: flex; align-items: center; gap: 14px; font-size: clamp(52px, 5.4vw, 72px); font-weight: 300; line-height: 1; letter-spacing: -0.05em; font-variant-numeric: tabular-nums; }
.wx-temp small { align-self: flex-start; margin-top: 0.3em; font-size: 0.3em; font-weight: 500; color: var(--wx-mut); letter-spacing: 0; }
.wx-temp svg { width: 54px; height: 54px; color: var(--wx-blue); }
.wx-where { padding-left: 28px; border-left: 1px solid var(--wx-line); }
.wx-where b { display: block; font-size: 18px; font-weight: 700; letter-spacing: -0.015em; }
.wx-where p { margin-top: 6px; font-size: 14px; line-height: 1.6; color: var(--wx-txt); }
.wx-where a { color: var(--wx-blue); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(10, 95, 154, 0.35); text-underline-offset: 3px; transition: text-decoration-color 0.2s ease; }
.wx-where a:hover { text-decoration-color: currentColor; }
.wx-verdict { display: inline-flex; align-items: center; gap: 10px; padding: 14px 18px; border-radius: 16px; font-size: 14.5px; font-weight: 700; letter-spacing: -0.01em; white-space: nowrap; }
.wx-verdict::before { content: ''; flex: none; width: 10px; height: 10px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 4px color-mix(in srgb, currentColor 18%, transparent); }
.wx-v-ok { color: #3F6A0C; background: rgba(182, 205, 32, 0.2); box-shadow: inset 0 0 0 1px rgba(122, 150, 16, 0.22); }
.wx-v-mid { color: #8A5300; background: rgba(245, 166, 35, 0.16); box-shadow: inset 0 0 0 1px rgba(200, 130, 20, 0.22); }
.wx-v-no { color: #A3301F; background: rgba(214, 69, 54, 0.1); box-shadow: inset 0 0 0 1px rgba(214, 69, 54, 0.2); }

/* 7 días: hoy en tinta IMMAC, el resto en vidrio; el color del veredicto va en el borde inferior */
.wx-days { list-style: none; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; margin: 14px 0 0; padding: 0; }
.wx-day {
  position: relative;
  overflow: hidden;
  padding: 16px 8px 18px;
  border-radius: 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.95), 0 0 0 1px rgba(14, 19, 24, 0.06);
  transition: transform 0.35s var(--wx-ease), box-shadow 0.35s ease;
}
.wx-day b { display: block; font-size: 12.5px; font-weight: 700; letter-spacing: 0.02em; text-transform: capitalize; color: var(--wx-txt); }
.wx-day svg { display: block; width: 32px; height: 32px; margin: 12px auto 10px; color: var(--wx-blue); }
.wx-day .t { font-size: 16px; font-weight: 700; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.wx-day .t span { font-weight: 500; color: var(--wx-mut); }
.wx-day .p { display: inline-flex; align-items: center; justify-content: center; gap: 4px; margin-top: 10px; padding: 4px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--wx-blue); background: rgba(10, 95, 154, 0.08); }
.wx-day .p svg { width: 11px; height: 11px; margin: 0; color: inherit; }
.wx-day .bar { position: absolute; left: 0; right: 0; bottom: 0; display: block; height: 4px; margin: 0; }
.wx-day:first-child { color: #fff; background: radial-gradient(120% 70% at 100% 0%, rgba(63, 180, 230, 0.28), rgba(63, 180, 230, 0) 60%), var(--wx-dark); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 20px 36px -22px rgba(5, 15, 30, 0.8); }
.wx-day:first-child b { color: #C9DD3C; }
.wx-day:first-child svg { color: #7FD0F2; }
.wx-day:first-child .t span { color: rgba(255, 255, 255, 0.6); }
.wx-day:first-child .p { color: #BFE7F8; background: rgba(255, 255, 255, 0.1); }
@media (hover: hover) and (pointer: fine) {
  .wx-day:hover { transform: translateY(-3px); box-shadow: inset 0 1px 0 #fff, 0 0 0 1px rgba(14, 19, 24, 0.06), 0 18px 30px -20px rgba(10, 40, 70, 0.45); }
  .wx-day:first-child:hover { box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14), 0 24px 40px -22px rgba(5, 15, 30, 0.85); }
}
.wx-ok { background: var(--wx-lime); }
.wx-mid { background: #F5A623; }
.wx-no { background: #D64536; }
.wx-legend { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--wx-line); font-size: 12.5px; font-weight: 500; color: var(--wx-mut); }
.wx-legend span { display: inline-flex; align-items: center; gap: 8px; }
.wx-legend i { width: 16px; height: 4px; border-radius: 4px; }
.wx-legend em { flex-basis: 100%; font-style: normal; font-size: 12px; line-height: 1.55; color: #6B7684; }

@media (max-width: 860px) {
  .wx-head { grid-template-columns: 1fr; }
  .wx-now { grid-template-columns: auto minmax(0, 1fr); gap: 20px; }
  .wx-verdict { grid-column: 1 / -1; justify-self: start; }
  .wx-days { display: flex; gap: 8px; margin: 14px calc(-1 * clamp(24px, 3.4vw, 44px)) 0; padding: 0 clamp(24px, 3.4vw, 44px) 8px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 clamp(24px, 3.4vw, 44px); scrollbar-width: none; }
  .wx-days::-webkit-scrollbar { display: none; }
  .wx-day { flex: 0 0 96px; scroll-snap-align: start; }
}
@media (max-width: 560px) {
  .wx-card { border-radius: 26px; }
  .wx-pick { padding: 5px; border-radius: 18px; }
  .wx-trig { padding: 0 10px; font-size: 14.5px; }
  /* "Mi ubicación" queda como ícono (el texto se conserva para lectores de pantalla) */
  .wx-btn { width: 50px; padding: 0; justify-content: center; }
  .wx-btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .wx-now { grid-template-columns: 1fr; gap: 16px; padding: 20px; }
  .wx-where { padding-left: 0; padding-top: 16px; border-left: 0; border-top: 1px solid var(--wx-line); }
  .wx-verdict { white-space: normal; }
}
@media (prefers-reduced-motion: reduce) {
  .wx-k::before { animation: none; }
  .wx-panel, .wx-trig svg, .wx-out, .wx-day, .wx-btn { transition: none; }
}
