/* ========================================================== */
/* STICKY HEADER (SHARED BASE)                                */
/* ========================================================== */

.ab-nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  /* Default Desktop Padding */
  padding: 40px 7vw;
  background-color: transparent; /* Start Transparent */
  transition: transform 0.4s cubic-bezier(0.215, 0.61, 0.355, 1), 
              padding 0.3s ease, 
              background-color 0.3s ease;
  will-change: transform;
}

.ab-nav.nav-hidden {
  transform: translateY(-100%);
}

.ab-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  z-index: 1001;
}

/* Scrolled State (Shared) */
.ab-nav.is-scrolled {
  background-color: rgba(0, 0, 0, 0.98);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
/* Desktop Scrolled Padding */
@media (min-width: 769px) {
  .ab-nav.is-scrolled { padding: 24px 7vw; }
}

/* ========================================================== */
/* DESKTOP STYLES (Min-Width: 769px)                          */
/* ========================================================== */

@media (min-width: 769px) {
  /* HIDE MOBILE ELEMENTS STRICTLY */
  .ab-nav-toggle,
  .ab-mobile-menu,
  .ab-logo-mobile-full,
  .ab-logo-mobile-icon {
    display: none !important;
  }

  /* LOGO HANDLING */
  .ab-logo a {
    display: block;
    position: relative;
    height: 20px;       
    width: 180px;       
    transition: width 0.3s ease, height 0.3s ease;
  }

  .ab-logo img {
    height: 100%;
    width: auto;
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }

  /* Initial State: Full Visible, Icon Hidden */
  .ab-logo-full { opacity: 1; transform: translateY(0); }
  .ab-logo-icon { opacity: 0; transform: translateY(20px); }

  /* Scrolled State: Full Hidden, Icon Visible */
  .ab-nav.is-scrolled .ab-logo a { height: 26px; width: 32px; }
  .ab-nav.is-scrolled .ab-logo-full { opacity: 0; transform: translateY(-26px); }
  .ab-nav.is-scrolled .ab-logo-icon { opacity: 1; transform: translateY(0); }

  /* NAVIGATION */
  .ab-nav-links {
    display: flex;
    gap: 32px;
    font-size: 14px;
    align-items: center;
  }

  .ab-nav-links a,
  .ab-nav-link-btn {
    color: var(--ab-text-main);
    text-decoration: none;
    opacity: 0.78;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    position: relative;
    padding-bottom: 4px;
    background: none;
    border: none;
    font-family: inherit;
    font-size: inherit;
    cursor: pointer;
    transition: opacity 0.1s ease, color 0.1s ease;
  }

  .ab-nav-links a:hover,
  .ab-nav-link-btn:hover { opacity: 1; color: #fff; }

  .ab-nav-links a::after,
  .ab-nav-link-btn::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 0;
    height: 1px;
    background: var(--ab-accent);
    transition: width 0.18s ease-out;
  }

  .ab-nav-links a:hover::after,
  .ab-nav-links a.is-current::after,
  .ab-nav-link-btn.is-current::after { width: 100%; }

  /* DROPDOWN */
  .ab-nav-dropdown { position: relative; height: 100%; display: flex; align-items: center; }
  .ab-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    min-width: 260px;
    background: #050505; 
    border-top: 2px solid var(--ab-accent);
    border-left: 1px solid #1a1a1a;
    border-right: 1px solid #1a1a1a;
    border-bottom: 1px solid #1a1a1a;
    padding: 8px 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.1s ease-out, transform 0.1s ease-out, visibility 0.1s;
    box-shadow: 0 20px 50px rgba(0,0,0,0.9);
    display: flex;
    flex-direction: column;
  }
  .ab-nav-dropdown:hover .ab-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(20px);
  }
  .ab-dropdown-menu a {
    display: block;
    padding: 14px 24px;
    white-space: nowrap;
    font-size: 13px;
    opacity: 0.7;
    color: #a1a1aa;
    transition: all 0.1s ease;
    border-left: 2px solid transparent;
  }
  .ab-dropdown-menu a:hover {
    opacity: 1;
    color: #fff;
    background: linear-gradient(90deg, rgba(27, 138, 255, 0.1) 0%, transparent 100%);
    border-left: 2px solid var(--ab-accent);
    padding-left: 28px;
  }
}

/* ========================================================== */
/* MOBILE STYLES (Max-Width: 768px)                           */
/* ========================================================== */

@media (max-width: 768px) {
  /* HIDE DESKTOP ELEMENTS STRICTLY */
  .ab-nav-links,
  .ab-logo-full,
  .ab-logo-icon {
    display: none !important;
  }

  /* HEADER PADDING */
  .ab-nav { padding: 20px 24px; }
  .ab-nav.is-scrolled { padding: 16px 24px; }

  /* HAMBURGER (Right Side Default) */
  .ab-nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 6px;
    background: none;
    border: none;
    padding: 10px 0;
    z-index: 2001; 
    position: relative;
    order: 2; /* Push to right */
  }

  .ab-toggle-line {
    display: block;
    width: 24px;
    height: 2px;
    background-color: #fff;
    transition: transform 0.3s ease;
  }

  /* LOGO CONTAINER */
  .ab-logo {
    order: 1; /* Left side default */
    flex: 1; /* Take up space to push hamburger right */
  }
  
  .ab-logo a {
    display: block;
    width: auto;
    height: auto;
  }

  /* LOGO IMAGES (FIXED SIZE - REDUCED to 16px) */
  .ab-logo img {
    height: 16px !important; 
    width: auto !important;
    display: block;
  }

  /* --- STATE 1: INITIAL (Full Logo Left, Hamburger Right) --- */
  .ab-logo-mobile-full { display: block !important; }
  .ab-logo-mobile-icon { display: none !important; }

  /* --- STATE 2: SCROLLED (Icon Logo Center, Hamburger Right) --- */
  .ab-nav.is-scrolled .ab-logo-mobile-full { display: none !important; }
  .ab-nav.is-scrolled .ab-logo-mobile-icon { 
    display: block !important; 
    margin: 0 auto; 
    height: 24px !important; 
  }
  .ab-nav.is-scrolled .ab-logo {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: auto;
    flex: initial;
  }

  /* FULL SCREEN MENU CONTAINER */
  .ab-mobile-menu {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    background: #000000;
    z-index: 2000;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .ab-mobile-menu.is-active {
    transform: translateY(0);
  }

  /* SLIDING PANELS LOGIC */
  .ab-mobile-menu-container {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
  }

  /* --- PREMIUM STYLE UPDATES START HERE --- */

  .ab-mobile-panel {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 120px 32px 40px; /* More top padding for breathing room */
    overflow-y: auto;
    transition: transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1), opacity 0.3s ease;
    
    /* Altablack Brand Gradient Background */
    background: radial-gradient(circle at 0% 0%, #111624 0%, #000000 70%);
  }

  /* Panel States */
  .ab-mobile-panel.ab-panel-hidden {
    transform: translateX(100%);
    display: block !important; 
  }
  
  .ab-mobile-panel.ab-panel-out-left {
    transform: translateX(-30%);
    opacity: 0;
  }

  .ab-mobile-links {
    display: flex;
    flex-direction: column;
    /* Removed gap in favor of padding on items for tighter control */
  }

  /* LINKS - Altablack Style: Uppercase, Tracked, Thin Blue Borders */
  .ab-mobile-links a {
    font-family: "Inter", sans-serif;
    font-size: 15px; /* Elegant, technical size */
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    
    /* Premium border separator */
    border-bottom: 1px solid var(--ab-border-soft);
    padding: 22px 0; /* Tall tap targets */
    
    transition: color 0.2s ease, padding-left 0.2s ease;
  }
  
  .ab-mobile-links a:hover {
    color: var(--ab-accent);
    padding-left: 10px; /* Slight movement on touch */
  }

  /* SERVICES BUTTON (Matches Links perfectly) */
  .ab-mobile-link-btn {
    background: none;
    border: none;
    border-bottom: 1px solid var(--ab-border-soft);
    width: 100%;
    text-align: left;
    padding: 22px 0;
    margin: 0;
    
    /* Font Inheritance */
    font-family: "Inter", sans-serif;
    font-size: 15px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    font-weight: 500;
    color: #ffffff;
    
    cursor: pointer;
    display: flex;
    justify-content: space-between; 
    align-items: center;
    transition: color 0.2s ease, padding-left 0.2s ease;
  }
  
  .ab-mobile-link-btn:hover {
    color: var(--ab-accent);
    padding-left: 10px;
  }
  
  .ab-arrow-right { 
    font-size: 20px; 
    line-height: 1; 
    color: var(--ab-accent); /* Electric Blue Arrow */
  }

  /* SUB-MENU BACK BUTTON */
  .ab-mobile-back-btn {
    background: none;
    border: none;
    font-family: "Inter", sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--ab-text-subtle);
    text-transform: uppercase;
    letter-spacing: 0.12em;
    margin-bottom: 40px; /* Separate from list */
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: color 0.2s ease;
  }
  
  .ab-mobile-back-btn:hover { color: #fff; }
  .ab-arrow-left { font-size: 18px; color: var(--ab-accent); }

  /* SUB-MENU HEADER ("SERVICES") */
  .ab-mobile-panel-header {
    font-family: "Inter", sans-serif;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-weight: 700;
    color: #8f98b6; /* Muted tech grey */
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--ab-accent); /* Accent underline */
    display: inline-block;
  }
}

/* BUTTONS */
.ab-cta, .ab-link-button {
  border-radius: 999px;
  border: 1px solid var(--ab-accent);
  background: transparent;
  color: var(--ab-text-main);
  font-size: 14px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 14px 38px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.ab-cta:hover {
  background: var(--ab-accent);
  color: #050915;
}

/* FOOTER (BASE DESKTOP) */
.ab-footer {
  margin-top: 64px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.ab-footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  font-size: 13px;
  color: var(--ab-text-subtle);
}
.ab-footer-brand img { height: 24px; margin-bottom: 8px; }
.ab-footer-links { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.ab-footer-links a { color: var(--ab-accent); text-decoration: none; }


/* ========================================================== */
/* MOBILE FOOTER OVERRIDES (Stack Left)                       */
/* ========================================================== */

@media (max-width: 768px) {
  .ab-footer-inner {
    flex-direction: column; /* Stack vertically */
    align-items: flex-start; /* Align everything to left */
    gap: 32px; /* Space between "Brand" and "Links" */
  }

  .ab-footer-links {
    align-items: flex-start; /* Align individual links to left */
    width: 100%;
  }
}