:root {
  --lh-blue: #415e94;
  --lh-bg: #f4f5f7;
  --lh-white: #ffffff;
  --lh-border: #e0e4ed;
  --lh-text: #1a1a2e;
  --lh-muted: #9aa3b8;
  --lh-stgo: #2d9e6b;
  --lh-provi: #c8920a;
  --lh-condes: #6b7a99;
  --lh-reg: #c0392b;
  --lh-pub: #c0392b;
  --lh-nunoa: #415e94;
  --lh-card-h: 144px;
}

.lh-wrap {
  background: var(--lh-bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--lh-text);
}

/* NAV PILLS */
.lh-nav {
  display: flex;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  scrollbar-width: none;
  background: var(--lh-white);
  border-bottom: 1px solid var(--lh-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.lh-nav::-webkit-scrollbar { display: none; }

.lh-pill {
  flex: 0 0 auto;
  font-size: 11px !important;
  font-weight: 600 !important;
  letter-spacing: 0.5px;
  padding: 3px 8px !important;
  line-height: 1 !important;
  border-radius: 20px;
  border: 1.5px solid var(--lh-border);
  color: var(--lh-muted);
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  background: var(--lh-white);
  transition: all 0.15s ease;
}
.lh-pill:hover { border-color: var(--lh-blue); color: var(--lh-blue); }
.lh-pill.active { background: var(--lh-blue); border-color: var(--lh-blue); color: #fff; }

/* OVERLAY */
.lh-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(26,26,46,0.55);
  z-index: 9999;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.lh-overlay.active { display: flex; }

.lh-overlay-panel {
  background: var(--lh-white);
  border-radius: 12px;
  box-shadow: 0 20px 60px rgba(65,94,148,0.25);
  width: 100%;
  max-width: 640px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.lh-overlay-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  background: linear-gradient(to bottom, #eef1f8, #f4f5f7);
  border-bottom: 1px solid var(--lh-border);
  flex-shrink: 0;
}

.lh-overlay-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--lh-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}
.lh-overlay-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--lh-blue);
  border-radius: 2px;
}

.lh-overlay-close {
  background: var(--lh-bg);
  border: 1.5px solid var(--lh-border);
  color: var(--lh-muted);
  font-size: 14px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}
.lh-overlay-close:hover { background: var(--lh-blue); color: #fff; border-color: var(--lh-blue); }

.lh-overlay-grid {
  display: flex;
  flex-wrap: wrap;
  padding: 16px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.lh-overlay-grid .lh-card {
  width: 96px;
  height: 144px;
  aspect-ratio: unset;
}

@media (max-width: 767px) {
  .lh-overlay { padding: 0; align-items: center; }
  .lh-overlay-panel {
    max-width: 100%;
    max-height: 85vh;
    border-radius: 12px;
    margin: 16px;
  }
}

/* SECCIÓN */
.lh-section {
  background: var(--lh-white);
  border-radius: 10px;
  margin: 16px;
  box-shadow: 0 2px 8px rgba(65,94,148,0.1), 0 1px 3px rgba(65,94,148,0.06);
  overflow: hidden;
}

.lh-section-hdr {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-bottom: 1px solid var(--lh-border);
  border-radius: 10px 10px 0 0;
  box-shadow: 0 3px 8px rgba(65,94,148,0.18), 0 1px 3px rgba(65,94,148,0.10);
  position: relative;
  z-index: 1;
  background: linear-gradient(to bottom, #eef1f8, #f4f5f7);
}

.lh-section-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--lh-blue);
  display: flex;
  align-items: center;
  gap: 8px;
}
.lh-section-title::before {
  content: '';
  display: block;
  width: 3px;
  height: 14px;
  background: var(--lh-blue);
  border-radius: 2px;
  flex-shrink: 0;
}

.lh-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 10px;
  color: var(--lh-muted);
  padding: 4px 6px;
  border-radius: 4px;
  transition: all 0.2s ease;
  line-height: 1;
}
.lh-toggle:hover { background: var(--lh-bg); color: var(--lh-blue); }
.lh-toggle.collapsed { transform: rotate(180deg); }

.lh-section-body {
  transition: max-height 0.3s ease, opacity 0.3s ease;
  max-height: 9999px;
  opacity: 1;
  overflow: hidden;
  border-radius: 0 0 10px 10px;
  padding-bottom: 8px;
}
.lh-section-body.collapsed { max-height: 0; opacity: 0; padding-bottom: 0; }

.lh-sublabel {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--lh-muted);
  padding: 10px 16px 4px;
  border-top: 1px solid var(--lh-bg);
}

/* GRID — sin gap, el padding de cada card genera el espacio */
.lh-grid {
  display: flex;
  flex-wrap: wrap;
  padding: 8px 12px;
}

/* CARD */
.lh-card {
  width: 33.333%;
  aspect-ratio: 96 / 144;
  padding: 4px;
  position: relative;
  cursor: pointer;
}

/* inner — donde va la imagen y efectos */
.lh-card-inner {
  width: 100%;
  height: 100%;
  position: relative;
  background: #dde2ed;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(65,94,148,0.12);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.lh-card:hover .lh-card-inner {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(65,94,148,0.22);
}

.lh-card a { display: block; width: 100%; height: 100%; text-decoration: none; }
.lh-card-inner img { width: 100%; height: 100%; object-fit: cover; object-position: center top; display: block; }

.lh-card-info {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 20px 6px 6px;
  background: linear-gradient(to top, rgba(10,15,40,0.88) 0%, transparent 100%);
}
.lh-card-name { font-size: 10px; font-weight: 700; color: #fff; letter-spacing: 0.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-align: center; }
.lh-card-zone { font-size: 8px; color: rgba(255,255,255,0.6); margin-top: 1px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.lh-badge { position: absolute; top: 5px; left: 5px; font-size: 7px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 5px; border-radius: 3px; text-transform: uppercase; z-index: 2; }
.lh-badge-stgo   { background: var(--lh-stgo);   color: #fff; }
.lh-badge-provi  { background: var(--lh-provi);  color: #fff; }
.lh-badge-condes { background: var(--lh-condes); color: #fff; }
.lh-badge-reg    { background: var(--lh-reg);    color: #fff; }
.lh-badge-pub    { background: var(--lh-pub);    color: #fff; }
.lh-badge-nunoa  { background: var(--lh-nunoa);  color: #fff; }

/* BREAKPOINTS */
@media (min-width: 568px) {
  .lh-card { width: 16.666%; }   /* móvil horizontal: 6 por fila */
}

@media (min-width: 992px) {
  .lh-card { width: 11.111%; }   /* desktop: 9 por fila */
}

@media (max-width: 767px) {
  .lh-section { margin: 12px 8px; }
}

.lh-section.lh-section-empty { display: none; }

/* Bloque FLO — fondo, título e indicador en rojo */
.lh-section[data-section="flo"] {
  background-color: rgba(143, 8, 8, 0.04);
}
.lh-section[data-section="flo"] .lh-section-title {
  color: rgba(255, 0, 0, 0.85);
}
.lh-section[data-section="flo"] .lh-section-title::before {
  background: rgba(255, 0, 0, 0.85);
}