/* 
   SHREE TECHNOLOGY | GLOBAL RESPONSIVE REFINEMENT (v3)
/* SHREE TECHNOLOGY | GLOBAL RESPONSIVE REFINEMENT (v3)
   Objective: Fix mobile layout (under 768px) ONLY. No desktop changes.
*/

/* 0. GLOBAL VARIABLES */
:root {
  --blue: #1a3d7c;
  --blue2: #2557b5;
  --sky: #4a90d9;
  --orange: #e8640a;
  --light: #f5f7fb;
  --text: #1a1a2e;
  --muted: #5a6272;
  --border: #e2e8f0;
  --white: #ffffff;
}

/* Global Button Click Interaction Animation */
button:active, .btn:active, .submit-btn:active, .popup-ok-button:active, 
.btn-hero:active, .nav-cta:active, .cta-btn:active, .btn-apply:active {
  transform: scale(0.96) !important;
  transition: transform 0.1s ease !important;
}

/* GLOBAL POPUP STYLES - Moved outside media query to fix desktop visibility bug */
.custom-popup {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 20000;
  padding: 20px;
  backdrop-filter: blur(5px);
}
.custom-popup.show { display: flex; }
.popup-content {
  background: white;
  padding: 2.5rem;
  border-radius: 20px;
  max-width: 550px;
  width: 100%;
  position: relative;
  box-shadow: 0 25px 50px rgba(0,0,0,0.3);
}
.close-button {
  position: absolute;
  top: 15px;
  right: 20px;
  font-size: 2rem;
  cursor: pointer;
  color: var(--muted);
}
.popup-ok-button {
  background: var(--blue2);
  color: white;
  border: none;
  padding: 1rem 2rem;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 1.5rem;
  width: 100%;
  transition: background 0.3s;
}
.popup-ok-button:hover { background: var(--blue); }

/* 0. GLOBAL NAVIGATION (Desktop & Mobile) */
nav {
  background: #fff;
  box-shadow: 0 2px 20px rgba(0, 0, 0, .08);
  position: sticky;
  top: 0;
  z-index: 1000;
  height: 70px;
}

.nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 0 1.5rem !important;
  display: flex;
  align-items: center;

  justify-content: space-between;
  height: 100%;
  gap: 1rem;
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 0.8rem !important;
  /* Reduced for clutter fix */
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav-menu li {
  position: relative;
}

.nav-menu li a {
  text-decoration: none;
  color: var(--text);
  font-size: 0.75rem !important;
  /* Smaller for Desktop */
  font-weight: 600 !important;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.mobile-toggle {
  display: none !important;
  /* Hidden on Desktop */
}

.caret {
  width: 8px !important;
  height: 8px !important;
  margin-left: 3px !important;
  opacity: 0.5;
}

.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
  padding: 1rem;
  border-radius: 8px;
  min-width: 220px;
  border-top: 3px solid var(--blue2);
  z-index: 1000;
  min-width: 220px;
}

.nav-menu li:hover .dropdown {
  display: block;
}

.back-to-home {
  font-size: 0.72rem !important;
  font-weight: 700;
  color: var(--blue2) !important;
  text-decoration: none;
  order: 10;
  padding: 5px 12px !important;
  border: 1.5px solid var(--blue2);
  border-radius: 6px;
  margin-left: 0.5rem !important;
  white-space: nowrap;
}

@media (max-width: 768px) {

  /* 1. Global Reset & Container Consistency */
  html,
  body {
    overflow-x: hidden !important;
    width: 100% !important;
    position: relative;
    -webkit-text-size-adjust: 100%;
  }

  * {
    box-sizing: border-box !important;
    max-width: 100% !important;
  }

  .container,
  .nav-inner {
    max-width: 100% !important;
    padding: 0 1.25rem !important;
  }

  section {
    padding: 3rem 1.25rem !important;
  }

  /* 2. HERO SECTION (Point 1 & 9) */
  /* 2. HERO SECTION */
  .slide-content {
    padding: 0 4.5rem !important;
    /* Clears s-arrow left/right 1.5rem + 3rem safe zone */
    max-width: 100% !important;
    text-align: left !important;
  }

  .slide-actions {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 0.75rem !important;
  }

  .btn-hero,
  .btn-primary-hero,
  .btn-outline-hero {
    width: auto !important;
    /* Per request: not 100% width in hero */
    max-width: max-content !important;
    margin: 0 !important;
  }

  /* 3. LOTTIE & CONNECTED GRID (Point 2) */
  /* 3. LOTTIE & CONNECTED GRID */
  .global-control-center {
    height: 280px !important;
    /* Per request: exact 280px height */
    width: 100% !important;
    margin-top: 1.5rem !important;
  }

  .connected-grid {
    grid-template-columns: 1fr !important;
    gap: 3rem !important;
  }

  /* 4. SERVICES GRID (Point 3) */
  /* 4. SERVICES GRID */
  .svc-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  @media (max-width: 480px) {
    .svc-grid {
      grid-template-columns: 1fr !important;
      /* Force 1 col below 480px */
    }
  }

  /* 5. COUNTER SECTION (Point 5) */
  /* 5. COUNTER SECTION */
  @media (max-width: 480px) {
    .ctr-grid {
      grid-template-columns: repeat(2, 1fr) !important;
      /* 2 cols below 480px */
      gap: 1rem !important;
    }
  }

  /* 6. FAQ SECTION (Point 6) */
  /* 6. FAQ SECTION */
  .faq-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 1.5rem 0 !important;
  }

  /* 7. NAVIGATION & MOBILE MENU (Point 4) */
  /* Hides the menu toggle on mobile for all pages EXCEPT index.html */
  html.not-home .mobile-toggle {
    display: none !important;
  }

  /* 7. NAVIGATION & MOBILE MENU - FIXED CLICK BLOCKING */
  .mobile-toggle {
    display: flex !important;
    /* Show toggle button */
    z-index: 10001 !important;
    /* Always on top of menu and overlay */
  }

  .nav-menu {
    position: fixed !important;
    top: 70px !important;
    left: -110% !important;
    width: 85% !important;
    max-width: 320px !important;
    height: calc(100vh - 70px) !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(10px) !important;
    -webkit-backdrop-filter: blur(10px) !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    padding: 2rem 0 !important;
    z-index: 10000 !important;
    /* Above overlay */
    transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1) !important;
    display: block !important;
    box-shadow: 15px 0 30px rgba(0, 0, 0, 0.1) !important;
  }

  .nav-menu.active {
    left: 0 !important;
  }

  /* Fix: Prevent single menu item from blocking the whole list */
  .nav-menu li {
    height: auto !important;
    width: 100% !important;
  }

  /* Navigation Drawer Overlay */
  /* Overlay fix: Pointer-events none when not active ensures clicks pass through to form */
  .nav-overlay, .mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0 !important;
    visibility: hidden;
    pointer-events: none;
    pointer-events: none !important; 
    transition: all 0.3s ease;
    z-index: 9999 !important;
    /* Below menu, above hero/content */
    z-index: 999 !important; /* Kept below Nav but above content when inactive */
  }

  .nav-overlay.active, .mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important; /* Only blocks clicks when menu is open */
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
  }

  /* Subdropdown styling on Mobile (Flattened Accordion) */
  /* Subdropdown styling on Mobile */
  .dropdown {
    display: none;
    background: #f8fafc !important;
    padding-left: 1.5rem !important;
    border-left: 3px solid var(--orange) !important;
    margin: 0.5rem 1rem !important;
    border-radius: 4px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
  }

  .nav-menu li a.has-dropdown {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .nav-menu li a.has-dropdown::after {
    content: '\ea4e';
    /* Remix icon for arrow down */
    font-family: 'remixicon';
    font-size: 1.2rem;
    transition: transform 0.3s;
  }

  /* 8. FOOTER (Point 7) */
  /* 8. FOOTER */
  .footer-grid {
    grid-template-columns: 1fr !important;
    text-align: left !important;
    gap: 2rem !important;
  }

  .footer-bottom {
    display: flex !important;
    flex-direction: column !important;
    text-align: center !important;
    gap: 0.75rem !important;
  }

  .footer-bottom div {
    margin-top: 0.5rem !important;
  }
  /* 9. GLOBAL SUBPAGE REFINEMENTS - FIXED FORM INTERACTION */
  .apply-section, .form-container, .contact-form-card {
    position: relative !important;
    z-index: 5 !important;
    pointer-events: auto !important;
  }

  /* 9. GLOBAL SUBPAGE REFINEMENTS */
  .container,
  .nav-inner {
    max-width: 100% !important;
    padding: 0 1.25rem !important;
  }

  /* Universal Grid Stacking */
  .content-grid,
  .team-grid,
  .why-grid,
  .impact-grid,
  .services-grid,
  .contact-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Universal Form Responsiveness (Apply/Contact pages) */
  /* Universal Form Responsiveness */
  .form-container,
  .contact-form-card {
    padding: 1.5rem !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  .form-group-grid {
    grid-template-columns: 1fr !important;
  }

  input,
  select,
  textarea,
  .submit-btn {
    width: 100% !important;
    font-size: 16px !important;
    /* Prevents iOS zoom on focus */
    pointer-events: auto !important;
  }

  .roadmap-details {
    padding: 2rem !important;
  }
  
  .roadmap-feature-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    margin-top: 15px;
  }

  #apply-form-msg, #form-msg {
    font-size: 0.9rem;
    padding: 10px;
    margin-bottom: 1rem;
  }

  .sec-title {
    font-size: 1.8rem !important;
    line-height: 1.3 !important;
  }

  .page-header {
    padding: 3rem 1.25rem !important;
  }

  .page-title {
    font-size: 2rem !important;
  }

  iframe,
  video {
    max-width: 100% !important;
  }
}