/* ============================================================
   Aethox AI & IT Solutions - Responsive Styles
   ============================================================ */

/* ── Large Desktop (≥1400px) ── */
@media (min-width: 1400px) {
  .container { max-width: 1320px; }
  h1 { font-size: 4rem; }
}

/* ── Desktop (≥1200px) ── */
@media (min-width: 1200px) {
  .dropdown-menu {
    left: 50%;
    transform: translateX(-50%);
  }
}

/* ── Tablet Landscape (≤1199px) ── */
@media (max-width: 1199px) {
  :root { --nav-height: 72px; }

  .section-padding { padding: 80px 0; }
  .hero-stats { gap: 28px; }
  .form-card { padding: 40px; }
}

/* ── Tablet Portrait (≤991px) ── */
@media (max-width: 991px) {
  :root { --nav-height: 68px; }

  /* Nav */
  #mainNav {
    background: rgba(5,13,31,.98) !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
  }

  #mainNav.scrolled {
    background: rgba(255,255,255,.84) !important;
    box-shadow: 0 8px 28px rgba(0,0,0,.08);
  }

  #mainNav::before { opacity: 0 !important; }
  #mainNav.scrolled::before { opacity: 1 !important; }

  #mainNav .navbar-brand img { filter: brightness(0) invert(1) !important; }
  #mainNav.scrolled .navbar-brand img { filter: none !important; }

  #mainNav .nav-link { color: rgba(255,255,255,.85) !important; }
  #mainNav.scrolled .nav-link { color: var(--gray-700) !important; }
  #mainNav.scrolled .nav-link:hover,
  #mainNav.scrolled .nav-link.active { color: var(--navy-900) !important; }

  .navbar-toggler {
    border: 1.5px solid rgba(255,255,255,.3);
    padding: 6px 10px;
    border-radius: var(--radius-sm);
  }

  #mainNav.scrolled .navbar-toggler {
    border-color: rgba(15, 23, 42, .18);
    background: rgba(255,255,255,.7);
  }

  .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255%2C255%2C255%2C0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }

  #mainNav.scrolled .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%2815%2C23%2C42%2C0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
  }

  .navbar-collapse {
    position: fixed;
    top: calc(var(--nav-height) + 8px);
    left: 12px;
    right: 12px;
    max-height: calc(100vh - var(--nav-height) - 20px);
    overflow-y: auto;
    background: rgba(10,22,40,.98);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-top: 0;
    box-shadow: var(--shadow-xl);
    z-index: 1150;
    overscroll-behavior: contain;
  }

  #mainNav.scrolled .navbar-collapse {
    background: rgba(255,255,255,.94);
  }

  .dropdown-menu {
    min-width: auto;
    box-shadow: none;
    border: none;
    background: rgba(255,255,255,.04);
    padding: 12px;
  }

  /* Hero */
  .hero { min-height: auto; padding: calc(var(--nav-height) + 60px) 0 60px; }
  .hero-visual { display: none; }
  .hero-stats { gap: 20px; }

  /* Sections */
  .section-padding { padding: 72px 0; }

  /* Steps */
  .steps-connector::after { display: none; }

  /* Page hero */
  .page-hero-visual { display: none; }

  /* Footer */
  .footer-bottom-links { justify-content: flex-start; margin-top: 12px; }
  .floating-actions {
    right: 16px;
    bottom: 76px;
  }

  .floating-action-consult {
    min-width: 132px;
    padding: 12px 16px;
    font-size: .8125rem;
  }

  .floating-action-whatsapp {
    width: 48px;
    height: 48px;
    font-size: 1.35rem;
  }
}

/* ── Mobile Landscape (≤767px) ── */
@media (max-width: 767px) {
  :root { --nav-height: 64px; }

  h1 { font-size: 2rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.25rem; }

  .section-padding { padding: 60px 0; }
  .section-padding-sm { padding: 48px 0; }

  .section-subheading { margin-bottom: 40px; }

  .btn { padding: 12px 26px; }
  .btn-lg { padding: 14px 32px; font-size: 1rem; }

  /* Hero */
  .hero h1 { font-size: 2rem; }
  .hero-subtitle { font-size: 1rem; }
  .hero-actions { flex-direction: column; align-items: flex-start; }
  .hero-stats { gap: 16px; }
  .hero-stat-value { font-size: 1.625rem; }

  .stat-value { font-size: 2rem; }

  /* Forms */
  .form-card { padding: 28px 20px; }

  /* Portfolio */
  .portfolio-filter { gap: 8px; }
  .filter-btn { padding: 7px 16px; font-size: .8125rem; }

  /* Footer */
  footer { padding: 60px 0 0; }
  .footer-social { flex-wrap: wrap; }

  /* Back to top */
  .back-to-top { bottom: 20px; right: 20px; width: 40px; height: 40px; }

  /* Page hero */
  .page-hero { padding: calc(var(--nav-height) + 48px) 0 56px; }

  .navbar-collapse {
    left: 8px;
    right: 8px;
    padding: 14px;
  }

  /* Success popup */
  .success-popup-inner { padding: 36px 24px; }

  .receipt-card { padding: 34px 24px; border-radius: 24px; }
  .form-error-modal { padding: 28px 20px; border-radius: 24px; }
  .form-error-modal h3 { font-size: 1.4rem; }
}

/* ── Mobile Small (≤575px) ── */
@media (max-width: 575px) {
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.4rem; }

  .section-padding { padding: 48px 0; }

  .hero-badge { font-size: .8125rem; padding: 7px 16px; }
  .hero-stat-value { font-size: 1.5rem; }

  .form-card { padding: 24px 16px; }

  .blog-card-body { padding: 20px 16px; }

  .testimonial-card { padding: 24px 20px; }
  .author-avatar { width: 48px; height: 48px; min-width: 48px; min-height: 48px; flex: 0 0 48px; }

  .feature-card { padding: 24px 20px; }
  .card-base { padding: 24px 20px; }

  .footer-bottom-links { gap: 16px; }
  .footer-bottom-link { font-size: .75rem; }
  .floating-actions {
    right: 14px;
    bottom: 70px;
    gap: 10px;
  }

  .floating-action-consult {
    min-width: 120px;
    padding: 11px 14px;
  }

  .dropdown-menu { min-width: auto; }

  .receipt-actions { flex-direction: column; }
  .receipt-actions .btn { width: 100%; }
  .form-error-actions { flex-direction: column; }
  .form-error-actions .btn { width: 100%; }
}

/* ── Portrait Specific ── */
@media (orientation: portrait) and (max-width: 767px) {
  .hero { min-height: 90vh; }
}

/* ── High DPI ── */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  .navbar-brand img { image-rendering: -webkit-optimize-contrast; }
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
}
