/* ============================================================
   1. BASIC RESET
   Ensures consistent rendering across browsers
============================================================ */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* ============================================================
   2. NAVBAR BASE
   Sticky navigation with centered container
============================================================ */
nav {
  position: fixed;           /* sticky nav */
  top: 0;
  left: 0;
  width: 100%;
  background: rgba(14, 14, 14, 1);
  z-index: 1000;
  padding: 20px 0;
  overflow: visible !important; /* prevent clipping */
}

nav .nav-container {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px;
  overflow: visible !important;
}

nav .logo img {
  height: 50px;
  width: auto;
  display: block;
}

/* ============================================================
   3. MENU LIST (DESKTOP)
============================================================ */
#nav-menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  overflow: visible !important;
}

#nav-menu li {
  position: relative;
  list-style: none;
}

#nav-menu li a {
  text-decoration: none;
  color: rgba(255, 255, 255, 0.8);
  font-weight: 100;
  transition: color 0.3s ease;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

#nav-menu li a:hover {
  color: #fff;
  background: none;
}

/* ============================================================
   4. DROPDOWN CARET
============================================================ */
.caret-menutoggle {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 4px solid rgba(255, 255, 255, 0.65);
  display: inline-block;
  margin-left: 0.3rem;
  transition: transform 0.25s ease;
  vertical-align: middle;
}

/* Rotate caret when submenu is open */
#nav-menu li.services.open > a .caret-menutoggle {
  transform: rotate(180deg);
}

/* ============================================================
   5. DROPDOWN MENU (DESKTOP)
============================================================ */
#nav-menu li ul.dropdown {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 180px;
  background: rgba(14, 14, 14, 0.95);
  border-radius: 4px;
  padding: 0.5rem 0;
  z-index: 999;
}

#nav-menu li ul.dropdown li {
  padding: 0.5rem 1rem;
}

#nav-menu li ul.dropdown li a {
  color: #fff;
  width: 100%;
}

/* Show dropdown on hover (desktop only) */
#nav-menu li.services:hover ul.dropdown,
#nav-menu li.social:hover ul.dropdown {
  display: flex;
}

/* ============================================================
   6. MOBILE DROPDOWN TOGGLE
============================================================ */
#nav-menu li.open > ul.dropdown {
  display: flex;
  flex-direction: column;
  padding-left: 1rem; /* indent inside mobile menu */
  animation: dropdown-slide 0.3s ease forwards;
}

@keyframes dropdown-slide {
  from { opacity: 0; transform: translateY(-10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   7. HAMBURGER MENU
============================================================ */
#is-menu-toggle {
  display: none; /* hidden on desktop */
  flex-direction: column;
  justify-content: space-between;
  width: 25px;
  height: 18px;
  cursor: pointer;
  position: relative;
  z-index: 1001;
  background: none;
  border: none;
}

#is-menu-toggle .line {
  width: 25px;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: all 0.3s ease;
  position: relative;
}

/* Hamburger animation when active */
#is-menu-toggle.active .line:nth-child(1) {
  transform: translateY(8px) rotate(45deg);
}
#is-menu-toggle.active .line:nth-child(2) {
  opacity: 0;
}
#is-menu-toggle.active .line:nth-child(3) {
  transform: translateY(-8px) rotate(-45deg);
}

/* ============================================================
   8. MOBILE VIEW
============================================================ */
@media (max-width: 768px) {
  #is-menu-toggle {
    display: flex;
  }

  #nav-menu {
    display: none;
    flex-direction: column;
    align-items: flex-start;
    background: rgba(14, 14, 14, 0.95);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem;
    gap: 1rem;
  }

  #nav-menu.active {
    display: flex;
    animation: menu-slide 0.3s ease forwards;
  }

  @keyframes menu-slide {
    from { opacity: 0; transform: translateY(-20px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ============================================================
   9. ALTERNATIVE MENU STYLING (.is-menu)
============================================================ */
.is-menu li ul {
  background: rgba(255, 255, 255, 0.95);
}
.is-menu li ul li a {
  color: rgba(0, 0, 0, 0.9);
}
.is-menu li ul li:hover {
  background: rgba(0, 0, 0, 0.05);
}
.is-menu li ul li:hover a {
  color: rgba(0, 0, 0, 1);
}
.is-menu > ul > li > ul.active {
  z-index: -1;
}

/* ============================================================
   10. SOCIAL DROPDOWN FIX
============================================================ */
#nav-menu li.social {
  position: relative;
}

#nav-menu li.social > a {
  display: flex;       
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}

/* Align social dropdown on desktop */
@media (min-width: 769px) {
  #nav-menu li.social > ul.dropdown {
    right: 0;
    left: auto;
  }
}