/* Swiper Custom Styles to Match RoyalSlider Layout */

/* Hero Slider Container */
.heroSlider.swiper {
    width: 100%;
    position: relative;
}

/* Maintain aspect ratios similar to RoyalSlider */
#your-business-slider.swiper {
    aspect-ratio: 1772 / 775;
    max-width: 100%;
}

/* Content sliders in service pages - match RoyalSlider behavior */
#content-slider.swiper {
    width: 100%;
    max-width: 1187px; /* Match production desktop width */
    height: 546px !important; /* Proportionally adjusted height */
    margin: 0 auto; /* Center the carousel */
    overflow: hidden; /* Ensure proper cropping */
}

/* Responsive height for mobile */
@media (max-width: 768px) {
    #content-slider.swiper {
        height: 300px !important;
        max-width: 100%;
    }
}

@media (max-width: 500px) {
    #content-slider.swiper {
        height: 250px !important;
        max-width: 100%;
    }
}

#content-slider-1.swiper {
    width: 100%;
    max-width: 1187px; /* Match production desktop width */
    height: 546px !important; /* Proportionally adjusted height */
    margin: 0 auto; /* Center the carousel */
    overflow: hidden; /* Ensure proper cropping */
}

#full-width-slider.swiper {
    width: 100%;
    aspect-ratio: 960 / 350;
}

/* Container constraints for service pages */
.internalFeaturedMedia.inBodyContent {
    width: 100%;
    max-width: 100%;
    overflow: hidden !important;
    margin: 0 0 20px; /* Reduced margin to match live site */
    position: relative;
    box-sizing: border-box;
}

/* Override specific Services page spacing */
.internalFeaturedMedia.inBodyContent.topPosition {
    margin: 0 0 20px !important; /* Match live site spacing */
}

@media (min-width: 840px) {
    .internalFeaturedMedia.inBodyContent {
        margin: 0 0 30px; /* Reduced margin to match live site */
    }
    
    .internalFeaturedMedia.inBodyContent.topPosition {
        margin: 0 0 30px !important; /* Match live site spacing */
    }
}

/* Ensure Swiper doesn't overflow its container */
.internalFeaturedMedia .swiper {
    width: 100% !important;
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box;
}

/* Specific height for content sliders in featured media */
.internalFeaturedMedia #content-slider.swiper,
.internalFeaturedMedia #content-slider-1.swiper {
    max-width: 1187px !important;
    height: 546px !important;
}

/* CRITICAL FIX: Force width constraints for loop mode bug */
.swiper.heroSlider {
    width: 100% !important;
    max-width: 1187px !important; /* Match production desktop width */
    overflow: hidden !important;
    position: relative !important;
    margin: 0 auto !important; /* Center the carousel */
}

.swiper.heroSlider .swiper-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    display: flex !important;
}

.swiper.heroSlider .swiper-slide {
    width: 100% !important;
    max-width: 100% !important;
    flex-shrink: 0 !important;
    flex-basis: 100% !important;
}

/* Swiper Slide Images - Match production RoyalSlider image handling */
.swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crop images to fit container like production */
    object-position: center; /* Center the image focal point */
    display: block;
}

/* Specific image handling for content sliders to match production */
#content-slider .swiper-slide img,
#content-slider-1 .swiper-slide img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

/* Ensure text overlays are properly positioned and visible */
.swiper-slide {
    position: relative;
    overflow: visible !important; /* Prevent text cutoff */
}

/* Content slider slides need specific height to match container */
#content-slider .swiper-slide,
#content-slider-1 .swiper-slide {
    height: 546px !important; /* Match production container height */
    position: relative;
    overflow: hidden; /* Crop overflowing images */
}

@media (max-width: 768px) {
    #content-slider .swiper-slide,
    #content-slider-1 .swiper-slide {
        height: 300px !important;
    }
}

@media (max-width: 500px) {
    #content-slider .swiper-slide,
    #content-slider-1 .swiper-slide {
        height: 250px !important;
    }
}

/* Service category text at bottom of slides */
.swiper-slide .service-category-text,
.swiper-slide h3,
.swiper-slide .slide-title {
    position: absolute;
    bottom: 10px;
    left: 20px;
    color: white;
    font-size: 24px;
    font-weight: bold;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    z-index: 10;
    margin: 0;
    padding: 5px 10px;
    background: rgba(0,0,0,0.3);
    border-radius: 4px;
}

/* Caption Styles (matching RoyalSlider's infoBottomBlock) */
.swiper-slide .infoBottomBlock {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 20px;
    z-index: 10;
}

.swiper-slide .infoBottomBlock h4 {
    margin: 0;
    color: white;
    font-size: 1.2em;
}

/* Navigation Button Customization */
.swiper-button-next,
.swiper-button-prev {
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    width: 44px;
    height: 44px;
    border-radius: 2px;
    transition: background-color 0.3s ease;
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: rgba(0, 0, 0, 0.8);
}

/* Pagination Bullets */
.swiper-pagination-bullet {
    background: #fff;
    opacity: 0.5;
    width: 10px;
    height: 10px;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    background: #fff;
}

/* Ensure proper display in featured media containers */
.internalFeaturedMedia .swiper {
    width: 100%;
}

/* Adjust main body container spacing to match live site */
.internal-mainBody-container {
    padding: 40px 0 !important; /* Reduced from 60px to match live site */
}

/* Mobile Responsive Adjustments */
@media (max-width: 768px) {
    .swiper-button-next,
    .swiper-button-prev {
        width: 35px;
        height: 35px;
    }

    .swiper-button-next:after,
    .swiper-button-prev:after {
        font-size: 18px;
    }

    #your-business-slider.swiper,
    #content-slider.swiper,
    #content-slider-1.swiper,
    #full-width-slider.swiper {
        aspect-ratio: 16 / 9;
    }
}

/* Remove default Swiper margins/paddings that might conflict */
.swiper {
    margin-left: auto;
    margin-right: auto;
}

/* Lazy loading fade-in effect */
.swiper-lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

.swiper-lazy-loaded {
    opacity: 1;
}