/* =============================== TOP CONTACT BAR =============================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-slate);
  color: var(--color-white);
  font-size: 0.9rem;
  padding: 0.4rem 0;
  display: none; /* hidden on mobile */
  z-index: 1200;
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-info span {
  margin-right: 1.5rem;
}

.contact-info i {
  margin-right: 6px;
  color: var(--color-green);
}

.social-icons a {
  color: var(--color-white);
  margin-left: 1rem;
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: var(--color-green);
}

@media (min-width: 768px) {
  .top-bar {
    display: block;
  }
}

/* =============================== MAIN HEADER (FIXED) =============================== */
.main-header {
  position: fixed;
  /* DESKTOP DEFAULT: Positioned below the visible top bar (32px) */
  top: 32px; 
  left: 0;
  width: 100%;
  z-index: 1100;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* For compatibility */
  transition: background 0.3s ease, box-shadow 0.3s ease, top 0.3s ease;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* REMOVED: body.has-no-topbar .main-header rule as it's handled by media query */

.main-header.scrolled {
  background: rgba(2, 6, 23, 0.85);
  box-shadow: 0 3px 15px rgba(0,0,0,0.3);
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
}

.logo img {
  width: 160px;
  height: auto;
}

/* =============================== NAVIGATION =============================== */
.navbar ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.navbar a {
  color: var(--color-white);
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
}

/* ✅ Underline hover animation */
.navbar a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-green);
  transition: width 0.3s ease;
}

.navbar a:hover::after,
.navbar a.active::after {
  width: 100%;
}

.navbar a:hover {
  color: var(--color-green);
}

/* =============================== CONTACT BUTTON =============================== */
.btn-contact {
  color: var(--color-green);
  border: 2px solid var(--color-green);
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: color 0.4s ease;
}

.btn-contact::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background-color: var(--color-green);
  z-index: -1;
  transition: width 0.4s ease;
}

.btn-contact:hover::before {
  width: 100%;
}

.btn-contact:hover {
  color: var(--color-slate) !important;
}

/* =============================== MOBILE MENU =============================== */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  z-index: 1300; 
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--color-white);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* ======== Responsive (Mobile < 768px) ======== */
@media (max-width: 768px) {
  
  /* ✅ THE FIX: Override the desktop 'top: 32px' setting to fix the header to the very top */
  .main-header {
    top: 0;
  }
  
  /* REMOVED: body.has-no-topbar .main-header { top: 0; padding:0;} */
  

  .navbar ul {
    position: fixed;
    top: 0; /* Menu slides from the very top */
    right: -100%;
    width: 75%;
    height: 100vh;
    background: rgba(2,6,23,0.96);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 4rem 1.5rem;
    text-align: left;
    transition: right 0.4s ease-in-out;
    box-shadow: -2px 0 10px rgba(0,0,0,0.4);
    overflow-y: auto;
  }

  .navbar ul.show {
    right: 0;
  }

  .navbar ul li {
    width: 100%;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .navbar ul li:last-child {
    border-bottom: none;
  }

  .navbar a {
    display: block;
    width: 100%;
    font-size: 1.1rem;
  }

  .menu-toggle {
    display: flex;
  }

  /* Hamburger → X animation */
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}
/* =============================== TOP CONTACT BAR =============================== */
.top-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--color-slate);
  color: var(--color-white);
  font-size: 0.9rem;
  padding: 0.4rem 0;
  display: none; /* hidden on mobile */
  z-index: 1200;
  transition: transform 0.3s ease, opacity 0.3s ease; /* ✅ added for smooth hide/show */
}

.top-bar .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.contact-info span {
  margin-right: 1.5rem;
}

.contact-info i {
  margin-right: 6px;
  color: var(--color-green);
}

.social-icons a {
  color: var(--color-white);
  margin-left: 1rem;
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: var(--color-green);
}

@media (min-width: 768px) {
  .top-bar {
    display: block;
  }
}

/* =============================== MAIN HEADER (FIXED) =============================== */
.main-header {
  position: fixed;
  /* DESKTOP DEFAULT: Positioned below the visible top bar (32px) */
  top: 32px;
  left: 0;
  width: 100%;
  z-index: 1100;
  background: rgba(2, 6, 23, 0.9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px); /* For compatibility */
  transition: background 0.3s ease, box-shadow 0.3s ease, top 0.3s ease,
              transform 0.3s ease, opacity 0.3s ease; /* ✅ added for smooth hide/show */
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

/* =============================== ✅ ADDED HIDE ANIMATION =============================== */
@media (min-width: 768px) {
  .top-bar.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
  }

  .main-header.hidden {
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
  }
}

/* =============================== SCROLLED STATE =============================== */
.main-header.scrolled {
  background: rgba(2, 6, 23, 0.85);
  box-shadow: 0 3px 15px rgba(0,0,0,0.3);
}

.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.65rem 0;
}

.logo img {
  width: 160px;
  height: auto;
}

/* =============================== NAVIGATION =============================== */
.navbar ul {
  list-style: none;
  display: flex;
  gap: 2rem;
  margin: 0;
  padding: 0;
}

.navbar a {
  color: var(--color-white);
  font-weight: 600;
  position: relative;
  transition: color 0.3s ease;
}

/* ✅ Underline hover animation */
.navbar a::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--color-green);
  transition: width 0.3s ease;
}

.navbar a:hover::after,
.navbar a.active::after {
  width: 100%;
}

.navbar a:hover {
  color: var(--color-green);
}

/* =============================== CONTACT BUTTON =============================== */
.btn-contact {
  color: var(--color-green);
  border: 2px solid var(--color-green);
  padding: 0.5rem 1.2rem;
  border-radius: 6px;
  font-weight: 600;
  position: relative;
  overflow: hidden;
  z-index: 1;
  transition: color 0.4s ease;
}

.btn-contact::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0;
  background-color: var(--color-green);
  z-index: -1;
  transition: width 0.4s ease;
}

.btn-contact:hover::before {
  width: 100%;
}

.btn-contact:hover {
  color: var(--color-slate) !important;
}

/* =============================== MOBILE MENU =============================== */
.menu-toggle {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
  z-index: 1300;
}

.menu-toggle span {
  width: 25px;
  height: 3px;
  background: var(--color-white);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* ======== Responsive (Mobile < 768px) ======== */
@media (max-width: 768px) {
  .main-header {
    top: 0;
  }

  .navbar ul {
    position: fixed;
    top: 0;
    right: -100%;
    width: 75%;
    height: 100vh;
    background: rgba(2,6,23,0.96);
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 4rem 1.5rem;
    text-align: left;
    transition: right 0.4s ease-in-out;
    box-shadow: -2px 0 10px rgba(0,0,0,0.4);
    overflow-y: auto;
  }

  .navbar ul.show {
    right: 0;
  }

  .navbar ul li {
    width: 100%;
    padding: 0.2rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }

  .navbar ul li:last-child {
    border-bottom: none;
  }

  .navbar a {
    display: block;
    width: 100%;
    font-size: 1.1rem;
  }

  .menu-toggle {
    display: flex;
  }

  /* Hamburger → X animation */
  .menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
  }
  .menu-toggle.active span:nth-child(2) {
    opacity: 0;
  }
  .menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
  }
}
