/**
 * COMPREHENSIVE RESPONSIVE FIXES
 * Ensures perfect responsiveness across all devices
 */

/* ========================================
   BASE RESPONSIVE SETUP
   ======================================== */

* {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

body {
    min-width: 320px;
    overflow-x: hidden;
}

/* Flexible media */
img,
video,
iframe,
embed,
object {
    max-width: 100%;
    height: auto;
}

/* ========================================
   MOBILE FIRST (320px - 575px)
   ======================================== */

@media (max-width: 575.98px) {
    /* Typography */
    h1 { font-size: 24px !important; line-height: 32px !important; }
    h2 { font-size: 22px !important; line-height: 30px !important; }
    h3 { font-size: 20px !important; line-height: 28px !important; }
    h4 { font-size: 18px !important; line-height: 26px !important; }
    h5 { font-size: 16px !important; line-height: 24px !important; }
    
    p {
        font-size: 14px !important;
        line-height: 22px !important;
    }
    
    /* Header */
    .header-top_area {
        padding: 8px 0;
    }
    
    .header-top_area .social_media_links a {
        margin-right: 8px;
        font-size: 13px;
    }
    
    .short_contact_list ul li a {
        font-size: 11px;
        margin-left: 10px !important;
    }
    
    .main-header-area {
        padding: 12px 0 !important;
    }
    
    .logo img {
        max-width: 120px;
    }
    
    /* Slider */
    .slider_area {
        min-height: 400px !important;
    }
    
    .slider_text {
        padding: 20px 15px;
    }
    
    .slider_text h3 {
        font-size: 24px !important;
        line-height: 32px !important;
        margin-bottom: 15px;
    }
    
    .slider_text p {
        font-size: 13px !important;
        line-height: 20px !important;
        margin-bottom: 20px;
    }
    
    .slider_text p br {
        display: none;
    }
    
    .slider_text .boxed-btn3 {
        padding: 12px 24px;
        font-size: 12px;
    }
    
    /* Services */
    .service_area .container {
        padding: 0 15px;
    }
    
    .single_service {
        padding: 30px 20px !important;
        margin-bottom: 20px;
    }
    
    .single_service .icon i {
        font-size: 40px;
    }
    
    .single_service h3 {
        font-size: 18px !important;
        margin: 15px 0 10px;
    }
    
    .single_service p {
        font-size: 13px !important;
        line-height: 20px !important;
    }
    
    /* Welcome section */
    .welcome_docmed_area {
        padding: 50px 0;
    }
    
    .welcome_thumb {
        margin-bottom: 30px;
    }
    
    .welcome_thumb .thumb_1,
    .welcome_thumb .thumb_2 {
        width: 100%;
        margin: 0 0 15px 0;
    }
    
    .welcome_docmed_info h2 {
        font-size: 20px !important;
        margin-bottom: 10px;
    }
    
    .welcome_docmed_info h3 {
        font-size: 22px !important;
        line-height: 30px !important;
        margin-bottom: 15px;
    }
    
    .welcome_docmed_info h3 br {
        display: none;
    }
    
    .welcome_docmed_info ul {
        margin: 20px 0;
    }
    
    .welcome_docmed_info ul li {
        font-size: 13px;
        margin-bottom: 10px;
    }
    
    /* Departments */
    .our_department_area {
        padding: 50px 0;
    }
    
    .section_title {
        margin-bottom: 30px !important;
    }
    
    .section_title h3 {
        font-size: 24px !important;
        line-height: 32px !important;
        padding-bottom: 10px;
    }
    
    .section_title p {
        font-size: 13px !important;
        line-height: 20px !important;
    }
    
    .section_title p br {
        display: none;
    }
    
    .single_department {
        margin-bottom: 20px;
    }
    
    .department_content {
        padding: 20px 15px;
    }
    
    .department_content h3 {
        font-size: 18px !important;
        margin-bottom: 10px;
    }
    
    .department_content p {
        font-size: 13px !important;
        line-height: 20px !important;
    }
    
    /* Testimonials */
    .testmonial_area {
        padding: 50px 0;
    }
    
    .testmonial_info p {
        font-size: 14px !important;
        line-height: 22px !important;
    }
    
    .testmonial_info p br {
        display: none;
    }
    
    .quote i {
        font-size: 30px;
    }
    
    /* Business expert */
    .business_expert_area {
        padding: 50px 0;
    }
    
    .business_tabs_area .nav-item {
        margin-bottom: 10px;
    }
    
    .business_tabs_area .nav-link {
        font-size: 13px;
        padding: 10px 15px;
    }
    
    .business_info {
        padding: 30px 15px;
        margin-bottom: 20px;
    }
    
    .business_info h3 {
        font-size: 20px !important;
        line-height: 28px !important;
    }
    
    .business_thumb {
        margin-top: 20px;
    }
    
    /* Expert doctors */
    .expert_doctors_area {
        padding: 50px 0;
    }
    
    .doctors_title h3 {
        font-size: 24px !important;
        margin-bottom: 30px;
    }
    
    .single_expert {
        margin-bottom: 20px;
    }
    
    .experts_name h3 {
        font-size: 18px !important;
    }
    
    .experts_name span {
        font-size: 13px;
    }
    
    /* Emergency contact */
    .Emergency_contact .single_emergency {
        padding: 30px 15px;
        flex-direction: column !important;
        text-align: center;
    }
    
    .Emergency_contact .info {
        margin-bottom: 20px;
    }
    
    .Emergency_contact h3 {
        font-size: 18px !important;
        margin-bottom: 10px;
    }
    
    .Emergency_contact p {
        font-size: 13px !important;
    }
    
    /* Footer */
    .footer_top {
        padding: 40px 0 20px;
    }
    
    .footer_widget {
        margin-bottom: 30px;
        text-align: center;
    }
    
    .footer_widget h3 {
        font-size: 18px !important;
        margin-bottom: 15px;
    }
    
    .footer_widget p,
    .footer_widget ul li a {
        font-size: 13px !important;
    }
    
    .socail_links ul li {
        margin: 0 5px;
    }
    
    /* Popup form */
    .popup_box {
        padding: 20px;
    }
    
    .popup_inner h3 {
        font-size: 20px !important;
        margin-bottom: 20px;
    }
    
    .popup_inner input,
    .popup_inner select {
        margin-bottom: 15px;
        padding: 10px;
        font-size: 13px;
    }
}

/* ========================================
   SMALL DEVICES (576px - 767px)
   ======================================== */

@media (min-width: 576px) and (max-width: 767.98px) {
    .slider_text h3 {
        font-size: 32px !important;
        line-height: 40px !important;
    }
    
    .section_title h3 {
        font-size: 28px !important;
        line-height: 36px !important;
    }
    
    .single_service,
    .single_department {
        margin-bottom: 25px;
    }
    
    .welcome_docmed_info h3 {
        font-size: 26px !important;
        line-height: 34px !important;
    }
}

/* ========================================
   MEDIUM DEVICES (768px - 991px)
   ======================================== */

@media (min-width: 768px) and (max-width: 991.98px) {
    /* Header */
    .main-menu ul li {
        margin: 0 5px;
    }
    
    .main-menu ul li a {
        font-size: 13px;
    }
    
    /* Slider */
    .slider_text h3 {
        font-size: 36px !important;
        line-height: 44px !important;
    }
    
    /* Services */
    .single_service {
        padding: 35px 25px;
    }
    
    /* Departments */
    .single_department {
        margin-bottom: 30px;
    }
    
    /* Business tabs */
    .business_tabs_area .nav-link {
        font-size: 14px;
        padding: 12px 20px;
    }
}

/* ========================================
   LARGE DEVICES (992px - 1199px)
   ======================================== */

@media (min-width: 992px) and (max-width: 1199.98px) {
    .container {
        max-width: 960px;
    }
    
    .main-menu ul li {
        margin: 0 8px;
    }
    
    .main-menu ul li a {
        font-size: 14px;
    }
    
    .slider_text h3 {
        font-size: 40px !important;
        line-height: 48px !important;
    }
}

/* ========================================
   EXTRA LARGE DEVICES (1200px+)
   ======================================== */

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

/* ========================================
   LANDSCAPE ORIENTATION
   ======================================== */

@media (orientation: landscape) and (max-height: 600px) {
    .slider_area {
        min-height: 450px !important;
    }
    
    .slider_text {
        padding: 30px 0;
    }
    
    .slider_text h3 {
        font-size: 28px !important;
        line-height: 36px !important;
        margin-bottom: 10px;
    }
    
    .slider_text p {
        font-size: 14px !important;
        line-height: 20px !important;
        margin-bottom: 15px;
    }
}

/* ========================================
   TOUCH DEVICES
   ======================================== */

@media (hover: none) and (pointer: coarse) {
    /* Increase tap targets */
    a, button, input, select, textarea {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Remove hover effects */
    .single_service:hover,
    .single_department:hover,
    .single_expert:hover {
        transform: none;
    }
    
    /* Add active states */
    .single_service:active,
    .single_department:active,
    .single_expert:active {
        opacity: 0.9;
        transform: scale(0.98);
    }
    
    /* Simplify animations */
    * {
        animation-duration: 0.3s !important;
    }
}

/* ========================================
   HIGH DPI DISPLAYS
   ======================================== */

@media (-webkit-min-device-pixel-ratio: 2),
       (min-resolution: 192dpi) {
    body {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Visibility helpers */
.visible-xs { display: none !important; }
.visible-sm { display: none !important; }
.visible-md { display: none !important; }
.visible-lg { display: none !important; }
.visible-xl { display: none !important; }

@media (max-width: 575.98px) {
    .visible-xs { display: block !important; }
    .hidden-xs { display: none !important; }
}

@media (min-width: 576px) and (max-width: 767.98px) {
    .visible-sm { display: block !important; }
    .hidden-sm { display: none !important; }
}

@media (min-width: 768px) and (max-width: 991.98px) {
    .visible-md { display: block !important; }
    .hidden-md { display: none !important; }
}

@media (min-width: 992px) and (max-width: 1199.98px) {
    .visible-lg { display: block !important; }
    .hidden-lg { display: none !important; }
}

@media (min-width: 1200px) {
    .visible-xl { display: block !important; }
    .hidden-xl { display: none !important; }
}

/* Spacing utilities */
@media (max-width: 767px) {
    .mb-xs-20 { margin-bottom: 20px !important; }
    .mb-xs-30 { margin-bottom: 30px !important; }
    .mt-xs-20 { margin-top: 20px !important; }
    .mt-xs-30 { margin-top: 30px !important; }
    .p-xs-15 { padding: 15px !important; }
    .p-xs-20 { padding: 20px !important; }
}

/* Text alignment */
@media (max-width: 767px) {
    .text-xs-center { text-align: center !important; }
    .text-xs-left { text-align: left !important; }
    .text-xs-right { text-align: right !important; }
}

/* Flexbox helpers */
@media (max-width: 767px) {
    .flex-xs-column {
        flex-direction: column !important;
    }
    
    .flex-xs-center {
        justify-content: center !important;
        align-items: center !important;
    }
}

/* ========================================
   ACCESSIBILITY
   ======================================== */

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline: 2px solid #5db2ff;
    outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: #5db2ff;
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 10000;
}

.skip-to-content:focus {
    top: 0;
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    * {
        background: transparent !important;
        color: black !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    a, a:visited {
        text-decoration: underline;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    h2, h3 {
        page-break-after: avoid;
    }
    
    .header-area,
    .footer,
    .scroll-progress,
    .cursor-dot,
    .cursor-outline {
        display: none !important;
    }
}
