/* ==========================================================================
   1. PALET WARNA & VARIABEL
   ========================================================================== */
:root {
    --primary: #10b981;       /* Emerald Green */
    --primary-dark: #059669;  /* Deep Emerald untuk Hover */
    --secondary: #3b82f6;     /* Soft Blue untuk aksen 'Sewa' */
    --accent: #ef4444;        /* Muted Red untuk Harga */
    --text-main: #1f2937;     /* Charcoal Gray untuk Judul */
    --text-muted: #6b7280;    /* Cool Gray untuk Lokasi/Deskripsi */
    --bg-body: #f3f4f6;       /* Light Gray untuk background halaman */
    --white: #ffffff;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 30px rgba(0, 0, 0, 0.12);
    --radius: 16px;
    --transition: all 0.3s ease;
}

/* ==========================================================================
   2. CONTAINER & LAYOUT GRID UTAMA (MOBILE FIRST)
   ========================================================================== */
.pu-container {
    max-width: 1200px;
    margin: auto;
    padding: 20px;
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body .pu-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 25px !important;
}

/* Pasukan Child Grid */
body .pu-grid > .pu-card {
    width: 100% !important;
    max-width: 100% !important;
    flex: unset !important;
}

/* ==========================================================================
   3. CARD PROPERTI UTAMA (Rata Kiri)
   ========================================================================== */
.pu-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
    border: 1px solid rgba(0,0,0,0.03);
    text-align: left; /* Memastikan rata kiri */
}

.pu-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

.pu-thumb {
    position: relative;
    display: block;
    overflow: hidden;
    background: #eee;
}

.pu-thumb img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.pu-card:hover .pu-thumb img {
    transform: scale(1.08);
}

/* Badge Harga & Label di Atas Gambar */
.pu-overlay-price {
    position: absolute;
    top: 12px;
    left: 12px;
    background: var(--accent);
    color: var(--white);
    padding: 6px 14px;
    font-size: 14px;
    border-radius: 8px;
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(239, 68, 68, 0.3);
    z-index: 10;
}

.pu-label-top {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    gap: 6px;
    z-index: 10;
}

.pu-label-status, .pu-label-type {
    font-size: 11px;
    padding: 4px 10px;
    border-radius: 6px;
    font-weight: 800;
    color: var(--white);
    text-transform: uppercase;
}

.pu-label-status.jual { background: var(--primary-dark); }
.pu-label-status.sewa { background: var(--secondary); }
.pu-label-type { background: rgba(31, 41, 55, 0.8); }

/* Spec Overlay Lama (Blur Gelas) */
.pu-overlay-bottom {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(4px);
    color: var(--white);
    font-size: 12px;
    padding: 8px 12px;
    white-space: nowrap;
}

.pu-overlay-bottom span { margin: 0 6px; }
.pu-overlay-bottom .sep { opacity: 0.4; }

/* Content di dalam Card */
.pu-content {
    padding: 15px;
    text-align: left; /* Rata kiri untuk judul, harga, dll */
}

.pu-content h3 {
    font-size: 17px;
    margin: 0 0 8px 0;
    line-height: 1.4;
    font-weight: 700;
    text-align: left;
}

.pu-content h3 a {
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
}

.pu-content h3 a:hover {
    color: var(--primary);
}

.pu-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #e53e3e; 
    margin-bottom: 10px;
    text-align: left;
}

.pu-location {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    text-align: left;
}

.pu-desc {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.5;
    height: 3.0em; 
    overflow: hidden;
    text-align: left;
}

/* Spesifikasi Rumah Elemen Flat */
.pu-specs {
    display: flex;
    justify-content: space-between; 
    background: #f7fafc; 
    padding: 8px 12px;
    border-radius: 6px;
    margin-bottom: 12px;
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 0.85rem;
    color: #4a5568; 
}

/* Tombol CTA Card */
.pu-btn {
    display: block;
    text-align: center;
    background-color: #00b173; 
    color: #fff !important;
    padding: 10px;
    border-radius: 8px; 
    text-decoration: none;
    font-weight: bold;
    margin-top: 10px;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.pu-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
}

/* ==========================================================================
   4. FILTER FORM
   ========================================================================== */
#pu-filter {
    max-width: 900px;
    margin: 40px auto;
    padding: 30px;
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

#pu-filter label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--text-main);
    font-size: 14px;
}

#pu-filter input[type="text"],
#pu-filter select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #edf2f7;
    border-radius: 12px;
    font-size: 14px;
    transition: var(--transition);
    background: #f8fafc;
}

#pu-filter input[type="text"]:focus,
#pu-filter select:focus {
    border-color: var(--primary);
    outline: none;
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

#pu-filter button {
    background: var(--primary);
    color: var(--white);
    padding: 14px 30px;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition);
    width: 100%;
}

#pu-filter button:hover {
    background: var(--primary-dark);
}

/* ==========================================================================
   5. SINGLE PROPERTY DETAIL & HALAMAN DETAIL
   ========================================================================== */
.property-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
}

.property-section-box {
    margin-top: 35px;
    margin-bottom: 35px;
}

.property-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin: 25px 0 40px;
}

.detail-box {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 15px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-box span {
    color: #64748b;
    font-size: 14px;
}

.detail-box strong {
    color: #111827;
    font-size: 15px;
}

/* Fitur / Fasilitas */
.feature-grid {
    display: block;
}

/* Fitur / Fasilitas / Akses Keunggulan */
.feature-grid {
    display: block;
}

.feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 12px;         /* Sedikit dikurangi agar proporsional dengan font kecil */
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    line-height: 1.5;           /* Diubah dari 1.7 ke 1.5 agar jarak antar baris teks kecil tidak renggang */
    font-size: 13px;            /* Ditambahkan untuk memperkecil ukuran teks deskripsi */
}

/* Memastikan tulisan tebal (jika ada tag strong) di dalamnya ikut mengecil */
.feature-item strong {
    font-size: 13px;
}

.feature-icon {
    color: #10b981;
    font-size: 14px;            /* Diperkecil dari 16px ke 14px agar seimbang dengan teks */
    margin-top: 2px;
    flex-shrink: 0;
}


/* Gallery Slider */
.gallery-section {
    margin-bottom: 24px;
}

.gallery-main {
    position: relative;
    border-radius: 16px;
    overflow: hidden;
    background: #f1f5f9;
}

.gallery-main img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    display: block;
}

.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 45px;
    height: 45px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    z-index: 10;
    padding: 0;
    opacity: 0.8;
}

.gallery-nav:hover {
    opacity: 1;
    background: rgba(0,0,0,0.25);
    border-radius: 50%;
}

.gallery-nav svg {
    width: 32px;
    height: 32px;
    stroke-width: 3;
}

.gallery-prev { left: 15px; }
.gallery-next { right: 15px; }

.gallery-counter {
    position: absolute;
    bottom: 12px;
    right: 12px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(4px);
}

.gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.thumb {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.2s;
    flex-shrink: 0;
}

.thumb.active, .thumb:hover {
    border-color: #2563eb;
}

.thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Property Header */
.property-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 20px;
    flex-wrap: wrap;
}

.property-title {
    font-size: 24px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.property-location {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #64748b;
    font-size: 14px;
}

.property-location svg {
    color: #2563eb;
    flex-shrink: 0;
}

.property-price {
    font-size: 22px;
    font-weight: 800;
    color: #dc2626;
    background: #fef2f2;
    padding: 8px 16px;
    border-radius: 12px;
    white-space: nowrap;
}

/* Stats Grid Detail */
.property-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 12px;
}

.stat-icon {
    width: 44px;
    height: 44px;
    background: #eff6ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #2563eb;
    flex-shrink: 0;
}

.stat-text {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
}

.stat-label {
    font-size: 11px;
    color: #94a3b8;
}

/* Tombol Aksi Halaman Detail */
.property-actions {
    display: flex;
    gap: 12px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: inherit;
}

.btn-crm {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.btn-crm:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.btn-whatsapp {
    background: #25D366;
    color: #fff;
}

.btn-whatsapp:hover {
    background: #128C7E;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(37,211,102,0.4);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* Deskripsi Konten */
.section-title {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid #e2e8f0;
}

.description-content {
    color: #475569;
    line-height: 1.8;
    font-size: 15px;
}

.description-content p { margin: 0 0 16px 0; }
.description-content ul, .description-content ol { margin: 0 0 16px 20px; }

/* Swiper Fix Arrow Override */
.swiper-button-prev,
.swiper-button-next {
    background: transparent !important;
    border-radius: 0 !important;
    width: 40px !important;
    height: 40px !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.swiper-button-prev::after,
.swiper-button-next::after {
    font-size: 35px !important;
    color: #111 !important;
}

/* ==========================================================================
   6. SIDEBAR RIGHT & AGENT PROFILE
   ========================================================================== */
.property-sidebar-right {
    display: flex;
    flex-direction: column;
    gap: 24px; 
}

.agent-profile-box {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.agent-card-content {
    display: flex;
    flex-direction: column; 
    gap: 16px;
    margin-top: 16px;
    padding-bottom: 20px;
    border-bottom: 1px dashed #e5e7eb; 
}

.agent-info-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.agent-avatar {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid #e2e8f0;
    flex-shrink: 0;
}

.agent-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.agent-bio h3 {
    font-size: 16px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.agent-role {
    font-size: 13px;
    color: #64748b;
    margin: 0;
}

.agent-phone {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    margin: 4px 0 0 0;
}

.agent-action-right .btn {
    width: 100%;
    justify-content: center;
}

/* ==========================================================================
   7. SIMILAR PROPERTY (Properti Serupa - Menggunakan Grid & Margin 20px)
   ========================================================================== */
.similar-property {
    margin: 0; 
	margin-bottom: 50px; 
}
.similar-property .section-title {
    margin-left: 20px;
}
.similar-grid {
    display: grid;              /* Diubah menjadi grid */
    grid-template-columns: 1fr; /* Default 1 kolom untuk mobile */
    gap: 16px;
    margin-left: 20px;          /* Ditambahkan margin left 20px */
    margin-right: 20px;         /* Ditambahkan margin right 20px */
}

.similar-card {
    display: flex !important;
    align-items: center;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    border: 1px solid #e5e7eb;
    transition: all 0.25s ease;
    position: relative;
}

.similar-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.similar-thumb {
    width: 110px;
    height: auto;          /* Ubah dari 80px ke auto agar tingginya dinamis mengikuti kartu */
    align-self: stretch;   /* MEMAKSA elemen pembungkus ditarik full dari atas ke bawah */
    position: relative;
    flex-shrink: 0;
    overflow: hidden;
}

.similar-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: absolute;    /* Mengunci posisi foto agar benar-benar menutup area pembungkus */
    top: 0;
    left: 0;
}


.similar-body {
    padding: 12px;
    flex-grow: 1;
}

.similar-body h3 {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    margin: 0 0 4px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-align: left;
}

.similar-price {
    font-size: 13px;
    font-weight: 700;
    color: #dc2626;
    text-align: left;
}

.similar-card::after {
    content: "Lihat Detail";
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 6px;
    opacity: 0;
    transition: 0.2s;
}

.similar-card:hover::after {
    opacity: 1;
}

/* ==========================================================================
   8. MODAL MODAL
   ========================================================================== */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.6);
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.active { display: flex; }

.modal-content {
    background: #fff;
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 440px;
    position: relative;
    animation: modalSlide 0.3s ease-out;
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: #f1f5f9;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    transition: all 0.2s;
}

.modal-close:hover {
    background: #e2e8f0;
    color: #1e293b;
}

.modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.modal-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.modal-icon.wa-icon {
    background: #dcfce7;
    color: #25D366;
}

.modal-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.modal-subtitle {
    color: #64748b;
    font-size: 14px;
    margin: 0;
}

/* Form di Modal */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #25D366;
    box-shadow: 0 0 0 3px rgba(37,211,102,0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-error {
    display: none;
    color: #dc2626;
    font-size: 13px;
    text-align: center;
    margin-bottom: 12px;
    padding: 8px;
    background: #fef2f2;
    border-radius: 8px;
}

/* ==========================================================================
   9. MEDIA QUERIES (RESPONSIVE DESIGN)
   ========================================================================== */

/* TABLET (min-width: 768px) */
@media (min-width: 768px) {
    body .pu-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    #pu-filter form {
        display: grid;
        grid-template-columns: repeat(3, 1fr) auto;
        gap: 15px;
        align-items: end;
    }
    #pu-filter button { 
        width: auto; 
    }
}

/* DESKTOP (min-width: 1024px) */
@media (min-width: 1024px) {
    body .pu-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

/* MAX-WIDTH 768px (Mobile & Tablet Modif) */
@media (max-width: 768px) {
    .property-page {
        padding: 12px;
    }
    .gallery-main img {
        height: 250px;
    }
    .property-header {
        flex-direction: column;
    }
    .property-price {
        align-self: flex-start;
    }
    .property-stats {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 16px;
    }
    .property-actions {
        flex-direction: column;
    }
    .btn {
        justify-content: center;
    }
    .property-title {
        font-size: 20px;
    }
    .modal-content {
        padding: 24px;
    }
    /* Layout grid properti serupa berubah menjadi 2 kolom di tablet */
    .similar-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* MAX-WIDTH 600px */
@media (max-width: 600px) {
    .property-detail-grid {
        grid-template-columns: 1fr;
    }
}

/* MAX-WIDTH 480px (Layar Kecil Mobile) */
@media (max-width: 480px) {
    .gallery-thumbs {
        gap: 6px;
    }
    .thumb {
        width: 60px;
        height: 45px;
    }
    .stat-item {
        gap: 8px;
    }
    .stat-icon {
        width: 36px;
        height: 36px;
    }
    .stat-value {
        font-size: 14px;
    }
    /* Kembali menjadi 1 kolom di mobile hp kecil */
    .similar-grid {
        grid-template-columns: 1fr;
    }
}
