/* CSS Reset & Variables */
:root {
    --color-primary: #fc5b08;
    --color-primary-hover: #e04f05;
    --color-secondary: #333333;
    --color-text-light: #666666;
    --color-bg-cream: #fffaf0;
    --color-glass-bg: rgba(255, 255, 255, 0.65);
    --color-glass-border: rgba(255, 255, 255, 0.8);
    --color-dark-bg: #111111;
    --color-white: #ffffff;
    --color-white-10: rgba(255, 255, 255, 0.1);
    --color-white-50: rgba(255, 255, 255, 0.5);

    --font-display: 'Kanit', serif;
    --font-sans: 'Inter', 'Kanit', sans-serif;
    --font-thai: 'Kanit', sans-serif;
}

/* ลบ Scrollbar ทุกจุดในหน้าเว็บ */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

*::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, Opera */
}

/* ค้นหา css body เดิม แล้วแก้เป็นแบบนี้ครับ */
body {
    font-family: var(--font-sans);
    font-weight: 200;
    /* 200 คือ ExtraLight */
    color: var(--color-secondary);
    width: 100%;
    height: 100%;

    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    position: relative;
    background-color: transparent;

    /* === เพิ่ม 2 บรรทัดนี้สำหรับ Fade In === */
    opacity: 0;
    /* เริ่มต้นด้วยการซ่อน */
    animation: fadeInPage 0.8s ease-out forwards;
    /* สั่งให้ค่อยๆ แสดง */
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* ห้ามมี Scrollbar เพราะเราจะให้พอดีเป๊ะ */
    background-color: transparent;
    /* ให้เห็นพื้นหลัง Modal หรือ Iframe */
}

/* === เพิ่ม keyframes นี้ที่ท้ายไฟล์ css ก็ได้ครับ === */
@keyframes fadeInPage {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.material-symbols-outlined {
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
}

/* Background Layers */
.bg-layer-image {
    position: fixed;
    inset: 0;
    z-index: -1;
    background-image: url('https://images.unsplash.com/photo-1464822759023-fed622ff2c3b?q=80&w=3540&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
    opacity: 0.1;
    pointer-events: none;
    display: none;
}

.bg-layer-gradient {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(to bottom right, rgba(255, 250, 240, 0.8), rgba(255, 255, 255, 0.4), rgba(252, 91, 8, 0.05));
    pointer-events: none;
}

/* Navbar - ซ่อนหรือย้ายไปอยู่มุม เพื่อไม่ให้กินพื้นที่การ์ด */
.navbar {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 20;
    width: 100%;
    padding: 1rem 2rem;
    display: none;
    /* ซ่อน Navbar ตามบริบทที่เน้นการ์ดกลางจอ */
}

/* Main Container - เป็น Wrapper จัดกลาง */
/* ================================================================= */
/* 1. Reset พื้นฐาน: บังคับหน้าเว็บให้สูงเต็ม 100% และไม่มี Scrollbar นอก */
/* ================================================================= */
html,
body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
    /* ห้าม Scrollbar ที่ขอบหน้าต่าง Modal */
    background-color: transparent;
}

.main-container {
    width: 100%;
    height: 100%;
    padding: 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

.glass-card {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    border-radius: 0 !important;
    /* ตัดขอบมนออก ให้ Iframe ของ index จัดการเอง */
    border: none !important;
    box-shadow: none !important;
    margin: 0 !important;

    display: flex;
    flex-direction: column;
    /* มือถือ: บน-ล่าง */
    background-color: var(--color-glass-bg);
    overflow: hidden;
    /* สำคัญ: ตัดส่วนเกินทิ้ง */
}

/* 4. จัดการ Layout ภายในให้ยืดตาม */
@media (min-width: 1024px) {
    .glass-card {
        flex-direction: row;
        /* แนวนอนสำหรับ Desktop */
    }

    /* 1. ปรับ Container ของฝั่งซ้ายให้เป็นจุดอ้างอิง (Relative) */
    /* 1. กล่องหลักฝั่งซ้าย (Showcase) - ต้องอยู่นอก Media Query */
    .project-showcase {
        position: relative;
        width: 100%;
        /* มือถือเต็มจอ */
        height: 35%;
        /* มือถือให้สูงแค่ 35% */
        flex-shrink: 0;
        /* ห้ามหด */
        overflow: hidden;
        z-index: 1;
    }

    /* ฝั่งฟอร์ม (ขวา) */
    .form-panel {
        height: 100%;
        /* ยืดความสูงเต็ม */
        flex-grow: 1;
        width: auto;
        border-radius: 0 !important;
        /* เอาความโค้งออกให้เชื่อมกันสนิท */
        overflow-y: auto;
        /* ถ้าเนื้อหาเยอะให้ Scroll เฉพาะส่วนฟอร์ม */
    }
}

/* 5. ปรับรูปภาพให้ยืดเต็มพื้นที่ */
.showcase-bg,
.project-image {
    position: absolute;
    inset: 0;
    /* ชิดขอบ บน ล่าง ซ้าย ขวา = 0 */
    width: 100% !important;
    height: 100% !important;
    object-fit: cover;
    /* ขยายรูปให้เต็มพื้นที่โดยไม่เสียสัดส่วน */
    object-position: center;
    z-index: 0;
    display: block;
}

.showcase-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Overlay สีดำ */
.image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
    z-index: 1;
    pointer-events: none;
}

/* เนื้อหาบนรูปภาพ */
.showcase-content {
    position: relative;
    z-index: 10;
    width: 100%;
    height: 100%;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    /* ดันเนื้อหา บน-ล่าง */
}

.badge-selected {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    background-color: rgba(252, 91, 8, 0.2);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(252, 91, 8, 0.3);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-primary);
    margin-bottom: 1rem;
}

.project-title {
    font-family: var(--font-display);
    font-size: 2rem;
    /* ลดขนาด Font */
    font-weight: 500;
    margin-bottom: 0.75rem;
    line-height: 1.1;
}

.project-desc {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.8rem;
    /* ลดขนาด Font */
    line-height: 1.4;
    max-width: 24rem;
    margin-bottom: 1.5rem;
    font-family: var(--font-thai);
}

.project-specs {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    /* ลด Gap */
}

.spec-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.spec-icon-box {
    width: 2.25rem;
    /* เล็กลง */
    height: 2.25rem;
    border-radius: 0.75rem;
    background-color: var(--color-white-10);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.spec-icon-box .material-symbols-outlined {
    font-size: 1rem;
}

.spec-label {
    font-size: 0.6rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--color-white-50);
}

.spec-value {
    font-size: 0.8rem;
    font-weight: 600;
}

/* ในไฟล์ Build_with_us.css */

.price-section {
    /* --- แก้ไข: ยึดตำแหน่งไว้ที่ด้านล่างสุดแบบถาวร --- */
    position: absolute;
    bottom: 2rem;  /* ระยะห่างจากขอบล่าง (เท่ากับ padding ของ showcase-content) */
    left: 2rem;    /* ระยะห่างจากซ้าย */
    right: 2rem;   /* ระยะห่างจากขวา */
    
    margin-top: 0; /* เอา margin เดิมออก */
    padding-top: 1.5rem;
    border-top: 1px solid var(--color-white-10);
    z-index: 20;   /* เพื่อให้แน่ใจว่าอยู่ชั้นบน */
}

.price-label {
    color: var(--color-white-50);
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.25rem;
}

.price-display {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}

.price-amount {
    font-size: 1.75rem;
    /* เล็กลง */
    font-family: var(--font-display);
    font-weight: 500;
}

.price-currency {
    font-size: 0.75rem;
    color: var(--color-white-50);
}

.price-note {
    font-size: 0.6rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 0.5rem;
    font-style: italic;
    font-weight: 300;
    font-family: var(--font-thai);
}

/* Right Panel: Form */
.form-panel {
    position: relative;
    width: 100%;
    height: 65%;
    /* มือถือ: เหลือพื้นที่ให้ฟอร์ม 65% */
    flex-grow: 1;
    background-color: rgba(255, 255, 255, 0.9);

    /* === จุดสำคัญ: จัดการ Scrollbar === */
    overflow-y: auto;
    /* ถ้าเนื้อหายาว (Step 3) ให้มี Scrollbar ขึ้นมาเอง */
    overflow-x: hidden;

    display: flex;
    flex-direction: column;
    padding: 2rem;
}

@media (min-width: 1024px) {
    .form-panel {
        width: 58%;
        /* แบ่งสัดส่วนที่เหลือ */
        height: 100%;
        /* Desktop: สูงเต็ม 100% */
        padding: 3rem;
    }
}

.step-header {
    margin-bottom: 1.5rem;
    /* ลดจาก 2.5rem */
    flex-shrink: 0;
}

.step-info {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 0.5rem;
}

.step-title {
    font-size: 1.25rem;
    /* เล็กลง */
    font-family: var(--font-display);
    font-weight: 500;
    color: var(--color-secondary);
}

.step-desc {
    font-size: 0.7rem;
    color: var(--color-text-light);
    margin-top: 0.1rem;
    font-family: var(--font-thai);
}

.step-count {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: 0.1em;
}

.progress-bar-track {
    height: 0.3rem;
    width: 100%;
    background-color: #e5e7eb;
    border-radius: 9999px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--color-primary);
    border-radius: 9999px;
    width: 66%;
}

/* Form Styles - Compact Mode */
.inquiry-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    /* ลด Gap ระหว่างหัวข้อ (สำคัญมากเพื่อลดความสูง) */
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    /* ลดระยะห่างระหว่าง Label กับ Input */
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    /* เล็กลง */
    font-weight: 700;
    color: var(--color-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-family: var(--font-thai);
}

.icon-primary {
    color: var(--color-primary);
    font-size: 1.1rem;
}

.input-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 768px) {
    .input-row {
        grid-template-columns: 1fr 1fr;
    }
}

.select-wrapper {
    position: relative;
}

.form-input {
    width: 100%;
    height: 2.75rem;
    /* ลดความสูง Input (จาก 3.5rem) */
    padding: 0 1rem;
    border-radius: 0.75rem;
    border: 1px solid #e5e7eb;
    background-color: #ffffff;
    font-size: 0.8rem;
    font-weight: 500;
    font-family: var(--font-thai);
    transition: all 0.2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus {
    box-shadow: 0 0 0 2px rgba(252, 91, 8, 0.2);
    border-color: var(--color-primary);
}

.select-arrow {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #9ca3af;
    font-size: 1.25rem;
}

/* Radio Buttons - Compact */
.radio-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .radio-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.radio-card {
    position: relative;
    cursor: pointer;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.card-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* ลด Padding ใน Card ย่อย */
    padding: 0.75rem 0.5rem;
    border-radius: 0.75rem;
    border: 2px solid #f3f4f6;
    background-color: #ffffff;
    transition: all 0.2s;
}

.radio-card:hover .card-content {
    background-color: #f9fafb;
}

.radio-card input:checked+.card-content {
    border-color: var(--color-primary);
    background-color: rgba(252, 91, 8, 0.05);
}

.card-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--color-secondary);
    font-family: var(--font-thai);
}

.card-subtitle {
    font-size: 0.6rem;
    color: var(--color-text-light);
    margin-top: 0.15rem;
    text-transform: uppercase;
}

/* Checkboxes - Compact */
.checkbox-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .checkbox-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.checkbox-card {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 0.75rem;
    /* ลด Padding */
    border-radius: 0.75rem;
    background-color: #ffffff;
    border: 1px solid #f3f4f6;
    cursor: pointer;
    transition: border-color 0.2s;
}

.checkbox-card:hover {
    border-color: rgba(252, 91, 8, 0.5);
}

.custom-checkbox {
    width: 1rem;
    height: 1rem;
    border-radius: 0.25rem;
    border: 1px solid #d1d5db;
    accent-color: var(--color-primary);
    cursor: pointer;
}

.checkbox-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--color-text-light);
    font-family: var(--font-thai);
}

/* Buttons */
.action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
}

@media (min-width: 640px) {
    .action-buttons {
        flex-direction: row;
    }
}

.btn-back {
    flex: 1;
    height: 3rem;
    /* ลดจาก 3.5rem */
    border-radius: 0.75rem;
    border: 2px solid #f3f4f6;
    background: transparent;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: var(--font-thai);
}

.btn-back:hover {
    background-color: #f9fafb;
}

.btn-next {
    flex: 2;
    height: 3rem;
    /* ลดจาก 3.5rem */
    border-radius: 0.75rem;
    background-color: var(--color-primary);
    border: none;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    font-family: var(--font-thai);
}

.btn-next:hover {
    background-color: var(--color-primary-hover);
}

.btn-next:active {
    transform: scale(0.98);
}

.btn-icon {
    font-size: 1rem;
    transition: transform 0.2s;
}

.btn-next:hover .btn-icon {
    transform: translateX(4px);
}

.contact-notice {
    text-align: center;
    font-size: 0.6rem;
    color: var(--color-text-light);
    margin-top: 1rem;
    font-weight: 500;
    font-family: var(--font-thai);
}


/* --- ส่วนเพิ่มใหม่: การจัดการ Animation ขยายรูปภาพ --- */

/* 1. ปุ่มลูกศร (เริ่มต้นซ่อนอยู่) */
.nav-arrows {
    position: absolute;
    inset: 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    z-index: 40;
    pointer-events: none;
    /* กดทะลุได้ตอนยังไม่โชว์ */
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.4s ease 0.2s, transform 0.4s ease 0.2s;
}

.arrow-btn {
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    pointer-events: auto;
    /* ให้กดปุ่มได้ */
}

.arrow-btn:hover {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* 2. ปรับ Layout Desktop ให้เป็น Flex เพื่อให้ขยาย Width ได้สมูท */
@media (min-width: 1024px) {
    .glass-card {
        flex-direction: row;
        /* เรียงแนวนอน */
        overflow: hidden;
        /* สำคัญ: ห้ามมีอะไรล้น */
    }

    .project-showcase {
        width: 42%;
        /* แบ่งสัดส่วนความกว้าง */
        height: 100%;
        /* Desktop: สูงเต็ม 100% แน่นอน */
        transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .form-panel {
        width: 58.333%;
        flex-grow: 1;
        transition: opacity 0.4s ease;
    }

    /* เมื่อขยาย: ปรับความกว้างเป็น 100% (ความสูง 100% จะคงเดิมจากด้านบน) */
    .glass-card.is-expanded .project-showcase {
        width: 100%;
    }

    .glass-card.is-expanded .form-panel {
        opacity: 0;
        pointer-events: none;
        width: 0; /* ซ่อนความกว้างเมื่อรูปขยาย */
        padding: 0;
    }

    .glass-card.is-expanded .nav-arrows {
        opacity: 1;
        /* โชว์ลูกศร */
        transform: scale(1);
    }
}

/* 4. สั่งซ่อนข้อความเมื่อขยาย (เพิ่ม .cost-summary-list เข้าไป) */
/* ตั้งค่า Default Transition ให้ Element เหล่านี้ */
.project-title,
.project-desc,
.project-specs,
.badge-selected,
.cost-summary-list {
    /* <--- เพิ่มตรงนี้ */
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
    opacity: 1;
    transform: translateY(0);
}

/* เมื่อขยาย ให้ซ่อน (Fade Out & Slide Up) */
.glass-card.is-expanded .project-title,
.glass-card.is-expanded .project-desc,
.glass-card.is-expanded .project-specs,
.glass-card.is-expanded .badge-selected,
.glass-card.is-expanded .cost-summary-list {
    /* <--- เพิ่มตรงนี้ */
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: none;
}

