/*
=====================================
  HEADER & NAVIGATION
  Navbar, Toolbar, Mobile Menu
=====================================
*/

/*---------------------------------------
  MAIN NAVBAR
-----------------------------------------*/
.navbar {
  padding-top: 0;
  padding-bottom: 0;
  transition: all 0.3s ease;
  background: var(
    --navbar-bg,
    linear-gradient(
      to right,
      rgba(180, 195, 210, 0.92) 0%,
      rgba(140, 160, 180, 0.9) 15%,
      rgba(100, 130, 150, 0.88) 30%,
      rgba(70, 95, 120, 0.9) 50%,
      rgba(44, 62, 80, 0.92) 100%
    )
  );
  backdrop-filter: blur(12px) saturate(150%);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
  height: 71px;
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  box-shadow: var(
    --navbar-shadow,
    0 8px 32px rgba(0, 0, 0, 0.15),
    0 2px 8px rgba(0, 0, 0, 0.1)
  );
  border-bottom: none;
  will-change: backdrop-filter;
  transform: translateZ(0);
}

.navbar-brand {
  font-size: var(--h4-font-size);
  font-weight: var(--font-weight-bold);
}

.navbar-brand,
.navbar-brand:hover {
  color: var(--navbar-brand-color, #ffffff);
}

/* Logo size classes using CSS custom properties */
.logo-mobile {
  width: var(--logo-width-mobile);
  height: var(--logo-height-mobile);
}

.logo-desktop {
  width: var(--logo-width-desktop);
  height: var(--logo-height-desktop);
}

.logo-toolbar-desktop,
.logo-toolbar-medium {
  width: var(--logo-toolbar-width);
  height: var(--logo-toolbar-height);
}

/* Keep all logos in original color */
.navbar .logo-mobile {
  filter: none;
  -webkit-filter: none;
}

/*---------------------------------------
  BRAND TAGLINE FOR RESPONSIVE DISPLAY
-----------------------------------------*/
.brand-tagline {
  font-size: 11px;
  line-height: 1.1;
  opacity: 1;
  color: var(
    --navbar-tagline-color,
    #ffffff
  ) !important;
  font-weight: 700;
  vertical-align: bottom !important;
  align-self: flex-end !important;
  padding-bottom: 2px !important;
}

/* Ensure navbar-brand allows proper vertical alignment */
.navbar-brand {
  align-items: flex-end !important;
}

/* Extra force for mobile brand alignment */
@media screen and (max-width: 991.98px) {
  .navbar.navbar-expand-lg .navbar-brand {
    align-items: flex-end !important;
  }

  .navbar.navbar-expand-lg .navbar-brand .brand-tagline {
    align-self: flex-end !important;
    vertical-align: bottom !important;
    padding-bottom: 2px !important;
    opacity: 1 !important;
    color: #ffffff !important;
    font-weight: 700 !important;
  }
}

.navbar-expand-lg .navbar-nav .nav-link {
  margin-right: 0;
  margin-left: 0;
  padding: 20px 35px;
}

.navbar-nav .nav-link {
  display: inline-block;
  color: var(--navbar-link-color, rgba(255, 255, 255, 0.9));
  font-size: var(--menu-font-size);
  font-weight: var(--font-weight-medium);
  position: relative;
  padding-top: 15px;
  padding-bottom: 15px;
  transition: all 0.3s ease;
  text-shadow: var(--navbar-link-shadow, 0 1px 2px rgba(0, 0, 0, 0.3));
}

.navbar-nav .nav-link.active,
.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.show {
  background: var(--navbar-link-hover-bg, rgba(255, 215, 79, 0.15));
  color: var(--navbar-link-hover-color, #ffffff);
  text-shadow: var(--navbar-link-hover-shadow, 0 1px 3px rgba(0, 0, 0, 0.4));
}

.dropdown-menu {
  border-radius: 0;
  border: 0;
  padding: 0;
}

.dropdown-item {
  border-bottom: 1px solid var(--border-color);
  display: inline-block;
  color: var(--p-bg-color);
  font-size: var(--menu-font-size);
  font-weight: var(--font-weight-medium);
  position: relative;
  padding-top: 10px;
  padding-bottom: 10px;
}

.dropdown-menu li:last-child .dropdown-item {
  border-bottom: 0;
}

.dropdown-item.active,
.dropdown-item:active,
.dropdown-item:focus,
.dropdown-item:hover {
  background: var(--primary-color);
  color: var(--white-color);
}

.dropdown-toggle::after {
  content: "\f282";
  display: inline-block;
  font-family: bootstrap-icons !important;
  font-size: var(--copyright-font-size);
  font-style: normal;
  font-weight: normal !important;
  font-variant: normal;
  text-transform: none;
  line-height: 1;
  vertical-align: -0.125em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  left: 2px;
  border: 0;
}

.navbar-toggler {
  border: 0;
  padding: 0;
  cursor: pointer;
  margin: 0;
  width: 30px;
  height: 35px;
  outline: none;
}

.navbar-toggler:focus {
  outline: none;
  box-shadow: none;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
  background: transparent;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:before,
.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:after {
  transition: top 300ms 50ms ease, -webkit-transform 300ms 350ms ease;
  transition: top 300ms 50ms ease, transform 300ms 350ms ease;
  transition: top 300ms 50ms ease, transform 300ms 350ms ease,
    -webkit-transform 300ms 350ms ease;
  top: 0;
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:before {
  transform: rotate(45deg);
}

.navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:after {
  transform: rotate(-45deg);
}

.navbar-toggler .navbar-toggler-icon {
  background: var(--white-color);
  transition: background 10ms 300ms ease;
  display: block;
  width: 30px;
  height: 2px;
  position: relative;
}

.navbar-toggler .navbar-toggler-icon:before,
.navbar-toggler .navbar-toggler-icon:after {
  transition: top 300ms 350ms ease, -webkit-transform 300ms 50ms ease;
  transition: top 300ms 350ms ease, transform 300ms 50ms ease;
  transition: top 300ms 350ms ease, transform 300ms 50ms ease,
    -webkit-transform 300ms 50ms ease;
  position: absolute;
  right: 0;
  left: 0;
  background: var(--white-color);
  width: 30px;
  height: 2px;
  content: "";
}

.navbar-toggler .navbar-toggler-icon::before {
  top: -8px;
}

.navbar-toggler .navbar-toggler-icon::after {
  top: 8px;
}

/*---------------------------------------
  CTA TOOLBAR
-----------------------------------------*/
.toolbar-section {
  /* Theme-aware default background */
  background: var(--toolbar-bg);
}

/* Scroll transparency for Navy theme - seamless gradient continuation from header */
.toolbar-section {
  background: linear-gradient(
    to right,
    rgba(80, 95, 120, calc(0.65 - (0.45 * var(--scroll-transparency, 0)))) 0%,
    rgba(65, 80, 105, calc(0.74 - (0.44 * var(--scroll-transparency, 0)))) 15%,
    rgba(45, 60, 85, calc(0.85 - (0.45 * var(--scroll-transparency, 0)))) 40%,
    rgba(15, 30, 50, calc(0.95 - (0.50 * var(--scroll-transparency, 0)))) 70%,
    rgba(5, 20, 35, calc(1.0 - (0.55 * var(--scroll-transparency, 0)))) 100%
  ) !important;
  border-top: none !important;
  border-bottom: none !important;
  margin-top: -1px !important;
}

/* Dark theme scroll transparency */
.theme-dark .toolbar-section {
  background: linear-gradient(
    to right,
    rgba(45, 45, 45, calc(0.98 - (0.78 * var(--scroll-transparency, 0)))) 0%,
    rgba(40, 40, 40, calc(0.96 - (0.76 * var(--scroll-transparency, 0)))) 25%,
    rgba(35, 35, 35, calc(0.98 - (0.78 * var(--scroll-transparency, 0)))) 50%,
    rgba(30, 30, 30, calc(0.96 - (0.76 * var(--scroll-transparency, 0)))) 75%,
    rgba(25, 25, 25, calc(0.98 - (0.78 * var(--scroll-transparency, 0)))) 100%
  ) !important;
}

/* Common toolbar styles with clear glass effect */
.toolbar-section {
  backdrop-filter: blur(calc(2px + (6px * var(--scroll-transparency, 0)))) saturate(calc(110% + (20% * var(--scroll-transparency, 0)))) contrast(calc(98% + (4% * var(--scroll-transparency, 0)))) brightness(calc(99% + (2% * var(--scroll-transparency, 0))));
  -webkit-backdrop-filter: blur(calc(2px + (6px * var(--scroll-transparency, 0)))) saturate(calc(110% + (20% * var(--scroll-transparency, 0)))) contrast(calc(98% + (4% * var(--scroll-transparency, 0)))) brightness(calc(99% + (2% * var(--scroll-transparency, 0))));
  padding: 6px 0;
  position: fixed;
  top: 71px;
  left: 0;
  right: 0;
  /* Ensure sticky positioning is maintained */
  z-index: 1025;
  /* Smooth transition for gradual transparency change */
  transition: all 0.2s ease-out;
  transform: translateZ(0);
  border-bottom: var(--toolbar-border, 1px solid rgba(255, 255, 255, 0.6));
  box-shadow: var(--toolbar-shadow, 0 2px 10px rgba(0, 0, 0, 0.04));
  width: 100%;
  max-width: 100vw;
  box-sizing: border-box;
  overflow-x: hidden;
  will-change: backdrop-filter;
}

/* Old scrolled state removed - now using CSS custom properties for gradual transparency */

/* Old pseudo-elements removed - no longer needed with CSS custom property approach */

/* Base button styles */
.toolbar-btn {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 16px;
  border-radius: 50px;
  text-decoration: none;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  letter-spacing: 0.025em;
}

/* Toolbar service text container */
.toolbar-service-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}

/* Toolbar compact container for logo + stars */
.toolbar-compact-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  position: relative;
  min-height: 50px;
}

/* Toolbar emergency content container */
.toolbar-emergency-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

/* Toolbar emergency stars styling */
.toolbar-emergency-stars {
  display: none;
  gap: 2px;
  align-items: center;
  font-size: 8px;
  justify-content: center;
  line-height: 1;
}

.toolbar-emergency-stars .bi-star-fill {
  color: #ffca28 !important;
  opacity: 1;
  transition: all 0.2s ease;
  width: 8px;
  height: 8px;
  font-size: 8px;
}

.toolbar-emergency-stars .bi-star-fill:hover {
  opacity: 1;
  transform: scale(1.2);
}

/* Stars overlay positioning for compact mode */
.toolbar-compact-container .toolbar-stars {
  position: absolute;
  bottom: -1px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1;
}

/* Base outline style for all CTA buttons */
.toolbar-btn.btn-outline-cta {
  background: rgba(255, 255, 255, 0.8);
  border: 2px solid #dee2e6;
  color: #495057;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Hover overlay for all buttons */
.toolbar-btn.btn-outline-cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: -1;
}

.toolbar-btn.btn-outline-cta:hover {
  background: transparent;
  color: white !important;
  border-color: transparent;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

/* Ensure icons and all text turn white on hover */
.toolbar-btn.btn-outline-cta:hover .bi,
.toolbar-btn.btn-outline-cta:hover span,
.toolbar-btn.btn-outline-cta:hover .text-primary,
.toolbar-btn.btn-outline-cta:hover .text-success {
  color: white !important;
}

.toolbar-btn.btn-outline-cta:hover::before {
  opacity: 1;
}

/* Get Quote button - Green theme */
#toolbar-quote-btn {
  border-color: rgba(0, 160, 93, 0.5);
  background: rgba(0, 160, 93, 0.08);
  color: var(--success-color);
  font-weight: 700;
  padding: 12px 24px;
}

#toolbar-quote-btn .bi {
  color: var(--success-color);
}

#toolbar-quote-btn::before {
  background: linear-gradient(
    135deg,
    var(--success-color),
    var(--success-dark)
  );
}

/* Call Now button - Green theme */
#toolbar-call-btn {
  border-color: rgba(25, 135, 84, 0.5);
  background: rgba(25, 135, 84, 0.08);
  color: #198754;
  width: 95px;
  text-align: center;
  white-space: nowrap;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

#toolbar-call-btn .bi {
  color: #198754;
  font-size: 14px;
}

#toolbar-call-btn::before {
  background: linear-gradient(135deg, #198754, #157347);
}

/* Book Consultation button - Green theme */
#toolbar-consultation-btn {
  border-color: rgba(25, 135, 84, 0.5);
  background: rgba(25, 135, 84, 0.08);
  color: #198754;
  width: 95px;
  text-align: center;
  white-space: nowrap;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

#toolbar-consultation-btn .bi {
  color: #198754;
}

#toolbar-consultation-btn::before {
  background: linear-gradient(135deg, #198754, #146c43);
}

/* WhatsApp button - Match Book Consultation button exactly */
#toolbar-whatsapp-btn {
  border-color: rgba(25, 135, 84, 0.5);
  background: rgba(25, 135, 84, 0.08);
  color: #198754;
  width: 95px;
  text-align: center;
  white-space: nowrap;
  padding: 6px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

#toolbar-whatsapp-btn .bi {
  color: #198754;
  font-size: 14px;
}

#toolbar-whatsapp-btn::before {
  background: linear-gradient(135deg, #198754, #146c43);
}

/*---------------------------------------
  MOBILE SLIDE-IN MENU
-----------------------------------------*/

/* Mobile Menu Toggle Button */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 30px;
  height: 24px;
  cursor: pointer;
  position: relative;
  z-index: 10001;
  padding: 0;
  margin: 0;
}

.hamburger-line {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--white-color);
  margin: 5px 0;
  transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  transform-origin: center;
}

/* Hamburger Animation States */
.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
  opacity: 0;
  transform: translateX(10px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile Menu Container */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 320px;
  height: 100vh;
  z-index: 10000;
  transition: right 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active {
  right: 0;
}

/* Mobile Menu Content */
.mobile-menu-content {
  position: relative;
  width: 100%;
  height: 100%;
  background: #ffffff;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  overflow-y: auto;
  overflow-x: hidden;
  transform: translateX(100%);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.mobile-menu.active .mobile-menu-content {
  transform: translateX(0);
}

/* Mobile Menu Header */
.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  background: var(--bg-light);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 10;
}

.mobile-menu-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading-color);
}

.mobile-menu-close {
  background: transparent;
  border: none;
  font-size: 1.5rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 5px;
  border-radius: 5px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
}

.mobile-menu-close:hover {
  background: var(--bg-light);
  color: var(--dark-color);
}

/* Mobile Menu Body */
.mobile-menu-body {
  padding: 20px 0;
}

/* Mobile Navigation List */
.mobile-nav-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-nav-item {
  border-bottom: 1px solid var(--border-light);
}

.mobile-nav-item:last-child {
  border-bottom: none;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  padding: 16px 20px;
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  font-size: 1rem;
  transition: all 0.2s ease;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.mobile-nav-link:hover,
.mobile-nav-link:focus {
  background: var(--bg-light);
  color: var(--primary-color);
  padding-left: 25px;
}

.mobile-nav-link i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

/* Mobile CTA Section */
.mobile-menu-cta {
  padding: 20px;
  background: var(--bg-section);
  border-top: 1px solid var(--border-light);
  margin-top: 20px;
}

.mobile-cta-divider {
  height: 1px;
  background: var(--border-light);
  margin-bottom: 15px;
}

.mobile-cta-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 14px 20px;
  margin-bottom: 10px;
  border-radius: var(--border-radius-medium);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  text-align: center;
}

.mobile-cta-btn:last-child {
  margin-bottom: 0;
}

.mobile-cta-call {
  background: var(--success-color);
  color: white;
}

.mobile-cta-call:hover,
.mobile-cta-call:focus {
  background: var(--success-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 160, 93, 0.3);
}

.mobile-cta-whatsapp {
  background: var(--whatsapp-color);
  color: white;
}

.mobile-cta-whatsapp:hover,
.mobile-cta-whatsapp:focus {
  background: #128c7e;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

/* Mobile Menu Overlay */
.mobile-menu-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.75);
  z-index: 9998;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
  backdrop-filter: blur(2px);
  pointer-events: none;
}

.mobile-menu.active .mobile-menu-overlay {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

/* Mobile Menu Responsive Breakpoints */
@media screen and (max-width: 991.98px) {
  .mobile-menu-toggle {
    display: block;
  }

  .desktop-nav {
    display: none !important;
  }
}

/* Ensure desktop navigation is visible on larger screens */
@media screen and (min-width: 992px) {
  .mobile-menu {
    display: none !important;
  }

  .mobile-menu-toggle {
    display: none !important;
  }
}

/* Menu Accessibility Focus States */
.mobile-menu-toggle:focus,
.mobile-menu-close:focus,
.mobile-nav-link:focus,
.mobile-dropdown-toggle:focus,
.mobile-dropdown-link:focus,
.mobile-cta-btn:focus {
  outline: 2px solid var(--primary-color);
  outline-offset: 2px;
}

/* Prevent body scroll when menu is open */
body.mobile-menu-open {
  overflow: hidden;
}

/* Darken main content when mobile menu is open */
body.mobile-menu-open > :not(.mobile-menu):not(.mobile-menu-overlay) {
  filter: brightness(0.7);
  transition: filter 0.15s ease;
}

/* Ensure menu content remains bright */
.mobile-menu-content {
  filter: brightness(1) !important;
}

/* Ensure overlay maintains its darkness */
.mobile-menu-overlay {
  filter: brightness(1) !important;
}


/*---------------------------------------
  REDUCED MOTION SUPPORT
-----------------------------------------*/
@media (prefers-reduced-motion: reduce) {
  .navbar,
  .navbar-nav .nav-link {
    transition: none !important;
    animation: none !important;
  }

  /* Allow smooth color transitions for toolbar but no animations */
  .toolbar-section {
    animation: none !important;
  }

  .navbar,
  .toolbar-section {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  .navbar {
    background: linear-gradient(
      to right,
      rgba(180, 195, 210, 0.98) 0%,
      rgba(140, 160, 180, 0.96) 15%,
      rgba(100, 130, 150, 0.94) 30%,
      rgba(70, 95, 120, 0.96) 50%,
      rgba(44, 62, 80, 0.98) 100%
    ) !important;
  }

  .toolbar-section {
    background: rgba(255, 255, 255, 0.95) !important;
  }
}