/* ============================================
   VIGHNAHARTA FLUID NAVIGATION
   Self-contained — no conflicts with other CSS
   ============================================ */

/* --- Header Container --- */
.vh-header {
  position: sticky !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  z-index: 1000 !important;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(32px) saturate(220%);
  -webkit-backdrop-filter: blur(32px) saturate(220%);
  transition: background 0.4s ease, box-shadow 0.4s ease;
  border-bottom: none !important;
}

.vh-header.scrolled {
  background: rgba(255, 255, 255, 0.55);
  box-shadow: 0 4px 32px rgba(0, 0, 0, 0.04);
  border-bottom: none !important;
}

/* Gradient bottom edge — fades in from sides instead of a hard line */
.vh-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.35) 20%, rgba(255,255,255,0.65) 50%, rgba(255,255,255,0.35) 80%, transparent 100%);
  transition: opacity 0.4s ease;
}
.vh-header.scrolled::after {
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.55) 20%, rgba(255,255,255,0.85) 50%, rgba(255,255,255,0.55) 80%, transparent 100%);
}

/* --- Nav Inner --- */
.vh-nav {
  max-width: 1280px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  height: auto;
  padding: 8px 16px;
}
@media (min-width: 1024px) {
  .vh-nav { padding: 8px 40px; }
}

/* --- Logo --- */
.vh-logo {
  display: flex !important;
  align-items: center;
  gap: 12px;
  text-decoration: none !important;
  flex-shrink: 0;
}
.vh-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary-color, #004aad);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  flex-shrink: 0;
  overflow: hidden;
}
.vh-logo-icon .material-symbols-outlined {
  font-size: 22px;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
.vh-logo-img {
  display: none;
  max-width: 220px;
  max-height: 56px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.vh-logo-img[src]:not([src=""]) {
  display: block;
}
.vh-logo-img[src]:not([src=""]) + .vh-logo-icon-fallback {
  display: none;
}
/* When a logo image is loaded, strip the colored box — logo stands open */
.vh-logo-icon:has(.vh-logo-img[src]:not([src=""])) {
  width: auto !important;
  height: auto !important;
  background: none !important;
  border-radius: 0 !important;
  padding: 0 !important;
}
/* Hospital name image (custom font wordmark) */
.vh-logo-name-img {
  display: none;
  max-width: 220px;
  max-height: 48px;
  width: auto;
  height: auto;
  object-fit: contain;
}
.vh-logo-name-img[src]:not([src=""]) {
  display: block;
}
.vh-logo:has(.vh-logo-name-img[src]:not([src=""])) .vh-logo-text {
  display: none;
}
/* On mobile: logo icon top-center, hospital name image full-width below it,
   emergency button stays top-right — no collision */
@media (max-width: 1023px) {
  /* Disable scroll anchoring: the collapsing header would otherwise drag
     scrollY toward 0 and loop the collapse/expand animation forever */
  html { overflow-anchor: none; }
  .vh-nav {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: start;
  }
  .vh-logo {
    display: grid !important;
    grid-column: 1 / -1;
    grid-row: 1;
    grid-template-columns: 1fr auto 1fr;
    grid-template-rows: auto auto;
    row-gap: 4px;
    justify-items: center;
    align-items: center;
    flex-shrink: 1;
    min-width: 0;
    overflow: hidden;
  }
  .vh-logo-icon {
    grid-column: 2;
    grid-row: 1;
  }
  .vh-logo-name-img {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    max-height: 64px;
    height: auto;
    object-fit: contain;
  }
  .vh-logo-text {
    grid-column: 1 / -1;
    grid-row: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 92%;
    max-height: 40px;
    justify-self: center;
    text-align: center;
    font-size: 22px;
  }
  .vh-logo-img[src]:not([src=""]) {
    max-height: 40px;
    max-width: 160px;
  }
  .vh-logo:has(.vh-logo-img[src]:not([src=""])) .vh-logo-text {
    display: none;
  }
  .vh-actions {
    grid-column: 3;
    grid-row: 1;
    align-self: start;
    justify-self: end;
    margin-top: 2px;
    flex-shrink: 1;
    min-width: 0;
  }
  .vh-btn-emergency { display: none !important; }
}

.vh-logo-text {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color, #00357f);
  letter-spacing: -0.3px;
  text-decoration: none !important;
}
@media (max-width: 400px) {
  .vh-logo-text { font-size: 20px; }
}

/* --- Desktop Nav Links --- */
.vh-links {
  display: none !important;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.45);
  border-radius: 9999px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
@media (min-width: 1024px) {
  .vh-links { display: flex !important; }
}

.vh-link {
  text-decoration: none !important;
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: #555871;
  padding: 7px 18px;
  border-radius: 9999px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  white-space: nowrap;
  position: relative;
  border: none !important;
  background: transparent !important;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.vh-link:hover {
  color: var(--primary-color, #00357f);
  background: rgba(var(--primary-rgb, 0, 74, 173), 0.08) !important;
  transform: translateY(-1px);
}
.vh-link:active {
  transform: translateY(0);
}
.vh-link.active {
  background: var(--primary-color, #00357f) !important;
  color: #ffffff !important;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(var(--primary-rgb, 0, 74, 173), 0.25);
}

/* --- Actions (buttons) --- */
.vh-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.vh-btn-appt {
  display: none !important;
  padding: 10px 20px;
  border: 1.5px solid var(--primary-color, #004aad) !important;
  border-radius: 8px;
  font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--primary-color, #004aad) !important;
  text-decoration: none !important;
  background: none !important;
  transition: all 0.25s ease;
  cursor: pointer;
}
@media (min-width: 1024px) {
  .vh-btn-appt { display: inline-flex !important; }
}
.vh-btn-appt:hover {
  background: var(--primary-color, #004aad) !important;
  color: #ffffff !important;
}

.vh-btn-emergency {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: #ba1a1a !important;
  border: none !important;
  border-radius: 8px;
  font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: #ffffff !important;
  text-decoration: none !important;
  transition: all 0.25s ease;
  cursor: pointer;
}
.vh-btn-emergency:hover {
  background: #a01515 !important;
  transform: scale(1.03) !important;
}
.vh-btn-emergency .material-symbols-outlined {
  font-size: 18px;
  font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}
@media (max-width: 400px) {
  .vh-btn-emergency span:last-child { display: none; }
  .vh-btn-emergency { padding: 10px 12px; }
}

/* --- Hamburger --- */
.vh-hamburger {
  display: flex;
  flex-direction: column;
  gap: 5px;
  background: none !important;
  border: none !important;
  cursor: pointer;
  padding: 8px;
  position: relative;
  z-index: 1002;
}
@media (min-width: 1024px) {
  .vh-hamburger { display: none; }
}
.vh-hamburger span {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #191b22;
  border-radius: 4px;
  transition: all 0.3s ease;
  transform-origin: center;
}
.vh-hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.vh-hamburger.active span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.vh-hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* --- Mobile Overlay --- */
.vh-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
}
.vh-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* --- Mobile Slide-in Menu --- */
.vh-mobile {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  max-width: 80vw;
  height: 100vh;
  background: #ffffff;
  z-index: 999;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding-top: 128px;
  box-shadow: -8px 0 30px rgba(0, 0, 0, 0.1);
  overflow-y: auto;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), padding-top 0.3s ease;
}
.vh-mobile.open {
  transform: translateX(0);
}

.vh-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 20px;
}

.vh-mobile-link {
  display: block;
  padding: 14px 16px;
  border-radius: 8px;
  font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 500;
  color: #434653;
  text-decoration: none !important;
  transition: all 0.2s ease;
  border: none !important;
  background: none !important;
}
.vh-mobile-link:hover {
  background: rgba(var(--primary-rgb, 0, 74, 173), 0.06) !important;
  color: var(--primary-color, #00357f);
}
.vh-mobile-link.active {
  color: var(--primary-color, #00357f);
  font-weight: 600;
  background: rgba(var(--primary-rgb, 0, 74, 173), 0.08) !important;
}

.vh-mobile-cta {
  display: block;
  margin-top: 16px;
  padding: 14px;
  border-radius: 8px;
  background: var(--primary-color, #004aad) !important;
  color: #ffffff !important;
  font-family: 'Inter', 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-decoration: none !important;
  text-align: center;
  transition: background 0.2s ease;
  border: none !important;
}
.vh-mobile-cta:hover {
  background: var(--primary-color, #004aad) !important;
  opacity: 0.85;
}

/* --- Floating WhatsApp Button --- */
.vh-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 997;
  display: block;
  cursor: pointer;
  text-decoration: none !important;
}
.vh-whatsapp-icon {
  width: 56px;
  height: 56px;
  background: #25D366;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(37, 211, 102, 0.4);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  flex-shrink: 0;
}
.vh-whatsapp:hover .vh-whatsapp-icon {
  transform: scale(1.08);
  box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5);
}
@media (max-width: 768px) {
  .vh-whatsapp { bottom: 16px; right: 16px; }
  .vh-whatsapp-icon { width: 48px; height: 48px; }
}

/* Button pulse animation */
.vh-whatsapp-icon::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 3px solid #25D366;
  opacity: 0;
  animation: vh-pulse 2s ease-in-out infinite;
}
@keyframes vh-pulse {
  0% { transform: scale(1); opacity: 0.6; }
  70% { transform: scale(1.35); opacity: 0; }
  100% { transform: scale(1.35); opacity: 0; }
}

/* --- Floating Emergency Button (mobile only; desktop keeps the top-nav button) --- */
.vh-emergency-fab {
  display: none;
  position: fixed;
  z-index: 998;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #ba1a1a !important;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(186, 26, 26, 0.45);
  text-decoration: none !important;
}
.vh-emergency-fab .material-symbols-outlined {
  font-size: 26px;
  font-variation-settings: 'FILL' 1, 'wght' 500, 'GRAD' 0, 'opsz' 24;
  color: #ffffff;
}
.vh-emergency-fab::after {
  content: '';
  position: absolute;
  inset: -5px;
  border-radius: 50%;
  border: 3px solid #ba1a1a;
  opacity: 0;
  animation: vh-pulse 2.2s ease-in-out infinite;
  animation-delay: 0.8s;
}
@media (min-width: 769px) and (max-width: 1023px) {
  .vh-emergency-fab { display: flex; right: 24px; bottom: 92px; }
}
@media (max-width: 768px) {
  .vh-emergency-fab { display: flex; right: 16px; bottom: 76px; width: 48px; height: 48px; }
  .vh-emergency-fab .material-symbols-outlined { font-size: 24px; }
}

/* Mobile: name image collapses out of view on scroll while the logo icon stays pinned */
@media (max-width: 1023px) {
  .vh-logo-name-img, .vh-logo-text { transition: max-height 0.3s ease, opacity 0.3s ease; }
  .vh-header.collapsed .vh-logo-name-img { max-height: 0 !important; opacity: 0; }
  .vh-header.collapsed .vh-logo-text { max-height: 0 !important; opacity: 0; }
  .vh-header.collapsed ~ .vh-mobile { padding-top: 84px; }
}

/* Tighten the desktop header on medium screens so it never overflows */
@media (min-width: 1024px) and (max-width: 1440px) {
  .vh-logo-name-img[src]:not([src=""]) { max-width: 170px; }
  .vh-links { gap: 0; }
  .vh-link { padding: 7px 12px; font-size: 12.5px; }
}
@media (min-width: 1024px) and (max-width: 1150px) {
  .vh-btn-appt { display: none !important; }
}
