/**
 * Mangaldeep Saving & Credit Co-operative Ltd.
 * Responsive Styles (responsive.css)
 */

/* ==========================================================================
   Extra Large Screens (Desktop >= 1440px)
   ========================================================================== */
@media (min-width: 1440px) {
  .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
    max-width: 1320px;
  }
}

/* ==========================================================================
   Large Screens (Laptops & Desktops 992px - 1199px)
   ========================================================================== */
@media (max-width: 1199.98px) {
  .hero-title {
    font-size: 2.75rem;
  }

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

  .main-navbar .nav-link {
    padding: 16px 12px !important;
    font-size: 0.98rem;
  }
}

/* ==========================================================================
   Medium Screens (Tablets 768px - 991px)
   ========================================================================== */
@media (max-width: 991.98px) {
  .header-top-bar {
    text-align: center;
  }

  .header-top-bar .top-bar-item {
    justify-content: center;
    margin-bottom: 4px;
  }

  .header-quick-info {
    display: none;
  }

  /* Hide the desktop "Become Member" pill on mobile/tablet.
     A "Become a Member" action already exists inside the offcanvas menu,
     which prevents the navbar from overflowing on narrow screens. */
  .main-navbar .nav-cta-btn {
    display: none !important;
  }

  /* Push the hamburger toggler to the far right on mobile/tablet */
  .main-navbar .navbar-toggler {
    margin-left: auto !important;
  }

  /* Make offcanvas dropdown menus expand in place instead of floating
     absolutely over the content below them. */
  .offcanvas-custom .dropdown-menu {
    position: static !important;
    top: auto !important;
    left: auto !important;
    inset: auto !important;
    transform: none !important;
    margin-left: 18px !important;
    margin-right: 18px !important;
    width: auto !important;
    min-width: 0 !important;
  }

  .hero-slider-section .carousel-item {
    height: auto;
    min-height: 520px;
    padding: 60px 0;
  }

  .hero-title {
    font-size: 2.25rem;
  }

  .hero-desc {
    font-size: 1rem;
  }

  .hero-glass-card {
    margin-top: 30px;
  }

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

  .chairperson-card {
    padding: 24px;
  }

  .welcome-badge-box {
    position: relative;
    bottom: 0;
    right: 0;
    margin-top: 20px;
  }

  .stat-number {
    font-size: 2.2rem;
  }
}

/* ==========================================================================
   Small Screens (Mobiles 576px - 767px)
   ========================================================================== */
@media (max-width: 767.98px) {
  .header-top-bar .row > div {
    margin-bottom: 4px;
  }

  .header-logo-section {
    padding: 16px 0;
  }

  .brand-nepali-name {
    font-size: 1.2rem;
  }

  .brand-english-name {
    font-size: 0.95rem;
  }

  .brand-emblem-svg {
    width: 52px;
    height: 52px;
  }

  .hero-title {
    font-size: 1.85rem;
  }

  .hero-desc {
    font-size: 0.95rem;
  }

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

  .section-subtitle {
    font-size: 0.98rem;
  }

  .btn-primary-custom,
  .btn-secondary-custom,
  .btn-light-custom {
    padding: 10px 22px;
    font-size: 0.9rem;
    width: 100%;
    margin-bottom: 8px;
  }

  /* Keep modal action buttons compact instead of forcing full width */
  .modal .btn-primary-custom,
  .modal .btn-secondary-custom {
    width: auto !important;
  }

  .hero-content .d-flex {
    flex-direction: column;
  }

  .cta-banner {
    padding: 36px 20px;
    text-align: center;
  }

  .cta-banner .d-flex {
    flex-direction: column;
  }

  /* Override the large inline font sizes inside the CTA banner */
  .cta-banner h2[style] {
    font-size: 1.6rem !important;
  }

  .cta-banner p[style] {
    font-size: 1rem !important;
  }

  .stat-item {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 20px 0;
  }

  .page-hero-banner {
    padding: 48px 0;
  }

  .page-hero-title {
    font-size: 2rem;
  }

  .map-container {
    height: 320px;
  }

  .office-info-card {
    padding: 24px;
  }

  .calc-result-value {
    font-size: 1.8rem;
  }

  .testimonial-card .fs-5 {
    font-size: 1.05rem !important;
  }
}

/* ==========================================================================
   Extra Small Screens (< 576px)
   ========================================================================== */
@media (max-width: 575.98px) {
  .hero-title {
    font-size: 1.6rem;
  }

  .hero-slider-section .carousel-item {
    min-height: 480px;
    padding: 48px 0;
  }

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

  .page-hero-title {
    font-size: 1.7rem;
  }

  .carousel-control-prev,
  .carousel-control-next {
    display: none;
  }

  .stat-number {
    font-size: 1.75rem;
  }

  .stat-icon {
    width: 54px;
    height: 54px;
    font-size: 1.5rem;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .testimonial-card {
    padding: 24px 18px;
  }

  .office-info-card {
    padding: 24px 18px;
  }

  .cta-banner {
    padding: 32px 18px;
  }

  .calc-result-value {
    font-size: 1.6rem;
  }

  .gallery-item img {
    height: 210px;
  }

  /* Gallery filter buttons: horizontal scroll strip on small phones */
  .text-center:has(> .gallery-filter-btn) {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    justify-content: flex-start;
    gap: 6px;
    padding: 2px 0 10px;
  }

  .gallery-filter-btn {
    flex: 0 0 auto;
    white-space: nowrap;
  }

  /* Reduce modal padding on small screens for more breathing room */
  .modal-header,
  .modal-body {
    padding: 1rem !important;
  }

  #back-to-top {
    bottom: 16px;
    right: 16px;
    width: 42px;
    height: 42px;
  }
}

/* ==========================================================================
   Very Small Phones (< 400px)
   ========================================================================== */
@media (max-width: 399.98px) {
  .hero-title {
    font-size: 1.45rem;
  }

  .hero-badge {
    font-size: 0.78rem;
    padding: 6px 14px;
  }

  .top-bar-item {
    flex-wrap: wrap;
    justify-content: center;
  }

  .brand-emblem-svg {
    max-height: 64px;
  }

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

  .btn-primary-custom,
  .btn-secondary-custom,
  .btn-light-custom,
  .btn-outline-white {
    padding: 10px 18px;
    font-size: 0.85rem;
  }

  .footer-heading {
    font-size: 1.05rem;
  }

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