/* Custom Overrides (Preloader & Responsive Fixes) */

/* Preloader */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #ffffff;
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
}
.loader-spinner {
    display: inline-block;
    position: relative;
    width: 64px;
    height: 64px;
}
.loader-spinner div {
    box-sizing: border-box;
    display: block;
    position: absolute;
    width: 51px;
    height: 51px;
    margin: 6px;
    border: 6px solid #dc3545;
    border-radius: 50%;
    animation: loader-spinner 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;
    border-color: var(--global--color-primary, #dc3545) transparent transparent transparent;
}
.loader-spinner div:nth-child(1) { animation-delay: -0.45s; }
.loader-spinner div:nth-child(2) { animation-delay: -0.3s; }
.loader-spinner div:nth-child(3) { animation-delay: -0.15s; }
@keyframes loader-spinner {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Base Responsive Fixes */
@media (max-width: 991px) {
    body {
        font-size: 15px;
    }
}
@media (max-width: 767px) {
    /* Limit slider and banner image heights */
    .banner-image img {
        height: 300px !important;
    }
    
    /* Center align headers on mobile */
    .heading {
        text-align: center;
    }
    
    .footer-widget {
        margin-bottom: 30px;
        text-align: center;
    }
    
    /* Ensure no horizontal scrolling */
    .container, .container-fluid {
        overflow-x: hidden;
    }
    
    /* Section padding reduction for mobile */
    section:not(.slider):not(.page-title):not(.banner-image):not(.pt-0):not(.features-p-1) {
        padding-top: 50px !important;
    }
    section:not(.slider):not(.page-title):not(.banner-image):not(.pb-0) {
        padding-bottom: 50px !important;
    }
    
    /* Fix inline padding on fancy boxes horizontally */
    .fancy-box {
        padding: 40px 15px !important;
    }

    /* Fix image sizing in columns */
    .img-fluid {
        max-width: 100%;
        height: auto;
    }

    /* Fix button stacking on mobile if needed */
    .btn {
        margin-bottom: 15px;
        display: inline-block;
    }
    
    /* Download catalog button container */
    .module-container.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        margin-top: 15px;
    }
    .module-container.d-flex .btn {
        width: 100% !important;
        margin-bottom: 10px !important;
    }
    
    /* Responsive iframes for maps and videos */
    iframe, .map-gray {
        width: 100% !important;
        max-width: 100%;
    }
}
