/* ==========================================================================
   SUNMAX SOLAR POWER - HEADER & NAVIGATION STYLES
   ========================================================================== */

/* Sticky Header Container (Both Topbar and Navbar stay sticky at the top) */
#header-placeholder {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  width: 100%;
  min-height: 125px;
  z-index: 1000;
  display: block;
}

header.header-wrapper,
.header-wrapper {
  position: relative;
  width: 100%;
  display: block;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
}

/* Fallback if header.html is used directly without #header-placeholder */
header.header-wrapper:not(#header-placeholder .header-wrapper) {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 1000;
}

/* Top Info Bar */
.topbar {
  background: #021a30;
  color: #d1d5db;
  font-family: 'Poppins', sans-serif;
  font-size: 13px;
  padding: 8px 5vw;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: relative;
  z-index: 1002;
}

.topbar-left,
.topbar-right {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.topbar-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #e5e7eb;
  text-decoration: none;
  transition: color 0.25s ease;
}

.topbar-item:hover {
  color: #ffb703;
}

.topbar-item i,
.topbar-item svg {
  color: #ffb703;
  font-size: 14px;
}

.topbar-badge {
  background: rgba(255, 183, 3, 0.15);
  border: 1px solid rgba(255, 183, 3, 0.4);
  color: #ffb703;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.topbar-social {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.topbar-social a {
  color: #e5e7eb;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.12);
  text-decoration: none;
  font-size: 13px;
  transition: all 0.25s ease;
}

.topbar-social a:hover {
  color: #fff;
  transform: translateY(-2px);
}

.topbar-social a.social-fb:hover {
  background: #1877f2;
}

.topbar-social a.social-ig:hover {
  background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285aeb 90%);
}

.topbar-social a.social-yt:hover {
  background: #ff0000;
}

.topbar-social a.social-wa:hover {
  background: #25d366;
}

/* Header & Main Navbar */
.site-header,
header.site-header {
  background: linear-gradient(90deg, #003366 0%, #0077b6 45%, #ffb703 85%, #fb8500 100%);
  color: white;
  width: 100%;
  transition: all 0.3s ease;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 5vw;
  max-width: 1400px;
  margin: 0 auto;
}

/* Brand Logo */
.logo {
  display: flex;
  align-items: center;
}

.logo img {
  height: 75px;
  width: auto;
  border-radius: 6px;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.logo img:hover {
  transform: scale(1.05);
}

/* Desktop Navigation Links */
.nav-links {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 24px;
  margin: 0;
  padding: 0;
}

.nav-links li {
  position: relative;
}

.nav-links li a {
  color: #ffffff;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  position: relative;
  transition: color 0.25s ease, transform 0.25s ease;
}

.nav-links li a::after {
  content: '';
  position: absolute;
  width: 0;
  height: 3px;
  bottom: 0;
  left: 0;
  background: #ffffff;
  border-radius: 2px;
  transition: width 0.3s ease;
}

.nav-links li a:hover::after,
.nav-links li a.active::after {
  width: 100%;
}

.nav-links li a:hover,
.nav-links li a.active {
  transform: translateY(-1px);
}

.nav-links .arrow {
  font-size: 10px;
  transition: transform 0.25s ease;
  margin-left: 3px;
}

.nav-links .dropdown:hover .arrow {
  transform: rotate(90deg);
}

/* Dropdown Menu (Desktop) */
.nav-links .dropdown-content {
  display: block;
  position: absolute;
  top: calc(100% + 5px);
  left: 0;
  min-width: 280px;
  padding: 8px 0;
  background: #092c48;
  border: 1px solid rgba(255, 183, 3, 0.3);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4),
              0 0 20px rgba(255, 183, 3, 0.2);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  pointer-events: none;
  transition: all 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: 1050;
}

.nav-links .dropdown:hover .dropdown-content {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.nav-links .dropdown-content a {
  display: block;
  padding: 12px 20px;
  color: #f3f4f6;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.25s ease, color 0.25s ease, padding-left 0.25s ease;
}

.nav-links .dropdown-content a:last-child {
  border-bottom: none;
}

.nav-links .dropdown-content a:hover,
.nav-links .dropdown-content a.active {
  background: rgba(255, 183, 3, 0.15);
  color: #ffb703;
  padding-left: 26px;
}

.nav-links .dropdown-content a::after {
  display: none;
}

/* Header Quote CTA Button */
.header-cta-btn {
  background: #002244;
  color: #ffffff !important;
  font-family: 'Poppins', sans-serif;
  font-weight: 700 !important;
  font-size: 13.5px !important;
  padding: 9px 18px !important;
  border-radius: 25px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  transition: all 0.3s ease !important;
  border: 2px solid #ffb703;
  white-space: nowrap;
}

.header-cta-btn:hover {
  background: #ffb703 !important;
  color: #002244 !important;
  transform: translateY(-2px) scale(1.03) !important;
  box-shadow: 0 6px 18px rgba(255, 183, 3, 0.5);
}

.header-cta-btn::after {
  display: none !important;
}

/* Mobile Hamburger Menu */
.burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  z-index: 1001;
  padding: 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, 0.15);
  transition: background 0.3s ease;
}

.burger:hover {
  background: rgba(0, 0, 0, 0.3);
}

.burger div {
  width: 26px;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

/* Mobile Sidebar Drawer */
.sidebar {
  position: fixed;
  top: 0;
  left: -320px;
  width: 300px;
  height: 100%;
  background: linear-gradient(180deg, #002244 0%, #004d7a 50%, #006850 100%);
  color: white;
  transition: left 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
  padding: 25px 20px 40px 20px;
  box-shadow: 6px 0 35px rgba(0, 0, 0, 0.7);
  z-index: 9999;
  border-right: 1px solid rgba(255, 255, 255, 0.1);
  overflow-y: auto;
  box-sizing: border-box;
}

.sidebar.open {
  left: 0;
}

/* Mobile Drawer Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(3px);
  z-index: 9998;
}

.sidebar-overlay.active {
  display: block;
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 18px;
  margin-bottom: 15px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.sidebar-logo img {
  height: 55px;
}

.sidebar .close-btn {
  font-size: 26px;
  text-decoration: none;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  transition: color 0.25s ease;
}

.sidebar .close-btn:hover {
  color: #ffb703;
}

.sidebar a {
  display: block;
  padding: 12px 16px;
  color: white;
  text-decoration: none;
  font-family: 'Poppins', sans-serif;
  font-weight: 600;
  font-size: 15px;
  border-radius: 8px;
  margin-bottom: 6px;
  transition: all 0.25s ease;
}

.sidebar a:hover,
.sidebar a.active {
  background: #ffb703;
  color: #002244;
  padding-left: 22px;
}

/* Dropdown in Mobile Drawer */
.sidebar .dropdown > a {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sidebar .dropdown-content {
  background: rgba(0, 0, 0, 0.25);
  max-height: 0;
  overflow: hidden;
  border-radius: 8px;
  transition: max-height 0.35s ease, padding 0.3s ease;
  margin-left: 10px;
}

.sidebar .dropdown.active .dropdown-content {
  max-height: 450px;
  padding: 6px 0;
  margin-bottom: 8px;
}

.sidebar .dropdown-content a {
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 14px;
  margin: 0;
  border-radius: 6px;
  color: #e2e8f0;
}

.sidebar .dropdown-content a:hover,
.sidebar .dropdown-content a.active {
  background: rgba(255, 183, 3, 0.2);
  color: #ffb703;
}

/* Mobile Quick Contacts at Drawer Bottom */
.sidebar-contact-info {
  margin-top: 25px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  font-size: 13px;
  font-family: 'Poppins', sans-serif;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-contact-info a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 0;
  font-size: 13px;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.08);
}

.sidebar-contact-info a:hover {
  background: #ffb703;
  color: #002244;
}

/* Responsive Media Queries */
@media (max-width: 1024px) {
  .nav-links {
    gap: 16px;
  }
  .nav-links li a {
    font-size: 14px;
  }
  .header-cta-btn {
    display: none;
  }
}

@media (max-width: 820px) {
  #header-placeholder {
    min-height: 105px;
  }
  .topbar-right .topbar-time,
  .topbar-right .topbar-badge {
    display: none;
  }
  .nav-links {
    display: none;
  }
  .burger {
    display: flex;
  }
  .logo img {
    height: 60px;
  }
}

@media (max-width: 580px) {
  #header-placeholder {
    min-height: 98px;
  }
  .topbar {
    padding: 6px 12px;
    font-size: 11px;
  }
  .topbar-left {
    gap: 10px;
    width: 100%;
    justify-content: space-between;
    align-items: center;
  }
  .topbar-left .topbar-location {
    display: none;
  }
  .topbar-right {
    display: none;
  }
  .navbar {
    padding: 8px 14px;
  }
}

@media (max-width: 420px) {
  .topbar-left {
    justify-content: center;
    gap: 12px;
  }
  .topbar-item span {
    max-width: 155px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}
