/* ================================
   WP Rentals - Frontend Styles
   ================================ */

/* ==== BOX CHUNG ==== */
.wpr-property-box {
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 18px 22px;
    margin-top: 25px;
    background: #fff;
    box-shadow: 0 3px 8px rgba(0,0,0,0.06);
}

/* ==== TIÊU ĐỀ ==== */
.wpr-section-title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 14px;
    border-left: 4px solid #0073aa;
    padding-left: 10px;
    color: #222;
}

/* ==== GRID THUỘC TÍNH ==== */
.wpr-property-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 14px 20px;
    background: #fff;
    padding: 18px;
    border: 1px solid #eee;
    border-radius: 10px;
    margin-bottom: 20px;
}

.wpr-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fafafa;
    border: 1px solid #f2f2f2;
    transition: all 0.2s ease;
}

.wpr-item:hover {
    background: #f0f8ff;
    transform: translateY(-1px);
}

.wpr-icon {
    font-size: 18px;
    width: 28px;
    text-align: center;
    opacity: 0.85;
}

.wpr-label {
    font-weight: 500;
    color: #555;
    min-width: 160px;
    white-space: nowrap;
}

.wpr-value {
    font-weight: 600;
    color: #111;
    word-break: break-word;
}

/* ==== LIÊN HỆ ==== */
.wpr-contact {
    margin-top: 18px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Ẩn 1 phần số điện thoại */
.wpr-phone-hidden,
.wpr-phone-number {
    font-weight: 600;
    color: #0073aa;
    background: #f7f7f7;
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #e2e2e2;
    display: inline-block;
    width: fit-content;
}

.wpr-show-phone {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 9px 18px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease;
    font-weight: 500;
    width: fit-content;
}

.wpr-show-phone:hover {
    background: #005d88;
    transform: scale(1.02);
}

/* ==== NÚT HÀNH ĐỘNG ==== */
.wpr-actions {
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.wpr-actions button {
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 14px;
    cursor: pointer;
    transition: background 0.25s, transform 0.1s;
    font-size: 14px;
}

.wpr-actions button:hover {
    background: #005d88;
    transform: translateY(-1px);
}

.wpr-actions button.wpr-favorite.active {
    background: #ff4d6d;
}

/* ==== CHIA SẺ ==== */
.wpr-share {
    font-size: 14px;
    color: #555;
}

.wpr-share span {
    font-weight: 500;
}

.wpr-share a {
    color: #0073aa;
    text-decoration: none;
    margin: 0 4px;
}

.wpr-share a:hover {
    text-decoration: underline;
}

/* ==== PHẢN HỒI ==== */
.wpr-feedback {
    margin-top: 22px;
    background: #fafafa;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid #eee;
}

.wpr-feedback-btn {
    background: #eee;
    border: none;
    padding: 6px 12px;
    margin-right: 8px;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.wpr-feedback-btn:hover {
    background: #ddd;
}

/* ==== BẢN ĐỒ - BLOCK RIÊNG ==== */
.wpr-map-section {
    margin-top: 40px;
    padding: 20px;
    background: #fff;
    border-radius: 12px;
    border: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}

.wpr-map-section h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #222;
    margin-bottom: 14px;
    border-left: 4px solid #0073aa;
    padding-left: 10px;
}

.wpr-map-section #wpr-map {
    width: 100%;
    height: 400px;
    border-radius: 10px;
    overflow: hidden;
}

/* ==== TIN TƯƠNG TỰ ==== */
.wpr-similar {
    margin-top: 32px;
    border-top: 2px solid #eee;
    padding-top: 18px;
}

.wpr-similar h3 {
    font-size: 1.15rem;
    margin-bottom: 10px;
    font-weight: 600;
    color: #222;
}

.wpr-similar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.wpr-similar li {
    padding: 5px 0;
}

.wpr-similar a {
    color: #0073aa;
    text-decoration: none;
    transition: color 0.2s;
}

.wpr-similar a:hover {
    color: #005d88;
    text-decoration: underline;
}

/* ==== MODAL BẢN ĐỒ ==== */
#wpr-map-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 9999;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

#wpr-map-modal .wpr-map-wrapper {
    background: #fff;
    border-radius: 10px;
    max-width: 600px;  /* 👉 Chiều rộng tối đa */
    width: 50%;
    height: 50vh;      /* 👉 Chiều cao hiện tại là 70% chiều cao màn hình */
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}


#wpr-map {
    width: 100%;
    height: 100px;
    border-radius: 10px;
}

.wpr-map-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #ff4d4d;
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    font-size: 18px;
    line-height: 32px;
    text-align: center;
    cursor: pointer;
    transition: background 0.25s ease;
}

.wpr-map-close:hover {
    background: #d93636;
}

/* ==== RESPONSIVE ==== */
@media (max-width: 600px) {
    .wpr-label {
        min-width: 120px;
    }
    .wpr-item {
        flex-wrap: wrap;
    }
    .wpr-phone-number {
        font-size: 0.95rem;
    }
    #wpr-map-modal .wpr-map-wrapper {
        height: 60vh;
    }
}

/* ==== TOAST THÔNG BÁO ==== */
.wpr-toast {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background: #0073aa;
    color: #fff;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 10000;
    display: none;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ====== THÔNG TIN BẤT ĐỘNG SẢN — BOX CĂN TRÁI ====== */
.wpr-property-box {
    background: #fff;
    border: 1px solid #e6e6e6;
    border-radius: 14px;
    padding: 25px 28px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.05);
    margin-top: 30px;
    margin-bottom: 40px;
    max-width: 730px;
    text-align: left;
    
    /* 🔹 Căn bên trái trang */
    margin-left: 0; 
    margin-right: auto;
}

/* Tiêu đề */
.wpr-property-header h2 {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Các dòng thông tin */
.wpr-property-details {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.wpr-detail {
    padding: 10px 0;
    font-size: 15px;
    color: #333;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    gap: 6px;
    align-items: center;
}

.wpr-detail:last-child {
    border-bottom: none;
}

.wpr-detail span {
    color: #666;
    font-weight: 500;
    min-width: 180px; /* cố định cột nhãn */
}

.wpr-detail strong {
    color: #111;
    font-weight: 600;
}

/* Hiệu ứng hover nhẹ */
.wpr-detail:hover {
    background: #fafcff;
    transition: background 0.2s ease;
}

/* Responsive cho mobile */
@media (max-width: 768px) {
    .wpr-property-box {
        max-width: 100%;
        margin: 20px 0;
    }

    .wpr-detail {
        flex-direction: column;
        align-items: flex-start;
    }

    .wpr-detail span {
        min-width: unset;
    }
}


/* ==== THANH NGƯỜI DÙNG ==== */
.wpr-user-toolbar {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #fff;
    border-radius: 12px;
    padding: 10px 16px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
}

.wpr-user-toolbar .wpr-btn {
    background: #0073aa;
    color: #fff;
    padding: 6px 12px;
    border-radius: 6px;
    text-decoration: none;
    transition: background 0.2s ease;
}

.wpr-user-toolbar .wpr-btn:hover {
    background: #005d88;
}

.wpr-user-toolbar .logout {
    background: #ff4d4d;
}

.wpr-user-toolbar .login {
    background: #28a745;
}

.wpr-user-welcome {
    color: #333;
    font-weight: 500;
}

.wpr-card-thumb {
    width: 100%;
    padding-top: 100%; /* tạo tỉ lệ 1:1 */
    position: relative;
    overflow: hidden;
    border-radius: 8px; /* bo góc nếu muốn */
}

.wpr-card-thumb img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    object-fit: cover; /* 🔹 đảm bảo ảnh phủ đầy khung và cắt dư nếu cần */
    transform: translate(-50%, -50%);
}

/* ==== CỐ ĐỊNH TỈ LỆ ẢNH CHỈ TRONG GRID VIEW ==== */
.wpr-filter-results.view-grid .wpr-thumb {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1; /* 🟢 tạo khung vuông 1:1 */
    overflow: hidden;
    border-radius: 10px;
    background: #f9f9f9;
}

.wpr-filter-results.view-grid .wpr-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Container chứa số điện thoại và nút */
.wpr-phone-row {
    display: flex;
    align-items: stretch; /* ✅ Giúp 2 phần tử cao bằng nhau */
    gap: 10px;
    flex-wrap: wrap;
}

/* Ô số điện thoại */
.wpr-phone-number {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f7f7f7;
    padding: 0 14px; /* bỏ padding top/bottom, chỉ giữ ngang */
    border-radius: 6px;
    border: 1px solid #e2e2e2;
    font-weight: 600;
    color: #0073aa;
    min-height: 42px; /* ✅ đảm bảo chiều cao đồng đều */
}

/* Nút “Hiện SĐT” */
.wpr-show-phone {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 0 18px; /* bỏ padding top/bottom, chỉ giữ ngang */
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s ease, transform 0.15s ease;
    min-height: 42px; /* ✅ bằng với ô số điện thoại */
}

/* ===== LIÊN HỆ TRÊN CÙNG HÀNG ===== */
.wpr-contact-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 14px;
	margin-bottom: 12px;
}

.wpr-contact-header .wpr-subtitle {
	margin: 0;
	font-size: 1.2rem;
	font-weight: 600;
	color: #222;
	display: flex;
	align-items: center;
	gap: 6px;
}

/* Ô số điện thoại và nút hiện — Căn đều chiều cao */
.wpr-phone-inline {
	display: flex;
	align-items: center;
	gap: 8px;
}

.wpr-phone-number {
	background: #f7f7f7;
	padding: 0 14px; /* bỏ padding dọc */
	border-radius: 6px;
	border: 1px solid #ddd;
	color: #0073aa;
	font-weight: 600;
	height: 40px; /* ✅ đồng nhất chiều cao */
	display: flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
}

.wpr-show-phone {
	background: #0073aa;
	color: #fff;
	border: none;
	padding: 0 14px;
	border-radius: 6px;
	cursor: pointer;
	font-weight: 500;
	height: 40px; /* ✅ cùng chiều cao */
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.25s ease, transform 0.15s ease;
	box-sizing: border-box;
}

.wpr-show-phone:hover {
	background: #005d88;
	transform: scale(1.02);
}


/* Các nút hành động */
.wpr-contact-header .wpr-favorite,
.wpr-contact-header .wpr-report {
	background: #0073aa;
	color: #fff;
	border: none;
	border-radius: 6px;
	padding: 0 14px;
	cursor: pointer;
	font-weight: 500;
	min-height: 38px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.25s, transform 0.1s;
}

.wpr-contact-header .wpr-favorite:hover,
.wpr-contact-header .wpr-report:hover {
	background: #005d88;
	transform: translateY(-1px);
}

.wpr-contact-header .wpr-favorite.active {
	background: #ff4d6d;
}

/* Mobile */
@media (max-width: 768px) {
	.wpr-contact-header {
		flex-direction: column;
		align-items: flex-start;
	}
	.wpr-phone-inline {
		width: 100%;
	}
}

/* ===============================
   📱 Responsive chỉ cho phần chi tiết BĐS (bên dưới tiêu đề)
   =============================== */

/* Giữ bố cục gọn và co giãn linh hoạt */
.wpr-property-details {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* Mỗi dòng thông tin */
.wpr-detail {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f0;
	color: #333;
	font-size: 15px;
}

.wpr-detail:last-child {
	border-bottom: none;
}

/* Cột nhãn (bên trái) */
.wpr-detail span {
	min-width: 180px;
	color: #666;
	font-weight: 500;
	white-space: nowrap;
}

/* Cột giá trị (bên phải) */
.wpr-detail strong {
	color: #111;
	font-weight: 600;
	word-break: break-word;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
	.wpr-property-details {
		gap: 6px;
	}

	.wpr-detail {
		flex-direction: column;  /* ✅ Xuống hàng khi màn hình nhỏ */
		align-items: flex-start;
		padding: 8px 0;
	}

	.wpr-detail span {
		min-width: unset;        /* bỏ cố định độ rộng */
		font-weight: 600;
		color: #333;
	}

	.wpr-detail strong {
		font-weight: 500;
		color: #111;
	}
}

/* ===============================
   ⚙️ Fix layout phần chi tiết BĐS
   =============================== */

/* Khung chứa chi tiết */
.wpr-property-details {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

/* Mỗi dòng thông tin (2 cột) */
.wpr-detail {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 10px;
	padding: 10px 0;
	border-bottom: 1px solid #f0f0f0;
	color: #333;
	font-size: 15px;
	flex-wrap: nowrap; /* ✅ giữ trên cùng 1 hàng */
}

/* Cột nhãn (trái) */
.wpr-detail span {
	display: inline-block;
	min-width: 180px;
	color: #666;
	font-weight: 500;
	white-space: nowrap; /* ✅ không xuống dòng */
}

/* Cột giá trị (phải) */
.wpr-detail strong {
	color: #111;
	font-weight: 600;
	word-break: break-word;
}

/* Dòng cuối bỏ gạch */
.wpr-detail:last-child {
	border-bottom: none;
}

/* ===== Responsive: chỉ áp dụng khi màn hình nhỏ thật sự ===== */
@media (max-width: 768px) {
	.wpr-detail {
		flex-direction: column; /* ✅ chỉ xuống hàng ở mobile */
		align-items: flex-start;
		gap: 4px;
	}

	.wpr-detail span {
		min-width: unset;
		white-space: normal;
	}

	.wpr-detail strong {
		display: block;
	}
}

/* ⚙️ Giữ nhãn và giá trị cùng hàng trên mobile */
@media (max-width: 768px) {
    .wpr-detail {
        flex-direction: row !important; /* ép về cùng hàng */
        align-items: center !important;
        flex-wrap: nowrap !important;
        gap: 6px;
    }

    .wpr-detail span {
        white-space: nowrap; /* không cho nhãn xuống dòng */
        min-width: 110px; /* thu hẹp để vừa màn hình nhỏ */
    }

    .wpr-detail strong {
        flex: 1; /* phần giá trị co giãn để tránh tràn */
        word-break: break-word;
    }
}

.wpr-contact-header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.wpr-phone-inline {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wpr-contact-header button,
.wpr-phone-inline button {
    margin: 0; /* tránh đẩy lệch */
}
