/* ═══════════════════════════════════════════════════════════════
   COMPREHENSIVE RESPONSIVE FIXES - ALL DEVICES
   Mobile (320px-480px) | Tablet (481px-768px) | Desktop (769px+)
═══════════════════════════════════════════════════════════════ */

/* ════ GLOBAL FIXES ════ */
html, body {
  overflow-x: hidden !important;
  max-width: 100%;
}

* {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  -webkit-text-size-adjust: 100%;
}

img, video {
  max-width: 100%;
  height: auto;
  display: block;
}

/* ALIGNMENT FIXES */
h1, h2, h3, h4, h5, h6 {
  text-align: center !important;
  margin-left: auto !important;
  margin-right: auto !important;
  line-height: 1.6 !important;
  display: block !important;
  word-wrap: break-word !important;
  word-break: break-word !important;
}

.section-title,
.section-header,
.text-center {
  text-align: center !important;
}

.section-title h2 {
  text-align: center !important;
  line-height: 1.6 !important;
  margin: 0 auto !important;
  display: block !important;
}

.section-title h2::after,
.section-header h2::after {
  content: "" !important;
  display: block !important;
  margin: 15px auto 0 !important;
  width: 100px !important;
  height: 2px !important;
  background-color: var(--accent-color) !important;
}

/* Center content blocks */
section, .section {
  text-align: center !important;
}

section p, .section p {
  margin-left: auto !important;
  margin-right: auto !important;
  text-align: center !important;
}

/* Flex centering */
.d-flex {
  justify-content: center !important;
}

.row {
  margin-left: auto !important;
  margin-right: auto !important;
}

/* ════ EXTREMELY SMALL PHONES (320px - 374px) ════ */
@media (max-width: 374px) {
  body { font-size: 13px; }
  .container, .container-fluid { padding-left: 12px; padding-right: 12px; }

  /* AGGRESSIVE HEADING FIXES */
  h1, h2, h3, h4, h5, h6,
  .hero h1, .hero h2,
  .section-title h2,
  .about .about-content h2,
  .call-to-action .cta-hero-content h2,
  .service-details .service-main-content .content-section h1,
  .privacy .privacy-header .header-content h1,
  .privacy .privacy-content .content-section h2 {
    font-size: 18px !important;
    line-height: 1.15 !important;
    word-break: break-word !important;
    word-wrap: break-word !important;
    margin-bottom: 12px !important;
    padding: 0 !important;
    max-width: 100% !important;
  }

  h1 { font-size: 22px !important; }
  h2 { font-size: 18px !important; }
  h3 { font-size: 16px !important; }
  h4 { font-size: 14px !important; }
  h5, h6 { font-size: 12px !important; }
  p { font-size: 13px !important; line-height: 1.6 !important; }

  .hero { padding: 32px 12px !important; }
  .section { padding: 32px 12px !important; margin-bottom: 0 !important; }
  .btn { padding: 10px 18px !important; font-size: 12px !important; }

  /* Navigation fixes */
  .navbar { padding: 8px 0 !important; }
  .navbar-brand { font-size: 18px !important; }
  .nav-link { padding: 6px 10px !important; font-size: 12px !important; }

  /* Form fixes */
  .form-control, .form-select { padding: 10px 8px !important; font-size: 12px !important; }
  .form-label { font-size: 12px !important; }

  /* Card fixes */
  .card { padding: 12px !important; }
  .card-body { padding: 12px !important; }

  /* Grid/flex fixes */
  .row > [class*="col-"] { padding: 4px !important; }

  /* Stats */
  .stat-num { font-size: 18px !important; }
  .stat-label { font-size: 9px !important; }

  /* Section title specific */
  .section-title { padding-bottom: 20px !important; margin-bottom: 20px !important; text-align: center !important; }
  .section-title h2 {
    text-align: center !important;
    margin: 0 auto 10px !important;
    line-height: 1.4 !important;
    display: block !important;
    font-size: 18px !important;
    word-spacing: normal !important;
  }
  .section-title h2::after {
    width: 80px !important;
    display: block !important;
    margin: 12px auto 0 !important;
    height: 2px !important;
    background-color: var(--accent-color) !important;
  }

  /* ALIGNMENT FIXES */
  .container { text-align: center !important; }
  .row { margin-left: auto !important; margin-right: auto !important; }

  h1, h2, h3, h4, h5, h6 {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  section, .section {
    text-align: center !important;
  }

  section p, .section p {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .d-flex { justify-content: center !important; }
}

/* ════ SMALL PHONES (375px - 480px) ════ */
@media (max-width: 480px) {
  body { font-size: 14px; }
  .container { padding-left: 14px; padding-right: 14px; }

  /* AGGRESSIVE HEADING FIXES */
  h1, h2, h3, h4, h5, h6,
  .hero h1, .hero h2,
  .section-title h2,
  .about .about-content h2,
  .call-to-action .cta-hero-content h2,
  .service-details .service-main-content .content-section h1,
  .privacy .privacy-header .header-content h1,
  .privacy .privacy-content .content-section h2 {
    word-break: break-word !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    margin-bottom: 12px !important;
    line-height: 1.2 !important;
  }

  /* Typography */
  h1 { font-size: 24px !important; line-height: 1.15 !important; }
  h2 { font-size: 20px !important; line-height: 1.15 !important; }
  h3 { font-size: 17px !important; }
  h4 { font-size: 15px !important; }
  p { font-size: 14px !important; line-height: 1.6; }

  /* Spacing */
  .hero { padding: 40px 14px !important; }
  .section { padding: 40px 14px !important; }
  .hero-content { margin-bottom: 20px; }

  /* Buttons */
  .btn {
    width: 100%;
    padding: 12px 16px !important;
    font-size: 13px !important;
    margin-bottom: 8px;
  }
  .btn-group, .btn-group-vertical {
    flex-direction: column;
  }
  .btn-group .btn { width: 100%; }

  /* Forms */
  .form-control, .form-select, textarea {
    padding: 12px 10px !important;
    font-size: 13px !important;
    border-radius: 6px !important;
  }
  .form-group { margin-bottom: 14px; }
  .form-floating > .form-control { padding-top: 18px !important; }

  /* Cards */
  .card {
    margin-bottom: 12px;
    padding: 14px !important;
  }
  .card-body { padding: 14px !important; }

  /* Navigation */
  .navbar { padding: 8px 0 !important; }
  .navbar-brand { font-size: 16px !important; margin-right: 8px; }
  .nav-link { padding: 8px 10px !important; font-size: 12px !important; }

  /* Hero stats */
  .hero-stats {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
  }
  .stat-num { font-size: 18px !important; }
  .stat-label { font-size: 9px !important; }

  /* Hero buttons */
  .hero-buttons {
    flex-direction: column;
    gap: 8px;
  }
  .hero-buttons .btn { width: 100%; }

  /* Grids */
  .cards-grid, .features-grid, .services-grid {
    grid-template-columns: 1fr !important;
    gap: 16px;
  }

  /* Tables */
  .table { font-size: 12px !important; }
  .table td, .table th { padding: 8px 6px !important; }

  /* Badges and pills */
  .badge { font-size: 11px !important; padding: 4px 8px !important; }

  /* Alerts */
  .alert { padding: 12px 14px !important; font-size: 13px !important; }

  /* Process steps */
  .process-grid { gap: 16px; }
  .proc-num { width: 44px !important; height: 44px !important; font-size: 18px !important; }

  /* FAQ/Accordion */
  .accordion-button { padding: 12px 14px !important; font-size: 13px !important; }
  .accordion-body { padding: 12px 14px !important; font-size: 13px !important; }

  /* Testimonials */
  .testimonial-card { padding: 14px !important; }

  /* Modals */
  .modal-content { border-radius: 12px; }
  .modal-header { padding: 12px 14px !important; }
  .modal-body { padding: 14px !important; }
  .modal-footer { padding: 10px 14px !important; }

  /* Dropdowns */
  .dropdown-menu { font-size: 13px !important; }
  .dropdown-item { padding: 8px 12px !important; }

  /* Carousel */
  .carousel-control-prev, .carousel-control-next { width: 32px !important; }
  .carousel-indicators { bottom: 8px !important; gap: 6px !important; }
  .carousel-indicators button { width: 10px !important; height: 10px !important; }
}

/* ════ TABLETS (481px - 768px) ════ */
@media (min-width: 481px) and (max-width: 768px) {
  .container { max-width: 100%; padding-left: 16px; padding-right: 16px; }

  /* AGGRESSIVE HEADING FIXES */
  h1, h2, h3, h4, h5, h6,
  .hero h1, .hero h2,
  .section-title h2,
  .about .about-content h2,
  .call-to-action .cta-hero-content h2 {
    word-break: break-word !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    max-width: 100% !important;
    margin-bottom: 16px !important;
  }

  /* Typography */
  h1 { font-size: 28px !important; line-height: 1.2 !important; }
  h2 { font-size: 24px !important; line-height: 1.2 !important; }
  h3 { font-size: 20px !important; }
  p { font-size: 14px !important; }

  /* Spacing */
  .hero { padding: 50px 16px !important; }
  .section { padding: 50px 16px !important; }

  /* Buttons */
  .btn { padding: 12px 20px !important; font-size: 14px !important; }
  .btn-sm { padding: 8px 12px !important; font-size: 12px !important; }
  .btn-lg { padding: 14px 24px !important; font-size: 15px !important; }

  /* Forms */
  .form-control, .form-select {
    padding: 12px 12px !important;
    font-size: 14px !important;
    border-radius: 8px !important;
  }

  /* Cards */
  .card {
    margin-bottom: 16px;
    padding: 16px !important;
  }

  /* Grids */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px;
  }
  .features-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 14px;
  }

  /* Hero stats */
  .hero-stats {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 12px;
  }
  .stat-num { font-size: 22px !important; }
  .stat-label { font-size: 11px !important; }

  /* Navigation */
  .navbar { padding: 10px 0 !important; }
  .navbar-brand { font-size: 18px !important; }
  .nav-link { padding: 8px 12px !important; font-size: 13px !important; }

  /* Tables */
  .table { font-size: 13px !important; }
  .table td, .table th { padding: 10px 8px !important; }

  /* Testimonials */
  .testimonial-card { padding: 18px !important; }
  .testi-author { gap: 10px; }

  /* Process steps */
  .process-grid { gap: 18px; }
  .proc-num { width: 50px !important; height: 50px !important; font-size: 20px !important; }

  /* ALIGNMENT FIXES FOR TABLETS */
  h1, h2, h3, h4, h5, h6 {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }

  .section-title {
    text-align: center !important;
  }

  .section-title h2 {
    text-align: center !important;
    margin: 0 auto 12px !important;
    line-height: 1.5 !important;
    display: block !important;
    word-spacing: normal !important;
  }

  .section-title h2::after {
    display: block !important;
    margin: 12px auto 0 !important;
    width: 100px !important;
    height: 2px !important;
    background-color: var(--accent-color) !important;
  }

  section, .section {
    text-align: center !important;
  }

  section p, .section p {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* ════ SMALL DESKTOPS (769px - 991px) ════ */
@media (min-width: 769px) and (max-width: 991px) {
  .container-lg { max-width: 100%; padding-left: 20px; padding-right: 20px; }

  /* Typography */
  h1 { font-size: clamp(28px, 6vw, 36px) !important; }
  h2 { font-size: clamp(26px, 5.5vw, 34px) !important; }

  /* Spacing */
  .section { padding: 60px 20px !important; }
  .hero { padding: 60px 20px !important; }

  /* Buttons */
  .btn { padding: 12px 24px !important; font-size: 15px !important; }

  /* Grids */
  .cards-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px;
  }
  .features-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 18px;
  }

  /* Hero stats */
  .hero-stats {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 14px;
  }

  /* Navigation */
  .navbar { padding: 12px 0 !important; }
  .navbar-brand { font-size: 20px !important; }
  .nav-link { padding: 8px 14px !important; font-size: 14px !important; }

  /* Sidebars */
  .sidebar { margin-top: 20px; }
  .service-sidebar { position: static !important; }

  /* Tables */
  .table { font-size: 14px !important; }
  .table td, .table th { padding: 12px 10px !important; }

  /* Modals */
  .modal-dialog { max-width: 90%; }

  /* ALIGNMENT FIXES FOR SMALL DESKTOPS */
  h1, h2, h3, h4, h5, h6 {
    text-align: center !important;
  }

  .section-title h2 {
    text-align: center !important;
  }

  .section-title h2::after {
    margin: 15px auto 0 !important;
  }
}

/* ════ LARGE DESKTOPS (992px - 1199px) ════ */
@media (min-width: 992px) and (max-width: 1199px) {
  .container-xl { max-width: 100%; padding-left: 24px; padding-right: 24px; }

  /* Typography */
  h1 { font-size: 38px !important; }
  h2 { font-size: 32px !important; }

  /* Spacing */
  .section { padding: 70px 24px !important; }

  /* Buttons */
  .btn { padding: 13px 28px !important; font-size: 15px !important; }

  /* Grids */
  .cards-grid {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 22px;
  }
  .features-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 20px;
  }

  /* ALIGNMENT FIXES FOR LARGE DESKTOPS */
  h1, h2, h3, h4, h5, h6 {
    text-align: center !important;
  }

  .section-title h2::after {
    margin: 18px auto 0 !important;
  }
}

/* ════ EXTRA LARGE DESKTOPS (1200px+) ════ */
@media (min-width: 1200px) {
  .container-xxl { max-width: 1280px; margin: 0 auto; }

  /* Optimal spacing for reading */
  .section { padding: 80px 0; }
  .hero { padding: 100px 0; }

  /* Typography */
  h1 { font-size: 48px !important; }
  h2 { font-size: 38px !important; }
  p { font-size: 16px !important; line-height: 1.8; }

  /* Grids */
  .cards-grid {
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 24px;
  }
  .features-grid {
    grid-template-columns: repeat(6, 1fr) !important;
    gap: 20px;
  }

  /* ALIGNMENT FIXES FOR EXTRA LARGE DESKTOPS */
  h1, h2, h3, h4, h5, h6 {
    text-align: center !important;
  }

  .section-title h2::after {
    margin: 20px auto 0 !important;
  }
}

/* ════ COMPONENT-SPECIFIC FIXES ════ */

/* Hero Section */
.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
  }
  .hero-buttons .btn { width: 100%; }
}

/* Navigation Bar */
@media (max-width: 768px) {
  .navbar-collapse { max-height: calc(100vh - 70px); overflow-y: auto; }
  .navbar-nav { flex-direction: column; }
  .nav-item { border-bottom: 1px solid rgba(0,0,0,.1); }
  .nav-link { padding: 10px 16px !important; }
}

/* Sticky Elements */
@media (max-width: 768px) {
  .sticky-top { position: static !important; }
  .whatsapp-float { bottom: 70px !important; }
  .scroll-top { bottom: 80px !important; }
}

/* Calendar/Date Pickers */
.cal-grid, .cal-day {
  font-size: clamp(11px, 3vw, 13px);
}
@media (max-width: 480px) {
  .cal-day { padding: 4px 2px; }
  .cal-day-label { font-size: 9px; }
}

/* Testimonials Grid */
.testimonials-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
@media (max-width: 768px) {
  .testimonials-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 480px) {
  .testi-card { padding: 14px !important; }
  .testi-stars { font-size: 13px; }
}

/* Forms - Floating Labels */
.form-floating > .form-control,
.form-floating > .form-select {
  padding: 18px 12px 6px;
}
.form-floating > label {
  padding: 16px 12px;
}
@media (max-width: 480px) {
  .form-floating > .form-control,
  .form-floating > .form-select {
    padding: 14px 10px 4px;
  }
}

/* Tables - Responsive */
.table-responsive { -webkit-overflow-scrolling: touch; }
@media (max-width: 768px) {
  .table { font-size: 12px; }
  .table td, .table th { padding: 8px 6px !important; }
}

/* Modals - Mobile Friendly */
@media (max-width: 480px) {
  .modal-dialog { margin: 10px; }
  .modal-content { border-radius: 10px; }
}

/* Alerts/Banners */
@media (max-width: 480px) {
  .alert { margin-bottom: 12px; padding: 12px !important; }
}

/* Badges/Pills */
.badge {
  font-size: clamp(10px, 2.5vw, 12px);
  padding: clamp(3px, 1vw, 6px) clamp(6px, 2vw, 10px);
}

/* Breadcrumbs */
@media (max-width: 480px) {
  .breadcrumb { font-size: 12px; }
  .breadcrumb-item { padding: 0 4px; }
}

/* List Groups */
.list-group-item {
  padding: clamp(10px, 2.5vw, 12px) clamp(12px, 3vw, 15px);
}

/* Pagination */
@media (max-width: 480px) {
  .pagination { gap: 4px; }
  .page-link { padding: 6px 8px; font-size: 12px; }
}

/* Dropdowns */
@media (max-width: 480px) {
  .dropdown-menu {
    font-size: 13px;
    max-width: 200px;
  }
  .dropdown-item { padding: 8px 12px; }
}

/* Tooltips & Popovers */
@media (max-width: 480px) {
  .tooltip-inner { font-size: 12px; max-width: 180px; }
  .bs-popover-top, .bs-popover-bottom { font-size: 12px; }
}

/* Carousel */
@media (max-width: 768px) {
  .carousel-caption { bottom: 10px; }
  .carousel-caption h5 { font-size: 16px; }
  .carousel-caption p { font-size: 12px; }
}

/* Spinner/Loaders */
.spinner-border {
  width: clamp(2rem, 5vw, 3rem);
  height: clamp(2rem, 5vw, 3rem);
}

/* Progress Bars */
.progress { height: clamp(0.5rem, 2vw, 1.5rem); }

/* Jumbotron */
@media (max-width: 768px) {
  .jumbotron { padding: 32px 16px; }
}

/* Contact Forms - Extra Focus */
.form-control:focus,
.form-select:focus,
textarea:focus {
  border-color: #14529d;
  box-shadow: 0 0 0 3px rgba(20, 82, 157, 0.1);
}

/* Hero Form */
.hero-form {
  padding: clamp(16px, 5vw, 32px);
}
@media (max-width: 480px) {
  .hero-form .row > [class*="col-"] {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* Proof Bar - Horizontal Scroll on Mobile */
.proof-bar {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.proof-bar::-webkit-scrollbar { display: none; }

/* CTA Sections */
@media (max-width: 768px) {
  .cta-section { padding: 50px 16px; }
}
@media (max-width: 480px) {
  .cta-section { padding: 40px 12px; }
}

/* Comparison Tables */
.comparison-table {
  font-size: clamp(12px, 3vw, 14px);
}
@media (max-width: 768px) {
  .comparison-table {
    font-size: 12px;
    display: block;
    overflow-x: auto;
  }
}

/* Tabs */
.nav-tabs {
  flex-wrap: wrap;
  gap: 4px;
}
@media (max-width: 480px) {
  .nav-tabs .nav-link {
    padding: 8px 10px;
    font-size: 12px;
  }
}

/* Accordion */
.accordion-button { text-align: left; }
@media (max-width: 480px) {
  .accordion-button {
    padding: 12px 14px;
    font-size: 13px;
  }
}

/* Prevent horizontal scroll on body */
body { overflow-x: hidden; }

/* Ensure all containers respect viewport */
.container,
.container-sm,
.container-md,
.container-lg,
.container-xl,
.container-xxl,
.container-fluid {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
}

/* Safe padding for all sections */
section, .section {
  padding-left: max(1rem, 5vw);
  padding-right: max(1rem, 5vw);
}

/* Ensure images never overflow */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Safe font scaling */
html {
  font-size: clamp(14px, 2.5vw, 16px);
}

/* Prevent text from being too small */
small, .small { font-size: clamp(10px, 2vw, 12px); }

/* Fix common overflow issues */
code, pre {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  word-wrap: break-word;
}