/* ============================================================
   DPR DEALER LOCATOR - CLEAN CSS
   ============================================================ */

/* 1. Grid Container */
/* Pastikan semua elemen menghitung padding sebagai bagian dari lebar */
.dpr-dealer-wrapper, 
.dpr-grid-container, 
.dpr-dealer-card {
    box-sizing: border-box;
}

.dpr-grid-container {
    display: grid;
    width: 100% !important;
    max-width: 100% !important;
    /* Kita biarkan kolom diatur inline oleh PHP, tapi kita amankan gap-nya */
    margin: 0 auto;
}

.dpr-dealer-card {
    width: 100% !important;
    min-width: 0 !important; /* Menghapus paksaan lebar minimal */
    max-width: 100% !important;
}

/* Responsif Mobile - Kita paksa murni 1 kolom */
@media (max-width: 767px) {
    .dpr-grid-container {
        display: flex !important; 
        flex-direction: column !important;
        grid-template-columns: 1fr !important; 
        gap: 0 !important;
        margin: 0 auto;
        padding-left: 15px !important; /* Tambah sedikit ruang napas di pinggir layar */
        padding-right: 15px !important;
        width: 100% !important;
    }

    .dpr-dealer-card {
        width: 100% !important;
        min-width: 100% !important; /* Paksa kartu memenuhi lebar container */
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
    
    .dpr-thumb {
        height: 180px; /* Sedikit lebih tinggi di HP biar fotonya puas dilihat */
    }
}

/* 2. Dealer Card Base */
.dpr-dealer-card {
    background: #ffffff;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.3s ease;
    margin-bottom: 5px; /* Menjaga shadow tidak terpotong */
}

.dpr-dealer-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

.dpr-dealer-card * {
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* 3. Thumbnail & Image */
.dpr-thumb {
    width: 100% !important;
    height: 180px; /* Anda bisa sesuaikan tingginya */
    overflow: hidden !important;
    position: relative;
    background-color: #f5f5f5; /* Warna cadangan sebelum gambar loading */
}

.dpr-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Tambahkan ini biar zoom-nya smooth kayak mentega */
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
/* 4. Content Area */
.dpr-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.dpr-content h4 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #333;
    font-weight: 700;
}

.dpr-pt-name {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #888;
    margin-top: -5px;
    margin-bottom: 5px !important;
    text-transform: uppercase;
}

/* 5. Meta Info (Alamat, WA, Email) */
.dpr-meta {
    margin-bottom: 10px;
    flex-grow: 1;
}

.dpr-meta p {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
    font-size: 13px;
    color: #555;
    line-height: 1.4;
}

.dpr-icon svg, .dpr-icon i {
    width: 16px;
    height: 16px;
    font-size: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

/* 6. Action Buttons */
.dpr-actions {
    display: flex;
    gap: 10px;
    margin-top: auto; /* Memaksa tombol selalu di paling bawah card */
}

.dpr-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 5px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 6px;
    transition: 0.3s;
    border: none;
}

.dpr-btn svg, .dpr-btn i {
    width: 14px;
    height: 14px;
}

.dpr-btn.maps {
    background: #2D3192;
    color: #fff;
}

.dpr-btn.online {
    background: #3F44AD;
    color: #fff;
}

.dpr-btn:hover {
    filter: brightness(1.2);
    transform: translateY(-2px);
}

/* 7. Pagination & Load More */
.dpr-pagination {
    margin-top: 40px;
    text-align: center;
}

.dpr-pagination .page-numbers {
    padding: 8px 16px;
    margin: 0 4px;
    background: #fff;
    border: 1px solid #ddd;
    color: #333;
    border-radius: 6px;
    text-decoration: none;
}

.dpr-pagination .page-numbers.current {
    background: #2D3192;
    color: #fff;
    border-color: #2D3192;
}

.dpr-load-more-container {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

#dpr-load-more-btn {
    background-color: #2D3192;
    color: #fff;
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 15px;
    transition: 0.3s;
}

/* Sekarang kita targetkan hover pada CARD-nya, bukan GRID-nya */
.dpr-hover-zoom .dpr-dealer-card:hover .dpr-thumb img {
    transform: scale(1.1);
}

/* Efek Grayscale yang Benar */
.dpr-hover-grayscale .dpr-thumb img {
    filter: grayscale(100%);
    transition: filter .5s ease;
}
.dpr-hover-grayscale .dpr-dealer-card:hover .dpr-thumb img {
    filter: grayscale(0%);
}


/* Filter Wrapper */
.dpr-filter-wrapper {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

/* Filter Field */
.dpr-filter-field {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.dpr-filter-field label {
    font-weight: 700;
    font-size: 14px;
    color: #2D3192;
}

/* Select */
.dpr-select {
    width: 100%;
    padding: 10px 15px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 14px;
    background-color: #fff;
    cursor: pointer;
    outline: none;
}

.dpr-select:disabled {
    background-color: #f9f9f9;
    opacity: 0.6;
    cursor: not-allowed;
}

/* Maps Container */
.dpr-maps-container {
    width: 100% !important;
    height: 450px !important;
    display: block !important;
    background-color: #f0f0f0;
    border-radius: 0;
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
    border: 1px solid #ddd;
}

/* Responsive */
@media (max-width: 767px) {
    .dpr-filter-wrapper {
        flex-direction: column;
        gap: 15px;
    }
}

/* ============================================================
   KUSTOMISASI GAYA MAPS (NUANSA NAVY GELAP)
   ============================================================ */

/* 1. Atur container maps */
#dpr-google-maps {
    /* Tinggi dan sudut tumpul agar rapi */
    height: 450px;
    width: 100%;
    border-radius: 12px;
    margin-bottom: 30px;
    position: relative;
    z-index: 10;
    
    /* Warna latar container senada dengan warna laut */
    background: #0d1e3d; 
    
    /* Matikan overflow agar gambar peta tidak meluber saat drag */
    overflow: hidden; 
}

/* 2. Berikan filter pada tiles (potongan gambar) Leaflet */
/* Trik ini akan mengubah OpenStreetMap menjadi mode gelap bernuansa biru */
#dpr-google-maps .leaflet-tile-container {
    filter: invert(100%) hue-rotate(190deg) brightness(0.9) contrast(1.1) saturate(0.8) sepia(0.2);
    -webkit-filter: invert(100%) hue-rotate(190deg) brightness(0.9) contrast(1.1) saturate(0.8) sepia(0.2);
}

/* 3. Atur elemen atribusi OpenStreetMap agar tetap terbaca */
.leaflet-container .leaflet-control-attribution {
    background: rgba(13, 30, 61, 0.7) !important;
    color: #a0acbd !important;
}

.leaflet-container .leaflet-control-attribution a {
    color: #4da3ff !important;
}

/* 4. Sesuaikan Kursor Leaflet */
.leaflet-container {
    cursor: grab !important;
}

.leaflet-dragging .leaflet-container {
    cursor: grabbing !important;
}

/* 5. Ganti Warna Marker Pin (Opsional, agar menyala di peta gelap) */
/* Marker default Leaflet akan terpengaruh filter CSS di atas. */
/* Jika ingin marker khusus yang menyala, tambahkan ini: */
.leaflet-marker-icon {
    /* Memberikan sedikit cahaya di belakang pin */
    filter: drop-shadow(0 0 5px rgba(255, 255, 255, 0.5));
}


.acf-form {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.acf-field {
    margin-bottom: 20px !important;
}

.acf-label label {
    font-weight: 700 !important;
    color: #2D3192;
    margin-bottom: 8px !important;
}

.acf-form-submit .acf-button {
    background: #2D3192 !important;
    color: #fff !important;
    padding: 12px 30px !important;
    border-radius: 5px !important;
    font-weight: bold;
    border: none;
    cursor: pointer;
}

.dpr-captcha-wrapper {
    margin-top: 20px;
    padding: 15px;
    background: #f0f4f8;
    border-radius: 8px;
}

.dpr-field-tutorial {
    background: #f0f7ff; /* Biru muda yang sangat soft */
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 12px; /* Jarak ke input di bawahnya */
    font-size: 13px;
    color: #2D3748;
    border-left: 4px solid #2D3192;
    line-height: 1.6;
}

.dpr-field-tutorial strong {
    color: #2D3192;
    display: block;
    margin-bottom: 5px;
}

.dpr-field-tutorial a {
    color: #2D3192;
    text-decoration: underline;
    font-weight: bold;
}

/* Container Utama Uploader */
.acf-field[data-name="foto_toko"] .acf-input {
    position: relative;
    border: 2px dashed #2D3192 !important;
    padding: 40px 15px !important;
    border-radius: 20px !important;
    background: #f0f4ff !important;
    text-align: center;
    overflow: hidden; /* POTONG apapun yang keluar jalur */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 150px;
}

/* Sembunyikan Input Asli Tapi Tetap Bisa Di-klik */
.acf-field[data-name="foto_toko"] input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0 !important; /* Paksa transparan */
    cursor: pointer;
    z-index: 10;
    /* Tambahan agar teks 'No file selected' tidak meluber di beberapa browser */
    font-size: 100px; 
    filter: alpha(opacity=0);
}

/* Buat Tampilan Pengganti yang Cakep */
.acf-field[data-name="foto_toko"] .acf-input::before {
    content: '📸';
    font-size: 40px;
    margin-bottom: 10px;
    display: block;
}

.acf-field[data-name="foto_toko"] .acf-input::after {
    content: 'Ketuk di sini untuk pilih foto toko';
    font-size: 14px;
    font-weight: 600;
    color: #2D3192;
    display: block;
    max-width: 200px; /* Biar teksnya melipat ke bawah di mobile, gak manjang ke samping */
    line-height: 1.4;
}

/* Hilangkan garis fokus default yang bikin jelek di mobile */
.acf-field[data-name="foto_toko"] input[type="file"]:focus {
    outline: none;
}