@media (max-width: 1299px) {
  .hero_area .hero_bg_box {
    top: 0;
    left: 0;
    width: 100%;
  }

}

@media (max-width: 1120px) {}

@media (max-width: 992px) {
  .hero_area {
    min-height: auto;
  }

  .custom_nav-container .navbar-nav {
    padding-top: 15px;
    align-items: flex-start;
    position: static;
    transform: none;
    text-align: left;
    width: 100%;
    /* Allow mega-menu accordion to expand without clipping */
    overflow: visible !important;
  }

  .custom_nav-container .navbar-nav .nav-item {
    width: 100%;
    overflow: visible !important;
  }

  /* Mobile Navigation Scroll Fix: 
     Allow the menu to scroll internally if it's longer than the screen. 
     This prevents the background page from scrolling instead of the menu. */
  .header_section .navbar-collapse {
    max-height: 85vh; /* Limit height to 85% of viewport */
    overflow-y: auto !important; /* Enable vertical scrolling */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    padding-bottom: 20px;
  }

  /* Remove the previous overflow:visible which prevented scrolling */
  .header_section .navbar-collapse.show,
  .header_section .navbar-collapse.collapsing {
    overflow-y: auto !important;
  }

  .custom_nav-container .navbar-nav .nav-item .nav-link {
    text-align: left;
    padding: 10px 0;
    width: 100%;
    display: flex !important;
    justify-content: space-between;
    align-items: center;
  }

  .custom_nav-container .navbar-nav .nav-item:last-child {
    margin-right: 0;
  }

  .slider_section .detail-box {
    text-align: left;
    margin-bottom: 45px;
    padding-left: 0;
  }

  .slider_section .detail-box .btn-box {
    justify-content: flex-start;
  }

  .slider_section .detail-box .hero_tag {
    margin-left: 0;
  }

  .custom_nav-container .navbar-nav .nav-item .nav-link {
    padding: 5px 25px;
    margin: 5px 0;
  }

  /* ===== MOBILE DEPARTMENTS DROPDOWN ===== */

  /* Mega-menu container: full-width accordion with smooth height transition */
  body .custom_nav-container .navbar-nav .nav-item.has-mega-menu .mega-menu {
    position: static !important;
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    transform: none !important;
    left: 0 !important;
    background-color: #ffffff !important;
    box-shadow: none !important;
    padding: 0 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    margin: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.3s ease, visibility 0.4s;
  }

  /* "Departments" nav-link — matches all other nav links on mobile */
  body .custom_nav-container .navbar-nav .nav-item.has-mega-menu > .nav-link {
    background-color: transparent !important;
    color: #ffffff !important;
    padding: 5px 25px !important;
    margin: 5px 0 !important;
    font-weight: normal !important;
    font-size: 18px !important;
    border-radius: 5px !important;
    cursor: pointer;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  /* Chevron rotation when open */
  body .custom_nav-container .navbar-nav .nav-item.has-mega-menu.is-open > .nav-link .dept-chevron {
    transform: rotate(180deg);
  }

  /* Show mega-menu: expanded state */
  body .custom_nav-container .navbar-nav .nav-item.has-mega-menu.is-open .mega-menu {
    max-height: 1500px; /* More than enough for 18 departments */
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transition: max-height 0.6s ease, opacity 0.4s ease;
  }

  /* Inner grid → single-column vertical list */
  body .custom_nav-container .navbar-nav .nav-item.has-mega-menu .mega-menu .mega-menu-inner {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    width: 100% !important;
  }

  /* Individual department links */
  body .custom_nav-container .navbar-nav .nav-item.has-mega-menu .mega-menu .mega-menu-link {
    color: #178066 !important;
    font-size: 15px !important;
    font-weight: 500 !important;
    padding: 15px 25px !important;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06) !important;
    width: 100% !important;
    display: block !important;
    text-align: left !important;
    transition: background-color 0.2s ease, color 0.2s ease, padding-left 0.2s ease !important;
    background: #ffffff !important;
    border-radius: 0 !important;
    letter-spacing: 0.3px !important;
  }

  /* Active / hover state — teal highlight */
  body .custom_nav-container .navbar-nav .nav-item.has-mega-menu .mega-menu .mega-menu-link:hover,
  body .custom_nav-container .navbar-nav .nav-item.has-mega-menu .mega-menu .mega-menu-link:active {
    background-color: #178066 !important;
    color: #ffffff !important;
    padding-left: 30px !important;
  }

  /* Remove border on last item */
  body .custom_nav-container .navbar-nav .nav-item.has-mega-menu .mega-menu .mega-menu-link:last-child {
    border-bottom: none !important;
  }

  /* ===== END MOBILE DEPARTMENTS DROPDOWN ===== */

  .btn_appointment {
    margin: 15px 0 25px 0;
    display: flex;
    justify-content: center;
    width: max-content;
  }

  .about_section .detail-box {
    padding: 0;
    text-align: center;
    align-items: center;
  }

  .about_section .detail-box .about_text {
    text-align: center;
  }

  .about_section .detail-box .read_more_btn {
    align-self: center;
  }

  /* Department Grid - Tablet (2 columns) */
  .dept_grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 22px;
  }

  .dept_subtitle {
    font-size: 15px;
    max-width: 500px;
  }

  .footer_section .footer_bg_box img {
    -o-object-position: 10% top;
    object-position: 10% top;
  }

  /* Appointment page responsive */
  .appointment_form_card {
    padding: 30px 25px;
  }

  .form_steps {
    padding: 0;
  }

  .step_item span {
    font-size: 10px;
  }

  .step_circle {
    width: 36px;
    height: 36px;
    font-size: 13px;
  }

  .step_line {
    margin: 0 8px;
  }
}

@media (max-width: 767px) {

  .navbar-brand img {
    height: 70px;
  }

  .about_section .about_img_container {
    height: 250px;
    margin-bottom: 20px;
  }

  .about_section .about_img_container img {
    height: 100%;
    object-fit: cover;
  }

  .about_section .img-box {
    margin-bottom: 30px;
  }

  /* Department Grid - Mobile (1 column) */
  .dept_grid {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 35px;
  }

  .dept_card_img {
    height: 180px;
  }

  .dept_card_content {
    padding: 22px 18px 24px;
  }

  .dept_icon {
    width: 46px;
    height: 46px;
    margin-top: -44px;
  }

  .dept_icon i {
    font-size: 20px;
  }

  .dept_card_content h4 {
    font-size: 16px;
  }

  .dept_subtitle {
    font-size: 14px;
  }

  .dept_cta {
    margin-top: 35px;
  }

  .dept_cta_btn {
    padding: 14px 38px;
    font-size: 13px;
  }

  /* Global Department Grid Overrides - Force 1 column on mobile */
  .dept_stats_grid,
  .dept_services_grid,
  .dept_facilities_grid,
  .dept_doctor_grid,
  .dept_about_features {
    grid-template-columns: 1fr !important;
  }

  .dept_stat_item::after {
    display: none !important;
  }

  /* Contact Section Responsive */
  .page_poster {
    padding: 80px 0;
  }

  .page_poster h1 {
    font-size: 36px;
  }

  .contact_form_container {
    padding: 30px 20px;
  }

  .contact_title {
    font-size: 24px;
    text-align: center;
  }

  .info_card {
    padding: 20px;
  }

  .map_section #googleMap {
    height: 350px !important;
  }

  .client_section .box {
    margin: 45px 0;
  }

  .hero_area .hero_bg_box video {
    -o-object-position: center top;
    object-position: center top;
  }

  /* Appointment page responsive */
  .appointment_form_card {
    padding: 25px 18px;
  }

  .review_grid {
    grid-template-columns: 1fr;
  }

  .form_nav {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .form_nav button {
    width: 100%;
    justify-content: center;
  }

  .step_item span {
    display: none;
  }

  .step_line {
    margin: 0 5px;
    margin-bottom: 0;
  }
}

@media (max-width: 576px) {}

@media (max-width: 480px) {
  .slider_section .detail-box h1 {
    font-size: 2rem;
  }

  .about_section {
    border-radius: 0;
    padding-left: 0;
    padding-right: 0;
  }

  .about_section .detail-box {
    padding: 0;
    margin-top: 15px;
  }
}

@media (max-width: 420px) {}

@media (max-width: 376px) {}

@media (min-width: 1200px) {
  .container {
    max-width: 1170px;
  }
}
/* ===== VIDEO HERO - MOBILE ===== */
@media (max-width: 767px) {
  .hero_area .hero_bg_box video {
    object-position: center center;
    width: 100%;
    height: 100%;
  }

  .slider_section {
    padding: 30px 0 50px 0;
  }

  .slider_section .detail-box .btn-box {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .slider_section .detail-box .btn-box a {
    min-width: 160px;
    padding: 12px 25px;
    font-size: 14px;
  }
}

@media (max-width: 480px) {
  .hero_area {
    min-height: 100svh;
  }

  .slider_section .detail-box h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .slider_section .detail-box .hero_tag {
    font-size: 0.85rem;
    letter-spacing: 1.5px;
  }

  .slider_section .detail-box p {
    font-size: 13px;
  }
}
