/* ==========================================================================
   RESPONSIVE.CSS — Отбасылық медицина клиникасы
   Breakpoints: Desktop (>1200px) / Laptop (992-1199px) / Tablet (768-991px) / Mobile (<768px)
   ========================================================================== */

/* ==========================================================================
   LAPTOP (max-width: 1199.98px)
   ========================================================================== */
@media (max-width: 1199.98px) {
  .gallery__grid { grid-template-columns: repeat(3, 1fr); }

  .hero__badge { left: -0.8rem; }
  .about__stat-chip { right: -0.4rem; }

  /* Slightly tighter nav so all 8 links stay on one line without wrapping */
  .navbar-nav .nav-link { padding: 0.5rem 0.6rem !important; font-size: 0.9rem; }
  .btn-appointment { padding: 0.75rem 1.3rem; font-size: 0.88rem; }
}

/* ==========================================================================
   TABLET (max-width: 991.98px)
   ========================================================================== */
@media (max-width: 991.98px) {
  :root { --nav-height: 70px; }

  /* Topbar: hide secondary items, keep essentials */
  .topbar__left li:nth-child(2) { display: none; }

  /* Navbar collapses to offcanvas-style dropdown */
  .navbar-collapse {
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    padding: 1.5rem;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(-8px);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition);
  }
  .navbar-collapse.show {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  .navbar-nav { margin-bottom: 1.2rem; }
  .navbar-nav .nav-link { padding: 0.85rem 0.5rem !important; border-bottom: 1px solid var(--clr-border); }
  .navbar-nav .nav-link::after { display: none; }
  .btn-appointment { margin-left: 0; width: 100%; justify-content: center; }

  /* Hero stacks */
  .hero { padding: 3rem 0 6rem; text-align: center; }
  .hero__content { padding-right: 0; }
  .hero__subtitle { margin-left: auto; margin-right: auto; }
  .hero__cta { justify-content: center; }
  .hero__trust { justify-content: center; }
  .hero__media { margin-top: 3rem; }

  /* About stacks with image first handled by row order in HTML/Bootstrap defaults */
  .about__stat-chip { right: 1rem; bottom: -1.2rem; }

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

  .why-us .col-lg-5 { text-align: center; margin-bottom: 1rem; }
}

/* ==========================================================================
   MOBILE (max-width: 767.98px)
   ========================================================================== */
@media (max-width: 767.98px) {
  :root { --topbar-height: auto; }

  .topbar { padding: 0.5rem 0; height: auto; }
  .topbar__row { flex-direction: column; gap: 0.5rem; align-items: flex-start; }
  .topbar__left { flex-wrap: wrap; gap: 0.9rem; row-gap: 0.4rem; }
  .topbar__right { width: 100%; justify-content: space-between; }

  .brand-text small { display: none; }

  .hero__title { font-size: 2rem; }
  .hero__subtitle { font-size: 1rem; }
  .hero__cta { flex-direction: column; align-items: stretch; }
  .hero__cta .btn { justify-content: center; }
  .hero__image-wrap { max-width: 320px; }
  .hero__badge { padding: 0.8rem 1rem; gap: 0.6rem; }

  .quick-services { padding-bottom: 3rem; }
  .about, .departments, .doctors, .why-us, .news, .gallery, .contact { padding: 3.5rem 0; }
  .stats { padding: 2.8rem 0; }

  .section-title { font-size: 1.6rem; }

  .about__image-wrap { margin-bottom: 2rem; }
  .about__stat-chip { position: static; display: inline-flex; flex-direction: column; margin-top: -1.5rem; margin-left: 1rem; }

  .gallery__grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
  .gallery__filters { justify-content: flex-start; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 0.4rem; }
  .gallery__filters button { flex-shrink: 0; }

  .news-card-sm { flex-direction: row; }
  .news-card-sm img { width: 70px; height: 70px; }

  .contact__form { padding: 1.4rem; }

  .footer__brand { flex-direction: row; }
  .site-footer { padding-top: 3.5rem; text-align: left; }

  #scrollTopBtn { width: 42px; height: 42px; bottom: 1.2rem; right: 1.2rem; font-size: 1rem; }
}

/* ==========================================================================
   SMALL MOBILE (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
  .gallery__grid { grid-template-columns: repeat(2, 1fr); }
  .hero__title { font-size: 1.7rem; }
  .stat-number { font-size: 1.9rem; }
  .brand-mark { width: 40px; height: 40px; font-size: 1.15rem; }
  .doctor-card__body { padding: 1.1rem; }
}

/* ==========================================================================
   LARGE DESKTOP (min-width: 1400px)
   ========================================================================== */
@media (min-width: 1400px) {
  .container { max-width: 1280px; }
}

/* ==========================================================================
   INNER PAGES — TABLET
   ========================================================================== */
@media (max-width: 991.98px) {
  .page-banner { padding: 2.6rem 0 4.5rem; }
  .history-block__figure { position: static; margin-bottom: 2.5rem; }
  .dept-row { flex-wrap: wrap; }
  .founder-card { flex-direction: column; text-align: center; }
}

/* ==========================================================================
   INNER PAGES — MOBILE
   ========================================================================== */
@media (max-width: 767.98px) {
  .page-banner h1 { font-size: 1.6rem; }
  .history-block, .structure-list, .dept-detail, .cabinet-grid,
  .service-detail, .school-list, .contact-cards { padding: 3rem 0; }
  .news-grid-page, .gallery-page, .contact-page, .doctors-page { padding: 2.5rem 0 3.5rem; }
  .dept-row__index { display: none; }
  .service-row { flex-direction: column; text-align: center; align-items: center; }
}