/**
 * ============================================================================
 * PetAura Veterinary Centre - Header & Navigation System
 * 100% Full-Width Responsive Navbar with Zero Overflow
 * Glassmorphic Sticky Header, Smooth Animated Dropdowns, & Mobile Drawer
 * ============================================================================
 */

/* ----------------------------------------------------------------------------
   1. Header Master Container (100% Full Width Normal)
   ---------------------------------------------------------------------------- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-width: 100vw;
  z-index: 1000;
  background-color: transparent;
  box-sizing: border-box;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              background-color 0.3s ease,
              box-shadow 0.3s ease;
}

/* ----------------------------------------------------------------------------
   2. Topbar Notification & Quick Contact (100% Full Width)
   ---------------------------------------------------------------------------- */
.site-topbar {
  background: var(--grad-dark);
  color: var(--text-light);
  font-size: 0.825rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  position: relative;
  z-index: 1001;
  width: 100%;
  box-sizing: border-box;
}

.site-topbar .topbar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-left: clamp(1rem, 2.5vw, 2.5rem) !important;
  padding-right: clamp(1rem, 2.5vw, 2.5rem) !important;
  box-sizing: border-box;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(201, 153, 31, 0.15);
  color: var(--accent-bright);
  padding: 0.18rem 0.65rem;
  border-radius: var(--r-full);
  font-size: 0.75rem;
  font-weight: 600;
  border: 1px solid rgba(201, 153, 31, 0.3);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.topbar-badge .pulse-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 6px #22c55e;
  animation: pulseGreen 1.8s infinite;
  flex-shrink: 0;
}

@keyframes pulseGreen {
  0% { transform: scale(0.95); opacity: 0.8; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.8; }
}

.topbar-info {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
  white-space: nowrap;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: clamp(0.75rem, 1.5vw, 1.25rem);
}

.topbar-link {
  color: rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--t-fast);
}

.topbar-link:hover {
  color: var(--accent-bright);
}

.topbar-link.whatsapp-link {
  color: #4ade80;
  font-weight: 600;
}

.topbar-link.whatsapp-link:hover {
  color: #86efac;
}

/* ----------------------------------------------------------------------------
   3. Main Navigation Bar (100% Full Width Normal)
   ---------------------------------------------------------------------------- */
.site-navbar {
  width: 100%;
  max-width: 100vw;
  height: var(--navbar-height);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(13, 43, 85, 0.08);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease, height 0.3s ease;
  position: relative;
  z-index: 1000;
  box-sizing: border-box;
}

.site-header.scrolled .site-navbar {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(5, 16, 30, 0.08);
  border-bottom-color: rgba(13, 43, 85, 0.12);
  height: 66px;
}

/* 100% Fluid Navbar Inner: fills the screen normally, logo left, nav center, actions right */
.site-navbar .navbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  padding-left: clamp(1rem, 2.5vw, 2.5rem) !important;
  padding-right: clamp(1rem, 2.5vw, 2.5rem) !important;
  gap: clamp(0.5rem, 1.2vw, 1.5rem);
  box-sizing: border-box;
}

/* ----------------------------------------------------------------------------
   4. Page Home Transparent Header over Hero Video
   ---------------------------------------------------------------------------- */
.page-home .site-header:not(.scrolled) .site-navbar {
  background: rgba(7, 24, 40, 0.52);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.page-home .site-header:not(.scrolled) .brand-title {
  color: #FFFFFF;
}

.page-home .site-header:not(.scrolled) .brand-sub {
  color: #F5D470;
}

.page-home .site-header:not(.scrolled) .nav-link {
  color: rgba(255, 255, 255, 0.92);
}

.page-home .site-header:not(.scrolled) .nav-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.15);
}

.page-home .site-header:not(.scrolled) .nav-link.active {
  color: #FFFFFF;
  background: rgba(201, 153, 31, 0.28);
  border: 1px solid rgba(201, 153, 31, 0.5);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

.page-home .site-header:not(.scrolled) .header-call-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

.page-home .site-header:not(.scrolled) .header-call-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: var(--accent-bright);
  border-color: rgba(201, 153, 31, 0.45);
}

.page-home .site-header:not(.scrolled) .mobile-toggle-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.page-home .site-header:not(.scrolled) .hamburger-line,
.page-home .site-header:not(.scrolled) .hamburger-line::before,
.page-home .site-header:not(.scrolled) .hamburger-line::after {
  background-color: #FFFFFF;
}

/* Home Scrolled State (Deep obsidian/navy glass) */
.page-home .site-header.scrolled .site-navbar {
  background: rgba(7, 24, 40, 0.96);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(201, 153, 31, 0.35);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.page-home .site-header.scrolled .brand-title {
  color: #FFFFFF;
}

.page-home .site-header.scrolled .brand-sub {
  color: #F5D470;
}

.page-home .site-header.scrolled .nav-link {
  color: rgba(255, 255, 255, 0.9);
}

.page-home .site-header.scrolled .nav-link:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.14);
}

.page-home .site-header.scrolled .nav-link.active {
  color: var(--accent-bright);
  background: rgba(201, 153, 31, 0.24);
  border: 1px solid rgba(201, 153, 31, 0.5);
}

.page-home .site-header.scrolled .header-call-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.page-home .site-header.scrolled .header-call-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  color: var(--accent-bright);
}

.page-home .site-header.scrolled .mobile-toggle-btn {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.page-home .site-header.scrolled .hamburger-line,
.page-home .site-header.scrolled .hamburger-line::before,
.page-home .site-header.scrolled .hamburger-line::after {
  background-color: #FFFFFF;
}

/* ----------------------------------------------------------------------------
   5. Brand Logo & Crest
   ---------------------------------------------------------------------------- */
.brand-logo {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 0.8vw, 0.75rem);
  text-decoration: none;
  flex-shrink: 0;
  user-select: none;
}

.brand-crest {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0D2B55 0%, #071828 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent-bright);
  box-shadow: 0 4px 14px rgba(13, 43, 85, 0.22);
  border: 1px solid rgba(201, 153, 31, 0.35);
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease;
}

.brand-crest svg {
  display: block;
}

.brand-logo:hover .brand-crest {
  transform: scale(1.05) rotate(-3deg);
  box-shadow: 0 6px 18px rgba(201, 153, 31, 0.38);
}

.brand-text-wrap {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: clamp(1.2rem, 1.35vw, 1.35rem);
  font-weight: 700;
  color: var(--primary);
  line-height: 1.1;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color 0.3s ease;
}

.brand-title span {
  color: var(--accent-dark);
}

.brand-sub {
  font-size: 0.62rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.3s ease;
}

/* ----------------------------------------------------------------------------
   6. Desktop Navigation Menu (1-2 Word Layout, Adaptive Scaling)
   ---------------------------------------------------------------------------- */
.nav-menu {
  display: flex;
  align-items: center;
  gap: clamp(0.15rem, 0.5vw, 0.4rem);
  margin: 0;
  padding: 0;
  list-style: none;
  flex-shrink: 1;
}

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.45rem clamp(0.45rem, 0.65vw, 0.8rem);
  color: var(--text-body);
  font-size: clamp(0.82rem, 0.85vw, 0.92rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  border-radius: var(--r-full);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  border: 1px solid transparent;
}

.nav-link:hover {
  color: var(--primary);
  background: rgba(13, 43, 85, 0.06);
  transform: translateY(-1px);
}

.nav-link.active {
  color: var(--primary);
  background: var(--accent-pale);
  font-weight: 600;
  border: 1px solid var(--border-gold);
  box-shadow: 0 2px 8px rgba(201, 153, 31, 0.12);
}

.nav-link .arrow-icon {
  width: 10px;
  height: 10px;
  transition: transform 0.22s ease;
  opacity: 0.7;
}

.nav-item:hover .arrow-icon {
  transform: rotate(180deg);
  opacity: 1;
}

/* ----------------------------------------------------------------------------
   7. Dropdown Menu (Services Submenu)
   ---------------------------------------------------------------------------- */
.dropdown-menu {
  position: absolute;
  top: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  width: 290px;
  background: #FFFFFF;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(7, 24, 40, 0.14), 0 0 0 1px rgba(201, 153, 31, 0.2);
  padding: 0.55rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.22s;
  pointer-events: none;
  z-index: 1000;
}

/* Invisible hover bridge prevents accidental closing */
.dropdown-menu::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.nav-item:hover .dropdown-menu,
.nav-item:focus-within .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

.dropdown-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.18s ease, transform 0.18s ease;
}

.dropdown-link:hover {
  background: rgba(13, 43, 85, 0.05);
  transform: translateX(3px);
}

.dropdown-link-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(13, 43, 85, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dropdown-link:hover .dropdown-link-icon {
  background: var(--primary);
  color: var(--accent-bright);
  transform: scale(1.08);
}

.dropdown-link-text {
  display: flex;
  flex-direction: column;
}

.dropdown-link-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-dark);
  line-height: 1.25;
}

.dropdown-link-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Transparent Home Hero Dropdown (Dark Theme) */
.page-home .site-header:not(.scrolled) .dropdown-menu {
  background: rgba(7, 24, 40, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(201, 153, 31, 0.35);
}

.page-home .site-header:not(.scrolled) .dropdown-link:hover {
  background: rgba(255, 255, 255, 0.08);
}

.page-home .site-header:not(.scrolled) .dropdown-link-title {
  color: #FFFFFF;
}

.page-home .site-header:not(.scrolled) .dropdown-link-desc {
  color: rgba(255, 255, 255, 0.65);
}

.page-home .site-header:not(.scrolled) .dropdown-link-icon {
  background: rgba(255, 255, 255, 0.1);
}

/* ----------------------------------------------------------------------------
   8. Navbar Actions (Direct Call Pill & CTA)
   ---------------------------------------------------------------------------- */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: clamp(0.4rem, 0.8vw, 0.75rem);
  flex-shrink: 0;
}

.header-call-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.48rem clamp(0.6rem, 0.85vw, 0.95rem);
  border-radius: var(--r-full);
  background: var(--primary-pale);
  color: var(--primary);
  font-size: clamp(0.8rem, 0.84vw, 0.85rem);
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.header-call-btn:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13, 43, 85, 0.2);
}

.call-text-short {
  display: none;
}

.navbar-actions .btn {
  white-space: nowrap;
  font-size: clamp(0.82rem, 0.86vw, 0.88rem);
  font-weight: 600;
  padding: 0.48rem clamp(0.85rem, 1vw, 1.15rem);
  border-radius: var(--r-full);
}

/* ----------------------------------------------------------------------------
   9. Mobile Hamburger Toggle Button
   ---------------------------------------------------------------------------- */
.mobile-toggle-btn {
  display: none;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(13, 43, 85, 0.06);
  color: var(--primary);
  border: 1px solid var(--border);
  cursor: pointer;
  padding: 0;
  transition: var(--t-fast);
  flex-shrink: 0;
}

.mobile-toggle-btn:hover {
  background: rgba(13, 43, 85, 0.1);
}

.hamburger-line {
  display: block;
  width: 20px;
  height: 2px;
  background-color: var(--primary);
  transition: transform 0.25s ease, opacity 0.25s ease, background-color 0.25s ease;
  position: relative;
}

.hamburger-line::before,
.hamburger-line::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 2px;
  background-color: inherit;
  transition: transform 0.25s ease;
}

.hamburger-line::before {
  top: -6px;
}

.hamburger-line::after {
  bottom: -6px;
}

.mobile-toggle-btn.open .hamburger-line {
  background-color: transparent !important;
}

.mobile-toggle-btn.open .hamburger-line::before {
  transform: rotate(45deg) translate(4px, 4px);
  background-color: var(--primary);
}

.mobile-toggle-btn.open .hamburger-line::after {
  transform: rotate(-45deg) translate(4px, -4px);
  background-color: var(--primary);
}

.page-home .site-header:not(.scrolled) .mobile-toggle-btn.open .hamburger-line::before,
.page-home .site-header:not(.scrolled) .mobile-toggle-btn.open .hamburger-line::after {
  background-color: #FFFFFF;
}

/* ----------------------------------------------------------------------------
   10. Mobile Drawer Overlay & Sliding Panel
   ---------------------------------------------------------------------------- */
.mobile-drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(7, 24, 40, 0.65);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mobile-drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 320px;
  max-width: 85vw;
  background: var(--bg-white);
  box-shadow: -8px 0 35px rgba(0, 0, 0, 0.25);
  z-index: 1200;
  transform: translateX(100%);
  visibility: hidden;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s ease;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.mobile-drawer.active {
  transform: translateX(0);
  visibility: visible;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.15rem 1.35rem;
  border-bottom: 1px solid var(--border);
}

.drawer-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-muted);
  color: var(--text-dark);
  font-size: 1.4rem;
  line-height: 1;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all 0.2s ease;
}

.drawer-close-btn:hover {
  background: var(--primary);
  color: #FFFFFF;
  border-color: var(--primary);
}

.drawer-nav {
  padding: 1.15rem 1.35rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.drawer-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.7rem 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.18s ease;
}

.drawer-link:hover {
  color: var(--primary);
  background: rgba(13, 43, 85, 0.05);
}

.drawer-link.active {
  color: var(--primary);
  background: var(--accent-pale);
  border-left: 3px solid var(--accent);
  padding-left: 0.85rem;
}

.drawer-submenu {
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.15rem;
  margin-bottom: 0.35rem;
  border-left: 2px solid rgba(13, 43, 85, 0.08);
  margin-left: 0.85rem;
}

.drawer-sublink {
  padding: 0.4rem 0.6rem;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.18s ease;
}

.drawer-sublink:hover {
  color: var(--primary);
  background: rgba(13, 43, 85, 0.04);
}

.drawer-footer {
  margin-top: auto;
  padding: 1.25rem 1.35rem;
  background: var(--bg-pale);
  border-top: 1px solid var(--border-gold);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-phone-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg-white);
  padding: 0.7rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  text-decoration: none;
  transition: var(--t-fast);
}

.drawer-phone-card:hover {
  border-color: var(--accent);
}

.drawer-phone-icon {
  font-size: 1.25rem;
}

.drawer-phone-text b {
  display: block;
  font-size: 0.9rem;
  color: var(--primary);
}

.drawer-phone-text span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ----------------------------------------------------------------------------
   11. Adaptive Responsive Breakpoints (Guaranteed Zero Overflow)
   ---------------------------------------------------------------------------- */

/* Laptop screens (<= 1260px): Streamline logo & shorten call button */
@media (max-width: 1260px) {
  .brand-sub {
    display: none !important;
  }
  .call-text-full {
    display: none !important;
  }
  .call-text-short {
    display: inline !important;
  }
}

/* Tablets and small laptops (<= 1060px): Switch cleanly to mobile drawer toggle */
@media (max-width: 1060px) {
  .nav-menu {
    display: none !important;
  }
  .mobile-toggle-btn {
    display: flex !important;
  }
  .header-call-btn {
    display: inline-flex !important;
  }
}

/* Mobile Devices (<= 768px) */
@media (max-width: 768px) {
  .topbar-left .topbar-info {
    display: none;
  }
  .brand-title {
    font-size: 1.15rem;
  }
  .brand-crest {
    width: 36px;
    height: 36px;
  }
  .header-call-btn {
    display: none !important;
  }
  .navbar-actions .btn {
    padding: 0.42rem 0.85rem;
    font-size: 0.8rem;
  }
}

/* Small Phones (<= 480px) */
@media (max-width: 480px) {
  .site-topbar {
    font-size: 0.75rem;
  }
  .topbar-left .topbar-badge {
    font-size: 0.7rem;
    padding: 0.12rem 0.5rem;
  }
  .topbar-right .topbar-link:not(.whatsapp-link) {
    display: none;
  }
  .navbar-actions .btn {
    display: none;
  }
}
