/**
 * RankDigit — full frontend responsive system
 * Loads after responsive.css + theme-unified.css
 *
 * Breakpoints (Bootstrap-aligned):
 * - xs:  <576px   phones
 * - sm:  ≥576px   large phones
 * - md:  ≥768px   tablets portrait
 * - lg:  ≥992px   tablets landscape / small laptops
 * - xl:  ≥1200px  desktops
 * - xxl: ≥1400px  large desktops
 */

/* Safe areas (notched devices) */
.main-wrapper {
  padding-left: env(safe-area-inset-left, 0);
  padding-right: env(safe-area-inset-right, 0);
}

.floating-whatsapp,
.back-to-top {
  right: max(16px, env(safe-area-inset-right, 0));
}

.back-to-top {
  bottom: max(20px, env(safe-area-inset-bottom, 0));
}

.floating-whatsapp {
  bottom: max(88px, calc(env(safe-area-inset-bottom, 0) + 72px));
}

/* Fluid section spacing (desktop baseline) */
.section-space {
  padding-top: clamp(48px, 5vw, 88px);
  padding-bottom: clamp(48px, 5vw, 88px);
}

/* ==========================================================================
   LARGE DESKTOP (≥1400px)
   ========================================================================== */
@media (min-width: 1400px) {
  .container,
  .container-lg,
  .container-md,
  .container-sm,
  .container-xl,
  .container-xxl {
    max-width: 1320px !important;
    padding-left: 28px !important;
    padding-right: 28px !important;
  }

  .section-space {
    padding-top: 88px;
    padding-bottom: 88px;
  }

  .theme-section-head {
    max-width: 860px;
  }

  .home-pricing-section .col-lg-4 {
    flex: 0 0 auto;
    width: 33.333333%;
  }
}

/* ==========================================================================
   DESKTOP (1200px – 1399px) — default container 1280 in style.css
   ========================================================================== */
@media (min-width: 1200px) and (max-width: 1399.98px) {
  .service-included-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* ==========================================================================
   TABLET LANDSCAPE / SMALL LAPTOP (≤1199px)
   ========================================================================== */
@media (max-width: 1199.98px) {
  .service-included-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
  }

  .service-features-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .home-pricing-section .row > [class*="col-"] {
    margin-bottom: 0;
  }

  .industry-hero-row .col-lg-7,
  .blog-hero-row .col-lg-7 {
    margin-bottom: 24px;
  }

  .policy-wrapper,
  .terms-wrapper {
    padding: 48px 40px;
  }
}

/* ==========================================================================
   TABLET PORTRAIT (≤991px)
   ========================================================================== */
@media (max-width: 991.98px) {
  .service-included-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .service-features-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .service-feature-icon,
  .service-included-icon {
    width: 64px;
    height: 64px;
    font-size: 28px;
  }

  .service-included-icon img,
  .service-feature-icon img {
    width: 32px;
    height: 32px;
  }

  .home-pricing-section-title h2 {
    font-size: clamp(26px, 4vw, 34px);
  }

  .home-pricing-card {
    height: 100%;
  }

  .industry-hero-buttons,
  .industry-hero-buttons .industry-primary-btn,
  .industry-hero-buttons .industry-secondary-btn {
    flex-wrap: wrap;
  }

  .blog-hero-search,
  .service-search-form {
    max-width: 100%;
  }

  .cta-box {
    padding: 36px 24px !important;
    border-radius: 20px;
  }

  .cta-box h2 {
    font-size: clamp(24px, 4.5vw, 32px);
  }

  .cta-buttons {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    max-width: 360px;
    margin-left: auto;
    margin-right: auto;
  }

  .cta-box .cta-buttons .header-btn {
    width: 100%;
    justify-content: center;
  }

  .contact-cta1 .cta-doodle-left,
  .contact-cta1 .cta-doodle-right {
    opacity: 0.35;
    max-width: 120px;
  }

  .policy-wrapper,
  .terms-wrapper {
    padding: 40px 28px;
    border-radius: 16px;
  }

  .footer-top .col-lg-3,
  .footer-top .col-lg-2,
  .footer-top .col-lg-4 {
    margin-bottom: 8px;
  }

  .page-banner nav {
    flex-wrap: wrap;
    justify-content: center;
    max-width: 100%;
  }

  .theme-section-head.text-start {
    text-align: center !important;
  }
}

/* ==========================================================================
   MOBILE (≤767px)
   ========================================================================== */
@media (max-width: 767.98px) {
  .service-included-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .service-included-card {
    min-height: auto;
    padding: 24px 20px;
  }

  .service-included-heading {
    margin-bottom: 32px;
  }

  .service-included-heading h2 {
    font-size: clamp(24px, 6vw, 30px);
  }

  .service-feature-heading {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .service-feature-icon {
    flex: 0 0 auto;
    width: 56px;
    height: 56px;
    font-size: 26px;
  }

  .home-pricing-section .col-lg-4 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .home-pricing-card {
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
  }

  .home-pricing-features {
    font-size: 14px;
  }

  .industry-hero-section,
  .blog-hero-section {
    padding-top: 72px !important;
    padding-bottom: 40px !important;
  }

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

  .industry-primary-btn,
  .industry-secondary-btn {
    width: 100%;
    justify-content: center;
    text-align: center;
  }

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

  .blog-hero-content h1,
  .blog-hero-content h1 span {
    display: block;
  }

  .blog-hero-search input,
  .service-search-form input {
    font-size: 16px; /* prevents iOS zoom on focus */
    min-height: 48px;
  }

  .blog-hero-search button,
  .service-search-form button {
    min-width: 48px;
    min-height: 48px;
  }

  .contact-cta1 {
    padding: 28px 0;
  }

  .contact-cta1 .cta-box {
    margin: 0 4px;
  }

  .contact-cta1 .cta-doodle-left,
  .contact-cta1 .cta-doodle-right {
    display: none;
  }

  .policy-wrapper,
  .terms-wrapper {
    padding: 28px 18px;
  }

  .policy-block h2,
  .terms-block h2 {
    font-size: 20px;
  }

  .faq-question {
    font-size: 15px;
    padding: 16px 18px;
  }

  .service-card,
  .blog-card {
    height: auto;
  }

  .service-card-header h3 {
    font-size: 17px;
  }

  .icon-svg-picker .service-icon-dropdown {
    max-height: 240px;
    overflow-y: auto;
  }

  .floating-whatsapp {
    width: 48px;
    height: 48px;
    font-size: 38px;
    bottom: max(76px, calc(env(safe-area-inset-bottom, 0) + 64px));
  }

  .back-to-top {
    width: 44px;
    height: 44px;
    bottom: max(16px, env(safe-area-inset-bottom, 0));
  }
}

/* ==========================================================================
   SMALL PHONES (≤575px)
   ========================================================================== */
@media (max-width: 575.98px) {
  .footer-top .col-6 {
    flex: 0 0 100%;
    max-width: 100%;
  }

  .footer-about {
    text-align: center;
  }

  .footer-about p {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-social {
    justify-content: center;
  }

  .footer-area h5 {
    margin-top: 8px;
  }

  .theme-eyebrow {
    font-size: 11px;
    letter-spacing: 0.12em;
  }

  .theme-section-head h2 {
    font-size: clamp(22px, 6.5vw, 28px);
  }

  .page-banner h1 {
    font-size: clamp(26px, 7vw, 32px) !important;
  }

  .page-banner p {
    font-size: 14px !important;
  }

  .home-pricing-popular-badge {
    font-size: 11px;
    padding: 4px 10px;
  }

  .pricing-plan-item .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ==========================================================================
   ULTRA-NARROW (≤375px)
   ========================================================================== */
@media (max-width: 375px) {
  .header-cta-btn span {
    max-width: 72px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .home-pricing-amount {
    font-size: 36px;
  }
}

/* ==========================================================================
   LANDSCAPE PHONES (short viewport)
   ========================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero-section,
  .hero-section.hero-scenic-style {
    min-height: auto !important;
    padding-top: 64px !important;
    padding-bottom: 32px !important;
  }

  .mobile-menu {
    max-height: 100dvh;
    overflow-y: auto;
  }
}

/* Touch targets */
@media (hover: none) and (pointer: coarse) {
  .main-menu a,
  .footer-area ul li a,
  .header-btn,
  .home-pricing-btn,
  .faq-question,
  .mobile-menu-list a {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  .footer-area ul li a {
    display: inline-flex;
  }
}

/* Prevent horizontal overflow on wide tables / pre */
.main-wrapper pre,
.main-wrapper table {
  max-width: 100%;
}

.main-wrapper .table-responsive {
  margin-bottom: 1rem;
}
