/* =================================================================== */
/* ============= KODE FINAL UNTUK STYLE.CSS (CLEANED) ============= */
/* =================================================================== */

/* --- PENGATURAN DASAR --- */
body {
    font-family: 'Inter', sans-serif;
}

/* --- NAVBAR STYLING --- */
#mainNavbar {
    padding: 1rem 2rem;
    background-color: #111; /* Latar belakang HITAM saat di atas */
    transition: background-color 0.4s ease-in-out;
}
#mainNavbar.navbar-scrolled-transparent {
    background-color: transparent; /* Latar belakang HILANG saat di-scroll */
}
#mainNavbar .navbar-brand {
    letter-spacing: 0.1em;
}
#mainNavbar .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem;
}

/* --- HERO CAROUSEL STYLING --- */
/* Memberi jarak pada carousel dari navbar fixed-top */
#heroCarousel {
    padding-top: 72px; /* Sesuaikan angka ini dengan tinggi navbar Anda */
}
.mapss {
    padding-top: 72px; /* Sesuaikan angka ini dengan tinggi navbar Anda */
}

/* CSS untuk membuat iframe (peta) menjadi responsif */

.map-responsive-wrapper {
    position: relative;
    overflow: hidden;
    height: 0;
    
    /* Aspek Rasio Peta:
       - 75%    -> Rasio 4:3 (lebih kotak)
       - 56.25% -> Rasio 16:9 (widescreen)
       - 50%    -> Rasio 2:1 (lebih lebar/pendek)
       Pilih 50% atau 56.25% untuk peta full-width agar tidak terlalu tinggi di desktop.
    */
    padding-bottom: 50%;
}

.map-responsive-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
#heroCarousel .carousel-item {
    height: 100vh;
    min-height: 700px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
#heroCarousel .carousel-item::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(to right, rgba(0,0,0,0.6), transparent);
}
#heroCarousel .carousel-caption {
    position: absolute;
    bottom: 20%;
    left: 10%;
    right: auto;
    z-index: 10;
}
#heroCarousel .carousel-indicators {
    position: absolute;
    right: 5%;
    left: auto;
    bottom: 2rem;
    margin-left: 0;
    margin-right: 0;
    width: auto;
}

#heroCarousel .carousel-control-custom {
    /* Menghilangkan background default & mengatur ukuran */
    background: none;
    opacity: 1;
    width: 50px;
    height: 50px;
    
    /* Memposisikan tombol sedikit ke dalam */
    top: 50%;
    transform: translateY(-50%);
    transition: transform 0.2s ease;
}

#heroCarousel .carousel-control-prev.carousel-control-custom {
    left: 2rem; /* Jarak dari kiri */
}
#heroCarousel .carousel-control-next.carousel-control-custom {
    right: 2rem; /* Jarak dari kanan */
}

/* Efek saat hover */
#heroCarousel .carousel-control-custom:hover {
    transform: translateY(-50%) scale(1.1); /* Sedikit membesar saat di-hover */
}

/* Styling Ikon SVG di dalam tombol */
#heroCarousel .carousel-control-custom svg {
    width: 32px;
    height: 32px;
}

/*
|--------------------------------------------------------------------------
| Custom Carousel Indicators (Sesuai Lampiran)
|--------------------------------------------------------------------------
*/

#heroCarousel .carousel-indicators {
    bottom: 30px; /* Atur jarak dari bawah */
}

#heroCarousel .carousel-indicators button {
    /* Mengubah indikator menjadi lingkaran */
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.5);
    border: none;
    margin: 0 8px; /* Jarak antar indikator */
    transition: all 0.4s ease; /* Transisi mulus */
}

/* Style untuk indikator yang sedang aktif */
#heroCarousel .carousel-indicators .active {
    /* Mengubah dari lingkaran menjadi batang panjang */
    width: 50px; 
    border-radius: 10px;
    background-color: white;
}
/* ================================================================= */
/* ============= CSS BARU (Tambahkan & Ganti yang Lama) ============= */
/* ================================================================= */

/* Tambahkan class wrapper baru ini */
.model-viewer-wrapper {
    width: 120%; /* Buat wrapper lebih lebar 20% dari parent-nya */
    position: relative;
    left: 50%; /* Posisikan titik awal di tengah */
    transform: translateX(-50%); /* Geser ke kiri 50% dari lebarnya SENDIRI untuk membuatnya benar-benar center */
}

/* GANTI KODE LAMA ANDA untuk .left-image dan .right-image dengan ini */
.left-image {
    left: 5%; /* Posisikan 5% dari tepi wrapper (bukan lagi -10%) */
    transform: perspective(1200px) rotateY(-25deg);
}

.right-image {
    right: 5%; /* Posisikan 5% dari tepi wrapper (bukan lagi -10%) */
    transform: perspective(1200px) rotateY(25deg);
}

/* Styling Tab Navigasi */
.model-viewer-section .nav-tabs {
    position: relative;
    z-index: 20;
}
.model-viewer-section .nav-tabs .nav-link {
    border: none; color: #888; font-size: 1.2rem; font-weight: 500; padding-bottom: 0.5rem; margin: 0 1rem; position: relative;
}
.model-viewer-section .nav-tabs .nav-link.active {
    color: #000; font-weight: 600;
}
.model-viewer-section .nav-tabs .nav-link.active::after {
    content: ''; position: absolute; bottom: -3px; left: 50%; transform: translateX(-50%); width: 60%; height: 3px; background-color: #0055b8; border-radius: 2px;
}

/* === BAGIAN DESKTOP & MOBILE (BASE STYLES) === */
.model-display-area {
    position: relative;
    /* TRIK UTAMA: Buat area ini lebih lebar dari parent-nya */
    width: 120%;
    /* Dan pusatkan kembali area yang lebar ini */
    left: 50%;
    transform: translateX(-50%);
    
    height: 500px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.center-car-image {
    position: relative;
    z-index: 10;
    max-width: 60%;
    height: auto;
    filter: drop-shadow(0 15px 15px rgba(0,0,0,0.2));
    transition: all 0.3s ease;
}

.side-image {
    position: absolute;
    /* Atur agar berada di lapisan belakang */
    z-index: 1; 
    
    width: 35%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.left-image {
    left: 5%;
    transform: perspective(1200px) rotateY(-25deg);
}

.right-image {
    right: 5%;
    transform: perspective(1200px) rotateY(25deg);
}

    /* CSS untuk dot warna */
    .color-options {
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 20px;
    }

    .color-swatch {
        width: 30px;
        height: 30px;
        border-radius: 50%;
        border: 2px solid #ccc;
        cursor: pointer;
        transition: all 0.2s ease-in-out;
    }

    .color-swatch.active {
        border-color: #007bff;
        transform: scale(1.1);
    }

    .color-swatch:hover {
        transform: scale(1.1);
        box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
    }

    .color-swatch.two-tone {
        background-color: transparent; /* Hilangkan background default */
        display: flex; /* Gunakan flexbox untuk menampung dua bagian */
        flex-wrap: wrap;
        padding: 0;
        border: none;
        overflow: hidden;
    }

    .color-swatch.two-tone .top-half,
    .color-swatch.two-tone .bottom-half {
        width: 100%;
        height: 50%;
    }

    /* Tambahkan border seperti di gambar */
    .color-swatch.two-tone {
        border: 2px solid #ccc;
    }
    .color-swatch.two-tone.active {
        border-color: #007bff;
    }

    .inverted-logo {
        /* Filter untuk menginvert warna. Bisa disesuaikan nilainya */
        filter: invert(1) grayscale(1) brightness(2); 
        /* invert(1) akan membalik warna (hitam jadi putih, putih jadi hitam)
           grayscale(1) memastikan hasilnya monokrom (putih/abu-abu)
           brightness(2) meningkatkan kecerahan, agar lebih jelas terlihat putih */
    }

    @media (min-width: 768px) {
        .carousel-caption .caption-content {
            width: 100%;
            max-width: 800px; /* Atur lebar maksimum konten */
            margin-left: 5%;   /* Posisikan sedikit dari kiri */
        }
    }
    .carousel-caption {
        position: absolute;
        right: 0;
        bottom: 0;
        left: 0;
        top: 0;
        padding-top: 1.25rem;
        padding-bottom: 1.25rem;
        color: #fff;
        text-align: center;
    }

/* === Info Panel & Tombol === */
.model-info-panel {
    position: relative;
    z-index: 20;
}
.model-info-panel h2 {
    font-size: 2.2rem;
}
.color-swatches .color-swatch { width: 28px; height: 28px; border-radius: 50%; border: 2px solid #ddd; cursor: pointer; transition: transform 0.2s ease; padding: 0; }
.color-swatches .color-swatch:hover { transform: scale(1.1); }
.color-swatches .color-swatch.active { border-color: #0055b8; }
.up-arrow-button { background-color: #0055b8; color: white; width: 50px; height: 50px; border-radius: 50%; display: inline-flex; justify-content: center; align-items: center; }
.up-arrow-button:hover { background-color: #004494; }


/* === PERBAIKAN RESPONSIVE AGAR MIRIP DESKTOP === */
@media (max-width: 767px) {
    .model-display-area {
        height: 280px; /* Perkecil tinggi area di mobile */
    }

    .center-car-image {
        max-width: 55%; /* Perkecil ukuran mobil */
    }

    .side-image {
        width: 40%; /* Perkecil ukuran gambar samping */
        border-radius: 12px;
    }

    /* Posisikan ulang gambar samping agar pas di layar kecil */
    .left-image {
        left: 0;
        transform: perspective(800px) rotateY(-20deg); /* Kurangi efek 3D */
    }

    .right-image {
        right: 0;
        transform: perspective(800px) rotateY(20deg); /* Kurangi efek 3D */
    }

    .model-info-panel h2 {
        font-size: 1.8rem;
    }
}

/* --- ANIMASI TAMBAHAN UNTUK MODEL VIEWER --- */

/* Keyframes untuk animasi ganti warna mobil */
@keyframes slideOutLeft {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-50px); opacity: 0; }
}

@keyframes slideInFromRight {
    from { transform: translateX(50px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Keyframes untuk animasi ganti model (tab) */
@keyframes carouselSlideOut {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(-100%); opacity: 0; }
}

@keyframes carouselSlideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* Class-helper untuk menerapkan animasi */
.is-sliding-out {
    animation: slideOutLeft 0.3s forwards ease-in-out;
}

.is-sliding-in {
    animation: slideInFromRight 0.3s forwards ease-in-out;
}
/* Override default bootstrap fade agar animasi slide kita yang berjalan */
.tab-pane.is-sliding {
    display: block;
    opacity: 1; 
}
.tab-pane.carousel-slide-out {
    animation: carouselSlideOut 0.4s forwards ease;
}
.tab-pane.carousel-slide-in {
    animation: carouselSlideIn 0.4s forwards ease;
}

/* --- CSS untuk Animasi Slide Tab --- */

/* 1. Jadikan kontainer sebagai acuan posisi dan sembunyikan overflow */
.tab-content {
    /* Atur tinggi minimum atau tinggi tetap agar elemen di bawahnya (Bagian Info Card kedua)
       tidak bergerak naik-turun. Ganti XXXpx sesuai kebutuhan. */
    min-height: 650px; /* Nilai contoh. Sesuaikan agar lebih besar dari konten tab terpanjang */
    overflow: hidden; /* Pastikan konten yang slide di-clip */
    position: relative; /* Penting untuk positioning absolut pada tab pane */
}
  
  /* 2. Selama animasi, semua panel diposisikan absolut */
  .tab-pane.is-sliding {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transition: transform 0.5s ease-in-out; /* Durasi animasi */
  }
  
  /* 3. Definisi animasi keluar dan masuk */
  .tab-pane.slide-out {
    transform: translateX(-100%); /* Geser ke kiri hingga hilang */
  }
  
  .tab-pane.slide-in {
    transform: translateX(100%); /* Mulai dari kanan (di luar layar) */
  }
  
  /* 4. Saat panel baru menjadi aktif, posisinya kembali normal */
  .tab-pane.active.is-sliding {
      transform: translateX(0);
  }

/* Keyframes untuk animasi ganti model (tab) - GESER MURNI */
@keyframes carouselSlideOut {
    from { transform: translateX(0); }
    to { transform: translateX(-100%); }
}

@keyframes carouselSlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

/* --- CSS UNTUK ANIMASI SLIDE MOBIL (WAJIB ADA) --- */

/* Wrapper untuk mobil, pastikan posisinya relatif dan overflow-nya hidden */
.center-car-wrapper {
    position: relative;
    z-index: 10;
    width: 60%; 
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* Gambar mobil utama dan kloningannya */
.center-car-image, .cloned-car-image {
    width: 100%;
    height: auto;
    transition: transform 0.5s ease-in-out;
    /*Cegahgambar'loncat'saatanimasi*/flex-shrink: 0;
    -webkit-transition: transform 0.5s ease-in-out;
    -moz-transition: transform 0.5s ease-in-out;
    -ms-transition: transform 0.5s ease-in-out;
    -o-transition: transform 0.5s ease-in-out;
}

/* Posisi awal kloningan (di luar layar kanan) */
.cloned-car-image {
    position: absolute;
    transform: translateX(100%);
}

/* Class untuk menggeser gambar keluar (ke kiri) */
.is-sliding-out {
    transform: translateX(-100%);
}

/* Class untuk menggeser gambar masuk (ke tengah) */
.is-sliding-in {
    transform: translateX(0%);
}

/* -------------------------------------------------------------------------------- */
/* =================================================================== */
/* ============= CSS UNTUK INFO CARD (REVISI SESUAI GAMBAR) ========= */
/* =================================================================== */
/* =================================================================== */
/* ============= CSS UNTUK INFO CARD (RESPONSIVE) ==================== */
/* =================================================================== */
.info-card-section {
    background-color: #1a1a1a;
    padding: 6rem 0;
}

.info-card-link {
    text-decoration: none;
    color: white;
    display: block;
    height: 100%;
}

.info-card {
    position: relative;
    border: none;
    overflow: hidden;
    height: 500px; /* Atur tinggi card untuk desktop */
    border-radius: 10px; /* bisa diganti sesuai selera */
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.info-card:hover {
    transform: scale(1.05); /* efek zoom pas hover */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 10;
}

.info-card .card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.info-card:hover .card-img {
    transform: scale(1.1); /* gambar ikut nge-zoom */
}

.info-card .card-img-overlay {
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 50%);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 2rem;
    transition: background 0.4s ease;
}

.info-card .card-title {
    font-size: 2rem;
    font-weight: 600;
}

.info-card .card-text-link {
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.info-card:hover .card-text-link {
    opacity: 1;
}

/* Tablet */
@media (min-width: 768px) and (max-width: 991.98px) {
    .info-card-section .row > * {
        width: 100%;
    }
}

/* ======================================================= */
/* =========== PENYESUAIAN UNTUK MOBILE (BARU) =========== */
/* ======================================================= */
@media (max-width: 767.98px) {
    .info-card-section {
        padding: 4rem 0; /* Kurangi padding section */
    }

    .info-card {
        transform: skewX(0); /* HILANGKAN efek miring di mobile */
        height: 400px; /* Kurangi tinggi card */
    }
    
    .info-card:hover {
        transform: scale(1.03); /* Efek hover lebih sederhana */
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
    }

    .info-card .card-img {
        width: 100%; /* Kembalikan lebar gambar ke normal */
        transform: skewX(0) translateX(0); /* Hapus kompensasi skew */
    }
    
    .info-card:hover .card-img {
        transform: scale(1.05); /* Efek zoom hover tetap ada */
    }

    .info-card .card-img-overlay {
        transform: skewX(0); /* Hapus kompensasi skew */
        padding: 1.5rem; /* Kurangi padding overlay */
    }

    .info-card .card-title {
        font-size: 1.75rem; /* Kecilkan judul */
    }
}

/* ---------------------------------- */
/* Supaya dropdown full width */
/* ========================================= */
/* CSS ASLI ANDA (UNTUK DESKTOP)             */
/* ========================================= */

/* Supaya parent li tidak membatasi posisi absolute */
.navbar .nav-item.dropdown {
    position: static;
}

/* Default hitam */
#mainNavbar {
    background-color: rgba(0, 0, 0, 0.9) !important;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}
 
/* Saat discroll jadi transparan */
#mainNavbar.scrolled {
    background-color: transparent !important;
    box-shadow: none;
}
 
/* Mega menu full width */
.dropdown-mega {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    width: 100vw;
    border-radius: 0;
    border: none;
    background-color: #111;
    padding: 2rem 0;
    margin-top: 0;
    z-index: 1050;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
 
/* Style isi model */
.model-card img {
    max-height: 120px;
    object-fit: contain;
}
.model-card h6 {
    color: #fff;
    margin: 0;
}
.model-card p {
    color: #aaa;
    margin: 0;
}


/* ======================================================= */
/* TAMBAHAN CSS RESPONSIVE (UNTUK MOBILE)                  */
/* Media query ini akan aktif di layar 991px ke bawah      */
/* ======================================================= */
@media (max-width: 991.98px) {

    /* Kembalikan posisi parent li agar dropdown normal */
    .navbar .nav-item.dropdown {
        position: relative;
    }

    /* Ubah mega menu menjadi dropdown biasa */
    .dropdown-mega {
        position: static; /* Hapus posisi absolute */
        width: auto;      /* Hapus lebar 100vw */
        background-color: transparent; /* Hapus background agar menyatu */
        box-shadow: none; /* Hapus bayangan */
        padding: 0 1rem;  /* Sesuaikan padding untuk mobile */
    }

    /* Atur agar item di dalam mega menu tersusun ke bawah */
    .dropdown-mega .row {
        --bs-gutter-x: 0; /* Hapus gutter horizontal dari Bootstrap row */
        display: block;   /* Ubah dari flex menjadi block */
    }
    .dropdown-mega .col-lg-3 { /* Ganti .col-lg-3 sesuai class kolom Anda */
        width: 100%;
        margin-bottom: 1.5rem; /* Beri jarak antar item */
    }

    /* Atur perataan teks dan warna di mobile */
    .model-card {
        text-align: left; /* Teks rata kiri di mobile */
    }
    .model-card h6, .model-card p {
        color: #fff; /* Ubah warna teks agar kontras dengan navbar mobile */
    }
    .model-card img {
        max-height: 60px; /* Perkecil sedikit gambar di mobile */
        margin-bottom: 8px;
    }
}


/* --------------------------------------- */
.whatsapp-float {
    /* KUNCI: Membuat tombol menempel di layar (viewport) */
    position: fixed; 
    
    /* Menentukan posisi: 20px dari bawah */
    bottom: 20px; 
    
    /* Menentukan posisi: 20px dari kanan */
    right: 20px;
    
    /* Memastikan tombol berada di atas semua elemen lain */
    z-index: 1000; 
    
    /* Efek transisi (opsional, untuk tampilan lebih halus) */
    transition: transform 0.3s ease;
}

.whatsapp-icon {
    /* Ukuran ikon WA */
    width: 60px; /* Sesuaikan ukuran sesuai kebutuhan */
    height: 60px;
    
    /* Membuat bentuk ikon bulat */
    border-radius: 50%; 
    
    /* Menambahkan bayangan agar terlihat lebih menonjol */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.4); 
}

/* Efek opsional saat mouse diarahkan ke tombol */
.whatsapp-float:hover {
    transform: scale(1.1);
}