/* ========================================
   IMAGE SLIDER FIX
   Perbaikan foto terpotong di slider
   ======================================== */

/* Hero Image Container - Prevent Cropping */
.hero-image {
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible !important;
}

/* Hero Image - Full Display */
.hero-image img,
.hero-slide img,
.floating-image img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    border-radius: 20px;
}

/* Image Decoration - Don't Interfere */
.image-decoration {
    pointer-events: none;
    z-index: -1;
}

/* Swiper Slide - Full Height */
.swiper-slide {
    height: auto !important;
    display: flex !important;
    align-items: center !important;
}

/* Hero Slide - Proper Spacing */
.hero-slide {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 80px 0;
}

.hero-slide .container {
    width: 100%;
}

.hero-slide .row {
    align-items: center;
}

/* Desktop - Side by Side */
@media (min-width: 992px) {
    .hero-image {
        padding-left: 30px;
    }
    
    .hero-image img {
        max-height: 600px;
    }
    
    .hero-content {
        padding-right: 30px;
    }
}

/* Tablet - Stacked */
@media (max-width: 991px) {
    .hero-slide {
        min-height: auto;
        padding: 60px 0;
    }
    
    .hero-image {
        padding-left: 0;
        margin-top: 30px;
    }
    
    .hero-image img {
        max-height: 450px;
    }
    
    .hero-content {
        padding-right: 0;
        text-align: center;
    }
}

/* Mobile Landscape */
@media (max-width: 767px) {
    .hero-slide {
        padding: 50px 0;
    }
    
    .hero-image {
        margin-top: 25px;
    }
    
    .hero-image img {
        max-height: 350px;
        border-radius: 15px;
    }
}

/* Mobile Portrait */
@media (max-width: 575px) {
    .hero-slide {
        padding: 40px 0;
    }
    
    .hero-image {
        margin-top: 20px;
    }
    
    .hero-image img {
        max-height: 300px;
        border-radius: 12px;
    }
}

/* Extra Small */
@media (max-width: 374px) {
    .hero-image img {
        max-height: 260px;
        border-radius: 10px;
    }
}

/* Landscape Orientation - Show Image */
@media (max-height: 500px) and (orientation: landscape) {
    .hero-slide {
        min-height: 100vh;
        padding: 30px 0;
    }
    
    .hero-image {
        display: flex !important;
        margin-top: 15px;
    }
    
    .hero-image img {
        max-height: 250px;
    }
}

/* Fix untuk Swiper Wrapper */
.swiper-wrapper {
    align-items: stretch;
}

/* Prevent Image Distortion */
.hero-image img {
    aspect-ratio: auto;
    -o-object-fit: contain;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Remove Conflicting Styles */
.hero-image .floating-image {
    animation: none !important;
}

/* Ensure Container Doesn't Crop */
.heroSwiper,
.swiper-container {
    overflow: visible !important;
}

.hero-slider {
    overflow: hidden;
}

/* Fix untuk Image yang Terlalu Tinggi */
.hero-image img[style*="height"] {
    height: auto !important;
}

/* Responsive Image Wrapper */
.hero-image-wrapper {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Placeholder untuk Loading */
.hero-image img[loading="lazy"] {
    min-height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* High Resolution Display */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-image img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print Styles */
@media print {
    .hero-image img {
        max-height: none !important;
        page-break-inside: avoid;
    }
}

/* Accessibility - Screen Readers */
.hero-image img[alt=""] {
    opacity: 1;
}

/* Fix untuk Safari */
@supports (-webkit-touch-callout: none) {
    .hero-image img {
        -webkit-transform: translate3d(0, 0, 0);
    }
}

/* Fix untuk Firefox */
@-moz-document url-prefix() {
    .hero-image img {
        image-rendering: -moz-crisp-edges;
    }
}

/* Ensure No Overflow */
.hero-slide .col-lg-6 {
    overflow: visible !important;
}

/* Image Shadow - Optional Enhancement */
.hero-image img {
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.hero-image img:hover {
    transform: scale(1.02);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.2);
}

/* Disable Hover on Touch Devices */
@media (hover: none) {
    .hero-image img:hover {
        transform: none;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    }
}

/* Loading State */
.hero-image.loading img {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.hero-image.loaded img {
    opacity: 1;
}

/* Error State */
.hero-image img[alt]:after {
    content: attr(alt);
    display: block;
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    color: #6c757d;
    border-radius: 10px;
}
