/* ═══════════════════════════════════════════════
   PRAVISHT MAGADH — COMPREHENSIVE MOBILE CSS
   Fixes all elements for 320px–768px screens
═══════════════════════════════════════════════ */

/* ── GLOBAL MOBILE BASE ── */
@media (max-width: 768px) {

  html { font-size: 15px; }

  /* Prevent horizontal scroll on ALL elements */
  *, *::before, *::after {
    max-width: 100%;
    box-sizing: border-box;
  }

  /* ── NAVBAR ── */
  nav {
    padding: 0 4%;
    height: 62px;
  }

  .nav-logo img {
    height: 36px;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: fixed;
    top: 62px;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    padding: 16px;
    gap: 4px;
    border-top: 1px solid var(--border);
    overflow-y: auto;
    z-index: 999;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links > li > a {
    font-size: 15px;
    padding: 12px 14px;
    display: block;
    border-radius: 8px;
  }

  .nav-toggle {
    display: flex;
  }

  /* Dropdown becomes accordion on mobile */
  .nav-dropdown .dropdown-menu {
    position: static;
    transform: none;
    opacity: 1;
    visibility: visible;
    box-shadow: none;
    border: none;
    background: var(--light);
    border-radius: var(--radius);
    margin-top: 4px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    display: none;
  }

  .nav-dropdown.open .dropdown-menu {
    display: block;
    max-height: 400px;
  }

  .dropdown-menu a {
    font-size: 14px;
    padding: 10px 16px;
  }

  /* Hide portfolio button text on very small screens */
  .btn-portfolio {
    padding: 8px 14px;
    font-size: 13px;
  }

  /* ── HERO SECTION ── */
  .hero {
    min-height: 100svh;
    padding-top: 62px;
    align-items: flex-end;
  }

  .hero-content {
    padding: 32px 4% 48px;
    max-width: 100%;
  }

  .hero-tagline {
    font-size: 11px;
    padding: 5px 12px;
    margin-bottom: 16px;
  }

  .hero h1 {
    font-size: clamp(1.8rem, 7vw, 2.4rem);
    line-height: 1.12;
    margin-bottom: 8px;
  }

  .hero-sub-headline {
    font-size: 0.95rem;
    margin-bottom: 12px;
  }

  .hero p {
    font-size: 0.93rem;
    line-height: 1.7;
    margin-bottom: 28px;
  }

  .hero-btns {
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  .hero-btns .btn-primary,
  .hero-btns .btn-secondary {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 14px;
  }

  .hero-trust {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-top: 28px;
  }

  .hero-glow {
    width: 300px;
    height: 300px;
    right: -20%;
    top: 5%;
  }

  /* ── PAGE HERO (service pages) ── */
  .page-hero {
    min-height: 45vh;
    padding-top: 90px;
    padding-bottom: 32px;
    padding-left: 4%;
    padding-right: 4%;
    align-items: flex-end;
  }

  .page-hero h1 {
    font-size: clamp(1.5rem, 6vw, 2rem);
    margin-bottom: 10px;
    line-height: 1.15;
  }

  .page-hero p {
    font-size: 0.9rem;
    margin-bottom: 20px;
  }

  .page-hero-badge {
    font-size: 11px;
    padding: 4px 12px;
    margin-bottom: 12px;
  }

  /* ── SECTIONS ── */
  section {
    padding: 52px 4%;
  }

  .section-title {
    font-size: clamp(1.45rem, 5.5vw, 2rem);
    margin-bottom: 10px;
  }

  .section-sub {
    font-size: 0.92rem;
    line-height: 1.7;
  }

  /* ── STATS BAR ── */
  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
    border-radius: var(--radius);
  }

  .stat-item {
    padding: 24px 12px;
    border-right: 1px solid var(--border);
  }

  /* Fix 2×2 border layout */
  .stat-item:nth-child(1) { border-right: 1px solid var(--border); }
  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(3) {
    border-right: 1px solid var(--border);
    border-top: 1px solid var(--border);
  }
  .stat-item:nth-child(4) {
    border-right: none;
    border-top: 1px solid var(--border);
  }

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

  .stat-suffix {
    font-size: 1.6rem;
  }

  .stat-label {
    font-size: 0.78rem;
  }

  /* ── GRIDS ── */
  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* ── SPLIT LAYOUT ── */
  .split {
    grid-template-columns: 1fr;
    gap: 28px;
    direction: ltr;
  }

  .split-reverse {
    direction: ltr;
  }

  .split img {
    width: 100%;
    border-radius: var(--radius-lg) !important;
    max-height: 260px;
    object-fit: cover;
  }

  /* ── SERVICE CARDS ── */
  .service-card-img {
    height: 180px;
  }

  .service-card-body {
    padding: 18px;
  }

  .service-card-body h3 {
    font-size: 1rem;
  }

  .service-card-body p {
    font-size: 0.85rem;
  }

  /* ── CARDS ── */
  .card {
    padding: 20px;
  }

  .lift-card {
    padding: 24px 18px;
  }

  .lift-card .lc-icon {
    font-size: 28px;
    margin-bottom: 12px;
  }

  .lift-card h3 {
    font-size: 0.98rem;
  }

  /* ── BUTTONS ── */
  .btn-primary,
  .btn-secondary,
  .btn-navy,
  .btn-outline-navy {
    font-size: 14px;
    padding: 12px 22px;
  }

  /* ── CONTACT CARDS ── */
  .contact-cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .contact-card {
    padding: 24px 18px;
  }

  /* ── CONTACT FORM ── */
  .contact-form {
    padding: 20px;
    border-radius: var(--radius-lg);
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .form-group label {
    font-size: 13px;
  }

  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px; /* Prevents iOS zoom on focus */
    padding: 12px 13px;
  }

  /* ── MAP ── */
  .map-container {
    height: 260px;
    border-radius: var(--radius-lg);
  }

  /* ── DIGITAL MARKETING CARDS ── */
  .dm-card {
    padding: 20px;
  }

  .dm-card h3 {
    font-size: 0.98rem;
  }

  .dm-card p {
    font-size: 0.85rem;
  }

  /* ── SPECS TABLE ── */
  .specs-table {
    font-size: 0.85rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .specs-table td {
    padding: 10px 12px;
  }

  .specs-table td:last-child {
    text-align: left;
  }

  /* ── MODAL ── */
  .modal-box {
    padding: 24px 18px;
    border-radius: var(--radius-lg);
    max-height: 95svh;
  }

  .modal-title {
    font-size: 1.2rem;
    padding-right: 36px;
  }

  .modal-close {
    top: 14px;
    right: 14px;
  }

  /* ── CTA BANNER ── */
  .cta-banner {
    padding: 52px 4%;
  }

  .cta-banner h2 {
    font-size: clamp(1.4rem, 5vw, 1.9rem);
    margin-bottom: 10px;
  }

  .cta-banner p {
    font-size: 0.93rem;
    margin-bottom: 22px;
  }

  .cta-banner .btn-primary {
    width: 100%;
    max-width: 340px;
    justify-content: center;
  }

  /* ── TICKER ── */
  .ticker-track span {
    padding: 0 20px;
    font-size: 12px;
  }

  /* ── FOOTER ── */
  footer {
    padding: 44px 4% 24px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 28px;
    margin-bottom: 32px;
  }

  .footer-logo img {
    height: 40px;
  }

  .footer-brand p {
    font-size: 0.83rem;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 8px;
    font-size: 11.5px;
  }

  /* ── WHATSAPP FLOAT ── */
  .wa-float {
    bottom: 18px;
    right: 18px;
    left: auto;
    width: 50px;
    height: 50px;
  }

  .wa-float svg {
    width: 24px;
    height: 24px;
  }

  /* ── TOAST ── */
  .toast {
    bottom: 16px;
    right: 16px;
    left: 16px;
    text-align: center;
    font-size: 13.5px;
  }

  /* ── ABOUT SLIDER ── */
  .about-slider-wrap {
    padding: 0 0 28px;
  }

  .about-slide-card {
    flex: 0 0 240px;
    padding: 18px;
  }

  /* ── TAGS ── */
  .tags-row {
    gap: 8px;
  }

  .tag {
    font-size: 12px;
    padding: 6px 12px;
  }

  /* ── DARK MODE MOBILE FIXES ── */
  [data-theme="dark"] .nav-links {
    background: #0f172a;
    border-top-color: #334155;
  }

  [data-theme="dark"] .nav-dropdown .dropdown-menu {
    background: #1e293b;
  }
}

/* ── VERY SMALL SCREENS (320–480px) ── */
@media (max-width: 480px) {
  html { font-size: 14px; }

  nav {
    padding: 0 3.5%;
    height: 58px;
  }

  .nav-logo img {
    height: 32px;
  }

  .hero h1 {
    font-size: clamp(1.65rem, 8vw, 2rem);
  }

  .page-hero h1 {
    font-size: clamp(1.4rem, 7vw, 1.8rem);
  }

  .section-title {
    font-size: clamp(1.3rem, 6vw, 1.75rem);
  }

  section {
    padding: 40px 3.5%;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-num {
    font-size: 1.7rem;
  }

  .service-card-img {
    height: 160px;
  }

  .contact-form {
    padding: 16px;
  }

  .modal-box {
    padding: 20px 14px;
  }

  /* About page team section */
  .team-grid {
    grid-template-columns: 1fr !important;
  }

  /* Page hero height reduced on very small screens */
  .page-hero {
    min-height: 38vh;
    padding-bottom: 24px;
  }

  /* CTA buttons full width on very small */
  .btn-primary, .btn-navy {
    width: 100%;
    justify-content: center;
  }

  footer {
    padding: 36px 3.5% 20px;
  }
}

/* ── TABLET (768–1024px) ── */
@media (min-width: 769px) and (max-width: 1024px) {

  nav {
    padding: 0 4%;
  }

  .hero h1 {
    font-size: clamp(2rem, 4.5vw, 3rem);
  }

  .grid-3 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(2, 1fr);
  }

  .split {
    gap: 40px;
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }

  .stats-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .stat-item:nth-child(2) { border-right: none; }
  .stat-item:nth-child(3) {
    border-right: 1px solid var(--border);
    border-top: 1px solid var(--border);
  }
  .stat-item:nth-child(4) {
    border-top: 1px solid var(--border);
    border-right: none;
  }

  .contact-cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ── TOUCH IMPROVEMENTS ── */
@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets */
  .nav-links > li > a {
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .btn-primary,
  .btn-secondary,
  .btn-navy,
  .btn-outline-navy,
  .btn-portfolio {
    min-height: 44px;
  }

  /* Remove hover transforms on touch (avoids stuck states) */
  .card:hover,
  .service-card:hover,
  .lift-card:hover,
  .dm-card:hover {
    transform: none;
  }
}

/* ── SAFE AREA (iPhone notch/home bar) ── */
@supports (padding: max(0px)) {
  nav {
    padding-left: max(4%, env(safe-area-inset-left));
    padding-right: max(4%, env(safe-area-inset-right));
  }

  footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom));
  }

  .wa-float {
    bottom: max(18px, calc(env(safe-area-inset-bottom) + 12px));
    right: max(18px, env(safe-area-inset-right));
    left: auto;
  }
}

/* ── PRINT ── */
@media print {
  nav, .wa-float, .ticker-wrap, footer { display: none; }
  .hero { min-height: auto; padding: 20px 0; }
  body { color: #000; }
}

/* ── NAVBAR ALWAYS WHITE (even in dark mode) ── */
nav,
[data-theme="dark"] nav {
  background: rgba(255, 255, 255, 0.97) !important;
  border-bottom-color: #e2e8f0 !important;
}

[data-theme="dark"] .nav-links > li > a {
  color: #64748b !important;
}

[data-theme="dark"] .nav-links > li > a:hover,
[data-theme="dark"] .nav-links > li > a.active {
  color: #1a3a5c !important;
  background: rgba(26, 58, 92, 0.07) !important;
}

[data-theme="dark"] .nav-links {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="dark"] .dropdown-menu {
  background: #ffffff !important;
  border-color: #e2e8f0 !important;
}

[data-theme="dark"] .dropdown-menu a:hover {
  background: #f7f9fc !important;
  color: #1a3a5c !important;
}

[data-theme="dark"] .nav-toggle span {
  background: #1a3a5c !important;
}

/* ═══════════════════════════════════════════════
   ALIGNMENT PATCHES v2
═══════════════════════════════════════════════ */

/* Fix service card grid gaps on mobile */
@media (max-width: 768px) {
  .grid-3, .grid-2, .grid-4 {
    gap: 14px;
  }
  .service-card-img {
    height: 190px;
  }
  /* Stats section padding consistency */
  section[aria-label="Company Stats"] {
    padding: 40px 4%;
  }
  /* Ensure cards don't overflow */
  .service-card, .card, .dm-card {
    width: 100%;
  }
  /* CTA full width button fix */
  .cta-banner .btn-primary {
    display: flex;
    justify-content: center;
  }
  /* Footer brand paragraph spacing */
  .footer-brand {
    padding-bottom: 4px;
  }
}

/* ── LARGE DESKTOP (1440px+) — prevent over-stretching ── */
@media (min-width: 1440px) {
  section {
    padding-left: max(5%, calc((100% - 1280px) / 2));
    padding-right: max(5%, calc((100% - 1280px) / 2));
  }
  nav {
    padding-left: max(5%, calc((100% - 1280px) / 2));
    padding-right: max(5%, calc((100% - 1280px) / 2));
  }
  footer {
    padding-left: max(5%, calc((100% - 1280px) / 2));
    padding-right: max(5%, calc((100% - 1280px) / 2));
  }
  .cta-banner {
    padding-left: max(5%, calc((100% - 1280px) / 2));
    padding-right: max(5%, calc((100% - 1280px) / 2));
  }
  .ticker-track span {
    padding: 0 44px;
  }
}

/* ── ABOUT HERO — mobile padding fix ── */
@media (max-width: 768px) {
  .about-hero {
    padding-top: 90px;
    min-height: 45vh;
    align-items: flex-end;
    padding-bottom: 36px;
  }
}
@media (max-width: 480px) {
  .about-hero {
    padding-top: 80px;
    min-height: 38vh;
  }
}
