/* ✅ FIX: Body margin removal to prevent gap */
body {
    margin: 0;
    padding: 0;
    overflow-x: hidden; /* Prevent horizontal scroll */
}

.main-nav {
    background: #0A1F44;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    padding: 1rem 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
}

.nav-container {
    width: 100%;
    max-width: 1300px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo-img {
    height: 60px;
    width: auto;
    border-radius: 50%;
    border: 2px solid var(--secondary);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.5);
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: rotate(10deg);
}

.logo-text {
    font-size: 1.8rem;
    font-weight: 700;
    color: #D4AF37;
    letter-spacing: 1px;
}

.nav-links {
    display: flex;
    list-style: none;
    align-items: center !important;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    font-size: 0.93rem;
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 0.5rem 0;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    background-color: var(--secondary);
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    transition: width 0.3s ease-out;
}

.nav-links a:hover::after {
    width: 100%;
}

.nav-cta {
    background-color: #D4AF37;
    color: var(--primary) !important;
    padding: 0.7rem 1.8rem !important;
    border-radius: 50px;
    font-weight: 600 !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
}

/* Desktop Dropdown */
.dropdown,
.dropdown-menu {
  position: relative;
}
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0; /* remove the gap */
  background: rgba(10,31,68,0.95);
  min-width: 220px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  border: 1px solid #D4AF37;
  border-radius: 6px;
  overflow: hidden;
  z-index: 999;
}

/* Keep menu open when hovering either parent or menu itself */
.dropdown:hover .dropdown-menu,
.dropdown-menu:hover {
  display: block;
}
.dropdown-menu li {
  border-bottom: 1px solid #eee;
}

.dropdown-menu li:last-child {
  border-bottom: none;
}

.dropdown-menu a {
  display: block;
  padding: 12px 16px;
  font-size: 0.95rem;
  color: #fff;
  text-decoration: none;
}

.dropdown-menu a:hover {
  background: rgba(212,175,55,0.15);
  color: #fff; /* stays white text */
}

/* Show on hover */
.dropdown:hover .dropdown-menu {
  display: block;
}

/* Mobile submenu */
.mobile-dropdown .mobile-submenu {
  display: none;
  padding-left: 15px;
}

.mobile-dropdown.open .mobile-submenu {
  display: block;
}

.nav-cta:hover {
    background-color: #c19b2a !important;
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.nav-cta::after {
    display: none;
}

/* --- Mobile Navigation Styles --- */
.mobile-nav-container {
    display: none;
    position: relative;
}

.hamburger {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    z-index: 1001;
    padding: 10px;
}

.hamburger span {
    width: 30px;
    height: 3px;
    background-color: var(--secondary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-nav-menu {
    position: fixed;
    top: 0;
    right: 0;
    transform: translateX(100%);
    height: 100vh;
    width: 80%;
    max-width: 350px;
    background: rgba(10, 31, 68, 0.98);
    backdrop-filter: blur(10px);
    transition: transform 0.4s ease-out, opacity 0.3s ease;
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 80px 30px 30px;
    overflow-y: auto;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
    
    /* ✅ FIX: Ensure it doesn't affect page layout when hidden */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.mobile-nav-menu.active {
    transform: translateX(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}


.mobile-nav {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    list-style: none;
}

.mobile-nav li {
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.4s ease;
}

.mobile-nav.active li {
    opacity: 1;
    transform: translateX(0);
}

.mobile-nav li:nth-child(1) { transition-delay: 0.1s; }
.mobile-nav li:nth-child(2) { transition-delay: 0.15s; }
.mobile-nav li:nth-child(3) { transition-delay: 0.2s; }
.mobile-nav li:nth-child(4) { transition-delay: 0.25s; }
.mobile-nav li:nth-child(5) { transition-delay: 0.3s; }
.mobile-nav li:nth-child(6) { transition-delay: 0.35s; }
.mobile-nav li:nth-child(7) { transition-delay: 0.4s; }

.mobile-nav a {
    font-size: 1.2rem;
    color: var(--neutral);
    display: block;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.mobile-nav a:hover {
    background-color: rgba(212, 175, 55, 0.1);
    transform: translateX(5px);
}

.mobile-nav .nav-cta {
    margin-top: 20px;
    text-align: center;
}

.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
    pointer-events: none; /* 🔒 block events when not active */
}

.overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto; /* ✅ enable block */
}

/* Hamburger to 'X' animation */
.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(8px, -8px);
}

.close-menu {
    position: absolute;
    top: 20px;
    right: 20px;
    background: none;
    border: none;
    color: var(--secondary);
    font-size: 1.8rem;
    cursor: pointer;
    z-index: 1002;
}

/* --- Media Queries for Responsiveness --- */
@media (max-width: 1024px) {
    .desktop-nav {
        display: none;
    }

    .mobile-nav-container {
        display: block;
    }

    /* Adjust padding for a tighter mobile layout */
    .main-nav {
        padding: 0.8rem 1.5rem;
    }

    /* Ensure the logo image is not too large on small screens */
    .logo-img {
        height: 50px;
    }

    /* Scale down the logo text for smaller screens */
    .logo-text {
        font-size: 1.5rem;
    }
}

/* For very small screens (like phones in portrait mode) */
@media (max-width: 768px) {
    .main-nav {
        padding: 0.8rem 1rem;
    }
    
    .logo-img {
        height: 40px;
    }

    .logo-text {
        font-size: 1.3rem;
    }

    .nav-container {
        /* Ensure the logo and hamburger button are aligned correctly */
        gap: 1rem;
    }
}