/* ===================================================================
   GLOBAL MOBILE RESPONSIVE CSS - ALL SECTIONS
   Porto & Bootstrap 5 Compatible
   =================================================================== */

/* =================== PARALLAX SECTIONS =================== */
@media (max-width: 991px) {
    
    /* Parallax Section Fixes */
    .section-parallax {
        background-attachment: scroll !important;
        background-position: center center !important;
        background-size: cover !important;
    }
    
    .section-parallax .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
    
    /* Section Height Mobile */
    .section-height-3 {
        min-height: auto !important;
        padding: 3rem 0 !important;
    }
    
    /* Mockup Details Sections - Image & Text */
    .section-parallax .row {
        flex-direction: column !important;
    }
    
    .section-parallax .col-md-7,
    .section-parallax .col-md-4,
    .section-parallax .col-lg-7,
    .section-parallax .col-lg-4,
    .section-parallax .col-xl-7,
    .section-parallax .col-xl-4 {
        width: 100% !important;
        max-width: 100% !important;
        flex: 0 0 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin-bottom: 2rem !important;
    }
    
    /* Image Containers */
    .section-parallax img,
    .section img.img-fluid {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain !important;
        margin: 0 auto !important;
        display: block !important;
    }
    
    /* Text Content */
    .section-parallax h2,
    .section h2 {
        font-size: 1.75rem !important;
        line-height: 1.3 !important;
        margin-bottom: 1rem !important;
    }
    
    .section-parallax .text-9 {
        font-size: 1.5rem !important;
    }
    
    .section-parallax p,
    .section-parallax .text-4 {
        font-size: 0.95rem !important;
        line-height: 1.6 !important;
        text-align: left !important;
    }
    
    .section-parallax ul.list {
        padding-left: 0 !important;
        margin-left: 0 !important;
    }
    
    .section-parallax ul.list li {
        font-size: 0.9rem !important;
        margin-bottom: 0.75rem !important;
    }
    
    /* Order Fix for Mobile */
    .section-parallax .order-1,
    .section-parallax .order-2,
    .section-parallax .order-md-1,
    .section-parallax .order-md-2 {
        order: 0 !important;
    }
    
    /* First item (usually text) comes first */
    .section-parallax .row > div:first-child {
        order: 1 !important;
        margin-bottom: 2rem !important;
    }
    
    /* Second item (usually image) comes second */
    .section-parallax .row > div:last-child {
        order: 2 !important;
        margin-bottom: 1rem !important;
    }
    
    /* Text Alignment Mobile */
    .section-parallax .text-center,
    .section-parallax .text-md-start {
        text-align: left !important;
    }
    
    /* Buttons */
    .section-parallax .btn {
        width: 100% !important;
        max-width: 300px !important;
        margin: 1rem auto 0 !important;
        display: block !important;
        text-align: center !important;
    }
    
    /* Remove excessive padding */
    .section-parallax .pe-3,
    .section-parallax .pe-5,
    .section-parallax .ps-3,
    .section-parallax .ps-5,
    .section-parallax .pe-sm-5,
    .section-parallax .ps-sm-5 {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* =================== VIDEO SECTION =================== */
@media (max-width: 991px) {
    
    .section.video {
        height: 60vh !important;
        min-height: 500px !important;
    }
    
    .section.video h1 {
        font-size: 1.5rem !important;
        line-height: 1.4 !important;
    }
    
    .section.video .text-12 {
        font-size: 2rem !important;
    }
    
    .section.video .text-5 {
        font-size: 1.2rem !important;
    }
    
    .section.video p {
        font-size: 0.9rem !important;
        padding: 0 20px !important;
    }
    
    .slider-scroll-button {
        display: none !important;
    }
}

/* =================== CONTAINER CUSTOM =================== */
@media (max-width: 991px) {
    
    .container-xl-custom,
    .container-lg {
        padding-left: 20px !important;
        padding-right: 20px !important;
        max-width: 100% !important;
    }
    
    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
    }
}

/* =================== COUNTERS SECTION =================== */
@media (max-width: 991px) {
    
    .counters .col-sm-6,
    .counters .col-lg-4 {
        margin-bottom: 2rem !important;
    }
    
    .counters .col-lg-4:last-child {
        margin-bottom: 0 !important;
    }
    
    .counter strong {
        font-size: 2.5rem !important;
    }
    
    .counter label {
        font-size: 0.95rem !important;
    }
}

/* =================== BEFORE AFTER SECTION =================== */
@media (max-width: 991px) {
    
    .twentytwenty-container {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: auto !important;
    }
    
    .twentytwenty-container img {
        width: 100% !important;
        height: auto !important;
    }
    
    .twentytwenty-handle:before,
    .twentytwenty-horizontal .twentytwenty-handle:after {
        height: 120px !important;
    }
}

/* =================== REFERENCES / GALLERY =================== */
@media (max-width: 991px) {
    
    .owl-carousel img {
        max-width: 120px !important;
        margin: 0 auto !important;
    }
    
    .owl-carousel .owl-stage {
        display: flex !important;
        align-items: center !important;
    }
}

/* =================== NEWS SECTION =================== */
@media (max-width: 991px) {
    
    #news-carousel .owl-item img {
        width: 100% !important;
        height: auto !important;
        max-height: 250px !important;
        object-fit: cover !important;
    }
    
    #news-carousel h4 {
        font-size: 1.1rem !important;
        margin-top: 1rem !important;
    }
    
    #news-carousel .date {
        font-size: 0.85rem !important;
    }
    
    #news-carousel .btn {
        font-size: 0.85rem !important;
        padding: 0.5rem 1rem !important;
    }
}

/* =================== WORD ROTATOR =================== */
@media (max-width: 991px) {
    
    .word-rotator {
        font-size: 1.5rem !important;
        line-height: 1.4 !important;
    }
    
    .word-rotator.text-8 {
        font-size: 1.5rem !important;
    }
    
    .lead {
        font-size: 1rem !important;
    }
}

/* =================== APPEAR ANIMATIONS - MOBILE FIX =================== */
@media (max-width: 991px) {
    
    .appear-animation {
        opacity: 1 !important;
        transform: none !important;
        visibility: visible !important;
    }
}

/* =================== SECTION SPACING =================== */
@media (max-width: 991px) {
    
    .section {
        padding-top: 2.5rem !important;
        padding-bottom: 2.5rem !important;
    }
    
    .pt-5 {
        padding-top: 2rem !important;
    }
    
    .pb-5 {
        padding-bottom: 2rem !important;
    }
    
    .mt-5 {
        margin-top: 2rem !important;
    }
    
    .mb-5 {
        margin-bottom: 2rem !important;
    }
    
    .py-2 {
        padding-top: 1rem !important;
        padding-bottom: 1rem !important;
    }
}

/* =================== DATA SCROLL FIX =================== */
@media (max-width: 991px) {
    
    [data-scroll] {
        transform: none !important;
    }
    
    [data-scroll-direction] {
        transform: none !important;
    }
    
    [data-scroll-speed] {
        transform: none !important;
    }
}

/* =================== PORTO SPECIFIC OVERRIDES =================== */
@media (max-width: 991px) {
    
    /* Porto Featured Boxes */
    .featured-boxes-modern-style-2 {
        margin-bottom: 2rem !important;
    }
    
    .featured-box .box-content {
        padding: 2rem 1.5rem !important;
    }
    
    /* Porto Overlay */
    .overlay {
        position: relative !important;
    }
    
    .overlay:before {
        opacity: 0.6 !important;
    }
    
    /* Porto Plugin Options - Disable on Mobile */
    [data-plugin-parallax] {
        background-attachment: scroll !important;
    }
    
    [data-plugin-video-background] {
        pointer-events: none !important;
    }
}

/* =================== SMALL MOBILE (≤575px) =================== */
@media (max-width: 575px) {
    
    .section-parallax h2,
    .section h2 {
        font-size: 1.4rem !important;
    }
    
    .section-parallax .text-9 {
        font-size: 1.3rem !important;
    }
    
    .section-parallax p,
    .section-parallax .text-4 {
        font-size: 0.85rem !important;
    }
    
    .section-parallax ul.list li {
        font-size: 0.8rem !important;
    }
    
    .section.video {
        height: 50vh !important;
        min-height: 400px !important;
    }
    
    .section.video .text-12 {
        font-size: 1.5rem !important;
    }
    
    .section.video .text-5 {
        font-size: 1rem !important;
    }
    
    .word-rotator {
        font-size: 1.2rem !important;
    }
    
    .counter strong {
        font-size: 2rem !important;
    }
    
    .container,
    .container-fluid,
    .container-xl-custom {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* =================== TABLET LANDSCAPE (768px - 991px) =================== */
@media (min-width: 768px) and (max-width: 991px) {
    
    .section-parallax .col-md-7 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .section-parallax .col-md-4 {
        flex: 0 0 100% !important;
        max-width: 100% !important;
    }
    
    .section-parallax h2 {
        font-size: 2rem !important;
    }
    
    .section-parallax img {
        max-width: 500px !important;
        margin: 0 auto !important;
    }
}

/* =================== LANDSCAPE MODE MOBILE =================== */
@media (max-width: 991px) and (orientation: landscape) {
    
    .section.video {
        height: 100vh !important;
        min-height: 100vh !important;
    }
    
    .section-parallax {
        padding: 2rem 0 !important;
    }
}

/* =================== HIGH RESOLUTION MOBILE =================== */
@media (max-width: 991px) and (min-resolution: 2dppx) {
    
    .section-parallax img {
        image-rendering: -webkit-optimize-contrast !important;
        image-rendering: crisp-edges !important;
    }
}

/* =================== ACCESSIBILITY =================== */
@media (max-width: 991px) {
    
    /* Better touch targets */
    .section a.btn {
        min-height: 48px !important;
        min-width: 48px !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
    }
    
    /* Readable text */
    .section p,
    .section li {
        line-height: 1.6 !important;
    }
    
    /* Focus visible */
    .section a:focus,
    .section button:focus {
        outline: 2px solid #0d6efd !important;
        outline-offset: 2px !important;
    }
}

/* =================== PRINT FRIENDLY =================== */
@media print {
    
    .section-parallax {
        background: white !important;
        color: black !important;
    }
    
    .section img {
        max-width: 100% !important;
        page-break-inside: avoid !important;
    }
}
