/* Preloader Styles */
#preloader {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease-in-out, visibility 0.5s ease-in-out;
}

#preloader.fade-out {
    opacity: 0;
    visibility: hidden;
}

#preloader img {
    animation: pulse 2s infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

/* Mobile-first approach: Show content by default, hide only when JS loads */
@media (max-width: 767px) {
    .animate-on-scroll {
        opacity: 1 !important;
        transform: translateY(0) !important;
    }
}

/* Fallback for when JavaScript doesn't load */
.no-js .animate-on-scroll {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Hero/Banner Background Styles */
.slide-enter {
    opacity: 0;
    transform: translateX(100%);
}

.slide-enter-active {
    opacity: 1;
    transform: translateX(0);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

.slide-exit {
    opacity: 1;
    transform: translateX(0);
}

.slide-exit-active {
    opacity: 0;
    transform: translateX(-100%);
    transition: opacity 0.5s ease-in-out, transform 0.5s ease-in-out;
}

/* Banner Background Utility */
.banner-bg {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* Contact Page Banner Background */
.contact-banner-bg {
    background-image: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.4)), url('https://images.unsplash.com/photo-1516321318423-f06f85e504b3?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2070&q=80');
}

/* Text Shadow Utility */
.text-shadow-lg {
    text-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Mobile Menu Dropdown Styles */
#mobile-products-dropdown {
    transition: max-height 0.3s ease-in-out;
}

#mobile-dropdown-arrow {
    transition: transform 0.3s ease-in-out;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #10b981;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Print Styles */
@media print {

    #preloader,
    #back-to-top,
    nav,
    footer {
        display: none !important;
    }
}