/**
 * Batdongsan24h.net - Home Features Styles (Phase 2)
 * Quick Categories, Featured Properties (VIP/HOT), 3 Utility Widgets
 */

/* ==========================================================================
   1. GLOBAL CONTAINER & LAYOUT FOR HOME
   ========================================================================== */
.dx-home-container {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* Section Title & Header */
.dx-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 14px;
}
.dx-section-title {
    font-size: 22px;
    font-weight: 800;
    color: #0e2638;
    margin: 0;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-family: -apple-system, BlinkMacSystemFont, "Roboto", "Segoe UI", sans-serif;
}
.dx-section-title-icon {
    width: 22px;
    height: 22px;
    color: #0f4c3a;
}
.dx-section-link-more {
    font-size: 14px;
    font-weight: 600;
    color: #0f4c3a;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    transition: color 0.15s, transform 0.15s;
}
.dx-section-link-more:hover {
    color: #007749;
    transform: translateX(3px);
    text-decoration: none;
}

/* ==========================================================================
   2. QUICK CATEGORIES STRIP
   ========================================================================== */
.dx-quick-cats-section {
    position: relative;
    margin-top: -36px;
    margin-bottom: 40px;
    z-index: 10;
}
.dx-quick-cats-grid {
    display: grid;
    grid-template-columns: repeat(10, 1fr);
    gap: 10px;
    box-sizing: border-box;
}
.dx-quick-cat-item {
    background: #ffffff;
    border: 1px solid #eef2f6;
    border-radius: 14px;
    padding: 14px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 9px;
    text-decoration: none;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
}
.dx-quick-cat-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.09);
    border-color: #cbd5e1;
    text-decoration: none;
}
.dx-quick-cat-icon-wrap {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}
.dx-quick-cat-item:hover .dx-quick-cat-icon-wrap {
    transform: scale(1.08);
}
.dx-quick-cat-icon {
    width: 22px;
    height: 22px;
}
.dx-quick-cat-label {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
    line-height: 1.25;
    white-space: nowrap;
}

/* Icon Palette Variants */
.dx-qc-canho { background-color: #e8f5e9; color: #2e7d32; }
.dx-qc-nhadat { background-color: #fff3e0; color: #e65100; }
.dx-qc-nhapho { background-color: #ffebee; color: #c62828; }
.dx-qc-bietthu { background-color: #e0f2f1; color: #00695c; }
.dx-qc-datnen { background-color: #fff8e1; color: #f57f17; }
.dx-qc-vanphong { background-color: #e3f2fd; color: #1565c0; }
.dx-qc-matbang { background-color: #f3e5f5; color: #6a1b9a; }
.dx-qc-bando { background-color: #e0f7fa; color: #00838f; }
.dx-qc-sosanh { background-color: #ede7f6; color: #4527a0; }
.dx-qc-khoanvay { background-color: #e8f8f5; color: #0f4c3a; }

/* ==========================================================================
   3. FEATURED PROPERTIES (BẤT ĐỘNG SẢN NỔI BẬT)
   ========================================================================== */
.dx-featured-section {
    margin-bottom: 48px;
}
/* Filter Tabs */
.dx-featured-tabs {
    display: flex;
    align-items: center;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0;
}
.dx-featured-tab-btn {
    border: none;
    background: #f1f5f9;
    color: #475569;
    font-size: 13.5px;
    font-weight: 600;
    padding: 7px 18px;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.2s ease;
    outline: none;
}
.dx-featured-tab-btn:hover {
    background: #e2e8f0;
    color: #1e293b;
}
.dx-featured-tab-btn.is-active {
    background: #0f4c3a;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(15, 76, 58, 0.25);
}

/* Swiper Container & Grid */
.dx-featured-swiper-wrap {
    position: relative;
}
.dx-featured-swiper {
    width: 100%;
    padding: 6px 2px 14px;
}

/* Property Card */
.dx-bds-card {
    background: #ffffff;
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid #eef2f6;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    height: 100%;
    box-sizing: border-box;
}
.dx-bds-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
    border-color: #cbd5e1;
}

/* Card Thumbnail */
.dx-bds-thumb-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 10;
    height: 180px;
    max-height: 200px;
    overflow: hidden;
    background-color: #e2e8f0;
}
.dx-bds-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}
.dx-bds-card:hover .dx-bds-thumb {
    transform: scale(1.06);
}

/* Badges */
.dx-bds-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 3px 9px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #ffffff;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}
.dx-bds-badge-vip {
    background: linear-gradient(135deg, #ce050d 0%, #e11d48 100%);
}
.dx-bds-badge-hot {
    background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

/* Save Heart Button */
.dx-bds-save-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(4px);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s ease;
    z-index: 2;
}
.dx-bds-save-btn:hover,
.dx-bds-save-btn.is-saved {
    background: #ffffff;
    color: #ce050d;
    transform: scale(1.1);
}
.dx-bds-save-btn .re-icon {
    width: 15px;
    height: 15px;
}

/* Card Body */
.dx-bds-body {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    box-sizing: border-box;
}
.dx-bds-title {
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
    line-height: 1.4;
    margin: 0 0 8px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-decoration: none;
    transition: color 0.15s;
}
.dx-bds-title:hover {
    color: #ce050d;
    text-decoration: none;
}
.dx-bds-location {
    font-size: 13px;
    color: #64748b;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dx-bds-location .re-icon {
    width: 13px;
    height: 13px;
    color: #94a3b8;
    flex-shrink: 0;
}

/* Specs Row */
.dx-bds-specs {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 12.5px;
    color: #475569;
    padding-top: 10px;
    border-top: 1px dashed #e2e8f0;
    margin-top: auto;
}
.dx-bds-spec-item {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.dx-bds-spec-item .re-icon {
    width: 14px;
    height: 14px;
    color: #64748b;
}

/* Price Row */
.dx-bds-price-row {
    margin-top: 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.dx-bds-price {
    font-size: 18px;
    font-weight: 800;
    color: #ce050d;
    font-family: -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
}

/* Swiper Next / Prev Buttons */
.dx-swiper-nav-btn {
    position: absolute;
    top: 42%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1e293b;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s ease;
}
.dx-swiper-nav-btn:hover {
    background: #0f4c3a;
    color: #ffffff;
    border-color: #0f4c3a;
}
.dx-swiper-prev { left: -16px; }
.dx-swiper-next { right: -16px; }
.dx-swiper-nav-btn.swiper-button-disabled {
    opacity: 0;
    pointer-events: none;
}

/* ==========================================================================
   4. THREE UTILITY WIDGETS
   ========================================================================== */
.dx-widgets-section {
    margin-bottom: 50px;
}
.dx-widgets-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1.25fr;
    gap: 20px;
    box-sizing: border-box;
}

/* Widget Card Base */
.dx-widget-card {
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.05);
}
.dx-widget-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.1);
}

/* Widget 1: Bản đồ BĐS */
.dx-widget-map {
    background: linear-gradient(135deg, #e8f5e9 0%, #f1f8e9 100%);
    border: 1px solid #c8e6c9;
    padding: 24px;
    min-height: 220px;
}
.dx-widget-map-graphic {
    position: absolute;
    right: 14px;
    bottom: 14px;
    width: 110px;
    height: 110px;
    opacity: 0.85;
    pointer-events: none;
}
.dx-widget-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    color: #0f4c3a;
    background: rgba(255, 255, 255, 0.85);
    padding: 4px 10px;
    border-radius: 6px;
    margin-bottom: 10px;
    width: fit-content;
}
.dx-widget-title {
    font-size: 19px;
    font-weight: 800;
    color: #0e2638;
    margin: 0 0 6px 0;
    line-height: 1.3;
}
.dx-widget-desc {
    font-size: 13.5px;
    color: #475569;
    margin: 0 0 20px 0;
    line-height: 1.4;
    max-width: 220px;
}
.dx-widget-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 9px 18px;
    border-radius: 999px;
    font-size: 13.5px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.18s ease;
    width: fit-content;
}
.dx-widget-btn-primary {
    background: #0f4c3a;
    color: #ffffff !important;
}
.dx-widget-btn-primary:hover {
    background: #007749;
    color: #ffffff !important;
    text-decoration: none;
}

/* Widget 2: Dự án nổi bật */
.dx-widget-project {
    position: relative;
    padding: 24px;
    min-height: 220px;
    color: #ffffff;
    background-size: cover;
    background-position: center;
}
.dx-widget-project-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(14, 38, 56, 0.3) 0%, rgba(14, 38, 56, 0.85) 100%);
    z-index: 1;
}
.dx-widget-project-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
}
.dx-widget-project .dx-widget-title {
    color: #ffffff;
}
.dx-widget-project .dx-widget-desc {
    color: #cbd5e1;
    max-width: 100%;
}
.dx-widget-btn-glass {
    background: rgba(255, 255, 255, 0.22);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff !important;
}
.dx-widget-btn-glass:hover {
    background: #ffffff;
    color: #0e2638 !important;
    text-decoration: none;
}

/* Widget 3: Máy tính khoản vay mua nhà (Mortgage Calculator) */
.dx-widget-calc {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    padding: 20px 22px;
}
.dx-calc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}
.dx-calc-title {
    font-size: 16px;
    font-weight: 750;
    color: #0e2638;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
}
.dx-calc-title .re-icon {
    width: 18px;
    height: 18px;
    color: #0f4c3a;
}
.dx-calc-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.dx-calc-field-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.dx-calc-label {
    font-size: 11.5px;
    font-weight: 600;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin: 0;
}
.dx-calc-input,
.dx-calc-select {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    font-size: 13.5px;
    font-weight: 600;
    color: #1e293b;
    outline: none;
    transition: border-color 0.15s, background-color 0.15s;
    box-sizing: border-box;
}
.dx-calc-input:focus,
.dx-calc-select:focus {
    border-color: #0f4c3a;
    background: #ffffff;
}
.dx-calc-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* Result Box */
.dx-calc-result-box {
    background: linear-gradient(135deg, #e8f8f5 0%, #e0f2f1 100%);
    border: 1px solid #b2dfdb;
    border-radius: 12px;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 4px;
}
.dx-calc-result-left {
    display: flex;
    flex-direction: column;
}
.dx-calc-result-label {
    font-size: 12px;
    color: #00695c;
    font-weight: 600;
}
.dx-calc-result-value {
    font-size: 18px;
    font-weight: 800;
    color: #0f4c3a;
    font-family: -apple-system, BlinkMacSystemFont, "Roboto", sans-serif;
}
.dx-calc-result-sub {
    font-size: 11px;
    color: #64748b;
}
.dx-calc-icon-graphic {
    width: 32px;
    height: 32px;
    color: #007749;
    flex-shrink: 0;
}
