:root {
  --primary: #1f5c3a;
  --primary-dark: #143d26;
  --accent: #d97706;
  --bg: #f3f5f1;
  --surface: #ffffff;
  --text: #18231c;
  --muted: #54635a;
  --border: #dde3da;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(18, 38, 25, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.hidden {
  display: none !important;
}

.demo-banner {
  background: #fef3c7;
  color: #78350f;
  border-bottom: 1px solid #fde68a;
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
  padding: 5px 12px;
}

.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  z-index: 20;
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.06);
}

.hero-banner {
  position: relative;
  background-color: #173a25;
  background-image: url("assets/hero-goierri.jpg");
  background-size: cover;
  background-position: center 45%;
  color: #ffffff;
  padding: 16px 20px;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(14, 35, 22, 0.86) 0%, rgba(22, 54, 34, 0.68) 55%, rgba(18, 42, 27, 0.45) 100%);
  pointer-events: none;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
}

.brand-badge {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 1.45rem;
  flex-shrink: 0;
  overflow: hidden;
}

.lodging-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.guia-brand-lockup {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  margin-bottom: 6px;
  text-decoration: none;
  cursor: pointer;
}

.tokimap-hero-logo {
  height: 38px;
  width: auto;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.35));
}

.guia-logo-tagline {
  display: block;
  margin-left: 25.5%;
  margin-top: -3px;
  text-align: center;
  font-size: 0.66rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: #ffffff;
  border-bottom: 1.5px solid #a7e098;
  padding-bottom: 2px;
}

h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.015em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.subtitle {
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.88);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lang-switch {
  display: inline-flex;
  background: rgba(15, 28, 20, 0.55);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 3px;
}

.lang-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.77rem;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.lang-btn.active {
  background: #ffffff;
  color: var(--primary-dark);
}

.home-btn {
  text-decoration: none;
  background: #d97706;
  color: #fff;
  font-size: 0.84rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.home-btn:hover {
  background: #b45309;
  transform: translateY(-1px);
}

.controls-strip {
  padding: 10px 18px 12px;
  background: var(--surface);
}

.info-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.info-pill,
.filter-btn {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.info-pill {
  background: #e7f3ec;
  border-color: #b7dec6;
  color: var(--primary-dark);
  font-weight: 700;
}

.filter-btn.active,
.filter-btn.active:hover,
.filter-btn.active:focus {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.category-scroll {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.info-drawer {
  margin-top: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px 16px;
  max-height: 58dvh;
  overflow-y: auto;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(185px, 1fr));
  gap: 10px;
}

.info-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.84rem;
}

.info-item.info-wide {
  grid-column: 1 / -1;
}

.info-item.info-emergency {
  background: #fef2f2;
  border-color: #fecaca;
}

.info-item strong {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 3px;
}

.info-item.info-emergency strong {
  color: #991b1b;
}

.wifi-row,
.emerg-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.wifi-pass-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 700;
}

.copy-wifi-btn {
  border: 1px solid #b7dec6;
  background: #e7f3ec;
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}

.copy-wifi-btn.copied {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.info-tel {
  color: var(--primary-dark);
  font-weight: 700;
  text-decoration: none;
}

.emerg-btn {
  text-decoration: none;
  background: #dc2626;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
}

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 1.25fr 1fr;
}

.map-section {
  position: relative;
  height: 100%;
  min-height: 280px;
}

#map {
  width: 100%;
  height: 100%;
}

.map-style-switch {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 450;
  display: inline-flex;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  padding: 3px;
  gap: 2px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.14);
}

.map-style-btn {
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 700;
  padding: 6px 11px;
  border-radius: 999px;
  cursor: pointer;
}

.map-style-btn.active {
  background: var(--primary);
  color: #fff;
}

.mobile-view-toggle {
  display: none;
}

.list-section {
  height: 100%;
  overflow-y: auto;
  padding: 16px 18px 28px;
  border-left: 1px solid var(--border);
  background: var(--bg);
}

.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.list-header h2 {
  font-size: 1.02rem;
  font-weight: 800;
}

.count-badge {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--primary-dark);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.8rem;
  font-weight: 800;
}

.places-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.place-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.place-card:hover,
.place-card.selected {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(18, 46, 28, 0.13);
}

.card-cover {
  position: relative;
  height: 122px;
  background-size: cover;
  background-position: center;
}

.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.25) 0%, rgba(0, 0, 0, 0.05) 55%, rgba(0, 0, 0, 0.4) 100%);
}

.card-cover-top {
  position: relative;
  z-index: 2;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.card-body {
  padding: 13px 14px 14px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.cat-tag {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  color: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.dist-tag {
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--muted);
}

.card-cover .dist-tag {
  background: rgba(15, 23, 20, 0.68);
  color: #ffffff;
  padding: 3px 9px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.place-card h3 {
  font-size: 1.02rem;
  font-weight: 800;
  margin-bottom: 6px;
}

.route-specs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.spec-chip {
  font-size: 0.74rem;
  font-weight: 700;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 2px 8px;
  border-radius: 999px;
}

.spec-chip.diff-facil {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

.spec-chip.diff-media {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.spec-chip.diff-exigente {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

.place-card p {
  font-size: 0.88rem;
  color: var(--muted);
  margin-bottom: 10px;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.gpx-btn {
  text-decoration: none;
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  font-weight: 700;
  padding: 7px 11px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.gpx-btn:hover {
  border-color: var(--primary);
}

.schedule {
  font-size: 0.78rem;
  color: var(--muted);
}

.nav-btn {
  text-decoration: none;
  background: #e7f3ec;
  color: var(--primary-dark);
  border: 1px solid #b7dec6;
  font-size: 0.82rem;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.nav-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.custom-pin {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2.5px solid #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.34);
  display: grid;
  place-items: center;
  font-size: 15px;
  color: #fff;
}

.home-pin {
  width: 40px;
  height: 40px;
  font-size: 19px;
  border: 3px solid #fff;
}

.leaflet-popup-content {
  font-family: inherit;
  min-width: 215px;
}

.popup-title {
  font-weight: 800;
  font-size: 0.95rem;
  margin-bottom: 4px;
}

.popup-desc {
  font-size: 0.82rem;
  color: #4b5563;
  margin-bottom: 8px;
}

.popup-link {
  display: inline-block;
  text-decoration: none;
  background: var(--primary);
  color: #fff !important;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 999px;
}

@media (max-width: 860px) {
  body {
    height: auto;
    min-height: 100dvh;
    overflow: auto;
  }

  .hero-banner {
    padding: 14px 14px;
  }

  .controls-strip {
    padding: 10px 14px;
  }

  .info-bar,
  .category-scroll {
    flex-wrap: nowrap;
  }

  .info-bar {
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
  }

  .info-bar::-webkit-scrollbar {
    display: none;
  }

  .layout {
    grid-template-columns: 1fr;
    display: flex;
    flex-direction: column;
  }

  .map-section {
    height: 46dvh;
    min-height: 290px;
  }

  .list-section {
    border-left: none;
    border-top: 1px solid var(--border);
    overflow: visible;
  }

  .mobile-view-toggle {
    display: block;
    position: absolute;
    bottom: 12px;
    right: 12px;
    z-index: 500;
  }

  .mobile-view-toggle button {
    border: none;
    background: var(--text);
    color: #fff;
    padding: 8px 14px;
    border-radius: 999px;
    font-size: 0.82rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  }
}

.cat-svg-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  padding: 2px;
  object-fit: contain;
  vertical-align: middle;
  display: inline-block;
  flex-shrink: 0;
}

.filter-btn,
.cat-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pin-svg-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: contain;
  display: block;
}

.home-pin .pin-svg-icon {
  width: 30px;
  height: 30px;
}

.info-svg-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: #ffffff;
  padding: 1px;
  vertical-align: middle;
  margin-right: 4px;
  object-fit: contain;
}
