/* ==========================================================================
   RESPONSIVE LAYOUT & MEDIA QUERIES
   Mobile First Rules:
   - Base styles target Mobile (<= 767px, Image 2)
   - Tablet Breakpoint: 768px - 1023px
   - Desktop Breakpoint: 1024px+ (Image 1)
   - Large Desktop: 1440px / 1920px
   ========================================================================== */

/* --------------------------------------------------------------------------
   Mobile Base Adjustments (Max Width: 767px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 767px) {
  html, body {
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  /* Container & Section Padding */
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box !important;
  }

  .badge {
    max-width: 100%;
    white-space: normal !important;
    word-break: break-word;
    text-align: center;
    font-size: 0.6875rem;
    line-height: 1.3;
  }

  .hero-section__title,
  .section-header__title,
  .section-title {
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: normal;
  }

  /* All Grids & Cards Strict Mobile Bounds */
  .grid,
  .grid--1-col,
  .grid--2-col,
  .grid--3-col,
  .grid--4-col {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
    gap: 1.25rem;
    box-sizing: border-box;
  }

  .grid > * {
    min-width: 0;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }

  .service-card,
  .stat-card,
  .video-card,
  .industry-card,
  .news-featured-card,
  .news-side-item,
  .partner-card,
  .senior-card,
  .callback-card,
  .vid-card {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }

  /* Compact Service Card Mobile Sizing */
  .service-card {
    padding: 1.25rem 1rem !important;
    border-radius: 14px !important;
  }

  .service-card__top {
    margin-bottom: 0.75rem !important;
  }

  .service-card__title {
    font-size: 1.1rem !important;
    line-height: 1.35 !important;
    margin-bottom: 0.5rem !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
  }

  .service-card__desc {
    font-size: 0.875rem !important;
    line-height: 1.5 !important;
    margin-bottom: 1rem !important;
    overflow-wrap: break-word !important;
  }

  .service-card__link {
    font-size: 0.8125rem !important;
  }

  .section {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }

  .section-header {
    margin-bottom: 2rem;
  }

  .section-header__title {
    font-size: 1.75rem;
  }

  .section-header__desc {
    font-size: 0.9375rem;
  }

  /* Header Mobile Layout */
  .header__container {
    height: 64px;
  }

  .header__firm-sub {
    font-size: 0.5625rem;
  }
}

@media screen and (max-width: 1023px) {
  .header__nav,
  .header__contact-btn,
  .header__cta-btn {
    display: none !important;
  }

  .header__hamburger {
    display: flex !important;
  }

  /* Hide floating circular whatsapp icon on mobile/tablet because mobile-sticky-bar has WhatsApp button */
  .floating-whatsapp {
    display: none !important;
  }

  body {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* Hero Section Mobile */
  .hero-section {
    padding-top: 2rem;
    padding-bottom: 3rem;
  }

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

  .hero-section__title {
    font-size: 2rem;
    line-height: 1.2;
  }

  .hero-section__subtitle {
    font-size: 0.9375rem;
    margin-bottom: 1.5rem;
  }

  /* Hide Desktop Hero Image and Show Mobile Hero Image */
  .hero-section__image-wrapper--desktop {
    display: none;
  }

  .hero-section__image-wrapper--mobile {
    display: block;
    margin-bottom: 1.5rem;
  }

  .hero-section__img {
    height: 240px;
  }

  /* Form Card Mobile */
  .callback-card {
    padding: 1.25rem;
    border-radius: var(--radius-lg);
  }

  .callback-card__grid {
    grid-template-columns: 1fr;
    gap: 0.875rem;
  }

  .hero-section__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 1rem;
    background: rgba(255, 255, 255, 0.05);
    padding: 1rem;
    border-radius: var(--radius-md);
    border: 1px solid rgba(255, 255, 255, 0.1);
  }

  .stat-badge__number {
    font-size: 1.35rem;
  }

  .stat-badge__label {
    font-size: 0.75rem;
  }

  /* Trust Bar Mobile */
  .trust-bar__items {
    font-size: 0.75rem;
    gap: 0.75rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.25rem;
  }

  .trust-bar__items::-webkit-scrollbar {
    display: none;
  }

  /* Grids Stacked on Mobile */
  .grid--2-col,
  .grid--3-col,
  .grid--4-col {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .experience-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

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

  .stat-card__metric {
    font-size: 1.25rem;
    line-height: 1.35;
    word-break: normal;
  }

  .stat-card__title {
    font-size: 0.9375rem;
  }

  /* Industry Carousel Mobile */
  .section-header-flex {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .industry-carousel {
    grid-template-columns: 1fr;
  }

  .industry-card {
    padding: 1.5rem;
  }

  /* Resource Hub Mobile */
  .resource-hub__top {
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
  }

  .resource-hub__grid {
    grid-template-columns: 1fr 1fr;
    gap: 0.875rem;
  }

  .hub-card {
    padding: 1.25rem 1rem;
    gap: 0.75rem;
    flex-direction: column;
  }

  .hub-card__icon {
    width: 40px;
    height: 40px;
  }

  .hub-card__title {
    font-size: 0.9375rem;
  }

  .hub-card__desc {
    font-size: 0.75rem;
  }

  /* Regulatory News Mobile */
  .news-layout {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .news-tabs {
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }

  .tab-btn {
    padding: 0.375rem 0.875rem;
    font-size: 0.75rem;
  }

  .news-featured-card__image-wrapper {
    height: 200px;
  }

  .news-featured-card__content {
    padding: 1.25rem;
  }

  .news-featured-card__title {
    font-size: 1.2rem;
  }

  /* Testimonials Mobile */
  .testimonial-card {
    padding: 1.5rem;
  }

  .testimonial-card__text {
    font-size: 0.9375rem;
  }

  /* CTA Banner Mobile */
  .cta-banner__title {
    font-size: 1.85rem;
  }

  .cta-banner__subtitle {
    font-size: 0.9375rem;
  }

  .cta-banner__actions {
    flex-direction: column;
    width: 100%;
  }

  .cta-banner__actions .btn {
    width: 100%;
  }

  .cta-banner__trust-list {
    flex-direction: column;
    gap: 0.5rem;
  }

  /* Footer Mobile Accordions */
  .footer {
    padding-bottom: 5rem; /* Make room for mobile sticky bottom bar */
  }

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

  .footer__col--accordion .footer__title {
    cursor: pointer;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0;
  }

  .footer__col--accordion .footer__chevron {
    display: block;
    transition: transform var(--transition-fast);
  }

  .footer__col--accordion .footer__links {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal);
  }

  .footer__col--accordion.is-open .footer__links {
    max-height: 300px;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
  }

  .footer__col--accordion.is-open .footer__chevron {
    transform: rotate(45deg);
  }

  .footer__bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .footer__legal {
    justify-content: center;
    gap: 0.35rem 0.5rem;
    max-width: 100%;
  }

  .btn {
    max-width: 100%;
    white-space: normal;
    text-align: center;
  }

  /* Mobile Sticky Bottom Bar */
  .mobile-sticky-bar {
    display: flex;
    z-index: 998;
  }

  .back-to-top {
    bottom: 95px;
    right: 14px;
    width: 38px;
    height: 38px;
    font-size: 0.95rem;
    z-index: 1000;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
    border: 2px solid #FFFFFF;
  }
}

/* --------------------------------------------------------------------------
   Tablet View (768px to 1023px)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 768px) and (max-width: 1023px) {
  .hero-section__container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .hero-section__image-wrapper--desktop {
    display: block;
  }

  .hero-section__image-wrapper--mobile {
    display: none;
  }

  .callback-card__grid {
    grid-template-columns: 1fr 1fr;
  }

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

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

  .news-layout {
    grid-template-columns: 1fr;
  }

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

  .header__menu {
    gap: 1rem;
  }

  .header__menu-link {
    font-size: 0.84rem;
  }
}

/* --------------------------------------------------------------------------
   Desktop View (1024px and above - Matches Image 1)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 1024px) {
  .mobile-drawer,
  .mobile-drawer-overlay,
  .mobile-sticky-bar {
    display: none !important;
  }

  .callback-card__grid {
    grid-template-columns: minmax(170px, 1fr) minmax(170px, 1fr) minmax(190px, 1.1fr) auto;
    gap: 0.75rem;
  }
}

/* --------------------------------------------------------------------------
   Large Desktop View (1440px and 1920px)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 1440px) {
  .container {
    max-width: 1320px;
  }

  .hero-section__title {
    font-size: 3.25rem;
  }
}
