/**
 * TM Filers — global responsive hardening (all main site pages)
 * Breakpoints: 1200 (laptop), 1024 (tablet landscape), 768 (tablet), 576 (mobile), 480 (small mobile)
 */

/* --- Base safety --- */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

img,
video,
svg,
canvas {
  max-width: 100%;
  height: auto;
}

iframe {
  max-width: 100%;
}

table {
  width: 100%;
  border-collapse: collapse;
}

/* --- Laptop / small desktop (≤1200px) --- */
@media (max-width: 1200px) {
  .container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

  .hero-grid {
    gap: var(--space-8);
  }

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

  .nav-list {
    gap: var(--space-4);
  }

  .nav-link {
    font-size: 0.875rem;
  }
}

/* --- Tablet landscape (≤1024px) --- */
@media (max-width: 1024px) {
  .hero-grid,
  .value-grid,
  .contact-grid,
  .about-grid,
  .lead-form-layout,
  .image-strip-inner {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding: calc(var(--header-height) + var(--space-8)) 0 var(--space-10);
  }

  .page-hero h1,
  .service-hero-content h1 {
    font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  }

  .section {
    padding: var(--space-12) 0;
  }

  .section-header {
    margin-bottom: var(--space-8);
  }

  .pricing-grid,
  .types-grid {
    max-width: 520px;
  }

  .comparison-wrapper {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .comparison-vs {
    order: 0;
  }

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

  .footer-grid-extended {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-8);
  }

  .logo-img {
    max-width: 230px;
    height: auto;
  }

  .header .logo-img {
    height: 52px;
    max-width: 190px;
  }

  .footer .logo-img {
    height: 56px;
    max-width: 300px;
  }
}

/* --- Tablet portrait (≤768px) --- */
@media (max-width: 768px) {
  :root {
    --container-padding: 1.25rem;
    --space-20: 4rem;
    --space-24: 5rem;
    --header-height: 76px;
  }

  h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }

  h2 {
    font-size: clamp(1.35rem, 5vw, 2rem);
  }

  .page-hero p,
  .section-header p,
  .service-hero-lead {
    font-size: 1rem;
  }

  .hero-visual {
    order: 0;
  }

  .hero-content {
    order: -1;
  }

  .hero {
    overflow-x: hidden;
    min-height: auto;
    padding-top: calc(var(--header-height) + var(--space-8));
    padding-bottom: var(--space-10);
    align-items: flex-start;
  }

  .hero-grid {
    gap: var(--space-6);
    width: 100%;
    min-width: 0;
  }

  .hero-content,
  .hero-visual {
    min-width: 0;
    max-width: 100%;
  }

  .hero h1 {
    font-size: clamp(1.65rem, 6.5vw, 2.35rem);
    line-height: 1.15;
    word-break: break-word;
  }

  .hero-text {
    font-size: 0.95rem;
    margin-bottom: var(--space-5);
  }

  .hero-badge {
    max-width: 100%;
    white-space: normal;
    line-height: 1.35;
    padding: 0.4rem 0.75rem;
  }

  .hero-visual-container {
    min-height: 260px;
    max-width: 100%;
    padding: var(--space-4);
    overflow: hidden;
  }

  .hero-card-main {
    padding: var(--space-4);
    max-width: 100%;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .hero-stat-card:last-child {
    grid-column: 1 / -1;
  }

  .hero-stat-card {
    padding: var(--space-3) var(--space-4);
  }

  .hero-stat-card strong {
    font-size: 1.35rem;
  }

  .services-grid,
  .testimonials-grid,
  .steps-container,
  .form-grid,
  .form-grid-modal,
  .lead-form-grid {
    grid-template-columns: 1fr;
  }

  .contact-details {
    gap: var(--space-4);
  }

  .contact-item {
    flex-direction: row;
    align-items: flex-start;
  }

  .lead-form-wrapper,
  .contact-form-card {
    padding: var(--space-6);
  }

  .final-cta-inner,
  .cta-banner-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-4);
  }

  .final-cta-actions,
  .service-hero-actions,
  .service-secure-actions {
    flex-direction: column;
    width: 100%;
    align-items: stretch;
  }

  .final-cta-actions .btn,
  .service-hero-actions .btn,
  .service-secure-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-actions {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
    gap: 0.65rem;
  }

  .hero-actions .btn {
    width: 100%;
    flex: none;
    max-width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    white-space: normal;
    justify-content: center;
    text-align: center;
  }

  .trust-items {
    flex-direction: column;
    align-items: flex-start;
    max-width: 100%;
  }

  .footer-grid,
  .footer-grid-extended {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: var(--space-3);
  }

  .footer-bottom .footer-disclaimer {
    text-align: center;
  }

  .mobile-nav {
    max-height: calc(100vh - var(--header-height));
    overflow-y: auto;
  }

  /* Mobile header: logo left, CTA + menu right */
  .header {
    height: var(--header-height);
  }

  .header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    height: 100%;
    min-width: 0;
  }

  .nav {
    display: none !important;
  }

  .header .logo {
    flex: 0 1 auto;
    min-width: 0;
    max-width: calc(100% - 155px);
  }

  .header .logo-img {
    height: 56px !important;
    max-width: 200px !important;
    width: auto;
  }

  .header-actions {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 0.4rem;
    flex: 0 0 auto;
    margin-left: auto;
  }

  .header-actions .header-started-btn {
    display: none !important;
  }

  .header-actions .header-consult-btn {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    padding: 0.42rem 0.6rem;
    font-size: 0.68rem;
    line-height: 1.15;
    white-space: nowrap;
  }

  .header-consult-full {
    display: none;
  }

  .header-consult-short {
    display: inline;
  }

  .menu-toggle {
    display: inline-flex !important;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
  }

  .service-stats-inner {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-4);
  }

  .service-benefits-grid,
  .service-steps-grid,
  .service-related-grid {
    grid-template-columns: 1fr;
  }

  .service-hero-inner,
  .service-intro-grid,
  .service-detail-grid,
  .service-pricing-card,
  .service-secure-grid,
  .service-handle-card {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }

  .service-hero {
    min-height: auto;
    padding-bottom: var(--space-10);
  }

  .service-hero-media,
  .service-hero-media-wrap,
  .service-hero-media-wrap img {
    min-height: 260px;
  }

  .service-hero-float {
    display: none;
  }

  .service-connect-inner {
    flex-direction: column;
    text-align: center;
    gap: var(--space-4);
  }

  .service-connect-actions {
    justify-content: center;
    flex-wrap: wrap;
  }

  .service-handle-card {
    padding: var(--space-6);
  }

  .about-office-image {
    min-height: 240px;
  }

  .table-responsive {
    display: block;
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }
}

/* --- Mobile (≤576px) --- */
@media (max-width: 576px) {
  :root {
    --container-padding: 0.875rem;
    --header-height: 72px;
  }

  .logo-img {
    max-width: 185px;
  }

  .footer .logo-img {
    height: 44px;
    max-width: 200px;
  }

  .header-inner {
    gap: 0.4rem;
    padding-left: 10px;
    padding-right: 10px;
  }

  .header .logo {
    max-width: calc(100% - 145px);
  }

  .header .logo-img {
    height: 52px !important;
    max-width: 185px !important;
  }

  .header-actions {
    gap: 0.35rem;
  }

  .header-actions .header-started-btn {
    display: none !important;
  }

  .header-actions .header-consult-btn {
    display: inline-flex !important;
    padding: 0.4rem 0.55rem;
    font-size: 0.68rem;
    max-width: none;
  }

  .header-consult-full {
    display: none;
  }

  .header-consult-short {
    display: inline;
  }

  .menu-toggle {
    width: 38px;
    height: 38px;
  }

  .hero {
    padding-top: calc(var(--header-height) + var(--space-6));
    min-height: auto;
  }

  .hero-visual-container {
    min-height: 220px;
  }

  .hero-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-3);
  }

  .hero-badge {
    font-size: 0.75rem;
  }

  .btn-lg {
    padding: 0.875rem 1.25rem;
    font-size: 0.9375rem;
  }

  .pricing-card,
  .service-card,
  .type-card {
    padding: var(--space-5);
  }

  .service-stats-inner {
    grid-template-columns: 1fr;
  }

  .testimonial-card {
    padding: var(--space-5);
  }

  .lead-form-visual {
    min-height: 200px;
  }

  .page-hero {
    padding: calc(var(--header-height) + var(--space-6)) 0 var(--space-8);
  }

  .thank-you-card {
    padding: var(--space-8) var(--space-5);
  }
}

/* --- Small mobile (≤480px) --- */
@media (max-width: 480px) {
  .hero-stats {
    grid-template-columns: 1fr;
  }

  .comparison-vs-badge {
    margin: 0 auto;
  }

  .image-strip-inner {
    grid-template-columns: 1fr;
  }

  .about-values {
    grid-template-columns: 1fr;
  }

  .nav-dropdown-menu {
    width: min(92vw, 320px);
  }
}

/* --- Touch / coarse pointer --- */
@media (hover: none) and (pointer: coarse) {
  .btn,
  .nav-link,
  .mobile-nav-link,
  .menu-toggle {
    min-height: 44px;
  }
}

/* --- Client UX hardening (mobile) --- */
@media (max-width: 768px) {
  .final-cta-actions,
  .thank-you-actions,
  .section-cta-bar-actions,
  .service-secure-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
  }

  .final-cta-actions .btn,
  .thank-you-actions .btn,
  .section-cta-bar-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .hero-actions {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
    gap: 0.65rem;
  }

  .hero-actions .btn {
    width: 100%;
    flex: none;
    max-width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.9rem;
    white-space: normal;
    justify-content: center;
  }

  .hero-card-float,
  .hero-card-main {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    bottom: auto !important;
    transform: none !important;
    margin: 0.75rem 0 0;
    max-width: 100%;
  }

  .hero-card-float.shield,
  .hero-card-float.progress {
    display: none !important;
  }

  .hero-visual-container {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    max-width: 100%;
  }

  .pricing-grid {
    grid-template-columns: 1fr !important;
    max-width: 100%;
    gap: 1.5rem;
  }

  .pricing-card-featured {
    transform: none !important;
    order: -1;
  }

  .section-cta-bar {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
  }

  .trust-badges {
    gap: 0.5rem;
  }

  .trust-badge {
    min-width: calc(50% - 0.5rem);
    flex: 1 1 calc(50% - 0.5rem);
  }

  .social-float {
    right: 8px;
    bottom: 90px;
    top: auto;
    transform: none;
  }

  .lead-modal-dialog {
    width: calc(100% - 1rem);
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
  }

  .form-grid,
  .form-grid-modal {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 480px) {
  .trust-badge {
    min-width: 100%;
    flex-basis: 100%;
  }

  .hero-stats {
    grid-template-columns: 1fr !important;
  }
}

/* --- Checkout / one-step / global overlap safety --- */
body.page-checkout,
body.page-inner {
  overflow-x: hidden;
}

body.page-checkout main,
body.page-inner main {
  position: relative;
  z-index: 1;
}

body.page-checkout .header,
body.page-inner .header {
  z-index: 1000;
}

@media (max-width: 1024px) {
  .checkout-section,
  .thank-you-section,
  .section.lead-form-section {
    padding-left: 0;
    padding-right: 0;
  }

  .hero-card-float,
  .hero-card-main,
  .hero-visual-container > * {
    max-width: 100%;
  }
}

@media (max-width: 768px) {
  .page-hero,
  .service-hero,
  .checkout-section {
    padding-top: calc(var(--header-height, 88px) + 1.5rem) !important;
  }

  .final-cta-actions .btn,
  .service-secure-actions .btn,
  .checkout-submit .btn {
    width: 100%;
    max-width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 100%;
  }

  .pricing-card-featured {
    transform: none !important;
  }

  .social-float {
    z-index: 900;
  }
}

@media (max-width: 480px) {
  :root {
    --header-height: 70px;
    --container-padding: 0.75rem;
  }

  .header .logo {
    max-width: calc(100% - 140px);
  }

  .header .logo-img {
    height: 48px !important;
    max-width: 170px !important;
  }

  .header-actions {
    gap: 0.3rem;
  }

  .header-actions .header-consult-btn {
    padding: 0.38rem 0.5rem;
    font-size: 0.65rem;
  }

  .menu-toggle {
    width: 36px;
    height: 36px;
  }

  .menu-toggle svg {
    width: 20px;
    height: 20px;
  }

  .hero {
    padding-top: calc(var(--header-height) + var(--space-5));
    padding-bottom: var(--space-8);
  }

  .hero h1 {
    font-size: clamp(1.5rem, 7vw, 1.9rem);
  }

  .hero-visual-container {
    min-height: 200px;
    aspect-ratio: 1 / 0.9;
  }

  .hero-stats {
    grid-template-columns: 1fr;
  }

  .hero-stat-card:last-child {
    grid-column: auto;
  }
}

@media (max-width: 360px) {
  .header .logo-img {
    height: 44px !important;
    max-width: 150px !important;
  }

  .header-actions .header-consult-btn {
    padding: 0.35rem 0.4rem;
    font-size: 0.6rem;
  }
}
