/* ============================================
   Header V2 - Clean Implementation
   ============================================ */

.header-v2 {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10010;
  background: transparent;
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.header-v2.scrolled {
  background: rgba(26, 18, 64, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body.page-service-electrical-marine .header-v2 {
  background: rgba(26, 18, 64, 0.98);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

body[class^="page-service-"] .header-v2,
body[class*=" page-service-"] .header-v2 {
  background: rgba(26, 18, 64, 0.98) !important;
  backdrop-filter: blur(10px) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1) !important;
}

.header-container {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: none;
  margin: 0 auto;
  padding: 24px 40px;
}

/* Brand */
.header-brand {
  display: grid;
  grid-auto-flow: column;
  align-items: center;
  column-gap: 12px;
  text-decoration: none;
  color: #ffffff;
}

.header-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #ffffff;
}

.header-logo svg {
  width: 18px;
  height: 18px;
}

.header-logo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.header-brand-name {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

/* Services Dropdown */
.header-services {
  position: relative;
  display: flex;
  align-items: center;
}

.services-toggle {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
  text-transform: capitalize;
}

.services-toggle:hover {
  color: #ffffff;
}

.services-chevron {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.services-toggle[aria-expanded="true"] .services-chevron {
  transform: rotate(180deg);
}

.services-chevron svg {
  width: 14px;
  height: 14px;
}

.services-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 240px;
  background: rgba(26, 18, 64, 0.95);
  backdrop-filter: saturate(160%) blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 0;
  margin-top: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 9990;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}

.header-services.open .services-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.services-item {
  display: block;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.services-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Navigation */
.header-nav {
  display: flex;
  align-items: center;
  gap: 15px;
}

.header-nav-link {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: color 0.2s ease;
  text-transform: capitalize;
}

.header-nav-link:hover {
  color: #ffffff;
}

/* Nav Dropdown */
.nav-dropdown {
  position: relative;
}

.nav-dropdown-toggle {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s ease;
  text-transform: capitalize;
}

.nav-dropdown-toggle:hover {
  color: #ffffff;
}

.nav-chevron {
  display: flex;
  align-items: center;
  transition: transform 0.2s ease;
}

.nav-dropdown-toggle[aria-expanded="true"] .nav-chevron {
  transform: rotate(180deg);
}

.nav-chevron svg {
  width: 12px;
  height: 12px;
}

.nav-dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: rgba(26, 18, 64, 0.95);
  backdrop-filter: saturate(160%) blur(22px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 0;
  margin-top: 12px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
  z-index: 9990;
  box-shadow: 0 8px 12px rgba(0, 0, 0, 0.3);
}

.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-dropdown-item {
  display: block;
  padding: 12px 20px;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 15px;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.nav-dropdown-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

/* Search */
.header-search {
  margin-left: 0;
}

.search-form {
  display: flex;
  align-items: center;
}

.search-form input {
  display: none;
}

.search-form button {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  padding: 8px;
  display: flex;
  align-items: center;
  transition: color 0.2s ease;
}

.search-form button:hover {
  color: #ffffff;
}

.search-form button svg {
  width: 20px;
  height: 20px;
}

/* Header CTA */
.header-cta {
  display: flex;
  align-items: center;
  gap: 0;
  margin-left: auto;
}

.header-phone {
  display: grid;
  grid-template-rows: auto auto;
  gap: 0;
  align-items: end;
  justify-items: end;
  padding-right: 16px;
  border-right: 1px solid rgba(255, 255, 255, 0.3);
}

.phone-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  color: rgba(255, 255, 255, 0.7);
}

.phone-number {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  text-decoration: none;
  letter-spacing: -0.01em;
  transition: color 0.2s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.phone-number:hover {
  color: rgba(255, 255, 255, 0.8);
}

.btn-appointment {
  background: #5b7cff;
  color: #ffffff;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  padding: 12px 24px;
  margin-left: 16px;
  transition: all 0.25s ease;
  white-space: nowrap;
  border: 1px solid #5b7cff;
  height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-transform: capitalize;
}

.btn-appointment:hover {
  background: #4a66db;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  background: transparent;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 8px;
  order: 999;
}

.mobile-menu-toggle svg {
  width: 24px;
  height: 24px;
}

/* Responsive */
@media (max-width: 900px) {
  .header-container {
    position: relative;
  }
  
  .mobile-menu-toggle {
    display: block;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10000;
  }
  
  .header-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 300px;
    height: 100vh;
    background: #1a1240;
    backdrop-filter: none;
    flex-direction: column;
    align-items: flex-start;
    padding: 80px 24px 24px;
    gap: 0;
    transition: right 0.3s ease;
    overflow-y: auto;
    z-index: 9999;
    box-shadow: none;
  }
  
  .header-nav.mobile-open {
    right: 0;
  }
  
  /* Mobile overlay */
  .header-nav::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    z-index: -1;
  }
  
  .header-nav.mobile-open::before {
    opacity: 1;
    visibility: visible;
  }
  
  .nav-dropdown,
  .header-nav-link {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  }
  
  .nav-dropdown-toggle,
  .header-nav-link {
    padding: 16px 0;
    width: 100%;
    text-align: left;
  }
  
  .nav-dropdown-menu {
    position: static;
    width: 100%;
    margin-top: 0;
    padding: 0 0 8px 16px;
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }
  
  .nav-dropdown.open .nav-dropdown-menu {
    display: block;
  }
  
  .nav-dropdown-item {
    padding: 12px 0;
  }
  
  .header-search {
    display: none !important;
  }
  
  /* Hide nav on mobile by default */
  .header-nav {
    display: flex;
  }
  
  .header-cta {
    display: none !important;
  }
}

@media (max-width: 1024px) {
  .header-container {
    padding: 20px 24px;
  }
  
  .header-nav {
    gap: 12px;
  }
  
  .search-form input {
    width: 160px;
  }
  
  .btn-appointment {
    background: transparent;
    border: none;
    padding: 0;
    width: auto;
    min-width: auto;
    height: auto;
  }
  
  .btn-appointment:hover {
    background: transparent;
  }
  
  .btn-appointment svg {
    width: 20px;
    height: 20px;
  }
  
  .btn-appointment .btn-text {
    display: none;
  }
}
