/* ══════════════════════════════════════════
   SITE HEADER — siempre blanco, siempre visible
   Válido para HOME, MAPA, BUSCAR, y todas las páginas
═══════════════════════════════════════════ */

.site-header {
  background: #fff;
  border-bottom: 1px solid rgba(15, 23, 42, 0.05);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.02);
  position: sticky;
  top: 0;
  z-index: 200;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px; /* Taller for a premium feel */
  padding: 0 40px;
  max-width: 1400px; /* Constrain width on ultra-wide screens */
  margin: 0 auto;
  gap: 24px;
}

/* Logo */
.site-header__logo {
  flex: 1; /* Pushes nav to center */
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  transition: opacity 0.2s;
}
.site-header__logo:hover {
  opacity: 0.8;
}

.site-header__logo-img {
  height: 48px; /* Slightly refined size */
  width: auto;
  object-fit: contain;
}

/* Nav links */
.site-header__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
}

.site-header__link {
  font-size: 15px;
  color: #475569;
  text-decoration: none;
  font-weight: 500;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  padding: 8px 12px;
  border-radius: 8px;
  white-space: nowrap;
}
.site-header__link:hover { 
  color: #0F172A; 
  background: #F8FAFC;
}
.site-header__link--active { 
  color: #0F172A; 
  font-weight: 600; 
  background: #F1F5F9;
}

/* Actions */
.site-header__actions {
  flex: 1; /* Mirrors logo to guarantee nav centering */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
}

.site-header__icon-btn {
  background: none;
  border: none;
  padding: 10px;
  cursor: pointer;
  color: #64748B;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.site-header__icon-btn:hover {
  color: #E11D48; /* Premium red for favorites */
  background: #FFF1F2;
  transform: scale(1.05);
}

.site-header__btn {
  padding: 10px 24px;
  background: #0F172A;
  color: #fff;
  border-radius: 999px; /* Pill shape */
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
  transition: all 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  white-space: nowrap;
}
.site-header__btn:hover { 
  background: #1E293B;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}
.site-header__btn:active {
  transform: translateY(0);
}

.site-header__user {
  font-size: 14px;
  color: #4A90D9;
  text-decoration: none;
  font-weight: 500;
}

/* Hamburger */
.site-header__hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 8px;
  cursor: pointer;
  background: none;
  border: none;
  margin-left: 8px;
  flex-shrink: 0;
}
.site-header__hamburger span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: #0b1d35;
  border-radius: 2px;
  transition: all 0.2s;
}
.site-header__hamburger[aria-expanded="true"] span:nth-child(1) { transform: rotate(45deg) translateY(9px); }
.site-header__hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-header__hamburger[aria-expanded="true"] span:nth-child(3) { transform: rotate(-45deg) translateY(-9px); }

/* Menú móvil — oculto por defecto SIEMPRE */
.site-header__mobile-menu {
  display: none;
}
.site-header__mobile-link {
  padding: 11px 12px;
  font-size: 15px;
  color: #333;
  text-decoration: none;
  border-radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}
.site-header__mobile-link:hover { background: #f5f5f5; }
.site-header__mobile-btn {
  margin-top: 8px;
  padding: 12px;
  background: #0b1d35;
  color: #fff;
  text-align: center;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  text-decoration: none;
  font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .site-header {
    padding-top: env(safe-area-inset-top, 0px);
  }
  .site-header__inner { 
    padding: 0 16px; 
    justify-content: center;
    height: 56px;
  }
  .site-header__search-container { display: none !important; }
  .site-header__logo { width: auto; margin: 0 auto; justify-content: center; }
  .site-header__nav   { display: none; }
  .site-header__actions { display: none; }
  .site-header__hamburger { display: none; }
  .site-header__logo-img { height: 44px; }
  .site-header__logo-text { font-size: 18px; }

  /* Solo visible en móvil Y cuando JS lo activa */
  .site-header__mobile-menu.is-open {
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-top: 1px solid #f0f0f0;
    padding: 8px 16px 16px;
    background: #fff;
  }
}

@media (max-width: 360px) {
  .site-header__btn { padding: 7px 14px; font-size: 13px; }
}

/* ══════════════════════════════════════════
   MOBILE BOTTOM NAVIGATION
═══════════════════════════════════════════ */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 768px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    z-index: 9999;
    justify-content: space-around;
    align-items: center;
  }

  .mobile-bottom-nav__item {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    height: 100%;
    color: #94A3B8; /* Slate 400 */
    transition: color 0.2s;
  }

  .mobile-bottom-nav__item svg {
    transition: all 0.2s;
  }

  .mobile-bottom-nav__item.active {
    color: #2563EB; /* Brand blue active color */
  }

  /* Añadir padding al body para que el contenido no quede oculto bajo la nav */
  html, body {
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
  }
  body {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0px));
  }

}

/* ══════════════════════════════════════════
   HOME PAGE HEADER OVERRIDE (PREMIUM STYLE)
═══════════════════════════════════════════ */
.page-home .site-header {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: none;
}
.page-home .site-header__inner {
  height: 72px; /* Slightly taller for premium feel */
}
.page-home .site-header__search {
  background: #f8fafc;
  border: 1px solid transparent;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.02);
}
.page-home .site-header__search:focus-within {
  background: #ffffff;
  border-color: #e2e8f0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}
