/* Tablero Local v4.0 */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@300;400;500;600;700&display=swap');

:root {
  --tlf-page:  #f2f2f2;
  --tlf-bg:    #ffffff;
  --tlf-bdr:   #e8e8e8;
  --tlf-ink:   #1a1a1a;
  --tlf-ink2:  #6e6e6e;
  --tlf-ink3:  #b0b0b0;
  --tlf-red:   #d93025;
  --tlf-green: #3d8b40;
  --tlf-r:     18px;
  --tlf-font:  'Google Sans','Roboto',system-ui,sans-serif;
}

.tl-front {
  font-family: var(--tlf-font);
  background: var(--tlf-page);
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 14px;
  box-sizing: border-box;
}

/* ── Fila superior ── */
.tlf-top-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  align-items: stretch;
}
.tlf-top-row .tlf-card { height: 100%; }

/* ── Card base ── */
.tlf-card {
  background: var(--tlf-bg);
  border-radius: var(--tlf-r);
  padding: 22px 24px 18px;
  position: relative;
  overflow: visible;
  box-sizing: border-box;
}
.tlf-card--full { /* full width by default in flex column */ }

/* ── Fila de 2 columnas ── */
.tlf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: stretch;
}
.tlf-row > .tlf-card {
  height: 100%;
  box-sizing: border-box;
}

/* ── Card precio: layout columna con "ver" anclado abajo-derecha ── */
.tlf-precio__label {
  font-size: 15px;
  font-weight: 500;
  color: var(--tlf-ink);
  margin-bottom: 2px;
}
.tlf-precio__mes {
  font-size: 13px;
  color: var(--tlf-ink2);
  margin-bottom: 16px;
}

/*
  Número: $ chico arriba-izquierda (superíndice),
  entero grande en el medio,
  decimales chicos arriba-derecha (superíndice).
  Usamos baseline-bottom: alineamos todos al fondo del entero
  y subimos el $ y decimales con margin-bottom negativo.
*/
.tlf-precio__num {
  display: flex;
  align-items: flex-end;   /* todos sobre la misma línea de base inferior */
  line-height: 1;
  margin-bottom: 0;
}
.tlf-precio__signo {
  font-size: 18px;
  font-weight: 400;
  color: var(--tlf-ink);
  margin-right: 1px;
  /* sube el $ para que quede como superíndice sobre el número grande */
  margin-bottom: 10px;
}
.tlf-precio__entero {
  font-size: 52px;
  font-weight: 700;
  color: var(--tlf-ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.tlf-precio__decimal {
  font-size: 16px;
  font-weight: 500;
  color: var(--tlf-ink);
  margin-left: 2px;
  /* sube los centavos para que queden como superíndice arriba-derecha */
  margin-bottom: 10px;
}

/* "ver anteriores" / "ver histórico": texto chico alineado abajo-derecha */
.tlf-precio__ver {
  display: block;
  font-size: 12px;
  color: var(--tlf-ink3);
  text-decoration: none;
  text-align: right;
  margin-top: 10px;
}
.tlf-precio__ver:hover { color: var(--tlf-ink2); }

/* ── Lluvia: número + "mm" como superíndice en la misma línea ── */
.tlf-lluvia__num {
  display: flex;
  align-items: flex-end;
  line-height: 1;
  margin-bottom: 0;
}
.tlf-lluvia__val {
  font-size: 52px;
  font-weight: 700;
  color: var(--tlf-ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.tlf-lluvia__unit {
  font-size: 16px;
  font-weight: 400;
  color: var(--tlf-ink2);
  margin-left: 4px;
  margin-bottom: 10px; /* sube "mm" como superíndice */
}

/* ── Dólar: grilla multi-tipo ── */
.tlf-dolar-titulo {
  font-size: 15px;
  font-weight: 500;
  color: var(--tlf-ink);
  margin-bottom: 14px;
}
.tlf-dolar-fecha {
  font-size: 12px;
  color: var(--tlf-ink3);
  margin-bottom: 14px;
}
.tlf-dolar-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--tlf-bdr);
  border: 1px solid var(--tlf-bdr);
  border-radius: 12px;
  overflow: hidden;
}
.tlf-dolar-item {
  background: var(--tlf-bg);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  gap: 12px;
}
.tlf-dolar-item__name {
  font-size: 14px;
  font-weight: 700;
  color: var(--tlf-ink);
  letter-spacing: .02em;
  min-width: 80px;
}
.tlf-dolar-item__vals {
  display: flex;
  gap: 18px;
}
.tlf-dolar-item__col {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.tlf-dolar-item__lbl {
  font-size: 10px;
  font-weight: 600;
  color: var(--tlf-ink3);
  letter-spacing: .07em;
  text-transform: uppercase;
}
.tlf-dolar-item__val {
  font-size: 16px;
  font-weight: 600;
  color: var(--tlf-ink);
  white-space: nowrap;
}

/* ── Calendario ── */
.tlf-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.tlf-cal-nav-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: var(--tlf-ink2);
  cursor: pointer;
  padding: 0 6px;
  line-height: 1;
}
.tlf-cal-nav-btn:hover { color: var(--tlf-ink); }
.tlf-cal-mes {
  font-size: 20px;
  font-weight: 700;
  color: var(--tlf-ink);
}
.tlf-cal-head {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  margin-bottom: 2px;
}
.tlf-cal-head span {
  text-align: center;
  font-size: 10px;
  font-weight: 500;
  color: var(--tlf-ink2);
  padding: 2px 0;
}
.tlf-cal-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  grid-auto-rows: 40px;
  row-gap: 2px;
}
.tlf-cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin: 0 auto;
  font-size: 13px;
  font-weight: 500;
  color: var(--tlf-ink);
  border-radius: 50%;
  cursor: default;
  position: relative;
}
.tlf-cal-day--adj    { color: var(--tlf-ink3); font-weight: 400; }
.tlf-cal-day--today  { background: #e0e0e0; color: var(--tlf-ink); font-weight: 700; }
.tlf-cal-day--remate { background: var(--tlf-green); color: #fff; font-weight: 700; cursor: pointer; }
.tlf-cal-day--cancelado  { background: #f5c6c6; color: #c0392b; font-weight: 700; cursor: pointer; }
.tlf-cal-day--reprog { background: #fde8b0; color: #b7770d; font-weight: 700; cursor: pointer; }

.tlf-ev-dots { display: flex; gap: 2px; justify-content: center; margin-top: 1px; }
.tlf-ev-dot  { width: 4px; height: 4px; border-radius: 50%; }
.tlf-ev-dot--activo      { background: var(--tlf-green); }
.tlf-ev-dot--cancelado   { background: #c0392b; }
.tlf-ev-dot--reprogramado{ background: #b7770d; }

.tlf-cal-tooltip {
  display: none;
  position: absolute;
  z-index: 100;
  background: var(--tlf-ink);
  color: #fff;
  font-size: 12px;
  border-radius: 8px;
  padding: 10px 12px;
  max-width: 220px;
  pointer-events: none;
  white-space: normal;
  line-height: 1.4;
  box-shadow: 0 4px 16px rgba(0,0,0,.18);
}
.tlf-cal-tooltip--vis { display: block; }
.tlf-tip-ev + .tlf-tip-ev { margin-top: 8px; border-top: 1px solid rgba(255,255,255,.2); padding-top: 8px; }
.tlf-tip-badge { display: inline-block; font-size: 10px; border-radius: 4px; padding: 1px 5px; margin-bottom: 3px; }
.tlf-tip-badge--cancelado   { background: #c0392b; }
.tlf-tip-badge--reprogramado{ background: #b7770d; }

/* ── Remate card ── */
.tlf-remate__label  { font-size: 13px; font-weight: 500; color: var(--tlf-ink2); margin-bottom: 6px; }
.tlf-remate__badge  { display: inline-block; font-size: 12px; border-radius: 6px; padding: 3px 10px; margin-bottom: 10px; }
.tlf-remate__badge--cancelado   { background: #fce8e8; color: #c0392b; }
.tlf-remate__badge--reprogramado{ background: #fef3e0; color: #b7770d; }
.tlf-remate__titulo { font-size: 22px; font-weight: 600; color: var(--tlf-ink); margin-bottom: 18px; line-height: 1.2; }
.tlf-remate--cancelado .tlf-remate__titulo { text-decoration: line-through; color: var(--tlf-ink2); }
.tlf-remate__row    { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; font-size: 14px; color: var(--tlf-ink); }
.tlf-remate__nota   { font-size: 13px; color: #b7770d; margin-top: 8px; }
.tlf-remate__link   { display: inline-block; margin-top: 14px; font-size: 12px; color: var(--tlf-ink3); text-decoration: none; }

/* ── Weather animated card ── */
.tlf-card--weather {
  background: #1565C0;   /* fallback while canvas loads */
  padding: 0;
  overflow: hidden;
  min-height: 260px;
  position: relative;   /* needed for canvas absolute positioning */
}
#tl-weather-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  border-radius: var(--tlf-r);
}
.tlf-clima-overlay {
  position: relative;
  z-index: 2;
  padding: 22px 24px 20px;
  color: #fff;
  text-shadow: 0 1px 10px rgba(0,0,0,0.4);
}
.tlf-clima-overlay .tlf-clima-loc { color: rgba(255,255,255,0.85); }
.tlf-clima-overlay .tlf-clima-tempval { color: #fff; }
.tlf-clima-overlay .tlf-clima-fecha  { color: rgba(255,255,255,0.80); }
.tlf-clima-overlay .tlf-clima-sep    { border-color: rgba(255,255,255,0.25); }
.tlf-clima-overlay .tlf-clima-metric { color: rgba(255,255,255,0.85); }

/* ── Clima principal ── */
.tlf-clima-loc { display: flex; align-items: center; gap: 5px; font-size: 12px; color: rgba(255,255,255,0.82); margin-bottom: 6px; }
.tlf-clima-temprow { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.tlf-clima-tempval { font-size: 64px; font-weight: 300; color: #fff; letter-spacing: -0.03em; line-height: 1; }
.tlf-clima-mainicon { align-self: center; filter: brightness(10); }
.tlf-clima-fecha { font-size: 12px; color: rgba(255,255,255,0.75); margin-bottom: 18px; }
.tlf-clima-sep { border: none; border-top: 1px solid rgba(255,255,255,0.22); margin: 16px 0; }
.tlf-clima-metrics { display: flex; flex-wrap: wrap; gap: 6px 20px; }
.tlf-clima-metric { display: flex; align-items: center; gap: 4px; font-size: 12px; color: rgba(255,255,255,0.82); white-space: nowrap; }
.tlf-clima-metric svg { filter: brightness(10); }

/* ── Horas con flechas ── */
.tlf-card--horas {
  display: flex;
  flex-direction: column;
}
.tlf-horas-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
}
.tlf-horas-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--tlf-ink3);
  font-size: 22px;
  padding: 0 2px;
  line-height: 1;
  flex-shrink: 0;
  transition: color .15s;
}
.tlf-horas-btn:hover { color: var(--tlf-ink); }
.tlf-horas-btn:disabled { opacity: 0.2; cursor: default; }
.tlf-horas-scroll {
  overflow: hidden;
  flex: 1;
  min-width: 0;
}
.tlf-horas-inner {
  display: flex;
  flex-wrap: nowrap;
  transition: transform .25s ease;
  will-change: transform;
}
.tlf-hora-slot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  flex-shrink: 0;
  /* width set by JS */
}
.tlf-hora-label { font-size: 11px; color: var(--tlf-ink2); white-space: nowrap; }
.tlf-hora-icon { line-height: 1; }
.tlf-hora-temp { font-size: 12px; font-weight: 500; color: var(--tlf-ink); }

/* ── Pronóstico ── */
.tlf-fc-header { display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--tlf-ink3); margin-bottom: 14px; }
.tlf-fc-rows { display: flex; flex-direction: column; }
.tlf-fc-row { display: grid; grid-template-columns: 40px 32px 40px 1fr 40px; align-items: center; gap: 8px; padding: 7px 0; border-bottom: 1px solid var(--tlf-bdr); }
.tlf-fc-row:last-child { border-bottom: none; }
.tlf-fc-dia  { font-size: 13px; font-weight: 500; color: var(--tlf-ink); }
.tlf-fc-icon { display: flex; align-items: center; }
.tlf-fc-min  { font-size: 13px; color: var(--tlf-ink3); text-align: right; }
.tlf-fc-max  { font-size: 13px; font-weight: 600; color: var(--tlf-ink); text-align: right; }
.tlf-fc-bar-wrap { position: relative; height: 4px; background: #e8e8e8; border-radius: 2px; overflow: hidden; }
.tlf-fc-bar { position: absolute; top: 0; height: 100%; border-radius: 2px; }

/* ── Descuentos — cards estilo imagen ── */
.tlf-desc__label {
  font-size: 15px;
  font-weight: 500;
  color: var(--tlf-ink);
  margin-bottom: 18px;
}

.tlf-desc-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

.tlf-desc-card {
  background: #fff;
  border-radius: 20px;
  padding: 24px 16px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  border: 1px solid var(--tlf-bdr);
  transition: transform .18s ease, box-shadow .18s ease;
}
.tlf-desc-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.10);
}
.tlf-desc-card__img-wrap {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tlf-desc-card__img-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.tlf-desc-card__icon-default {
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tlf-desc-card__pct {
  font-size: 40px;
  font-weight: 700;
  color: var(--tlf-ink);
  letter-spacing: -0.02em;
  line-height: 1;
}
.tlf-desc-card__de {
  font-size: 13px;
  color: var(--tlf-ink2);
  margin-top: -4px;
}
.tlf-desc-card__super {
  font-size: 14px;
  font-weight: 600;
  color: var(--tlf-ink);
}
.tlf-desc-card__vig {
  font-size: 12px;
  color: var(--tlf-ink3);
  background: #f5f5f5;
  border-radius: 8px;
  padding: 3px 10px;
}

/* ── Skeleton ── */
.tlf-sk {
  background: linear-gradient(90deg,#f0f0f0 25%,#e8e8e8 50%,#f0f0f0 75%);
  background-size: 200% 100%;
  border-radius: 4px;
  animation: tlf-shimmer 1.5s infinite;
  display: inline-block;
}
@keyframes tlf-shimmer { to { background-position: -200% 0; } }

/* ── Responsive ── */

/* Desktop */
@media (min-width: 601px) {
  .tl-front {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (max-width: 600px) {
  .tl-front { padding: 10px; gap: 10px; }

  /* Fila de 2 columnas colapsa a 1 */
  .tlf-row {
    grid-template-columns: 1fr;
  }
  .tlf-row > .tlf-card {
    height: auto;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
  }

  /* Top row: 1 columna en móvil */
  .tlf-top-row { grid-template-columns: 1fr; gap: 10px; }

  /* Descuentos: 2 por fila en móvil */
  .tlf-desc-cards { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .tlf-desc-card { padding: 18px 10px 14px; }
  .tlf-desc-card__img-wrap,
  .tlf-desc-card__icon-default { width: 56px; height: 56px; }
  .tlf-desc-card__pct { font-size: 34px; }

  /* Dólar: 1 columna en móvil muy angosto */
  .tlf-dolar-item { padding: 12px 14px; }
}

@media (max-width: 400px) {
  .tlf-dolar-grid { grid-template-columns: 1fr; }
}
