/* Slider Image Quality Improvements */

/* Improve image rendering quality */
.hero-slider .item,
.hero-slide,
.hero-area3 .item {
    /* Photo backgrounds: avoid crisp-edges (meant for UI); use smooth scaling for photos */
    image-rendering: auto;
    image-rendering: optimizeQuality;
    
    /* Prevent blurry scaling */
    -webkit-backface-visibility: hidden;
    -moz-backface-visibility: hidden;
    -ms-backface-visibility: hidden;
    backface-visibility: hidden;
    
    /* Better scaling algorithm */
    -webkit-transform: translateZ(0);
    -moz-transform: translateZ(0);
    -ms-transform: translateZ(0);
    -o-transform: translateZ(0);
    transform: translateZ(0);
}

/* Optimize background image rendering */
.hero-slider .item,
.hero-slide,
.hero-area3 .item {
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    
    /* Better background image rendering */
    -webkit-background-size: cover !important;
    -moz-background-size: cover !important;
    -o-background-size: cover !important;
}

/* High DPI display support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-slider .item,
    .hero-slide,
    .hero-area3 .item {
        /* Use higher quality images for retina displays */
        background-size: cover !important;
        image-rendering: auto;
    }
}

/* Prevent image compression artifacts */
.hero-slider .item,
.hero-slide,
.hero-area3 .item {
    /* Smooth transitions */
    transition: background-image 0.3s ease-in-out;
    
    /* Prevent subpixel rendering issues */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Mobile optimization */
@media (max-width: 768px) {
    .hero-slider .item,
    .hero-slide,
    .hero-area3 .item {
        /* Maintain quality on mobile */
        background-size: cover !important;
        background-position: center !important;
        
        /* Prevent mobile browser compression */
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* Ensure proper aspect ratio maintenance */
.hero-slider .item {
    /* Maintain aspect ratio while covering */
    background-attachment: scroll;
}

/* Theme-specific optimizations */
.body_theme2 .hero-slider .item {
    /* Theme 2 specific quality improvements */
    image-rendering: optimize-quality;
}

.hero-area3 .item {
    /* Theme 3 specific quality improvements */
    image-rendering: optimize-quality;
}

/* -------------------------------------------------------------------------
   Homepage full-bleed hero (package-forwarding theme)
   Theme .hero-slider rules use border-radius + short .item height — this
   wrapper restores edge-to-edge slides and full-width owl items on desktop.
   ------------------------------------------------------------------------- */
.hero-slider-wrapper {
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.hero-slider-wrapper .hero-slider.owl-carousel {
    border-radius: 0;
    background: transparent;
    width: 100%;
    max-width: none;
}

.hero-slider-wrapper .owl-stage-outer {
    overflow: hidden;
}

.hero-slider-wrapper .owl-item,
.hero-slider-wrapper .hero-slide {
    width: 100%;
}

.hero-slider-wrapper .hero-slide {
    position: relative;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    min-height: 100vh;
}

@media (min-width: 992px) {
    .hero-slider-wrapper .hero-slide {
        min-height: min(92vh, 900px);
    }
}

/* -------------------------------------------------------------------------
   Theme1 homepage hero: no section tint, CTA bottom-center, shorter mobile
   ------------------------------------------------------------------------- */
.hero-section.hero-section--theme1-slider {
    background: transparent !important;
}

.hero-slider-main .item.hero-slide--theme1 {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
}

.hero-slider-main .item.hero-slide--theme1 > .container.hero-slide__inner {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 100%;
    justify-content: space-between;
}

.hero-slider-main .hero-slide__actions {
    width: 100%;
}

/* Shorter hero on small screens (overrides theme .hero-slider .item 370px at ≤575px) */
@media (max-width: 767.98px) {
    .hero-slider .hero-slider-main .item.hero-slide--theme1,
    .hero-slider .hero-slider-main > .owl-carousel .item.hero-slide--theme1 {
        height: 300px !important;
        min-height: 260px !important;
        padding-left: 0.75rem !important;
        padding-right: 0.75rem !important;
    }

    .hero-slider-main .hero-title {
        font-size: clamp(1.15rem, 4.5vw, 1.5rem);
        line-height: 1.25;
    }

    .hero-slider-main .hero-subtitle {
        font-size: 0.875rem;
        line-height: 1.35;
    }
}

@media (max-width: 575.98px) {
    .hero-slider .hero-slider-main .item.hero-slide--theme1,
    .hero-slider .hero-slider-main > .owl-carousel .item.hero-slide--theme1 {
        height: 260px !important;
        min-height: 220px !important;
    }
}
