/* css/responsive.css */

/* Prevent horizontal scroll on all devices */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

*, *::before, *::after {
  box-sizing: border-box;
}

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

/* Tablet (768px - 1023px) */
@media screen and (max-width: 1023px) {
  /* Common Grid Adjustments */
  .problems-grid, .benefits-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .hero-content {
    width: 60%;
  }
  
  .hero-image-col {
    width: 40%;
  }

  .hero-stats-grid {
    grid-template-columns: repeat(2, 1fr);
    row-gap: 32px;
  }
}

/* Mobile (Under 768px) */
@media screen and (max-width: 767px) {
  .d-none-mobile {
    display: none !important;
  }

  .flex-mobile-col {
    display: flex;
    flex-direction: column;
  }

  .flex-mobile-col-reverse {
    display: flex;
    flex-direction: column-reverse;
  }

  /* Typography */
  h1 { font-size: 32px; }
  h2 { font-size: 26px; }
  h3 { font-size: 20px; }
  
  .section-padding {
    padding: 60px 0;
  }

  /* Header */
  .mobile-menu-toggle {
    display: block;
  }

  .main-nav, .header-cta .btn {
    display: none;
  }

  /* Hide social icons from top-bar on mobile — they're in the sidebar */
  .social-links-top {
    display: none !important;
  }

  .hero-main {
    padding-top: 80px;
  }

  .service-hero {
    padding-top: 80px;
  }

  .blog-hero,
  .contacts-hero,
  .article-hero {
    padding-top: 80px;
  }

  /* Hero */
  .hero-container {
    flex-direction: column;
    padding-bottom: 40px;
    gap: 0;
  }

  .hero-content {
    width: 100%;
    margin-top: 0;
    order: 1;
  }

  .hero-image-col {
    display: block;
    width: 100%;
    margin-top: 0;
    margin-bottom: 24px;
    order: -1;
  }

  .hero-image-col::after {
    display: none;
  }

  .hero-image-col .floating-card {
    display: none;
  }

  .hero-image-wrapper {
    aspect-ratio: 16 / 9;
    max-height: 280px;
    border-radius: var(--radius-md);
    overflow: hidden;
  }

  .hero-stats-grid {
    grid-template-columns: 1fr; /* Prevent tight overlap on small phones */
    row-gap: 24px;
  }

  /* Logo tagline — smaller on mobile */
  .logo-tagline {
    font-size: 10px;
    padding-left: 8px;
    margin-left: 8px;
  }
  
  .neo-stat h3 {
    font-size: 32px;
  }
  
  .neo-fac-list li {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }

  /* Approach items: stack on mobile */
  .approach-item {
    grid-template-columns: 1fr !important;
    gap: 8px !important;
  }
  
  .logo-text {
    font-size: 22px;
  }

  /* Grids */
  .problems-grid, .benefits-grid, .blog-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  
  /* Splits */
  .split-section {
    gap: 40px;
  }

  .img-with-badge {
    width: min(100vw - 24px, 560px);
    margin: 0 auto 32px;
  }

  .img-with-badge img.main-img {
    min-height: 340px;
    object-fit: cover;
  }

  .before-after-badge {
    left: 50%;
    right: auto;
    bottom: -18px;
    transform: translateX(-50%);
    width: calc(100% - 24px);
    max-width: 320px;
    padding: 12px;
    gap: 12px;
    justify-content: center;
  }

  .before-after-badge i {
    font-size: 18px;
    flex-shrink: 0;
  }

  .ba-item img {
    width: 52px;
    height: 52px;
    margin-bottom: 6px;
  }

  .ba-item span {
    font-size: 10px;
  }

  /* Steps */
  .steps-wrapper {
    gap: 40px;
  }
  
  .steps-wrapper::before {
    display: none;
  }
  
  .newsletter-strip {
    text-align: center;
    padding: 32px 20px;
  }
  
  .newsletter-info {
    flex-direction: column;
    text-align: center;
    gap: 12px;
  }

  .copyright-bar {
    gap: 16px;
    text-align: center;
  }

  /* Prevent common overflow culprits */
  .main-nav ul {
    flex-wrap: wrap;
    gap: 16px;
  }

  .hero-buttons {
    flex-wrap: wrap;
  }


  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .map-container {
    height: 280px;
  }

  /* Forms on mobile */
  .contacts-form-wrapper {
    padding: 24px 16px;
  }

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

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

  .home-gallery-modal {
    padding: 20px;
  }

  .home-gallery-close {
    top: 12px;
    right: 12px;
  }

  /* Service FAQ on mobile */
  .faq-question {
    font-size: 15px;
    padding: 16px;
  }

  .faq-answer {
    padding: 0 16px;
    font-size: 14px;
  }

  .faq-item.active .faq-answer {
    padding-bottom: 16px;
  }
}
