/* =========================================
   NAVBAR RESPONSIVE STYLES
   ========================================= */

/* Mobile Menu Defaults (Hidden on Desktop) */
.mobile-nav-toggle,
.mobile-sidebar-overlay {
  display: none;
}

/* --- 1024px --- */
@media (max-width: 1024px) {
  nav {
    padding: 1rem 2rem;
  }
  
  .top-bar {
    padding: 8px 2rem;
  }
}

/* --- 768px --- */
@media (max-width: 768px) {
  body {
    padding-top: 105px; /* Adjust for mobile header height */
  }

  .top-bar {
    padding: 8px 1.5rem;
    height: auto;
    min-height: 35px;
  }

  .top-bar-left {
    gap: 1rem;
    font-size: 0.75rem;
  }

  nav {
    padding: 0.8rem 1.5rem;
    justify-content: space-between;
    align-items: center;
  }

  .nav-links {
    display: none !important;
  }

  nav .logo img {
    height: 35px !important;
  }

  nav .nav-right .nav-contact-item,
  nav .nav-right .nav-divider {
    display: none;
  }

  nav .cta-button {
    display: none; /* Desktop CTA hidden, sidebar CTA used instead */
  }

  /* Hamburger Toggle */
  .mobile-nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    z-index: 1100;
    padding: 5px;
  }

  .mobile-nav-toggle span {
    display: block;
    width: 25px;
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
    transition: 0.3s ease;
  }

  .mobile-nav-toggle.is-active span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  .mobile-nav-toggle.is-active span:nth-child(2) {
    opacity: 0;
  }

  .mobile-nav-toggle.is-active span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  /* Sidebar Overlay */
  .mobile-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: 0.4s ease;
    display: block; /* Ensure it's block when visible */
  }

  .mobile-sidebar-overlay.is-active {
    opacity: 1;
    visibility: visible;
  }

  /* Sidebar Container */
  .sidebar-container {
    position: absolute;
    top: 0;
    right: 0;
    width: 80%;
    max-width: 320px;
    height: 100%;
    background: white;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.1);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
  }

  .mobile-sidebar-overlay.is-active .sidebar-container {
    transform: translateX(0);
  }

  /* Sidebar Header */
  .sidebar-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }

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

  .sidebar-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #1a1a1a;
  }

  /* Sidebar Content */
  .sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0;
  }

  .sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
  }

  .sidebar-nav > li {
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
  }

  .sidebar-nav > li > a {
    display: block;
    padding: 1rem 1.5rem;
    color: #1a1a1a;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    transition: 0.2s;
  }

  .sidebar-nav > li > a.active {
    color: #4361ee;
    background: rgba(67, 97, 238, 0.05);
  }

  /* Sidebar Dropdowns */
  .sidebar-dropdown .dropdown-header {
    padding: 1rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    color: #1a1a1a;
    font-size: 1.1rem;
    font-weight: 500;
  }

  .dropdown-arrow {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    color: #666;
  }

  .sidebar-dropdown.is-active .dropdown-arrow {
    transform: rotate(180deg);
    color: #4361ee;
  }

  .dropdown-list {
    list-style: none;
    padding: 0;
    margin: 0;
    background: rgba(0, 0, 0, 0.02);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-out;
  }

  .sidebar-dropdown.is-active .dropdown-list {
    max-height: 200px;
  }

  .dropdown-list li a {
    display: block;
    padding: 0.8rem 2.5rem;
    color: #666;
    text-decoration: none;
    font-size: 0.95rem;
    transition: 0.2s;
  }

  .dropdown-list li a:hover {
    color: #4361ee;
  }

  /* Sidebar Footer */
  .sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
  }

  .sidebar-cta {
    display: block;
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, #4361ee, #7209b7);
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(67, 97, 238, 0.2);
  }
}
