/* 
  Rambla Property Partners - Centralized Mobile Optimizations
  This file handles global layout, typography, and animation restoration for mobile devices.
*/

/* 1. Global Layout & Overflow Fixes */
@media (max-width: 991px) {
    html, body {
        overflow-x: hidden !important;
        width: 100% !important;
        position: relative !important;
        -webkit-overflow-scrolling: touch;
    }

    .container {
        padding-left: 20px !important;
        padding-right: 20px !important;
        max-width: 100vw !important;
    }

    /* Standardize Footer Stacking */
    .footer-layout, .footer-bottom-wrap {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 30px !important;
    }

    .footer-logo-wrap {
        margin-bottom: 20px !important;
    }

    .footer-nav-wrap {
        flex-direction: column !important;
        gap: 15px !important;
    }

    /* Standardize Navigation (Hamburger) */
    .navbar-link-wrap {
        width: 100% !important;
        background-color: #ffffff !important;
        border-top: 1px solid #f0f0f0 !important;
        box-shadow: 0 4px 10px rgba(0,0,0,0.05) !important;
    }

    .nav-link {
        padding: 18px 25px !important;
        font-size: 18px !important;
        font-weight: 500 !important;
        color: #000000 !important;
        border-bottom: 1px solid #f5f5f5 !important;
        display: block !important;
        transition: background 0.2s ease !important;
    }

    .nav-link:active {
        background-color: #f9f9f9 !important;
    }

    .menu-button {
        padding: 12px !important;
        border-radius: 4px !important;
    }

    /* Typography Scaling */
    h1 { font-size: 32px !important; line-height: 1.2 !important; }
    h2 { font-size: 28px !important; line-height: 1.25 !important; }
    h3 { font-size: 24px !important; line-height: 1.3 !important; }
    .hero-heading { font-size: 42px !important; }
    .big-text { font-size: 34px !important; }
    
    /* 2. Animation Restoration & Mobile Parity */
    /* Ensure elements hidden for IX2 are visible or restored */
    .zoom-target {
        transition: opacity 1.5s cubic-bezier(0.25, 1, 0.5, 1), transform 1.5s cubic-bezier(0.25, 1, 0.5, 1) !important;
    }

    /* Restore opacity for entrance animations that IX2 might be failing on */
    html.w-mod-js:not(.w-mod-ix) [data-w-id] {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* 3. Page-Specific Global Elements */
@media (max-width: 767px) {
    /* Results Section - Premium Sticky Reveal */
    .results-layout {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
    }

    .result-details-wrap {
        position: sticky !important;
        top: 80px !important;
        z-index: 10 !important;
        background: #000 !important;
        padding-bottom: 20px !important;
    }

    /* Team Grid - Force Single Column Stacking */
    .member-list-wrap, .collection-list-wrap {
        display: flex !important;
        flex-direction: column !important;
        gap: 30px !important;
    }

    .member-collection-list-wrapper {
        width: 100% !important;
        display: block !important;
        margin-bottom: 20px !important;
    }

    .member-collection-list {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* Force Visibility for Broken Animations */
    .project-box, .project-element-box, .services-animation-details-wrap, .feedback-slider-layout {
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
    }

    /* Project Page Specific Spacing */
    .project-details-wrap {
        padding-top: 20px !important;
        padding-bottom: 20px !important;
    }

    .project-collection-item {
        margin-bottom: 40px !important;
    }

    /* Restore Hero Slider Visibility on Mobile - Definitive Fix */
    .section {
        padding-top: 15px !important;
        padding-bottom: 15px !important;
    }

    /* Force all layers to be visible and transparent */
    .banner-image-box-wrap,
    .banner-image-wrap,
    .starix-slider-wrap,
    .starix-bottom.one,
    .banner-image-wrap-top,
    .banner-image-wrap-bottom {
        opacity: 1 !important;
        visibility: visible !important;
        background-color: transparent !important;
        background: transparent !important;
        display: block !important;
    }

    .starix-bottom.one {
        display: flex !important; /* Keep flex for the slider items */
    }

    .banner-image-wrap-bottom {
        bottom: 0px !important;
    }

    .section.black {
        padding-top: 20px !important;
    }

    .starix-bottom.one img, 
    .starix-slider-wrap {
        height: 400px !important; /* Consistent height window */
    }

    .carve-image, .carve-image-two {
        max-height: 120px !important; /* Cap curve thickness */
        object-fit: cover !important;
        opacity: 1 !important;
        visibility: visible !important;
    }

    .carve-image-two {
        transform: scaleY(1.0) !important; /* Prevent total coverage */
    }

    .starix-top, 
    .stratix-button-info-wrap {
        margin-bottom: 20px !important;
    }
}
