/* ==========================================================================
   PAGE-SPECIFIC STYLES: REAL ESTATE (real-estate.css)
   Theme: Executive Navy Blue & Warm Caramel Gold
   ========================================================================== */

/* 1. Grid สำหรับ Icon Cards (Opportunities & What We Provide) */
.re-icon-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

.re-icon-card {
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--border-color, rgba(11, 19, 32, 0.08));
    border-radius: 12px;
    padding: 30px 20px;
    text-align: center;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
    transition: transform 0.3s, border-color 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.re-icon-card:hover {
    transform: translateY(-5px);
    border-color: var(--accent-gold, #C49765);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.re-icon-card svg {
    width: 32px;
    height: 32px;
    color: var(--primary-color, #0B1320);
    margin-bottom: 15px;
}

.re-icon-card p {
    font-size: 0.95rem;
    color: var(--primary-color, #0B1320);
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

/* 2. Grid สำหรับ Text Cards (Due Diligence & Solutions) */
.re-text-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-top: 30px;
}

.re-text-card {
    background: var(--bg-white, #ffffff);
    border: 1px solid var(--border-color, rgba(11, 19, 32, 0.08));
    border-radius: 12px;
    padding: 40px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02);
}

.re-text-card:hover {
    border-color: var(--accent-gold, #C49765);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.06);
    transform: translateY(-5px);
}

.re-text-card h4 {
    font-size: 1.15rem;
    color: var(--primary-color, #0B1320);
    margin-bottom: 15px;
}

.re-text-card p {
    font-size: 0.95rem;
    color: var(--text-muted, #5A6472);
    margin: 0;
    line-height: 1.6;
}

/* ==========================================================================
   🔥 3. FEATURED PROPERTY PORTFOLIOS (2x2 Grid)
   ========================================================================== */
.re-portfolio-grid {
    display: grid;
    /* 🔥 บังคับให้เป็น 2 คอลัมน์ สำหรับหน้าจอคอมพิวเตอร์ */
    grid-template-columns: repeat(2, 1fr);
    gap: 40px;
    /* เพิ่มช่องไฟให้ดูพรีเมียมขึ้น */
    margin-top: 30px;
    margin-bottom: 40px;
    width: 100%;
}

.re-portfolio-card {
    background-color: var(--bg-white, #ffffff);
    display: flex;
    flex-direction: column;
    border-radius: 16px;
    border: 1px solid var(--border-color, rgba(11, 19, 32, 0.08));
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
}

.re-portfolio-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 35px rgba(196, 151, 101, 0.15);
    border-color: var(--accent-gold, #C49765);
}

.re-portfolio-card img {
    width: 100%;
    /* ปรับความสูงรูปให้สมดุลกับความกว้างของการ์ด 2 คอลัมน์ */
    height: 300px;
    object-fit: cover;
    object-position: center;
    border-bottom: 3px solid var(--accent-gold, #C49765);
    /* เพิ่มลูกเล่นเส้นขอบทองใต้รูป */
    margin: 0;
}

.re-portfolio-info {
    padding: 35px;
    /* เพิ่ม Padding ให้อ่านง่ายขึ้น */
    display: flex;
    flex-direction: column;
    flex: 1;
    text-align: left;
}

.re-portfolio-info h4 {
    font-size: 1.35rem;
    /* ขยายฟอนต์หัวข้อขึ้นนิดนึง */
    font-weight: 700;
    color: var(--primary-color, #0B1320);
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.re-portfolio-info .subtitle {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--accent-gold, #C49765);
    margin-bottom: 20px;
    display: block;
}

.re-portfolio-info .desc {
    font-size: 0.95rem;
    color: var(--text-muted, #5A6472);
    line-height: 1.6;
    margin-bottom: 25px;
}

.re-portfolio-info ul {
    list-style-type: none;
    padding-left: 0;
    margin: 0;
    border-top: 1px dashed var(--border-color, rgba(11, 19, 32, 0.1));
    padding-top: 20px;
}

.re-portfolio-info ul li {
    font-size: 0.9rem;
    color: var(--text-dark, #333333);
    margin-bottom: 12px;
    line-height: 1.5;
    position: relative;
    padding-left: 18px;
}

.re-portfolio-info ul li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent-gold, #C49765);
    font-weight: bold;
}

/* 4. Timeline (Property Acquisition Process - 6 ขั้นตอน) */
.re-process-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 15px;
    margin-top: 40px;
    text-align: center;
}

.re-process-step {
    position: relative;
}

.re-process-num {
    width: 45px;
    height: 45px;
    background-color: var(--primary-color, #0B1320);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 auto 15px;
    position: relative;
    z-index: 2;
}

.re-process-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 22px;
    left: 50%;
    width: 100%;
    height: 2px;
    background-color: var(--border-color, rgba(11, 19, 32, 0.15));
    z-index: 1;
}

.re-process-step p {
    font-size: 0.95rem;
    color: var(--text-dark, #333333);
    line-height: 1.4;
    margin: 0;
    font-weight: 600;
}

/* ==========================================================================
   5. RESPONSIVE (TABLET & LAPTOP - สำหรับจอไม่เกิน 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
    .re-icon-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* บน Tablet ก็ยังคง 2 คอลัมน์ไว้ */
    .re-portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .re-process-grid {
        grid-template-columns: repeat(3, 1fr);
        row-gap: 40px;
    }

    .re-process-step:nth-child(3)::after {
        display: none;
    }
}

/* ==========================================================================
   🔥 6. REAL ESTATE MOBILE MASTER FIX (สำหรับจอมือถือไม่เกิน 768px)
   ========================================================================== */
@media (max-width: 768px) {

    /* --- 1. ป้องกันหน้าจอล้นแนวนอน 100% --- */
    body,
    html,
    main {
        overflow-x: hidden !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* --- 2. SAFE AREA (เว้นบน 100px พ้น Navbar + ซ้ายขวา 24px) --- */
    main,
    section,
    .hero-with-bg,
    [class*="-section"],
    [id*="section"] {
        padding-top: 100px !important;
        padding-bottom: 50px !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        height: auto !important;
        box-sizing: border-box !important;
    }

    .woxa-container,
    .re-icon-grid,
    .re-text-grid,
    .re-portfolio-grid,
    .re-process-grid {
        padding-left: 24px !important;
        padding-right: 24px !important;
        width: 100% !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    /* --- 3. ICON CARDS จัดเรียง 2 คอลัมน์พอดีจอ --- */
    .re-icon-grid {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }

    .re-icon-card {
        padding: 20px 12px !important;
        min-width: 0 !important;
        width: 100% !important;
    }

    .re-icon-card svg {
        width: 28px !important;
        height: 28px !important;
        margin-bottom: 10px !important;
    }

    .re-icon-card p {
        font-size: 0.85rem !important;
        line-height: 1.3 !important;
    }

    /* --- 4. TEXT CARDS เรียง 1 คอลัมน์ --- */
    .re-text-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .re-text-card {
        padding: 24px 20px !important;
        width: 100% !important;
    }

    /* --- 5. 🔥 PORTFOLIO CARDS (บังคับ 1 คอลัมน์ ไม่ล้นจอ) --- */
    .re-portfolio-grid {
        grid-template-columns: 1fr !important;
        gap: 25px !important;
    }

    .re-portfolio-card {
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .re-portfolio-card img {
        height: 220px !important;
        /* ความสูงรูปอสังหาฯ กำลังพอดีในมือถือ */
    }

    .re-portfolio-info {
        padding: 24px 20px !important;
    }

    .re-portfolio-info h4 {
        font-size: 1.25rem !important;
    }

    /* --- 6. PROCESS TIMELINE (ขั้นตอนการทำงานแบบการ์ดแนวนอน) --- */
    .re-process-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 16px !important;
        margin-top: 20px !important;
    }

    .re-process-step {
        display: flex !important;
        align-items: center !important;
        gap: 16px !important;
        text-align: left !important;
        width: 100% !important;
        background: #ffffff !important;
        padding: 18px 20px !important;
        border: 1px solid var(--border-color, rgba(11, 19, 32, 0.08)) !important;
        border-radius: 12px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02) !important;
        box-sizing: border-box !important;
    }

    .re-process-step:not(:last-child)::after {
        display: none !important;
    }

    .re-process-num {
        margin: 0 !important;
        flex-shrink: 0 !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 0.95rem !important;
        background-color: var(--accent-gold, #C49765) !important;
        /* เลขขั้นตอนสีทอง */
        color: #ffffff !important;
    }

    .re-process-step p {
        font-size: 0.92rem !important;
        line-height: 1.5 !important;
        margin: 0 !important;
    }

    /* --- 7. ปุ่ม CTA ทุกปุ่มอยู่ตรงกลางจออย่างสมดุล --- */
    .btn,
    .btn-primary,
    .btn-outline,
    [class*="btn-"] {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        margin: 20px auto 10px auto !important;
        width: fit-content !important;
        min-width: 220px !important;
        max-width: 90% !important;
    }
}