/* ========================================
   SLIDER MOBILE FIX
   Perbaikan tampilan slider yang terpotong di mobile
   ======================================== */

/* Prevent horizontal scroll - CRITICAL FIX */
html {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
}

body {
    overflow-x: hidden !important;
    width: 100% !important;
    max-width: 100vw !important;
    position: relative !important;
}

/* Hero Slider - Mobile Fix */
.hero-slider {
    position: relative;
    overflow: hidden !important;
    margin-top: 0 !important;
    padding-top: 0 !important;
    width: 100% !important;
    max-width: 100vw !important;
}

/* Swiper Container */
.heroSwiper {
    width: 100% !important;
    max-width: 100vw !important;
    height: 100vh;
    min-height: 500px;
    max-height: 700px;
    overflow: hidden !important;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Swiper Wrapper - Center Content */
.swiper-wrapper {
    align-items: center;
    display: flex;
    max-width: 100vw !important;
}

/* Swiper Slide - Center Content */
.swiper-slide {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
    overflow: hidden !important;
    max-width: 100vw !important;
}

/* Hero Slide */
.hero-slide {
    height: 100%;
    width: 100% !important;
    max-width: 100vw !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
    overflow: hidden !important;
}

.hero-slide .container {
    width: 100% !important;
    max-width: 1140px;
    margin: 0 auto;
    padding-left: 20px;
    padding-right: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
}

.hero-slide .row {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 -15px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
}

.hero-slide .row > * {
    padding: 0 15px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    max-width: 100% !important;
    overflow: hidden !important;
}

/* Hero Content */
.hero-content {
    width: 100%;
    padding-right: 20px;
}

.hero-content .badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    font-size: 0.8rem;
    margin-bottom: 12px;
    white-space: nowrap;
}

.hero-content h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.hero-content .lead {
    font-size: 1.05rem;
    line-height: 1.6;
    margin-bottom: 20px;
}

.hero-content .d-flex {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.hero-content .btn {
    padding: 10px 24px;
    font-size: 0.95rem;
    white-space: nowrap;
}

/* Hero Image */
.hero-image {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: 20px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden !important;
}

.hero-image img {
    width: 85% !important;
    height: auto !important;
    max-width: 400px !important;
    max-height: 350px;
    object-fit: contain !important;
    object-position: center !important;
    display: block !important;
    border-radius: 20px;
    margin: 0 auto !important;
}

/* Swiper Navigation */
.swiper-button-next,
.swiper-button-prev {
    width: 45px;
    height: 45px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    color: #3498db;
}

.swiper-button-next::after,
.swiper-button-prev::after {
    font-size: 20px;
    font-weight: bold;
}

.swiper-pagination {
    bottom: 20px !important;
}

.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: white;
    opacity: 0.6;
}

.swiper-pagination-bullet-active {
    opacity: 1;
    width: 24px;
    border-radius: 5px;
}

/* Animated Shapes - Mobile Optimization */
.animated-shapes {
    display: none; /* Hide di mobile untuk performa */
}

/* Scroll Indicator */
.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

/* Tablet Landscape (992px - 1199px) */
@media (max-width: 1199px) {
    .heroSwiper {
        min-height: 500px;
        max-height: 650px;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
    }
    
    .hero-content .lead {
        font-size: 1rem;
    }
    
    .hero-content .btn {
        padding: 10px 22px;
        font-size: 0.9rem;
    }
    
    .hero-image img {
        max-width: 380px !important;
        max-height: 320px;
    }
}

/* Tablet Portrait (768px - 991px) */
@media (max-width: 991px) {
    .heroSwiper {
        height: auto;
        min-height: 500px;
        max-height: none;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-slide {
        padding: 40px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        min-height: 500px;
    }
    
    .hero-slide .container {
        padding-left: 15px;
        padding-right: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-slide .row {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .hero-slide .row > * {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }
    
    .hero-content {
        padding-right: 0;
        margin-bottom: 30px;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    .hero-content h1 {
        font-size: 2.2rem;
        margin-bottom: 18px;
        text-align: center;
    }
    
    .hero-content .lead {
        font-size: 1rem;
        margin-bottom: 20px;
        text-align: center;
    }
    
    .hero-content .d-flex {
        justify-content: center;
        width: 100%;
    }
    
    .hero-image {
        padding-left: 0;
        margin-top: 20px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .hero-image img {
        max-height: 400px;
        object-fit: contain;
        object-position: center;
        margin: 0 auto;
        display: block;
    }
    
    .swiper-button-next,
    .swiper-button-prev {
        width: 40px;
        height: 40px;
    }
    
    .swiper-button-next::after,
    .swiper-button-prev::after {
        font-size: 18px;
    }
}

/* Mobile Landscape (576px - 767px) */
@media (max-width: 767px) {
    .heroSwiper {
        height: calc(100vh - 80px);
        min-height: 480px;
        max-height: 650px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-slide {
        padding: 25px 0;
        align-items: center;
        justify-content: center;
        display: flex;
        height: 100%;
    }
    
    .hero-slide .container {
        padding-left: 15px;
        padding-right: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        max-width: 100%;
    }
    
    .hero-slide .row {
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0;
        max-width: 100%;
        gap: 20px;
    }
    
    .hero-slide .row > * {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100%;
        max-width: 100%;
        padding-left: 12px;
        padding-right: 12px;
    }
    
    .hero-content {
        text-align: center;
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding: 0 8px;
    }
    
    .hero-content .badge {
        font-size: 0.75rem;
        padding: 5px 12px;
        margin-bottom: 10px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-content h1 {
        font-size: 1.6rem;
        line-height: 1.3;
        margin-bottom: 12px;
        text-align: center;
        width: 100%;
    }
    
    .hero-content .lead {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 15px;
        text-align: center;
        width: 100%;
    }
    
    .hero-content .d-flex {
        flex-direction: column;
        gap: 10px;
        align-items: center;
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }
    
    .hero-content .btn {
        width: 100%;
        padding: 11px 18px;
        font-size: 0.9rem;
        justify-content: center;
        text-align: center;
    }
    
    .hero-image {
        margin-top: 0;
        max-width: 100%;
        padding-left: 0;
        padding-right: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
    }
    
    .hero-image img {
        width: 80% !important;
        height: auto;
        max-height: 280px !important;
        max-width: 350px !important;
        object-fit: contain;
        object-position: center;
        border-radius: 15px;
        margin: 0 auto;
        display: block;
    }
    
    /* Hide navigation arrows on mobile */
    .swiper-button-next,
    .swiper-button-prev {
        display: none;
    }
    
    .swiper-pagination {
        bottom: 12px !important;
    }
    
    .swiper-pagination-bullet {
        width: 8px;
        height: 8px;
    }
    
    .swiper-pagination-bullet-active {
        width: 20px;
    }
    
    .scroll-indicator {
        display: none;
    }
}

/* Mobile Portrait (< 576px) */
@media (max-width: 575px) {
    .heroSwiper {
        height: calc(100vh - 80px);
        min-height: 450px;
        max-height: 600px;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden !important;
        max-width: 100vw !important;
    }
    
    .hero-slide {
        padding: 20px 0;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
        overflow: hidden !important;
        max-width: 100vw !important;
    }
    
    .hero-slide .container {
        padding-left: 15px;
        padding-right: 15px;
        display: flex;
        align-items: center;
        justify-content: center;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    .hero-slide .row {
        width: 100% !important;
        max-width: 100% !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        margin: 0;
        overflow: hidden !important;
        gap: 15px;
    }
    
    .hero-slide .row > * {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 10px;
        padding-right: 10px;
        overflow: hidden !important;
    }
    
    .hero-content {
        margin-bottom: 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 5px;
        overflow: hidden !important;
    }
    
    .hero-content .badge {
        font-size: 0.7rem;
        padding: 4px 10px;
        margin-bottom: 8px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .hero-content h1 {
        font-size: 1.3rem;
        line-height: 1.3;
        margin-bottom: 10px;
        text-align: center;
        width: 100%;
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .hero-content .lead {
        font-size: 0.85rem;
        line-height: 1.4;
        margin-bottom: 12px;
        text-align: center;
        width: 100%;
        max-width: 100%;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    .hero-content .d-flex {
        flex-direction: column;
        gap: 8px;
        align-items: center;
        width: 100%;
        max-width: 260px;
        margin: 0 auto;
    }
    
    .hero-content .btn {
        padding: 9px 16px;
        font-size: 0.85rem;
        width: 100%;
        text-align: center;
        justify-content: center;
    }
    
    .hero-image {
        margin-top: 0;
        padding-left: 0 !important;
        padding-right: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100% !important;
        max-width: 100% !important;
        overflow: hidden !important;
    }
    
    .hero-image img {
        width: 75% !important;
        height: auto !important;
        max-height: 220px !important;
        max-width: 280px !important;
        object-fit: contain !important;
        object-position: center !important;
        border-radius: 12px;
        margin: 0 auto !important;
        display: block !important;
    }
    
    .swiper-pagination {
        bottom: 10px !important;
    }
}

/* Extra Small Mobile (< 375px) */
@media (max-width: 374px) {
    .heroSwiper {
        min-height: 380px;
    }
    
    .hero-slide {
        padding: 20px 0;
        padding-top: 30px;
    }
    
    .hero-content h1 {
        font-size: 1.3rem;
        margin-bottom: 10px;
    }
    
    .hero-content .lead {
        font-size: 0.85rem;
        margin-bottom: 12px;
    }
    
    .hero-content .btn {
        padding: 9px 16px;
        font-size: 0.85rem;
    }
    
    .hero-image img {
        width: 100%;
        height: auto;
        max-height: 240px;
        object-fit: contain;
        object-position: center;
        border-radius: 10px;
    }
}

/* Landscape Orientation Fix */
@media (max-height: 500px) and (orientation: landscape) {
    .heroSwiper {
        height: auto;
        min-height: 100vh;
    }
    
    .hero-slide {
        padding: 20px 0;
    }
    
    .hero-content h1 {
        font-size: 1.5rem;
        margin-bottom: 10px;
    }
    
    .hero-content .lead {
        font-size: 0.9rem;
        margin-bottom: 12px;
    }
    
    .hero-content .badge {
        font-size: 0.75rem;
        padding: 5px 12px;
    }
    
    .hero-image {
        display: none; /* Hide image in landscape to save space */
    }
    
    .swiper-pagination {
        bottom: 10px !important;
    }
}

/* Fix untuk notch di iPhone X dan sejenisnya */
@supports (padding: max(0px)) {
    .hero-slide .container {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
}

/* Prevent horizontal scroll */
body {
    overflow-x: hidden;
}

.hero-slider,
.heroSwiper,
.hero-slide {
    overflow-x: hidden;
}

/* Image Decoration - Hide on Mobile */
@media (max-width: 991px) {
    .image-decoration {
        display: none;
    }
}

/* Fix untuk text yang terlalu panjang */
.hero-content h1,
.hero-content .lead,
.hero-content p {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* Ensure buttons don't overflow */
.hero-content .btn {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fix untuk badge yang terlalu panjang */
.hero-content .badge {
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading state */
.heroSwiper.swiper-initialized {
    opacity: 1;
    transition: opacity 0.3s ease;
}

.heroSwiper:not(.swiper-initialized) {
    opacity: 0;
}

/* Touch optimization */
.hero-slide {
    -webkit-tap-highlight-color: transparent;
    touch-action: pan-y;
}

/* Performance optimization */
.hero-slide img {
    will-change: transform;
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* Fix untuk Safari iOS */
@supports (-webkit-touch-callout: none) {
    .heroSwiper {
        height: -webkit-fill-available;
    }
}

/* Prevent content shift during swipe */
.swiper-wrapper {
    align-items: center;
}

.swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Fix untuk row alignment di mobile */
@media (max-width: 991px) {
    .hero-slide .row {
        flex-direction: column;
        align-items: center;
    }
    
    .hero-slide .row > * {
        width: 100%;
        max-width: 100%;
        flex: 0 0 100%;
    }
}

/* Ensure proper spacing between elements */
.hero-content > * {
    margin-left: 0;
    margin-right: 0;
}

/* Fix untuk button group */
.hero-content .d-flex.gap-3 {
    gap: 12px !important;
}

@media (max-width: 767px) {
    .hero-content .d-flex.gap-3 {
        gap: 10px !important;
    }
}

/* Accessibility improvements */
.hero-content .btn:focus,
.swiper-button-next:focus,
.swiper-button-prev:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-content h1,
    .hero-content .lead {
        text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .heroSwiper,
    .hero-slide,
    .swiper-wrapper {
        transition: none !important;
        animation: none !important;
    }
}
