/* ==========================================================================
   HimVantage Solutions - Master Responsive Breakpoints & Mobile/Tablet Engine
   Targeting: Desktops, Laptops (1024-1200px), Tablets (768-992px),
              Phablets (576-768px), Smartphones (360-480px), Small Mobiles (<=360px)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Large Tablets & Small Laptops (993px - 1180px)
   -------------------------------------------------------------------------- */
@media (max-width: 1180px) {
  .nav-link {
    padding: 0.3rem 0.45rem;
    font-size: 0.80rem;
  }

  .nav-actions .btn {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
  }

  .brand-logo img {
    height: 52px;
  }
}

/* --------------------------------------------------------------------------
   2. Tablets & Medium Viewports (<= 1024px)
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
  .hero-grid,
  .hero-reimagined-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-content,
  .hero-content-col {
    text-align: left;
    max-width: 100%;
    margin: 0;
  }

  .hero-visual-col {
    justify-content: center;
  }

  .hero-ai-art-wrapper {
    max-width: 560px;
    margin: 0 auto;
  }

  .hero-subtitle,
  .hero-reimagined-desc {
    margin-left: 0;
    margin-right: 0;
  }

  .hero-cta-group,
  .hero-action-buttons {
    justify-content: flex-start;
  }

  .hero-trust-row {
    justify-content: flex-start;
  }

  .hero-card-box {
    max-width: 580px;
    margin: 0;
  }

  .stats-banner-navy {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    padding: 1.5rem;
  }

  .stat-item-row:nth-child(2) {
    border-right: none;
  }

  .box-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .box-grid .solution-box-card:last-child {
    grid-column: span 2;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }

  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  .process-steps-wrap {
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
  }

  .health-check-banner-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    text-align: left;
  }

  .health-points-list {
    text-align: left;
    max-width: 540px;
    margin-left: 0;
    margin-right: auto;
  }

  .service-grid-sidebar {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .sidebar-sticky {
    position: static;
    max-width: 600px;
    margin: 0 auto;
    width: 100%;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }
}

/* --------------------------------------------------------------------------
   3. Tablet Responsive Drawer & Transition Point (<= 992px)
   Switches from desktop horizontal menu to full mobile drawer
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  /* Header & Navigation */
  .brand-logo img {
    height: 48px;
  }

  .nav-actions {
    display: none;
  }

  .mobile-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem;
    z-index: 1002;
  }

  /* Slide-Down Mobile Navigation Drawer */
  .nav-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #020d1e;
    flex-direction: column;
    align-items: stretch;
    padding: 5.5rem 1.5rem 3.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transform: translateY(-110%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.6);
    z-index: 999;
  }

  .nav-menu.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }

  .nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  }

  .nav-link {
    width: 100%;
    justify-content: space-between;
    font-size: 0.90rem;
    font-weight: 600;
    color: #f1f5f9;
    padding: 0.65rem 0.5rem;
    border-radius: var(--radius-sm);
  }

  .nav-link svg.dropdown-icon {
    color: #94a3b8;
    width: 14px;
    height: 14px;
  }

  /* Mobile Dropdown Sub-menu */
  .dropdown-menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(255, 255, 255, 0.04);
    border: none;
    border-left: 2px solid var(--secondary-gold);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    box-shadow: none;
    padding: 0.35rem 0.4rem 0.5rem 0.6rem;
    margin: 0.25rem 0 0.5rem 0.5rem;
    display: none;
    flex-direction: column;
    gap: 0.25rem;
  }

  .nav-item.dropdown-open .dropdown-menu {
    display: flex;
  }

  .nav-item.dropdown-open .nav-link {
    color: var(--gold-hover);
  }

  .nav-item.dropdown-open .nav-link svg.dropdown-icon {
    transform: rotate(180deg);
    color: var(--gold-hover);
  }

  .dropdown-link {
    padding: 0.35rem 0.45rem;
  }

  .dropdown-link-text strong {
    color: #ffffff;
    font-size: 0.80rem;
  }

  /* Grids & Cards on Tablet */
  .calculators-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .journey-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .matrix-grid-3 {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .table-scroll-hint {
    display: block;
  }
}

/* --------------------------------------------------------------------------
   4. Mobile Devices & Small Tablets (<= 768px)
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  .topbar {
    padding: 0.4rem 0.5rem;
    font-size: 0.76rem;
  }

  .topbar-tag-line {
    flex-direction: row;
    gap: 0.4rem;
    font-size: 0.74rem;
    line-height: 1.3;
    text-align: center;
    flex-wrap: wrap;
  }

  .badge-tag {
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
  }

  .btn {
    white-space: normal;
    text-align: center;
    line-height: 1.35;
  }

  .brand-logo img {
    height: 44px;
  }

  /* Hero Section */
  .hero-section,
  .hero-section.hero-reimagined {
    padding: 2.2rem 0 1.6rem;
  }

  .hero-title,
  .hero-reimagined-title {
    font-size: clamp(2.1rem, 6.5vw, 2.9rem);
    line-height: 1.12;
  }

  .hero-subtitle,
  .hero-reimagined-desc {
    font-size: 0.98rem;
    line-height: 1.6;
    margin-bottom: 1.75rem;
  }

  .hero-action-buttons {
    gap: 1rem;
  }

  .hero-card-box {
    padding: 1.35rem;
  }

  /* Stats Bar on Mobile */
  .stats-bar-section {
    margin-top: -1.25rem;
    margin-bottom: 2rem;
  }

  .stats-banner-navy {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem 0.85rem;
    padding: 1.35rem 1rem;
  }

  .stat-item-row {
    gap: 0.75rem;
    padding: 0.25rem;
  }

  .stat-item-row:nth-child(2) {
    border-right: none;
  }

  .stat-icon-gold {
    width: 38px;
    height: 38px;
  }

  .stats-banner-navy .stat-number {
    font-size: 1.65rem;
  }

  .stats-banner-navy .stat-label {
    font-size: 0.72rem;
    line-height: 1.25;
  }

  /* Section Padding */
  .solutions-section, 
  .products-matrix-section, 
  .process-section, 
  .comparison-section, 
  .faq-section,
  .service-content-layout,
  .contact-layout,
  .solutions-matrix-section {
    padding: 2.25rem 0;
  }

  .section-heading {
    margin-bottom: 1.35rem;
  }

  .section-heading h2 {
    font-size: clamp(1.45rem, 5vw, 1.85rem);
  }

  .box-grid {
    grid-template-columns: 1fr;
  }

  .box-grid .solution-box-card:last-child {
    grid-column: span 1;
  }

  .products-grid {
    grid-template-columns: 1fr;
  }

  .services-catalog-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
  }

  .process-steps-wrap {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .health-check-banner {
    padding: 2rem 1.25rem;
    margin: 2rem 0;
  }

  .health-points-list {
    grid-template-columns: 1fr;
  }

  .service-feature-box-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .form-grid-2 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .calc-card-wrap {
    padding: 1.5rem;
  }

  .contact-info-card,
  .contact-form-box {
    padding: 1.75rem;
  }

  /* Comparison Table Mobile Scaling */
  .comparison-table th, 
  .comparison-table td {
    padding: 0.85rem 1rem;
    font-size: 0.86rem;
  }

  .comparison-table {
    min-width: 520px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2.5rem;
  }

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

/* --------------------------------------------------------------------------
   5. Phablets & Mid-Size Phones (<= 576px)
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  .calc-form-row-2 {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .calc-card-wrap {
    padding: 1.25rem;
  }

  .calc-results-card {
    padding: 1.25rem;
  }

  .calc-results-row {
    font-size: 0.88rem;
    padding: 0.6rem 0;
  }

  .calc-results-row:last-child {
    font-size: 1.1rem;
  }

  .contact-info-card,
  .contact-form-box {
    padding: 1.35rem 1.15rem;
  }

  .solution-box-card {
    padding: 1.75rem 1.25rem;
  }

  .product-card {
    padding: 1.5rem 1.25rem;
  }

  .hero-float-badge.badge-top {
    top: -5px;
    left: 0;
    padding: 0.4rem 0.8rem;
    font-size: 0.74rem;
  }

  .hero-float-badge.badge-bottom {
    bottom: -5px;
    right: 0;
    padding: 0.45rem 0.85rem;
  }
}

/* --------------------------------------------------------------------------
   6. Smartphones (<= 480px)
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .hero-title,
  .hero-reimagined-title {
    font-size: clamp(1.9rem, 7.5vw, 2.35rem);
    line-height: 1.15;
  }

  .hero-gold-divider {
    margin: 1.2rem 0 1rem 0;
  }

  .section-heading h2 {
    font-size: 1.55rem;
  }

  .hero-cta-group,
  .hero-action-buttons {
    flex-direction: column;
    width: 100%;
    gap: 0.75rem;
  }

  .hero-cta-group .btn,
  .hero-action-buttons .btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

  /* 1-column Stats on small mobile */
  .stats-grid,
  .stats-banner-navy {
    grid-template-columns: 1fr;
    gap: 0.85rem;
    padding: 1.15rem 0.85rem;
  }

  .stat-item-row {
    border-right: none !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    padding-bottom: 0.75rem;
  }

  .stat-item-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .stat-card {
    border-right: none !important;
    border-bottom: 1px solid var(--border-color);
  }

  .stat-card:last-child {
    border-bottom: none;
  }

  /* Form & Input Adjustments to Prevent iOS Zoom */
  .form-control,
  .form-control-dark,
  .calc-input {
    font-size: 16px;
  }

  .quiz-radio-option {
    padding: 0.4rem 0.5rem;
    font-size: 0.88rem;
  }

  #healthScoreVal {
    font-size: 2.75rem !important;
  }

  .floating-actions {
    bottom: 16px;
    right: 16px;
    gap: 10px;
  }

  .fab-btn {
    width: 44px;
    height: 44px;
  }

  .fab-btn svg {
    width: 22px;
    height: 22px;
  }

  .matrix-col-header {
    font-size: 1.1rem;
    padding: 1rem;
  }

  .matrix-col-body {
    padding: 1.25rem 1rem;
  }
}

/* --------------------------------------------------------------------------
   7. Very Small Mobile Displays (<= 360px)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .container {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
  }

  .brand-logo img {
    height: 38px;
  }

  .topbar-tag-line {
    font-size: 0.68rem;
  }

  .hero-title {
    font-size: 1.5rem;
  }

  .btn {
    padding: 0.65rem 1.1rem;
    font-size: 0.88rem;
  }

  .btn-lg {
    padding: 0.75rem 1.35rem;
    font-size: 0.92rem;
  }

  .stat-number {
    font-size: 1.65rem;
  }
}
