/* =========================================================================
   RCCPL GLOBAL ALL-SCREEN RESPONSIVE LAYER (320px -> 1440px+)
   Guarantees zero horizontal scroll, clean mobile typography, balanced grids,
   and safe spacing from floating bars across every phone & tablet screen.
   ========================================================================= */

html,
body,
.body-inner {
  max-width: 100%;
  overflow-x: hidden !important;
}

img,
iframe,
video,
svg {
  max-width: 100%;
}

/* ---------- 1. Tablet & Small Laptop (<= 1199px) ---------- */
@media (max-width: 1199px) {
  .rccpl-facts-grid,
  .rccpl-facts-grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 16px !important;
  }

  .rccpl-nb-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .rccpl-pw-wrap {
    padding: 0 28px !important;
  }
}

/* ---------- 2. Tablet Portrait (<= 991px) ---------- */
@media (max-width: 991px) {
  .rccpl-page-wrap,
  .rccpl-dark-wrap,
  .rccpl-srv-wrap,
  .rccpl-proj-wrap,
  .rccpl-media-wrap {
    padding-left: 18px !important;
    padding-right: 18px !important;
  }

  /* Hero Card (index, building_clinic, building_audit) */
  .banner-carousel-1 .banner-carousel-item {
    min-height: 480px !important;
    height: auto !important;
  }
  .rccpl-hero-card,
  .bc-hero-card,
  .ba-hero-card {
    padding: 28px 22px !important;
    margin: 24px auto !important;
    border-radius: 18px !important;
  }
  .rccpl-hero-title,
  .bc-hero-title,
  .ba-hero-title {
    font-size: 30px !important;
    line-height: 1.24 !important;
  }

  /* Page Banner */
  .rccpl-page-banner {
    min-height: 240px !important;
    padding: 48px 18px !important;
  }
  .rccpl-page-banner .banner-title,
  .rccpl-page-banner h1.rccpl-banner-title {
    font-size: 30px !important;
    line-height: 1.22 !important;
  }

  /* Section Headings */
  .rccpl-sec-title,
  .rccpl-dark-title {
    font-size: 26px !important;
    line-height: 1.28 !important;
  }

  /* Service Detail Action Buttons */
  .rccpl-sd-actions-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  /* Testimonials Spotlight */
  .rccpl-testi-grid,
  .rccpl-testi-grid.no-video {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }

  /* Counters 3x2 on Tablet */
  .rccpl-facts-grid,
  .rccpl-facts-grid-4 {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }

  /* KPI Grid */
  .rccpl-kpi-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  /* Subscribe / CTA Band */
  .subscribe .subscribe-box,
  .rccpl-sub-wrap {
    flex-direction: column !important;
    text-align: center !important;
    justify-content: center !important;
    padding: 24px 20px !important;
    gap: 16px !important;
  }
  .subscribe .subscribe-text,
  .rccpl-sub-heading {
    font-size: 18px !important;
    flex: auto !important;
  }

  /* Footer */
  .rccpl-footer .footer-widget {
    margin-bottom: 28px !important;
  }
}

/* ---------- 3. Mobile Landscape & Large Phones (<= 767px) ---------- */
@media (max-width: 767px) {
  /* Prevent fixed left social bar from blocking phone content */
  .glass-social-bar {
    display: none !important;
  }

  /* Compact floating WhatsApp button safely at bottom-right */
  .floating-whatsapp {
    width: 48px !important;
    height: 48px !important;
    right: 14px !important;
    bottom: 18px !important;
  }
  .floating-whatsapp i {
    font-size: 24px !important;
  }

  /* Mobile Header Logo & Bar */
  .mobile-top {
    padding: 10px 14px !important;
  }
  .mobile-logo img {
    max-height: 46px !important;
    width: auto !important;
  }

  /* Hero */
  .banner-carousel-1 .banner-carousel-item {
    min-height: 420px !important;
  }
  .rccpl-hero-card,
  .bc-hero-card,
  .ba-hero-card {
    padding: 22px 16px !important;
  }
  .rccpl-hero-pills,
  .rccpl-hero-eyebrow {
    gap: 6px !important;
  }
  .rccpl-hero-title,
  .bc-hero-title,
  .ba-hero-title {
    font-size: 23px !important;
    line-height: 1.26 !important;
    word-break: break-word;
  }
  .rccpl-hero-sub,
  .bc-hero-desc,
  .ba-hero-desc {
    font-size: 13.5px !important;
    line-height: 1.65 !important;
  }
  .rccpl-hero-actions,
  .bc-hero-actions,
  .ba-hero-actions {
    flex-direction: column !important;
    width: 100%;
  }
  .rccpl-hero-actions a,
  .bc-hero-actions a,
  .ba-hero-actions a {
    width: 100% !important;
    justify-content: center !important;
  }

  /* Consultation CTA Banner */
  .rccpl-cta-card {
    flex-direction: column !important;
    text-align: center !important;
    padding: 22px 18px !important;
  }
  .rccpl-cta-btn {
    width: 100% !important;
    justify-content: center !important;
  }

  /* New Business 4 Cards -> 1 Column */
  .rccpl-nb-grid {
    grid-template-columns: 1fr !important;
    gap: 14px !important;
  }

  /* About / Story / Why / Leadership Grids */
  .rccpl-about-stats,
  .rccpl-why-highlights,
  .rccpl-story-chips {
    grid-template-columns: 1fr !important;
  }
  .rccpl-story-card,
  .rccpl-sd-shell,
  .bc-about-card,
  .ba-about-card,
  .rccpl-form-pad,
  .rccpl-side-panel {
    padding: 22px 18px !important;
  }
  .rccpl-story-media,
  .bc-img-box,
  .ba-img-box {
    min-height: 250px !important;
  }

  /* Counters 2x3 on Mobile */
  .rccpl-facts-grid,
  .rccpl-facts-grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }
  .rccpl-fact-card {
    padding: 20px 12px 18px !important;
  }
  .rccpl-fact-num,
  .rccpl-fact-number {
    font-size: 28px !important;
  }
  .rccpl-fact-label,
  .rccpl-fact-title {
    font-size: 11px !important;
  }

  /* Gallery Filter Pills */
  .shuffle-btn-group {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
  }
  .shuffle-btn-group label {
    padding: 8px 16px !important;
    font-size: 12px !important;
    margin: 0 !important;
  }

  /* Progress Photos Panels */
  .rccpl-pp-header {
    padding: 15px 16px !important;
  }
  .rccpl-pp-body {
    padding: 16px !important;
  }
  .rccpl-pp-slider-box .rccpl-slide-item,
  .rccpl-pp-slider-box .rccpl-slide-item img {
    height: 240px !important;
  }

  /* Clients Logo Grid */
  .rccpl-clients-section .client-card,
  .rccpl-client-card {
    height: 92px !important;
    padding: 10px 12px !important;
  }

  /* ISO Image Card */
  .rccpl-iso-card {
    padding: 14px !important;
  }

  /* Building Clinic / Audit Service Cards */
  .bc-service-card,
  .ba-service-card {
    padding: 20px 16px !important;
  }
  .bc-svc-identity,
  .ba-svc-identity {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
  }
  .bc-svc-price-pill,
  .ba-svc-price-pill {
    width: 100% !important;
  }
  .bc-svc-actions,
  .ba-svc-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }
  .bc-tab-btn,
  .ba-tab-btn {
    justify-content: center !important;
    padding: 10px 10px !important;
    font-size: 11.5px !important;
  }

  /* Footer Ventures & Copyright */
  .rccpl-footer-ventures .ventures-inner {
    flex-direction: column !important;
    text-align: center !important;
    gap: 12px !important;
  }
  .rccpl-footer-ventures .ventures-links {
    justify-content: center !important;
  }
}

/* ---------- 4. Small Phones (320px - 480px) ---------- */
@media (max-width: 480px) {
  .rccpl-page-wrap,
  .rccpl-dark-wrap,
  .rccpl-srv-wrap,
  .rccpl-proj-wrap,
  .rccpl-media-wrap,
  .rccpl-pw-wrap {
    padding-left: 14px !important;
    padding-right: 14px !important;
  }

  .rccpl-page-banner {
    min-height: 205px !important;
    padding: 36px 14px !important;
  }
  .rccpl-page-banner .banner-title,
  .rccpl-page-banner h1.rccpl-banner-title {
    font-size: 21px !important;
  }
  .rccpl-banner-eyebrow {
    font-size: 10px !important;
    padding: 5px 12px !important;
  }
  .rccpl-breadcrumb-pill {
    padding: 6px 14px !important;
  }
  .rccpl-breadcrumb-pill li {
    font-size: 11px !important;
  }

  .rccpl-sec-title,
  .rccpl-dark-title,
  .rccpl-sd-heading {
    font-size: 21px !important;
  }
  .rccpl-sec-sub,
  .rccpl-dark-sub {
    font-size: 13.5px !important;
  }

  /* Touch-friendly stacked buttons on narrow phones */
  .rccpl-sd-actions-grid,
  .rccpl-job-actions,
  .rccpl-doc-actions,
  .bc-svc-actions,
  .ba-svc-actions {
    grid-template-columns: 1fr !important;
  }

  .rccpl-dept-link,
  .bc-contact-pill,
  .ba-contact-pill {
    font-size: 12px !important;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .rccpl-map-wrap iframe {
    height: 260px !important;
  }

  .rccpl-testi-card {
    padding: 20px 15px !important;
  }
  .rccpl-testi-quote {
    font-size: 14px !important;
    line-height: 1.7 !important;
  }
  .iframe-box.rccpl-testi-video {
    height: 185px !important;
  }

  .rccpl-submit-btn,
  .subscribe .btn-subscribe {
    width: 100% !important;
    justify-content: center !important;
  }
}
