/* ==========================================================================
   TITLE SQUARE — RESPONSIVE BREAKPOINTS & MOBILE DRAWER
   ========================================================================== */

/* Desktop defaults for mobile drawer items - hidden completely on desktop */
.mobile-drawer-header,
.drawer-consult-card,
.drawer-section-label,
.drawer-quick-grid,
.mobile-drawer-actions,
.nav-link-icon-wrap,
.nav-link-sub,
.drawer-badge,
.nav-chevron {
  display: none !important;
}

/* Medium Desktop & Laptop Navbar Scaling (992px - 1180px) */
@media (min-width: 992px) and (max-width: 1180px) {
  .nav-link {
    font-size: 13.5px;
    padding: 7px 8px;
  }
  .mobile-drawer-links {
    gap: 1px;
  }
  .nav-actions {
    gap: 6px;
  }
  .btn-auth-red,
  .btn-auth-navy {
    padding: 7px 12px;
    font-size: 12.5px;
  }
}

/* ============================================================
   TABLET & MOBILE NAVIGATION (max 991px)
   ============================================================ */
@media (max-width: 991px) {
  /* Prevent background scrolling when mobile drawer is open */
  body.mobile-nav-open {
    overflow: hidden;
  }

  /* Raise header above overlay so drawer is never blurred or dimmed by overlay shadow */
  .site-header:has(.nav-menu.mobile-visible),
  body.mobile-nav-open .site-header,
  .site-header.mobile-nav-active {
    z-index: 2500 !important;
  }

  /* Hide floating widgets when mobile menu is open to prevent overlapping */
  body.mobile-nav-open .quick-check-widget,
  body.mobile-nav-open .quick-check-reopen-pill,
  body.mobile-nav-open .floating-contact-actions {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
  }

  /* Nav becomes a full-height slide-over drawer */
  .nav-menu {
    position: fixed;
    top: 0;
    left: -100%;
    width: 320px;
    max-width: 88vw;
    height: 100vh;
    height: 100dvh;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    gap: 0;
    box-shadow: 10px 0 40px rgba(0, 21, 43, 0.28);
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 2501;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    border-right: 1.5px solid var(--border);
  }

  .nav-menu.mobile-visible {
    left: 0;
  }

  /* Mobile Drawer Header */
  .mobile-drawer-header {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-light);
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
  }

  .drawer-header-left {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }

  .drawer-verified-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    color: var(--green);
    background: var(--green-bg);
    padding: 2px 7px;
    border-radius: 12px;
    width: fit-content;
  }

  .mobile-drawer-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    border: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--navy);
    cursor: pointer;
    transition: all 0.15s ease;
  }
  .mobile-drawer-close:hover,
  .mobile-drawer-close:active {
    background: #e2e8f0;
    transform: scale(0.95);
  }

  /* Consultation Banner Card */
  .drawer-consult-card {
    display: block !important;
    margin: 12px 14px 6px;
    padding: 13px 14px;
    border-radius: 12px;
    background: linear-gradient(135deg, #001e3d 0%, #002b55 100%);
    border: 1px solid rgba(255, 199, 44, 0.35);
    box-shadow: 0 4px 14px rgba(0, 34, 68, 0.15);
    color: #ffffff;
  }

  .dcc-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
  }

  .dcc-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.5px;
  }

  .dcc-badge-pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 6px var(--gold);
    display: inline-block;
  }

  .dcc-deliv {
    font-size: 10px;
    color: #93c5fd;
    font-weight: 600;
  }

  .dcc-title {
    font-family: var(--font-h);
    font-size: 13.5px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.35;
    margin-bottom: 4px;
  }

  .dcc-desc {
    font-size: 11px;
    color: #cbd5e1;
    line-height: 1.4;
    margin-bottom: 10px;
  }

  .dcc-btn {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: linear-gradient(135deg, #c8102e 0%, #a50d25 100%);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 8.5px 12px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(200, 16, 46, 0.35);
    transition: all 0.15s ease;
  }
  .dcc-btn:active {
    transform: scale(0.98);
  }

  /* Section Headers */
  .drawer-section-label {
    display: block !important;
    font-size: 10.5px;
    font-weight: 800;
    letter-spacing: 0.7px;
    text-transform: uppercase;
    color: #64748b;
    padding: 10px 16px 4px;
  }

  /* Drawer Nav Links */
  .mobile-drawer-links {
    display: flex;
    flex-direction: column;
    padding: 4px 10px 10px;
    gap: 4px;
  }

  .nav-menu .nav-link {
    width: 100%;
    padding: 9px 10px;
    border-radius: 10px;
    color: var(--navy);
    display: flex !important;
    align-items: center;
    gap: 11px;
    text-decoration: none;
    border: 1px solid transparent;
    background: #ffffff;
    transition: all 0.15s ease;
  }

  .nav-menu .nav-link:hover,
  .nav-menu .nav-link:active {
    background: #f8fafc;
    border-color: #e2e8f0;
  }

  .nav-menu .nav-link.active {
    background: #f0f7ff;
    border: 1px solid #bfdbfe;
    border-left: 3.5px solid var(--red);
    box-shadow: 0 2px 6px rgba(0, 34, 68, 0.05);
  }

  .nav-link-icon-wrap {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: #f1f5f9;
    color: var(--navy);
    flex-shrink: 0;
    transition: all 0.15s ease;
  }

  .nav-menu .nav-link.active .nav-link-icon-wrap {
    background: #dbeafe;
    color: #1e40af;
  }

  .nav-link-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
  }

  .nav-link-title {
    display: block;
    font-family: var(--font-h);
    font-size: 14px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.25;
  }

  .nav-link-sub {
    display: block !important;
    font-size: 11px;
    font-weight: 500;
    color: #64748b;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .drawer-badge {
    display: inline-flex !important;
    align-items: center;
    padding: 2px 6px;
    border-radius: 12px;
    font-size: 9.5px;
    font-weight: 700;
    flex-shrink: 0;
    margin-right: 2px;
  }

  .badge-pop {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
  }

  .badge-legal {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
  }

  .nav-chevron {
    display: block !important;
    color: #94a3b8;
    flex-shrink: 0;
    transition: transform 0.15s ease;
  }
  .nav-menu .nav-link:hover .nav-chevron,
  .nav-menu .nav-link:active .nav-chevron {
    transform: translateX(2px);
    color: var(--navy);
  }

  /* Quick Actions Grid */
  .drawer-quick-grid {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px 12px 14px;
  }

  .drawer-quick-tile {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 9px 10px;
    border-radius: 9px;
    background: #f8fafc;
    border: 1px solid var(--border-light);
    text-decoration: none;
    transition: all 0.15s ease;
  }
  .drawer-quick-tile:active {
    background: #eff6ff;
    border-color: #bfdbfe;
    transform: scale(0.98);
  }

  .dqt-icon-box {
    width: 32px;
    height: 32px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .dqt-icon-green {
    background: #ecfdf5;
    color: #059669;
  }
  .dqt-icon-navy {
    background: #eff6ff;
    color: #1e40af;
  }
  .dqt-icon-wa {
    background: #dcfce7;
    color: #16a34a;
  }
  .dqt-icon-amber {
    background: #fffbeb;
    color: #d97706;
  }

  .dqt-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .dqt-label {
    font-size: 11.5px;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .dqt-sub {
    font-size: 9.5px;
    font-weight: 500;
    color: #64748b;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Drawer Actions / Footer */
  .mobile-drawer-actions {
    display: flex !important;
    flex-direction: column;
    padding: 14px 14px 22px;
    border-top: 1px solid var(--border-light);
    background: #ffffff;
    margin-top: auto;
  }

  .drawer--info {
    margin-top: 10px;
    padding: 9px 11px;
    border-radius: 8px;
    background: #f8fafc;
    border: 1px solid #eef2f6;
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .dci-hours {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 10.5px;
    font-weight: 700;
    color: #0f766e;
  }

  .dci-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #10b981;
    box-shadow: 0 0 5px #10b981;
    display: inline-block;
  }

  .dci-loc {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 10px;
    color: #64748b;
    line-height: 1.35;
  }
  .dci-loc svg {
    flex-shrink: 0;
  }

  .mobile-toggle-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .nav-actions .btn-red {
    display: none;
  }

  /* Hero stacks */
  .hero-layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .hero-main-title { font-size: 32px; }
  .hero-main-desc { max-width: 100%; }

  /* Services */
  .services-grid-3 {
    grid-template-columns: 1fr;
    max-width: 560px;
    margin: 0 auto;
  }

  /* Cities */
  .cities-grid {
    grid-template-columns: 1fr;
    max-width: 520px;
    margin: 0 auto;
  }

  /* Team */
  .team-grid-2 {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin: 0 auto;
  }

  /* Trust bar */
  .trust-stats-grid {
    flex-wrap: wrap;
  }
  .ts-divider { display: none; }
  .ts-item { width: 50%; padding: 16px 8px; }

  /* Footer */
  .footer-grid-4 {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* ============================================================
   MOBILE OVERLAY SHADOW
   ============================================================ */
.mobile-overlay-shadow {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 21, 43, 0.65);
  backdrop-filter: blur(3px);
  z-index: 2490;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}

.mobile-overlay-shadow.mobile-visible {
  opacity: 1;
  visibility: visible;
}

/* ============================================================
   MOBILE (max 640px)
   ============================================================ */
@media (max-width: 640px) {
  .top-bar-left a:last-child { display: none; }

  .section-white,
  .section-gray { padding: 44px 0; }

  .section-heading { font-size: 23px; }

  .hero-wrapper { padding: 28px 0 36px; }
  .hero-main-title { font-size: 26px; }
  .hero-eyebrow { font-size: 11px; }

  .reg-card { padding: 20px 16px; }

  .ts-item { width: 100%; padding: 12px 8px; border-bottom: 1px solid var(--border-light); }
  .ts-item:last-child { border-bottom: none; }

  .team-photo-container { height: 270px; }

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

  .footer-bottom-bar {
    flex-direction: column;
    text-align: center;
    gap: 6px;
  }

  /* Compact header on mobile */
  .nav-container {
    height: 62px;
    padding: 0 14px;
  }
  .brand-logo-img {
    height: 36px;
  }
  .nav-actions {
    gap: 5px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
  }
  .btn-lang {
    padding: 4px 7px;
    font-size: 11px;
    height: 32px;
  }
  .btn-auth-red {
    padding: 4px 8px;
    font-size: 11px;
    height: 32px;
    white-space: nowrap;
  }
  .btn-auth-navy {
    display: none; /* Prominently present in mobile slide drawer & footer */
  }
  .mobile-toggle-btn {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  /* Quick Check Widget on Mobile: Place nicely above sticky bottom bar */
  .quick-check-widget {
    bottom: 74px;
    right: 10px;
    left: 10px;
    width: auto;
    max-width: calc(100vw - 20px);
  }
  .quick-check-reopen-pill {
    bottom: 72px;
    right: 10px;
    padding: 6px 12px;
    font-size: 11px;
  }

  /* Auth modal responsiveness */
  .auth-card {
    max-width: 100%;
    margin: 0 10px;
  }
  .auth-card-body {
    padding: 24px 18px 20px;
  }
  .auth-title {
    font-size: 22px;
  }

  /* Sample inspect modal on mobile */
  .audit-inspect-card {
    max-width: 100%;
    margin: 0 10px;
  }
  .sample-checklist-grid {
    grid-template-columns: 1fr;
  }

  /* Add bottom padding to body so content isn't covered by sticky bottom bar */
  body {
    padding-bottom: 68px !important;
  }
}

/* Responsive additions for interactive widgets */
@media (max-width: 991px) {
  .risk-scanner-wrap {
    grid-template-columns: 1fr;
  }
  .risk-nav-list {
    border-right: none;
    border-bottom: 1.5px solid var(--border);
    flex-direction: row;
    overflow-x: auto;
    padding: 12px;
  }
  .risk-nav-btn {
    white-space: nowrap;
    padding: 10px 14px;
  }
  .risk-content-panel {
    padding: 24px 20px;
  }
  .audit-pipeline-grid {
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }
  .panindia-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
  .estimator-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .hq-interactive-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .hq-map-frame {
    min-height: 350px;
  }
  .journey-steps-grid {
    grid-template-columns: 1fr 1fr;
    gap: 16px;
  }
}

@media (max-width: 640px) {
  .audit-pipeline-grid {
    grid-template-columns: 1fr;
  }
  .panindia-grid {
    grid-template-columns: 1fr;
  }
  .panindia-banner {
    padding: 24px 18px;
  }
  .hq-featured-card {
    padding: 20px 16px;
  }
  .hq-transit-list {
    grid-template-columns: 1fr;
  }
  .hq-map-frame {
    min-height: 300px;
  }
  .hq-map-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }
  .hq-map-toolbar-actions {
    width: 100%;
  }
  .map-action-btn {
    flex: 1;
    justify-content: center;
    text-align: center;
  }
  .estimator-box, .scheduler-box {
    padding: 20px 16px;
  }
  .slot-time-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .consult-mode-selector {
    grid-template-columns: 1fr;
  }
  .journey-steps-grid {
    grid-template-columns: 1fr;
  }
}
