/* ==========================================================================
   My Real Estate Plugin Stylesheet (Responsive Supported)
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Single Property Layout & General
   -------------------------------------------------------------------------- */
.mre-single-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 15px;
    box-sizing: border-box;
}

.mre-single-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.mre-main-content {
    flex: 1 1 68%;
    min-width: 0; /* ป้องกัน Content ดันขอบ Layout */
}

.mre-sidebar {
    flex: 1 1 28%;
    min-width: 280px;
}

/* --------------------------------------------------------------------------
   2. Property Image Slider (สไลเดอร์รูปภาพ - Responsive)
   -------------------------------------------------------------------------- */
.mre-slider-wrapper {
    position: relative;
    width: 100%;
    max-height: 480px;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 25px;
    background: #111111;
}

.mre-slider-container {
    display: flex;
    width: 100%;
    height: 480px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

.mre-slider-container::-webkit-scrollbar {
    display: none;
}

.mre-slide-item {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    scroll-snap-align: start;
}

.mre-slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ปุ่มกดสไลเดอร์ ซ้าย-ขวา */
.mre-slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    transition: background 0.3s ease;
}

.mre-slider-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
}

.mre-arrow-prev { left: 15px; }
.mre-arrow-next { right: 15px; }

.mre-slider-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    z-index: 6;
}

/* --------------------------------------------------------------------------
   3. Sidebar Contact Info Card
   -------------------------------------------------------------------------- */
.mre-sidebar .mre-contact-card {
    background: #ffffff;
    padding: 24px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    border: 1px solid #e2e8f0;
}

.mre-contact-card h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.25rem;
    color: #1a202c;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.mre-line-btn {
    display: block;
    background-color: #06C755;
    color: #ffffff !important;
    padding: 12px 15px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    margin-top: 15px;
    text-align: center;
    transition: background-color 0.2s ease;
}

.mre-line-btn:hover {
    background-color: #05b34c;
}

/* --------------------------------------------------------------------------
   4. Search Form & Filters Layout (Base & Field Styling)
   -------------------------------------------------------------------------- */
.mre-search-form, 
.mre-filter-container,
form.mre-search-box {
    background-color: #ffffff;
    border-radius: 12px;
    box-sizing: border-box;
    width: 100%;
}

/* การจัดวางช่องค้นหาเป็น Grid ระบบอัตโนมัติ */
.mre-search-fields-grid,
.mre-search-form .form-row,
form.mre-search-box .mre-fields-wrapper {
    display: grid;
    gap: 15px;
    align-items: center;
}

/* ปรับแต่งช่อง Input / Select ทุกช่องรวมถึงช่องทำเล/ที่ตั้ง */
.mre-search-form input[type="text"],
.mre-search-form select,
.mre-filter-container input[type="text"],
.mre-filter-container select,
.mre-location-select,
.mre-location-input {
    width: 100%;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    padding: 11px 14px !important;
    background-color: #f8fafc !important;
    font-size: 15px !important;
    color: #334155 !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s ease, background-color 0.2s ease !important;
}

.mre-search-form input[type="text"]:focus,
.mre-search-form select:focus,
.mre-filter-container input[type="text"]:focus,
.mre-filter-container select:focus,
.mre-location-select:focus,
.mre-location-input:focus {
    border-color: #0073aa !important;
    background-color: #ffffff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15) !important;
}

/* ปุ่มค้นหา */
.mre-search-form button[type="submit"],
.mre-filter-container button[type="submit"],
.mre-search-btn {
    width: 100%;
    background: linear-gradient(135deg, #0073aa, #005177) !important;
    color: #ffffff !important;
    font-weight: bold !important;
    font-size: 16px !important;
    border: none !important;
    border-radius: 6px !important;
    padding: 12px 24px !important;
    cursor: pointer !important;
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.3) !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.mre-search-form button[type="submit"]:hover,
.mre-filter-container button[type="submit"]:hover,
.mre-search-btn:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 18px rgba(0, 115, 170, 0.4) !important;
}

/* --------------------------------------------------------------------------
   5. Desktop View (หน้าจอคอมพิวเตอร์ > 992px)
   -------------------------------------------------------------------------- */
@media (min-width: 992px) {
    .mre-search-form, 
    .mre-filter-container,
    form.mre-search-box {
        border: 2px solid #0073aa !important;
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12) !important;
        padding: 24px !important;
    }

    .mre-search-form:hover,
    .mre-filter-container:hover,
    form.mre-search-box:hover {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18) !important;
        border-color: #005177 !important;
    }

    /* จัดวางช่องค้นหาเป็นแนวนอนแบ่งตามจำนวนช่อง (รวมช่องทำเล) */
    .mre-search-fields-grid,
    .mre-search-form .form-row,
    form.mre-search-box .mre-fields-wrapper {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    }
}

/* --------------------------------------------------------------------------
   6. Tablet & Mobile View (หน้าจอมือถือและแท็บเล็ต < 991px)
   -------------------------------------------------------------------------- */
@media (max-width: 991px) {
    .mre-search-form, 
    .mre-filter-container,
    form.mre-search-box {
        border: 1px solid #cbd5e1 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05) !important;
        padding: 16px !important;
    }

    .mre-search-fields-grid,
    .mre-search-form .form-row,
    form.mre-search-box .mre-fields-wrapper {
        grid-template-columns: 1fr; /* เรียงเป็นแนวตั้ง 1 คอลัมน์สำหรับมือถือ */
        gap: 12px;
    }

    /* ปรับขนาดสไลเดอร์ให้เหมาะสมกับหน้าจอมือถือ */
    .mre-slider-wrapper,
    .mre-slider-container {
        height: 280px;
    }

    .mre-slider-arrow {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }

    .mre-main-content,
    .mre-sidebar {
        flex: 1 1 100%; /* แสดงผลแบบเต็มความกว้าง */
    }
}
/* ==========================================================================
   CSS สำหรับกล่องราคา (ราคาต่ำสุด - ราคาสูงสุด)
   ========================================================================== */

/* จัดกลุ่มช่องกรอกราคาให้วางแนวนอน */
.mre-search-form .mre-search-field input[type="number"] {
    width: 100% !important;
    height: 42px !important;
    padding: 8px 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 6px !important;
    background-color: #f8fafc !important;
    font-size: 14px !important;
    color: #334155 !important;
    box-sizing: border-box !important;
    transition: all 0.2s ease !important;
}

/* เอฟเฟกต์ตอนคลิกใช้งาน (Focus) */
.mre-search-form .mre-search-field input[type="number"]:focus {
    border-color: #0073aa !important;
    background-color: #ffffff !important;
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.15) !important;
}

/* หากต้องการให้ช่องราคาต่ำสุดและสูงสุดวางคู่กันในบรรทัดเดียว (ถ้าจัดโครงสร้าง Grid) */
@media (min-width: 768px) {
    /* ปรับให้ฟิลด์ค้นหาแสดงผลแบบ Grid สวยงามขึ้น (ถ้าโครงสร้างHTMLรองรับ) */
    .mre-search-form {
        display: flex;
        flex-wrap: wrap;
        gap: 12px;
        align-items: center;
        background: #ffffff;
        padding: 20px;
        border-radius: 10px;
        box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    }
    
    .mre-search-form .mre-search-field {
        flex: 1 1 180px;
        margin-bottom: 0 !important;
    }
}