/*
 * CanWinn Arogya Dham — Complete Responsive System v3.0
 * Breakpoints:
 *   XS  : max-width: 360px   (very small phones: iPhone SE)
 *   SM  : max-width: 480px   (small phones)
 *   MD  : max-width: 768px   (mobile landscape / large phones)
 *   LG  : max-width: 991px   (tablets)
 *   XL  : min-width: 992px   (desktop)
 */

/* ===================================================
   1. GLOBAL BASE FIXES
=================================================== */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    width: 100%;
    max-width: 100vw;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
}

img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

.container, .container-fluid {
    padding-left: 15px;
    padding-right: 15px;
}

/* ===================================================
   2. TYPOGRAPHY — FLUID FONT SCALING
=================================================== */
@media (max-width: 991px) {
    .display-1 { font-size: clamp(2rem, 6vw, 2.8rem) !important; }
    .display-2 { font-size: clamp(1.8rem, 5.5vw, 2.5rem) !important; }
    .display-3 { font-size: clamp(1.6rem, 5vw, 2.2rem) !important; }
    .display-4 { font-size: clamp(1.4rem, 4.5vw, 1.9rem) !important; }
    .display-5 { font-size: clamp(1.2rem, 4vw, 1.6rem) !important; }
    h1 { font-size: clamp(1.6rem, 5vw, 2.2rem) !important; }
    h2 { font-size: clamp(1.4rem, 4.5vw, 1.9rem) !important; }
    h3 { font-size: clamp(1.2rem, 4vw, 1.6rem) !important; }
    h4 { font-size: clamp(1rem, 3.5vw, 1.3rem) !important; }
    .section-title h2 { font-size: clamp(1.4rem, 4.5vw, 1.9rem) !important; }
}

@media (max-width: 480px) {
    h1 { font-size: clamp(1.3rem, 5.5vw, 1.8rem) !important; }
    h2 { font-size: clamp(1.2rem, 5vw, 1.6rem) !important; }
    h3 { font-size: clamp(1rem, 4.5vw, 1.3rem) !important; }
    .section-title h2 { font-size: clamp(1.2rem, 5vw, 1.6rem) !important; }
}

/* ===================================================
   3. GRID & LAYOUT HELPERS
=================================================== */
@media (max-width: 991px) {
    section {
        padding: 40px 0;
    }

    .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* ===================================================
   4. TOP HEADER BAR
=================================================== */
@media (max-width: 991.98px) {
    /* Top header is already hidden on mobile with d-none d-xl-block — no fixes needed */
}

/* ===================================================
   5. NAVBAR
=================================================== */
@media (max-width: 1099.98px) {
    .navbar {
        position: relative !important;
        padding: 8px 16px !important;
        z-index: 100000 !important;
    }

    .navbar-brand img {
        height: 36px !important;
    }

    .navbar-toggler {
        padding: 6px 10px !important;
        border: 2px solid #000000 !important;
        border-color: #000000 !important;
        background: transparent !important;
        background-color: transparent !important;
        border-radius: 10px !important;
        outline: none !important;
        align-self: center !important;
        box-shadow: none !important;
        color: #ffffff !important;
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    .navbar-toggler-icon {
        width: 20px;
        height: 20px;
    }

    .navbar-collapse {
        background: #ffffff !important;
        border-radius: 20px !important;
        box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12) !important;
        border: 1px solid #e2e8f0 !important;
        padding: 14px 16px !important;
        position: absolute !important;
        top: calc(100% + 8px) !important;
        left: 16px !important;
        right: 16px !important;
        width: calc(100% - 32px) !important;
        max-width: 100% !important;
        margin: 0 auto !important;
        z-index: 999999 !important;
        max-height: calc(100vh - 90px) !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .navbar-collapse.collapsing {
        display: block !important;
        position: absolute !important;
        top: calc(100% + 8px) !important;
        left: 16px !important;
        right: 16px !important;
        width: calc(100% - 32px) !important;
        height: auto !important;
        transition: height 0.3s ease !important;
        overflow: hidden !important;
    }

    .navbar-collapse.show {
        display: block !important;
        animation: cwnSlideRightToLeft 0.52s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    }

    .navbar-nav {
        align-items: flex-start !important;
        padding: 0;
        width: 100%;
        gap: 0 !important;
    }

    .nav-item {
        width: 100%;
        margin: 0 !important;
        border-bottom: 1px solid #f1f5f9;
    }

    .nav-item:last-child {
        border-bottom: none;
    }

    .nav-link {
        width: 100% !important;
        display: block !important;
        padding: 12px 14px !important;
        font-size: 14px !important;
        border-radius: 12px !important;
        margin: 3px 0 !important;
    }

    /* Mega dropdown on mobile — stacks vertically */
    .mega-dropdown-menu {
        box-shadow: none !important;
        border: none !important;
        padding: 12px 16px !important;
        background: rgba(38, 177, 163, 0.03) !important;
        border-radius: 16px !important;
        width: 100% !important;
    }

    .mega-col-divider {
        border-right: none !important;
        padding-right: 0 !important;
        margin-bottom: 16px;
    }

    /* Book Now button — full width on mobile */
    .btn-book-now {
        width: 100%;
        text-align: center;
        margin-top: 10px;
    }
}

@media (max-width: 360px) {
    .navbar-brand img {
        height: 30px !important;
    }
}

/* ===================================================
   6. HERO SLIDER
=================================================== */
@media (max-width: 991px) {
    .slider-img {
        height: 55vw !important;
        min-height: 260px !important;
        max-height: 420px !important;
    }
}

@media (max-width: 768px) {
    .slider-img {
        height: auto !important;
        aspect-ratio: 16 / 10 !important;
        min-height: 220px !important;
    }

    .carousel-caption {
        padding: 12px !important;
        bottom: 10px !important;
    }

    .carousel-caption h1 {
        font-size: clamp(1rem, 4vw, 1.5rem) !important;
        line-height: 1.3;
    }

    .carousel-caption p {
        font-size: 0.85rem !important;
        display: none; /* hide on small phones to avoid clutter */
    }

    .carousel-caption .btn {
        font-size: 0.8rem !important;
        padding: 7px 14px !important;
    }
}

@media (max-width: 480px) {
    .slider-img {
        aspect-ratio: 4 / 3 !important;
    }
}

/* ===================================================
   7. QUICK ACTIONS BAR (Service Pill Slider)
=================================================== */
/* Mobile: handled inside quick_actions.php (max-width: 767px) */
/* Tablet (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .quick-actions-section {
        margin-top: -26px !important;
        margin-bottom: -26px !important;
        padding: 0 8px;
    }

    .quickActionsSwiper {
        border-radius: 18px !important;
    }

    .qa-item {
        padding: 16px 12px !important;
        gap: 10px !important;
    }

    .qa-icon-box {
        font-size: 20px !important;
        width: 34px !important;
        height: 34px !important;
    }

    .qa-title-top { font-size: 10px !important; }
    .qa-title-bottom, .qa-title-full { font-size: 12px !important; }

    .swiper-button-qa {
        width: 32px !important;
        height: 32px !important;
    }

    .prev-qa { left: -12px !important; }
    .next-qa { right: -12px !important; }
}

/* ===================================================
   8. OUR SERVICES (Specialty Grid Cards)
=================================================== */
@media (max-width: 1200px) {
    .custom-grid {
        grid-template-columns: repeat(4, 1fr) !important;
        gap: 18px !important;
    }
}

@media (max-width: 992px) {
    .custom-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 15px !important;
    }
}

@media (max-width: 768px) {
    .custom-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .spec-card {
        padding: 24px 14px !important;
        border-radius: 18px !important;
    }

    .icon-wrapper {
        width: 66px !important;
        height: 66px !important;
        border-radius: 16px !important;
    }

    .icon-wrapper img,
    .icon-wrapper i {
        width: 38px !important;
        height: 38px !important;
        font-size: 30px !important;
    }

    .spec-card h5 {
        font-size: 0.95rem !important;
    }
}

@media (max-width: 480px) {
    .custom-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .spec-card {
        padding: 18px 10px !important;
        border-radius: 14px !important;
    }

    .spec-card h5 {
        font-size: 0.85rem !important;
    }
}

/* ===================================================
   9. OPD / CANWINN SEVA SECTION
=================================================== */
@media (max-width: 991px) {
    .opd-section .row {
        flex-direction: column !important;
    }

    .opd-img-wrapper {
        width: 280px !important;
        height: 280px !important;
        margin: 0 auto 30px !important;
    }

    .badge-float {
        font-size: 10px !important;
        padding: 5px 10px !important;
    }

    .opd-list-card {
        border-radius: 20px !important;
    }
}

@media (max-width: 480px) {
    .opd-img-wrapper {
        width: 220px !important;
        height: 220px !important;
    }

    .badge-float {
        font-size: 9px !important;
        padding: 4px 8px !important;
    }

    .opd-features li {
        font-size: 0.9rem !important;
        margin-bottom: 10px !important;
    }
}

/* ===================================================
   10. TREATMENT VIDEO / HEALING JOURNEY SECTION
=================================================== */
@media (max-width: 991px) {
    .premium-journey .row {
        flex-direction: column !important;
    }

    .video-card {
        position: relative !important;
        top: 0 !important;
        margin-bottom: 30px;
    }

    .video-card video {
        height: 280px !important;
    }

    .steps-container {
        padding-left: 10px !important;
    }

    .step-box {
        margin-bottom: 20px !important;
    }

    .step-icon {
        width: 46px !important;
        height: 46px !important;
        font-size: 1.1rem !important;
    }
}

@media (max-width: 480px) {
    .video-card video {
        height: 220px !important;
    }
}

/* ===================================================
   11. STATS / COUNTER SECTION
=================================================== */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 14px !important;
    }

    .stat-card {
        padding: 20px 10px !important;
        border-radius: 18px !important;
    }

    .stat-icon-box {
        width: 52px !important;
        height: 52px !important;
        border-radius: 14px !important;
        margin-bottom: 10px !important;
    }

    .stat-icon-box i {
        font-size: 1.4rem !important;
    }

    .stat-number {
        font-size: 1.7rem !important;
    }

    .stat-label {
        font-size: 0.82rem !important;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .stat-card {
        padding: 16px 8px !important;
        border-radius: 14px !important;
    }

    .stat-icon-box {
        width: 44px !important;
        height: 44px !important;
        border-radius: 12px !important;
        margin-bottom: 8px !important;
    }

    .stat-icon-box i {
        font-size: 1.2rem !important;
    }

    .stat-number {
        font-size: 1.45rem !important;
        margin-bottom: 2px !important;
    }

    .stat-label {
        font-size: 0.75rem !important;
        line-height: 1.2 !important;
    }
}

/* ===================================================
   12. VIDEO TESTIMONIALS SECTION
=================================================== */
@media (max-width: 768px) {
    .testimonials-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }

    .video-image {
        height: 200px !important;
    }

    .reviews-header h2 {
        font-size: 1.6rem !important;
    }
}

/* ===================================================
   13. SACCHA SATHI / CTA BANNER
=================================================== */
@media (max-width: 768px) {
    .saccha-sathi-banner {
        padding: 24px 18px !important;
        border-radius: 20px !important;
    }

    .saccha-sathi-banner h2 {
        font-size: 1.3rem !important;
    }

    .saccha-sathi-banner p {
        font-size: 0.9rem !important;
    }
}

@media (max-width: 480px) {
    .saccha-sathi-banner h2 {
        font-size: 1.15rem !important;
    }
    .saccha-sathi-banner {
        padding: 18px 14px !important;
    }
}

/* ===================================================
   14. FOOTER
=================================================== */
@media (max-width: 991px) {
    .main-footer {
        border-top-left-radius: 40px !important;
        border-top-right-radius: 40px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding: 50px 0 20px !important;
    }

    .footer-column {
        margin-bottom: 28px;
        text-align: center;
    }

    .contact-info {
        text-align: center !important;
        margin: 0 auto;
        max-width: 320px;
    }

    .cwn-footer-contact-box {
        text-align: center !important;
        padding: 12px 18px !important;
    }

    .footer-badges {
        justify-content: center !important;
        display: flex !important;
        flex-wrap: wrap;
        gap: 12px;
    }

    .footer-badges img {
        height: 48px !important;
        margin: 0 !important;
    }

    .social-icons {
        justify-content: center !important;
        display: flex !important;
        margin-top: 15px;
    }

    .footer-links {
        text-align: center;
    }

    .copyright-bar {
        text-align: center !important;
        flex-direction: column;
        gap: 6px;
    }
}

@media (max-width: 480px) {
    .main-footer {
        border-top-left-radius: 28px !important;
        border-top-right-radius: 28px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding: 36px 0 16px !important;
    }

    .footer-column h4 {
        font-size: 1rem !important;
        margin-bottom: 16px;
    }

    .footer-links a {
        font-size: 0.88rem !important;
    }
}

/* Fix footer border-radius clipping on very small phones (360px and below) */
@media (max-width: 360px) {
    .main-footer {
        border-top-left-radius: 18px !important;
        border-top-right-radius: 18px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        width: 100% !important;
        padding: 28px 0 14px !important;
    }
}

/* ===================================================
   15. POLYCLINIC / HERO PRO PAGES
=================================================== */
@media (max-width: 768px) {
    .hero-pro {
        padding: 90px 0 100px !important;
        border-radius: 0 0 26px 26px !important;
    }

    .hero-pro h1 {
        font-size: clamp(1.5rem, 5vw, 2.2rem) !important;
    }

    .stats-overlap {
        margin-top: -40px !important;
    }

    .aarogya-dham-content {
        grid-template-columns: 1fr !important;
        gap: 24px !important;
    }

    .map-container,
    .map-container iframe {
        height: 280px !important;
        min-height: 280px !important;
    }

    .aarogya-dham-header h2 {
        font-size: 1.5rem !important;
    }
}

/* ===================================================
   16. ABOUT PAGE — TIMELINE
=================================================== */
@media (max-width: 768px) {
    .timeline::before {
        left: 28px !important;
    }

    .timeline-dot {
        left: 28px !important;
        transform: translateX(-50%) !important;
    }

    .timeline-item,
    .timeline-item:nth-child(odd),
    .timeline-item:nth-child(even) {
        padding-left: 56px !important;
        padding-right: 0 !important;
        text-align: left !important;
    }

    .about-hero,
    .services-hero {
        padding: 60px 0 !important;
    }

    .about-hero h1,
    .services-hero h1 {
        font-size: clamp(1.5rem, 5vw, 2.2rem) !important;
    }

    .about-hero p,
    .services-hero p {
        font-size: 0.95rem !important;
    }
}

/* ===================================================
   17. DOCTOR LISTING / SPECIALITY PAGES
=================================================== */
@media (max-width: 768px) {
    /* Doctor cards grid */
    .dr-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }

    /* Doctor detail modal full screen on mobile */
    .modal-dialog {
        margin: 0.5rem !important;
    }

    .modal-content {
        border-radius: 20px !important;
    }
}

@media (max-width: 480px) {
    .dr-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ===================================================
   18. LAB / RADIOLOGY / PACKAGE CART PAGES
=================================================== */
@media (max-width: 768px) {
    /* Cart table → stacked cards on mobile */
    .cart-table-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .lab-hero-section {
        padding: 60px 0 80px !important;
    }

    .lab-hero-section h1 {
        font-size: clamp(1.4rem, 5vw, 2rem) !important;
    }
}

/* ===================================================
   19. APPOINTMENT BOOKING FORMS
=================================================== */
@media (max-width: 768px) {
    .book-appt-card {
        padding: 20px 14px !important;
        border-radius: 20px !important;
    }

    .progress-stepper .step-label {
        font-size: 10px !important;
    }

    .slot-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
    }
}

@media (max-width: 480px) {
    .slot-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* ===================================================
   20. PROFILE PAGE
=================================================== */
@media (max-width: 768px) {
    .profile-sidebar {
        margin-bottom: 24px;
    }

    .profile-avatar {
        width: 90px !important;
        height: 90px !important;
    }

    .booking-receipt-card {
        padding: 16px !important;
        border-radius: 16px !important;
    }
}

/* ===================================================
   21. ADMIN PANEL — RESPONSIVE FIXES
=================================================== */
@media (max-width: 991px) {
    .admin-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        z-index: 1050;
        top: 0;
        left: 0;
        height: 100vh;
    }

    .admin-sidebar.open {
        transform: translateX(0);
    }

    .admin-main-content {
        margin-left: 0 !important;
    }
}

/* ===================================================
   22. TABLET SPECIFIC (768px — 991px)
=================================================== */
@media (min-width: 768px) and (max-width: 991px) {
    .custom-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .slider-img {
        height: 50vw !important;
    }

    .stats-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .testimonials-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .quick-actions-section {
        margin-top: -28px !important;
        margin-bottom: -28px !important;
    }
}

/* ===================================================
   23. IPHONE SE / VERY SMALL PHONES (≤ 360px)
=================================================== */
@media (max-width: 360px) {
    .navbar-brand img {
        height: 28px !important;
    }

    .section-title h2 {
        font-size: 1.2rem !important;
    }

    /* qa-item sizing handled in quick_actions.php @media(max-width:360px) */

    .qa-icon-box {
        font-size: 15px !important;
        width: 26px !important;
        height: 26px !important;
    }

    .qa-title-bottom, .qa-title-full {
        font-size: 10px !important;
    }

    .custom-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }

    .stat-number {
        font-size: 1.25rem !important;
    }

    .stat-label {
        font-size: 0.7rem !important;
    }

    /* .main-footer border-radius handled in section 14 footer fix above */
}

/* ===================================================
   24. DESKTOP POLISH (≥ 1200px)
=================================================== */
@media (min-width: 1200px) {
    .custom-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===================================================
   25. MISC UTILITIES
=================================================== */
/* Prevent horizontal scroll from negative margins */
@media (max-width: 991px) {
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
    }

    .overflow-fix {
        overflow-x: hidden;
    }
}

/* Touch-friendly tap targets */
@media (max-width: 768px) {
    /* Only apply to standalone buttons and major interactive elements */
    button, .btn, input[type="submit"], input[type="button"], input[type="reset"] {
        min-height: 42px;
    }

    /* Nav links get min-height but stay block */
    .nav-link {
        min-height: 42px;
        display: block;
    }

    /* Standalone anchor buttons only (has btn class) */
    a.btn {
        min-height: 42px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    /* Exceptions — all pure anchor/text links stay inline */
    a:not(.btn):not(.nav-link):not(.qa-item):not(.mega-links li a) {
        min-height: unset !important;
        display: inline !important;
    }

    /* Card links, icon links, logo links stay as-is */
    .card a, h1 a, h2 a, h3 a, h4 a, h5 a, h6 a,
    span a, .badge a, img a, figure a,
    .footer-links a, .mega-links li a,
    p a, li a, td a, th a, label a {
        min-height: unset !important;
        display: inline !important;
    }
}

/* Fix floating badges overflow on OPD section — tablet range (481px–767px) */
@media (min-width: 481px) and (max-width: 767px) {
    .dept-dentist { right: 0 !important; }
    .dept-physio  { right: 0 !important; }
    .dept-ecg     { right: 0 !important; }
    .opd-img-wrapper {
        width: 260px !important;
        height: 260px !important;
    }
}

/* Fix floating badges overflow on very small phones (≤480px) */
@media (max-width: 480px) {
    .dept-dentist { right: -5px !important; }
    .dept-physio  { right: -5px !important; }
    .dept-ecg     { right: -5px !important; }
}

/* ===================================================
   26. CAREER PAGE
=================================================== */
@media (max-width: 768px) {
    .career-hero, .career-section {
        padding: 50px 0 !important;
    }
    .job-card {
        padding: 18px !important;
        border-radius: 16px !important;
    }
    .job-card .d-flex {
        flex-wrap: wrap;
        gap: 8px;
    }
    .job-meta-badges {
        flex-wrap: wrap !important;
        gap: 6px !important;
    }
    .back-to-home-btn {
        font-size: 13px !important;
        padding: 8px 16px !important;
    }
}
@media (max-width: 480px) {
    .job-card h4, .job-card h5 { font-size: 1rem !important; }
    .job-card p { font-size: 0.88rem !important; }
}

/* ===================================================
   27. ABOUT PAGE
=================================================== */
@media (max-width: 768px) {
    .about-hero { padding: 60px 0 !important; }
    .core-values-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 14px !important;
    }
    .team-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 14px !important;
    }
    .about-stats {
        flex-wrap: wrap;
        gap: 16px;
    }
    .about-stats > div {
        flex: 0 0 45%;
        text-align: center;
    }
}
@media (max-width: 480px) {
    .core-values-grid { grid-template-columns: 1fr !important; }
    .team-grid { grid-template-columns: 1fr !important; }
    .about-stats > div { flex: 0 0 100%; }
}

/* ===================================================
   28. CONTACT PAGE
=================================================== */
@media (max-width: 768px) {
    .contact-card {
        padding: 20px 14px !important;
        border-radius: 18px !important;
        margin-bottom: 16px;
    }
    .contact-form-wrap {
        padding: 20px 14px !important;
    }
    .map-container iframe {
        height: 250px !important;
        border-radius: 16px !important;
    }
    .contact-info-item {
        flex-direction: column;
        text-align: center;
    }
}

/* ===================================================
   29. SERVICES PAGE
=================================================== */
@media (max-width: 768px) {
    .services-hero { padding: 60px 0 !important; }
    .service-detail-card {
        padding: 18px !important;
        margin-bottom: 14px;
    }
    .services-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 12px !important;
    }
}
@media (max-width: 480px) {
    .services-grid { grid-template-columns: 1fr !important; }
}

/* ===================================================
   30. ALL BLOGS PAGE
=================================================== */
@media (max-width: 768px) {
    .blogs-hero { padding: 60px 0 80px !important; }
    .blog-card {
        border-radius: 16px !important;
        overflow: hidden;
    }
    .blog-card img {
        height: 180px !important;
        object-fit: cover;
    }
    .blog-card .card-body {
        padding: 16px !important;
    }
    .blog-filters {
        flex-wrap: wrap;
        gap: 8px;
        justify-content: center;
    }
}

/* ===================================================
   31. LOGIN PAGE
=================================================== */
@media (max-width: 768px) {
    .login-container, .auth-card {
        padding: 24px 16px !important;
        border-radius: 20px !important;
        margin: 16px !important;
    }
    .login-logo { height: 50px !important; }
    .otp-inputs {
        gap: 8px !important;
    }
    .otp-inputs input {
        width: 42px !important;
        height: 48px !important;
        font-size: 1.2rem !important;
    }
}

/* ===================================================
   32. PROFILE PAGE
=================================================== */
@media (max-width: 991px) {
    .profile-sidebar-col {
        margin-bottom: 20px;
    }
    .profile-tabs .nav-link {
        font-size: 13px !important;
        padding: 10px 12px !important;
    }
    .booking-history-table {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }
    .booking-history-table table {
        min-width: 600px !important;
    }
}
@media (max-width: 768px) {
    .profile-info-grid {
        grid-template-columns: 1fr !important;
    }
    .profile-header-card {
        flex-direction: column !important;
        text-align: center;
        gap: 12px;
    }
    .profile-edit-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ===================================================
   33. SACCHASATHI PAGE
=================================================== */
@media (max-width: 768px) {
    .sathi-hero { padding: 50px 0 !important; }
    .sathi-form-wrapper {
        padding: 20px 14px !important;
        border-radius: 20px !important;
    }
    .wizard-stepper {
        gap: 8px !important;
    }
    .wizard-step-label {
        font-size: 10px !important;
    }
    .sathi-registration-container {
        padding: 16px !important;
    }
}

/* ===================================================
   34. BOOK TESTS / BOOK SCANS / CATEGORY PAGES
=================================================== */
@media (max-width: 768px) {
    .lab-hero-section { padding: 60px 0 80px !important; }
    .test-card, .scan-card {
        padding: 14px !important;
        border-radius: 14px !important;
    }
    .test-search-bar {
        flex-direction: column !important;
        gap: 8px !important;
    }
    .test-search-bar input,
    .test-search-bar select,
    .test-search-bar button {
        width: 100% !important;
        border-radius: 12px !important;
    }
    .cart-sticky-bar {
        padding: 10px 14px !important;
        border-radius: 16px !important;
    }
}
@media (max-width: 480px) {
    .test-card { margin-bottom: 10px; }
    .test-card h5 { font-size: 0.95rem !important; }
    .test-card .price { font-size: 1rem !important; }
}

/* ===================================================
   35. SECOND OPINION PAGE
=================================================== */
@media (max-width: 768px) {
    .second-opinion-hero { padding: 60px 0 !important; }
    .opinion-step-card {
        padding: 18px !important;
        border-radius: 16px !important;
    }
    .opinion-form-card {
        padding: 20px 14px !important;
    }
    .doctor-select-grid {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }
}

/* ===================================================
   36. HEALTH PACKAGES PAGE
=================================================== */
@media (max-width: 768px) {
    .package-hero { padding: 60px 0 80px !important; }
    .package-card {
        border-radius: 16px !important;
        overflow: hidden;
    }
    .package-features-list { padding-left: 0 !important; }
    .package-features-list li { font-size: 0.9rem !important; }
}

/* ===================================================
   37. HOME CARE PAGES
=================================================== */
@media (max-width: 768px) {
    .homecare-hero { padding: 60px 0 !important; }
    .service-icon-box {
        width: 60px !important;
        height: 60px !important;
    }
    .homecare-steps { flex-direction: column !important; }
}

/* ===================================================
   38. ORDER MEDICINES PAGE
=================================================== */
@media (max-width: 768px) {
    .medicine-hero { padding: 60px 0 !important; }
    .medicine-upload-area {
        padding: 24px 14px !important;
        border-radius: 16px !important;
    }
    .medicine-steps {
        flex-direction: column !important;
        gap: 16px !important;
    }
}

/* ===================================================
   39. EXPLORE / DOCTOR LISTING PAGE
=================================================== */
@media (max-width: 768px) {
    .explore-hero { padding: 60px 0 !important; }
    .doctor-filter-bar {
        flex-wrap: wrap !important;
        gap: 8px !important;
    }
    .doctor-filter-bar select,
    .doctor-filter-bar input {
        width: 100% !important;
        border-radius: 12px !important;
    }
    .doctor-card {
        border-radius: 16px !important;
    }
    .doctor-card .d-flex {
        flex-wrap: wrap;
    }
}

/* ===================================================
   40. GLOBAL MODAL RESPONSIVE
=================================================== */
@media (max-width: 768px) {
    .modal-dialog {
        margin: 8px auto !important;
        max-width: calc(100% - 16px) !important;
    }
    .modal-content { border-radius: 20px !important; }
    .modal-body { padding: 16px !important; }
    .modal-header {
        padding: 14px 16px !important;
        border-radius: 20px 20px 0 0 !important;
    }
    .modal-footer {
        padding: 12px 16px !important;
        flex-wrap: wrap;
        gap: 8px;
    }
    .modal-footer .btn {
        flex: 1 1 120px;
    }
}

/* ===================================================
   41. GLOBAL FORM RESPONSIVE
=================================================== */
@media (max-width: 768px) {
    .form-control, .form-select {
        font-size: 15px !important;
        padding: 10px 14px !important;
        border-radius: 12px !important;
    }
    textarea.form-control {
        min-height: 100px !important;
    }
    .form-label {
        font-size: 13px !important;
        font-weight: 600 !important;
        margin-bottom: 5px !important;
    }
    .input-group {
        flex-wrap: wrap;
    }
    .input-group > .form-control {
        border-radius: 12px !important;
    }
    .input-group > .btn {
        border-radius: 12px !important;
        margin-top: 6px;
        width: 100%;
    }
    /* When .input-group has inline appended button, keep horizontal */
    .input-group.search-group > .form-control,
    .input-group.inline-group > .form-control { width: auto; margin-top: 0; }
    .input-group.search-group > .btn,
    .input-group.inline-group > .btn { width: auto; margin-top: 0; border-radius: 0 12px 12px 0 !important; }
}

/* ===================================================
   42. GLOBAL BUTTON RESPONSIVE
=================================================== */
@media (max-width: 768px) {
    .btn-lg {
        font-size: 15px !important;
        padding: 12px 24px !important;
    }
    .btn-sm {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }
}

/* ===================================================
   43. PREVENT OVERFLOW ON ALL SECTIONS
=================================================== */
/* NOTE: .container and .container-fluid are intentionally excluded here.
   Adding overflow-x:hidden on them breaks position:sticky on child elements
   (e.g. sticky filter bars, sticky category headers). 
   Horizontal overflow on containers is handled by html,body overflow-x:hidden globally. */
section, .section,
.card, .modal-content, .navbar-collapse {
    overflow-x: hidden;
}
/* Exception: table containers need horizontal scroll */
.table-responsive, .cart-table-responsive,
.overflow-x-auto { overflow-x: auto !important; }

/* ===================================================
   44. GLOBAL BACK BUTTON POSITION SAFE ZONE
=================================================== */
/* Ensure fixed global back button doesn't overlap content */
@media (max-width: 768px) {
    .global-back-btn {
        top: 75px !important;
        left: 12px !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 14px !important;
        z-index: 990 !important;
    }
}


/* ===================================================
   45. TOP HEADER  INTERMEDIATE DESKTOP (1300px1499px)
=================================================== */
@media (min-width: 1300px) and (max-width: 1499.98px) {
    .top-header .contact-info span {
        margin-left: 10px !important;
        font-size: 11px !important;
    }
    .top-header .contact-info span:nth-child(1),
    .top-header .contact-info span:nth-child(2) {
        display: inline-flex !important;
    }
    .top-header .social-icons a {
        margin-right: 6px !important;
        font-size: 11px !important;
    }
}

/* ===================================================
   46. APPOINTMENT BOOKING  EXTRA RESPONSIVE FIXES
=================================================== */
@media (max-width: 991px) {
    .book-appt-sticky-sidebar { position: static !important; }
}
@media (max-width: 575.98px) {
    #appointment-form .card-body { padding: 1rem !important; }
    .payment-option-card { padding: 12px !important; }
    #coupon_code { font-size: 13px !important; }
    #apply_coupon_btn { font-size: 13px !important; width: 100% !important; margin-top: 6px; }
}
@media (max-width: 480px) {
    .form-control-lg, .form-select-lg {
        font-size: 14px !important;
        padding: 9px 12px !important;
        height: auto !important;
    }
    .slot-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 6px !important;
    }
}

/* ===================================================
   47. MEMBERS PAGE
=================================================== */
@media (max-width: 991px) { .membership-card { margin-bottom: 24px; } }
@media (max-width: 768px) {
    .membership-benefits-list { padding-left: 0 !important; }
    .membership-hero-section { padding: 50px 0 30px !important; text-align: center !important; }
    .member-plan-card { padding: 20px 14px !important; }
}

/* ===================================================
   48. LAB / RADIOLOGY CART PAGE
=================================================== */
@media (max-width: 768px) {
    .lab-cart-table th, .lab-cart-table td { font-size: 12px !important; padding: 8px 6px !important; }
    .lab-cart-summary-card { padding: 16px !important; }
    .lab-filter-bar { flex-wrap: wrap !important; gap: 8px !important; }
}

/* ===================================================
   49. PHARMACY PAGE
=================================================== */
@media (max-width: 768px) {
    .pharma-product-card { padding: 12px !important; }
    .pharma-cart-summary { padding: 14px !important; }
}

/* ===================================================
   50. CONTACT & CAREER PAGES
=================================================== */
@media (max-width: 768px) {
    .contact-info-block { margin-bottom: 20px; }
    .contact-map iframe { height: 260px !important; border-radius: 16px !important; }
    .career-job-card { padding: 16px !important; }
}

/* ===================================================
   51. REVIEWS / TESTIMONIALS
=================================================== */
@media (max-width: 768px) {
    .review-card { padding: 16px !important; margin-bottom: 16px; }
    .rating-stars { font-size: 14px !important; }
}

/* ===================================================
   52. ABOUT PAGE
=================================================== */
@media (max-width: 768px) {
    .about-hero-img { border-radius: 16px !important; margin-bottom: 24px; }
    .team-member-card { padding: 16px 12px !important; }
    .about-stat-box { padding: 16px !important; margin-bottom: 16px; }
}

/* ===================================================
   53. HOME PAGE  SERVICE CARDS
=================================================== */
@media (max-width: 768px) {
    .service-feature-card { padding: 16px 12px !important; }
    .home-stats-counter { font-size: clamp(1.6rem, 5vw, 2.4rem) !important; }
    .home-why-us-item { margin-bottom: 20px; }
}
@media (max-width: 480px) {
    .home-stats-counter { font-size: clamp(1.3rem, 5vw, 1.8rem) !important; }
}

/* ===================================================
   54. EXTRA-SMALL PHONES (<=360px)
=================================================== */
@media (max-width: 360px) {
    section, .section { padding: 28px 0 !important; }
    .container { padding-left: 10px !important; padding-right: 10px !important; }
    h2 { font-size: clamp(1.1rem, 5vw, 1.5rem) !important; }
    h3 { font-size: clamp(1rem, 4.5vw, 1.3rem) !important; }
    .btn { font-size: 13px !important; padding: 9px 14px !important; }
}

/* ===================================================
   55. SCROLLBAR POLISH  MOBILE MENU
=================================================== */
.navbar-collapse::-webkit-scrollbar { width: 4px; }
.navbar-collapse::-webkit-scrollbar-track { background: #f1f5f9; }
.navbar-collapse::-webkit-scrollbar-thumb { background: rgba(118,75,162,0.35); border-radius: 4px; }

/* ===================================================
   56-B. POLYCLINIC STAT BOXES  PREVENT OVERFLOW
=================================================== */
@media (max-width: 576px) {
    .polyclinic-stats-row,
    .d-flex.gap-5 {
        gap: 1.5rem !important;
        flex-wrap: wrap !important;
    }
}


/* Force perfect flex centering for footer social icons across ALL screen sizes */
.main-footer .social-icons a, .social-icons a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 38px !important;
    height: 38px !important;
    line-height: 1 !important;
    padding: 0 !important;
}
.main-footer .social-icons a i, .social-icons a i {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    font-size: 1rem !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

/* ===================================================
   57. UNIVERSAL 100% RESPONSIVE SUITE v4.0 (ALL DEVICES)
=================================================== */

/* 1. Mobile & Small Phone Fluid Mechanics (<= 576px) */
@media (max-width: 575.98px) {
    body, html {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100vw !important;
    }

    .container, .container-fluid {
        padding-left: 12px !important;
        padding-right: 12px !important;
    }

    /* Appointment Form & Cards */
    #appointment-form .card {
        border-radius: 16px !important;
    }
    
    .payment-option-card {
        padding: 10px 12px !important;
    }

    /* Billing Summary Box */
    .billing-summary-box {
        padding: 14px !important;
        border-radius: 16px !important;
    }

    /* Doctor Profile Cards */
    .doctor-card, .doc-detail-card {
        padding: 14px !important;
        border-radius: 16px !important;
    }

    /* Floating badges & Call to Actions */
    .btn-lg, .btn-group-lg > .btn {
        padding: 12px 18px !important;
        font-size: 15px !important;
        border-radius: 14px !important;
    }
}

/* 2. Tablet Viewport Adjustments (577px - 991px) */
@media (min-width: 576px) and (max-width: 991.98px) {
    .container {
        max-width: 100% !important;
        padding-left: 20px !important;
        padding-right: 20px !important;
    }

    .row {
        --bs-gutter-x: 1.25rem !important;
    }

    /* Appointment & Billing split side-by-side on tablet */
    .book-appt-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Hero section tablet scaling */
    .cwn-full-hero-section {
        min-height: 620px !important;
        padding-top: 130px !important;
    }
    .cwn-hero-content-grid {
        min-height: 450px !important;
    }
}

/* 3. Laptops & Intermediate Desktops (992px - 1399px) */
@media (min-width: 992px) and (max-width: 1399.98px) {
    .cwn-full-hero-section {
        min-height: 680px !important;
        padding-top: 155px !important;
    }
    .cwn-hero-content-grid {
        min-height: 490px !important;
    }
}

/* 4. Large Desktops & Ultra-wides (1400px+) */
@media (min-width: 1400px) {
    .cwn-full-hero-section {
        min-height: 710px !important;
        padding-top: 165px !important;
    }
    .cwn-hero-content-grid {
        min-height: 510px !important;
    }
    .cwn-hero-container {
        max-width: 1520px !important;
    }
}

/* ==========================================================================
   58. TRIPLE-PARADIGM MASTER RESPONSIVE SUITE v5.0
   Enforces:
     1. FLUID / LIQUID LAYOUT (Continuous viewport scaling via clamp/%)
     2. ADAPTIVE LAYOUT (Targeted media queries for exact screen sizes)
     3. PURE RESPONSIVE LAYOUT (Media-query-free CSS grid/flex auto-fit)
   ========================================================================== */

/* ── 1. FLUID / LIQUID LAYOUT MECHANICS ── */
:root {
    --fluid-container-padding: clamp(12px, 3.5vw, 40px);
    --fluid-section-padding: clamp(35px, 6vw, 90px);
    --fluid-h1: clamp(1.75rem, 4.5vw + 0.5rem, 3.2rem);
    --fluid-h2: clamp(1.5rem, 3.8vw + 0.4rem, 2.6rem);
    --fluid-h3: clamp(1.25rem, 3vw + 0.3rem, 2rem);
    --fluid-body: clamp(0.92rem, 1.2vw + 0.6rem, 1.08rem);
    --fluid-card-gap: clamp(12px, 2.5vw, 30px);
    --fluid-radius: clamp(14px, 2vw, 30px);
}

/* Apply fluid variables across all major elements */
html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
}

body {
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100vw;
    font-size: var(--fluid-body);
    line-height: 1.6;
}

/* Fluid Containers & Grid Systems */
.container, .container-fluid {
    padding-left: var(--fluid-container-padding) !important;
    padding-right: var(--fluid-container-padding) !important;
    max-width: 100%;
}

.row {
    margin-left: calc(-1 * var(--fluid-container-padding) / 2) !important;
    margin-right: calc(-1 * var(--fluid-container-padding) / 2) !important;
}

.row > [class*="col-"] {
    padding-left: calc(var(--fluid-container-padding) / 2) !important;
    padding-right: calc(var(--fluid-container-padding) / 2) !important;
}

/* Fluid Typography (excluding component cards) */
h1:not(.cw-slide-title):not(.card-title), .h1:not(.cw-slide-title) { font-size: var(--fluid-h1); line-height: 1.2; }
h2:not(.cw-slide-title):not(.card-title), .h2:not(.cw-slide-title) { font-size: var(--fluid-h2); line-height: 1.25; }
h3:not(.cw-slide-title):not(.cw-card-headline-title):not(.cw-popular-title):not(.card-title), .h3:not(.cw-slide-title):not(.cw-card-headline-title):not(.cw-popular-title) { font-size: var(--fluid-h3); line-height: 1.3; }

/* ── 2. PURE RESPONSIVE LAYOUT MECHANICS (Media-Query-Free) ── */
.pure-responsive-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)) !important;
    gap: var(--fluid-card-gap) !important;
}

.pure-responsive-flex {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: var(--fluid-card-gap) !important;
}

.pure-responsive-img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
}

.pure-responsive-card {
    border-radius: var(--fluid-radius) !important;
    padding: clamp(16px, 3vw, 36px) !important;
    transition: transform 0.3s ease, box-shadow 0.3s ease !important;
}

/* ── 3. ADAPTIVE LAYOUT TARGETED BREAKPOINTS ── */
/* 4K & Ultrawide Monitors (≥ 1600px) */
@media (min-width: 1600px) {
    .container {
        max-width: 1520px !important;
    }
}

/* Standard PC / Desktops (1200px – 1599.98px) */
@media (min-width: 1200px) and (max-width: 1599.98px) {
    .container {
        max-width: 1240px !important;
    }
}

/* Laptops & Tablets Landscape (992px – 1199.98px) */
@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px !important;
    }
    .footer-column {
        margin-bottom: 24px;
    }
}

/* Tablets Portrait & Large Smartphones (768px – 991.98px) */
@media (min-width: 768px) and (max-width: 991.98px) {
    .container {
        max-width: 720px !important;
    }
    .stats-grid,
    .cwn-hero-stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Smartphones Landscape (576px – 767.98px) */
@media (min-width: 576px) and (max-width: 767.98px) {
    .container {
        max-width: 540px !important;
    }
    .stats-grid,
    .cwn-hero-stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
}

/* Smartphones Portrait (360px – 575.98px) */
@media (min-width: 360px) and (max-width: 575.98px) {
    .container {
        max-width: 100% !important;
    }
    .stats-grid,
    .cwn-hero-stats-row {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }
    .footer-column {
        text-align: center !important;
        width: 100% !important;
    }
    .cwn-footer-contact-box {
        text-align: center !important;
        margin: 0 auto 12px auto;
        max-width: 100% !important;
    }
}

/* Ultra-Small Micro Smartphones & Smartwatches (< 360px) */
@media (max-width: 359.98px) {
    body, html {
        font-size: 14px !important;
    }
    .container {
        padding-left: 8px !important;
        padding-right: 8px !important;
    }
    .stats-grid,
    .cwn-hero-stats-row {
        grid-template-columns: repeat(1, 1fr) !important;
        gap: 8px !important;
    }
    .btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
    }
}

/* ==========================================================================
   59. MEDANTA-GRADE ULTRA-FAST RESPONSIVE ENGINE v6.0
   - GPU-accelerated smooth touch scrolling (-webkit-overflow-scrolling: touch)
   - Zero-layout-shift container constraints & hardware acceleration
   - Dynamic resolution adaptation (Mobile, Tablet, Laptop, 4K PC)
   ========================================================================== */

/* GPU Acceleration for UI elements & cards */
.cw-slide-card,
.doctor-card-premium,
.explorer-card-interactive,
.clinic-selector-card,
.cwn-stat-card,
.btn,
.navbar {
    will-change: transform, opacity;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}

/* Fast smooth touch momentum scrolling */
.cw-home-swiper,
.cw-popular-swiper,
.services-swiper-container,
.doctor-grid-premium,
.calendar-strip,
.schedule-tabs {
    -webkit-overflow-scrolling: touch !important;
    touch-action: pan-x pan-y;
    contain: content;
}

/* Medanta-grade fluid container margins & viewport safety */
@media (max-width: 767.98px) {
    .cwn-full-hero-bg,
    .cwn-full-hero-bg img,
    .cwn-full-hero-bg img.cwn-hero-slide-active {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }
}

@media (max-width: 575.98px) {
    .container {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
    
    /* Touch-friendly buttons (minimum 44px touch target) */
    .btn, button, input[type="submit"] {
        min-height: 44px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
}
