:root {
  --green-dark: #0f5132;
  --green-mid: #198754;
  --green-light: #4caf50;
  --brown: #d35400;
  --gold: #f1c40f;
  --teal: #00bcd4;
  --bg: #e8f5e9;
  --surface: #ffffff;
  --text: #004d40;
  --text-muted: #00695c;
  --shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  --radius: 12px;
  --font: "Segoe UI", system-ui, -apple-system, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: url("../decoraciones/2151973988.jpg") center/cover no-repeat;
  background-color: var(--bg);
}

.site-header {
  flex-shrink: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 1.25rem 0.75rem;
  background: linear-gradient(135deg, rgba(255,255,255,0.92) 0%, rgba(232,245,233,0.92) 50%, rgba(255,255,255,0.92) 100%), url("../decoraciones/56855.jpg");
  background-size: cover;
  background-position: center;
  border-bottom: 4px solid var(--green-mid);
  box-shadow: var(--shadow);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 280px;
}

.logo-wrap {
  flex-shrink: 0;
  line-height: 0;
}

.logo-main {
  display: block;
  height: clamp(120px, 18vw, 200px);
  width: auto;
  max-width: min(520px, 72vw);
  object-fit: contain;
}

.header-meta .tagline {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--green-dark);
}

.header-meta .edition {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.header-actions .btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

/* ─── Don Chucho en el Header ───────────────────────────── */
.header-don-chucho {
  background: linear-gradient(135deg, #198754 0%, #0f5132 100%);
  border-radius: 16px;
  padding: 0.75rem 1rem;
  border: 2px solid #f1c40f;
  flex-shrink: 0;
}

.hdch-wrap {
  display: flex;
  gap: 0.85rem;
  align-items: center;
}

.hdch-avatar {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #f1c40f;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hdch-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.hdch-content {
  flex: 1;
  min-width: 0;
}

.hdch-name {
  font-size: 1rem;
  font-weight: 800;
  color: #f1c40f;
  margin: 0 0 0.15rem;
  line-height: 1.1;
}

.hdch-role {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 0.35rem;
  font-weight: 600;
  line-height: 1.1;
}

.hdch-text {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0;
  line-height: 1.3;
}

.pautas-panel {
  margin-bottom: 1.25rem;
}

.pautas-panel h2 {
  margin: 0 0 0.65rem;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--green-dark);
  background: linear-gradient(90deg, var(--green-mid) 0%, var(--green-light) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.pautas-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.pauta-card {
  border-radius: var(--radius);
  overflow: hidden;
  border: 2px solid var(--green-mid);
  background: #fff;
  box-shadow: 0 2px 8px rgba(25, 135, 84, 0.15);
  max-width: 280px;
  margin: 0 auto;
}

.pauta-card-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  line-height: 0;
}

.pauta-card-btn img {
  width: 100%;
  height: auto;
  display: block;
  max-height: 140px;
  object-fit: contain;
}

.pauta-card-btn:hover img,
.pauta-card-btn:focus-visible img {
  opacity: 0.85;
  transform: scale(1.02);
  transition: transform 0.2s;
}

.pauta-card[data-pauta-id="diana_seguros"] {
  border-color: var(--gold);
}

.pauta-card[data-pauta-id="quindio_travel"] {
  border-color: var(--green-mid);
}

.pauta-card[data-pauta-id="anatolia"] {
  border-color: var(--brown);
}

.pauta-card-meta,
.pauta-card-tel {
  margin: 0;
  padding: 0.4rem 0.6rem;
  font-size: 0.75rem;
  color: var(--text);
  background: #e8f5e9;
}

.pauta-card-tel a {
  color: var(--green-mid);
  font-weight: 600;
}

body.ficha-open {
  overflow: hidden;
}

.popup-pauta {
  margin: 0 0 0.5rem;
}

.popup-pauta img {
  width: 100%;
  max-width: 280px;
  height: auto;
  border-radius: 8px;
  display: block;
}

.btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-secondary {
  background: var(--green-mid);
  color: #fff;
  box-shadow: 0 4px 12px rgba(25, 135, 84, 0.3);
}

.btn-secondary:hover {
  background: var(--green-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(15, 81, 50, 0.4);
}

.app-layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(280px, 340px) 1fr;
}

.sidebar {
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 1rem 1.25rem;
  padding-bottom: calc(1rem + 60px);
  background: url("../decoraciones/9081966_4092826.jpg") center/cover no-repeat;
  background-color: var(--surface);
  border-right: 1px solid #d8e6df;
}

.sidebar h2 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-dark);
}

.filters {
  margin-bottom: 1.25rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 600;
}

.filter-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filter-chip span {
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: #eef4f1;
  color: var(--text);
  transition: background 0.15s, border-color 0.15s;
}

.filter-chip input:checked + span {
  color: #fff;
}

.filter-all input:checked + span {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.filter-turistico input:checked + span {
  background: var(--green-mid);
  border-color: #157347;
  color: #fff;
}

.filter-comercial input:checked + span {
  background: var(--gold);
  border-color: #d4ac0d;
  color: #fff;
}

.filter-gastronomico input:checked + span {
  background: var(--brown);
  border-color: #c0392b;
  color: #fff;
}

.search-box {
  margin-bottom: 1.25rem;
}

.search-box label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0.35rem;
}

.search-box input {
  width: 100%;
  padding: 0.6rem 0.85rem;
  border: 2px solid #d8e6df;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-family: inherit;
}

.search-box input:focus {
  outline: none;
  border-color: var(--teal);
}

.badge {
  display: inline-block;
  min-width: 1.5rem;
  padding: 0.1rem 0.45rem;
  font-size: 0.75rem;
  text-align: center;
  background: var(--green-light);
  color: #fff;
  border-radius: 999px;
  vertical-align: middle;
}

.poi-items {
  list-style: none;
  margin: 0;
  padding: 0;
}

.poi-item {
  margin-bottom: 0.5rem;
}

.poi-item button {
  width: 100%;
  text-align: left;
  padding: 0.65rem 0.75rem;
  border: 1px solid #e2ebe6;
  border-radius: var(--radius);
  background: var(--bg);
  font-family: inherit;
  font-size: 0.85rem;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.poi-item button:hover,
.poi-item button:focus-visible {
  border-color: var(--teal);
  box-shadow: 0 2px 8px rgba(102, 194, 190, 0.25);
  outline: none;
}

.poi-item button.active {
  border-color: var(--green-mid);
  background: #e8f5e9;
}

.poi-item .poi-name {
  display: block;
  font-weight: 700;
  color: var(--green-dark);
}

.poi-item .poi-cat {
  display: inline-block;
  margin-top: 0.25rem;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
}

.cat-turistico .poi-cat {
  background: #4caf50;
  color: #fff;
}

.cat-comercial .poi-cat {
  background: #f1c40f;
  color: #7d6a0c;
}

.cat-gastronomico .poi-cat {
  background: #e67e22;
  color: #fff;
}

.legend {
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid #e2ebe6;
}

.legend-items {
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.85rem;
}

.legend-items li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.dot-turistico {
  background: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.3);
}

.dot-comercial {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.3);
}

.dot-gastronomico {
  background: var(--brown);
  box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.3);
}

.dot-pauta {
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--gold);
}

.legend-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 0.75rem 0 0;
}

.map-panel {
  position: relative;
  min-height: 0;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 280px;
  background: url("../decoraciones/8940221_4042181.jpg") center/cover no-repeat;
  background-color: #a5d6a7;
}

.map-status {
  position: absolute;
  bottom: 1rem;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.4rem 0.9rem;
  background: rgba(255, 255, 255, 0.95);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  box-shadow: var(--shadow);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.2s;
}

.map-status.visible {
  opacity: 1;
}

.site-footer {
  flex-shrink: 0;
  padding: 0.5rem 1.25rem;
  text-align: center;
  font-size: 0.75rem;
  background: var(--green-dark);
  color: #e8f5e9;
}

.site-footer p {
  margin: 0.15rem 0;
}

.footer-credit strong {
  color: var(--teal);
}

/* Marcadores Leaflet con nombre (y logo en pautas) */
.poi-marker-leaflet {
  background: transparent !important;
  border: none !important;
}

.poi-marker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
}

.poi-marker-label {
  display: block;
  max-width: 130px;
  padding: 0.2rem 0.45rem;
  font-size: 0.65rem;
  font-weight: 800;
  line-height: 1.2;
  color: var(--green-dark);
  background: rgba(255, 255, 255, 0.96);
  border: 2px solid #fff;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(27, 77, 62, 0.28);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.poi-marker-wrap--turistico .poi-marker-label {
  border-color: var(--green-mid);
  background: #e8f5e9;
  color: var(--green-dark);
}

.poi-marker-wrap--comercial .poi-marker-label {
  border-color: var(--gold);
  background: #fffde7;
  color: var(--brown);
}

.poi-marker-wrap--gastronomico .poi-marker-label {
  border-color: var(--brown);
  background: #fff3e0;
  color: var(--brown);
}

.poi-marker-wrap--pauta .poi-marker-label {
  font-size: 0.72rem;
  color: #fff;
  background: var(--green-mid);
  border-color: var(--gold);
  padding: 0.3rem 0.55rem;
  max-width: 140px;
  box-shadow: 0 0 0 3px var(--gold);
}

.poi-marker-thumb {
  width: 36px;
  height: 36px;
  margin: 2px 0;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(27, 77, 62, 0.35);
  background: #fff;
  line-height: 0;
}

.poi-marker-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.poi-marker-pin {
  width: 22px;
  height: 22px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 3px solid #fff;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.3);
  margin-top: 1px;
}

.poi-marker-pin--turistico {
  background: var(--green-mid);
  box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.4);
}

.poi-marker-pin--comercial {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(241, 196, 15, 0.4);
}

.poi-marker-pin--gastronomico {
  background: var(--brown);
  box-shadow: 0 0 0 3px rgba(211, 84, 0, 0.4);
}

.poi-marker-wrap--pauta .poi-marker-pin {
  width: 26px;
  height: 26px;
  border-width: 3px;
  background: var(--teal);
  box-shadow: 0 0 0 3px var(--gold), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.leaflet-popup-content-wrapper {
  border-radius: var(--radius);
  font-family: var(--font);
}

.leaflet-popup-content h3 {
  margin: 0 0 0.35rem;
  color: var(--green-dark);
  font-size: 1rem;
}

.leaflet-popup-content .popup-cat {
  font-size: 0.7rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--text-muted);
}

.leaflet-popup-content p {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.route-step-tooltip {
  background: #ffffff;
  color: var(--green-dark);
  border: 2px solid var(--green-mid);
  border-radius: 999px;
  box-shadow: 0 4px 10px rgba(15, 81, 50, 0.22);
  font-family: var(--font);
  font-weight: 800;
  font-size: 0.72rem;
  min-width: 1.5rem;
  text-align: center;
}

.route-step-tooltip::before {
  display: none;
}

@media (max-width: 900px) {
  body {
    overflow: hidden;
  }

  .site-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
  }

  .header-brand {
    min-width: 0;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.75rem;
  }

  .header-meta {
    order: 3;
  }

  .header-don-chucho {
    order: 2;
    width: 100%;
  }

  .hdch-wrap {
    justify-content: center;
  }

  .header-actions {
    order: 4;
    justify-content: center;
    width: 100%;
  }

  .app-layout {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 36svh) minmax(0, 1fr);
  }

  .sidebar {
    max-height: none;
    border-right: none;
    border-bottom: 1px solid #d8e6df;
  }

  .map-panel {
    min-height: 0;
  }

  .logo-main {
    height: clamp(60px, 20vw, 110px);
    max-width: 100%;
  }

  .site-footer {
    padding: 0.35rem 0.8rem;
    padding-bottom: calc(0.35rem + env(safe-area-inset-bottom, 0px));
    font-size: 0.7rem;
  }
}

@supports not (height: 100svh) {
  @media (max-width: 900px) {
    .app-layout {
      grid-template-rows: minmax(0, 36vh) minmax(0, 1fr);
    }
  }
}

/* ─── Banner Don Chucho ──────────────────────────────────── */
.don-chucho-intro {
  background: linear-gradient(135deg, #198754 0%, #0f5132 100%);
  border-radius: 16px;
  padding: 1rem;
  margin-bottom: 1rem;
  border: 2px solid #f1c40f;
}

.dch-intro-wrap {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.dch-intro-avatar {
  flex-shrink: 0;
  width: 70px;
  height: 70px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid #f1c40f;
  background: rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
}

.dch-intro-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.dch-intro-content {
  flex: 1;
  min-width: 0;
}

.dch-intro-name {
  font-size: 1.1rem;
  font-weight: 800;
  color: #f1c40f;
  margin: 0 0 0.25rem;
  line-height: 1.2;
}

.dch-intro-role {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.95);
  margin: 0 0 0.5rem;
  font-weight: 600;
  line-height: 1.2;
}

.dch-intro-text {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.9;
  margin: 0;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .don-chucho-intro {
    padding: 0.85rem;
  }
  
  .dch-intro-avatar {
    width: 60px;
    height: 60px;
  }
  
  .dch-intro-name {
    font-size: 1rem;
  }
  
  .dch-intro-text {
    font-size: 0.78rem;
  }
}
