/* =============================================================================
   MOBILE RESPONSIVE STYLES — ICATLAR TECHNICAL SERVICES
   Only handles layout/overflow issues on small screens.
   Does NOT change section designs, colors, or typography.
   ============================================================================= */

/* ─── HAMBURGER BUTTON (hidden on desktop) ─────────────────────────────────── */
.hamburger-btn {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  border-radius: 0;
  cursor: pointer;
  padding: 6px;
  gap: 5px;
  transition: transform 0.25s;
  z-index: 1100;
  flex-shrink: 0;
}
.hamburger-btn:hover { transform: scale(1.05); }
.hamburger-btn span {
  display: block;
  width: 20px;
  height: 2px;
  background: #5d215f;
  border-radius: 2px;
  transition: transform 0.3s, opacity 0.3s;
  transform-origin: center;
}
.hamburger-btn.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger-btn.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger-btn.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ─── MOBILE NAV OVERLAY ───────────────────────────────────────────────────── */
.mobile-nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1050;
  opacity: 0;
  transition: opacity 0.3s;
}
.mobile-nav-overlay.open { display: block; opacity: 1; }

/* ─── MOBILE NAV DRAWER ────────────────────────────────────────────────────── */
.mobile-nav-drawer {
  position: fixed;
  top: 72px;
  left: 0;
  width: 100%;
  max-height: calc(100vh - 72px);
  background: #fff;
  z-index: 1050;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.35s, visibility 0.35s;
  transform: translateY(-20px);
  opacity: 0;
  visibility: hidden;
  overflow-y: auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
  padding-bottom: 40px;
  border-top: 1px solid #F0EBF0;
}
.mobile-nav-drawer.open { 
  transform: translateY(0);
  opacity: 1;
  visibility: visible;
}

.mobile-nav-header {
  display: none !important;
}

.mobile-nav-links { padding: 16px 0; }

.mobile-nav-links a {
  display: block;
  padding: 16px 24px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1F2937;
  text-decoration: none;
  border-bottom: 1px solid #F5F5F5;
  transition: background 0.2s, color 0.2s;
}
.mobile-nav-links a:hover { background: #F5EFF5; color: #5d215f; }
.mobile-nav-links a.active {
  color: #5d215f;
  background: transparent;
}

.mobile-nav-gallery-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1F2937;
  border-bottom: 1px solid #F5F5F5;
  cursor: pointer;
  user-select: none;
  transition: background 0.2s;
}
.mobile-nav-gallery-toggle:hover { background: #F5EFF5; color: #5d215f; }
.mobile-nav-gallery-toggle svg { transition: transform 0.3s; flex-shrink: 0; }
.mobile-nav-gallery-toggle.open svg { transform: rotate(180deg); }

.mobile-nav-submenu { display: none; background: #FAFAFA; }
.mobile-nav-submenu.open { display: block; }
.mobile-nav-submenu a {
  padding: 11px 22px 11px 38px;
  font-size: 0.9rem;
  color: #4B5563;
  border-bottom: 1px solid #F0F0F0;
}
.mobile-nav-submenu a:hover { color: #5d215f; background: #F5EFF5; padding-left: 38px; }

.mobile-nav-cta {
  padding: 24px;
}
.language-selector {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border: 1px solid #E5E7EB;
  border-radius: 8px;
  margin-bottom: 16px;
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 0.95rem;
  color: #1F2937;
}
.language-selector-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.language-selector-left svg {
  color: #5d215f;
}
.language-selector-right {
  display: flex;
  align-items: center;
  gap: 8px;
}
.mobile-nav-cta a {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  padding: 13px;
  background: linear-gradient(135deg, #5d215f 0%, #3a1240 100%);
  color: #fff;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  border-radius: 12px;
  text-decoration: none;
  transition: box-shadow 0.3s;
}
.mobile-nav-cta a:hover { box-shadow: 0 8px 20px rgba(93, 33, 95, 0.4); }

/* ─── ALWAYS HIDE DRAWER ON DESKTOP ───────────────────────────────────────── */
@media (min-width: 951px) {
  .hamburger-btn    { display: none !important; }
  .mobile-nav-drawer { display: none !important; }
  .mobile-nav-overlay { display: none !important; }
}

/* ─── TABLET: 951px and below ─────────────────────────────────────────────── */
@media (max-width: 950px) {
  /* Show hamburger, hide desktop nav and CTA */
  .hamburger-btn { display: flex; }
  .nav-links     { display: none !important; }
  /* Hide the desktop "Get Quotes" CTA button only inside the header */
  .header .btn, .header .btn-red { display: none; }
}

/* ─── MOBILE: 768px and below ──────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Ensure images don't overflow */
  img { max-width: 100%; height: auto; }

  /* Prevent horizontal scroll on all pages */
  body { overflow-x: hidden; }

  /* Center Align Content in Sections */
  .hero-title, .hero-desc, .hero-subhead {
    text-align: center;
    margin-left: auto;
    margin-right: auto;
    justify-content: center;
  }
  .hero-subhead::before {
    display: none !important;
  }
  .hero-buttons {
    justify-content: center;
    gap: 12px;
  }
  /* Target the bottom badge row in the hero section */
  .hero-grid > div > div[style*="display:flex"] {
    justify-content: center;
    flex-wrap: wrap;
    text-align: center;
  }
  .hero-grid > div > div[style*="display:flex"] > div {
    text-align: center;
  }
  
  .about-grid > div,
  .mission-section .container > div,
  .portfolio-header,
  .services-section .container > div {
    text-align: center !important;
  }
  
  /* Make sure all grids stack as 1 column for line by line alignment */
  .about-grid, .mission-vision-grid, .core-values-grid {
    grid-template-columns: 1fr !important;
  }
  
  /* Center align elements within the about section specifically */
  .about-grid h2, .about-grid div {
    text-align: center !important;
  }
  
  .about-grid p, .mission-section p, .services-section p {
    text-align: justify !important;
  }
  
  .sleek-stats-row {
    justify-content: center !important;
    gap: 30px !important;
    text-align: center;
  }
  .sleek-stats-row .sleek-stat-item {
    align-items: center;
  }
  
  /* Fix Team Slider on Mobile */
  .team-slider-wrapper {
    padding: 0 45px !important;
  }
  .team-nav-btn {
    width: 36px !important;
    height: 36px !important;
  }
  .team-nav-btn.prev-btn {
    left: 2px !important;
  }
  .team-nav-btn.next-btn {
    right: 2px !important;
  }
  .team-card-hover {
    width: 260px !important;
  }
  .team-slider-container {
    padding: 10px 5px !important;
  }
  
  /* Make team card details visible by default on mobile */
  .team-card-hover .tc-overlay {
    opacity: 1 !important;
    transform: translateY(0) !important;
  }
  
  /* Blog grid: 2 → 1 col */
  .blog-grid { grid-template-columns: 1fr; }

  /* Move all other grids to 1 col at 768px for line-by-line stacking */
  .services-grid        { grid-template-columns: 1fr !important; }
  .projects-grid        { grid-template-columns: 1fr !important; }
  .contact-info-grid    { grid-template-columns: 1fr !important; }
  .contact-main-grid    { grid-template-columns: 1fr !important; }
  .form-row             { grid-template-columns: 1fr !important; }

  /* Filter buttons: horizontal scrolling */
  .filter-btns, .portfolio-filters { 
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    justify-content: flex-start;
    -webkit-overflow-scrolling: touch;
    gap: 12px;
    padding-bottom: 12px;
    margin-left: -16px;
    margin-right: -16px;
    padding-left: 16px;
    padding-right: 16px;
    scrollbar-width: none; /* Firefox */
  }
  .filter-btns::-webkit-scrollbar, .portfolio-filters::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
  }
  .filter-btns button, .portfolio-filters button {
    white-space: nowrap;
    flex-shrink: 0;
  }

  /* Footer bottom: stack links */
  .footer-premium-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }
}

/* ─── SMALL MOBILE: 480px and below ───────────────────────────────────────── */
@media (max-width: 480px) {
  /* Ensure containers have horizontal padding */
  .container { padding-left: 16px !important; padding-right: 16px !important; }

  /* Detail page: stacked layout */
  .container[style*="grid-template-columns: 1.5fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
  .service-sidebar { position: static !important; }

  /* Dark contact card: hide map on tiny screens */
  .dark-contact-grid { grid-template-columns: 1fr !important; }
  .dark-contact-image-side { display: none; }

  /* Footer */
  .footer-premium-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
  .footer-premium-bottom {
    flex-direction: column;
    text-align: center;
    gap: 10px;
  }

  /* Social links: stack vertically */
  .social-links-row { flex-direction: column; align-items: center; }

  /* Mission/Vision cards: single col */
  .mission-vision-grid { grid-template-columns: 1fr; margin: 24px 0 0; }
  .mv-card { flex-direction: column; text-align: center; }

  /* Legal pages content box padding */
  .container[style*="max-width: 800px"] { padding: 24px 16px !important; }
}
