/* =========================================================================
     🌌 1. GLOBAL STYLES & MINIMALIST FONTS
     ========================================================================= */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600&family=Prompt:wght@300;400;500;600&display=swap');

* {
    touch-action: manipulation; /* บล็อกการซูมจากการกดย้ำๆ ในระดับเบราว์เซอร์ */
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 30px 15px;
    font-family: 'Inter', 'Prompt', -apple-system, sans-serif;
    background: url('images/bg.jpg') center/cover fixed no-repeat;
    color: #334155; 
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.65), rgba(244,247,254,0.55));
    z-index: -1;
}

.main-container {
    width: 100%;
    max-width: 950px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* =========================================================================
     🏡 2. HERO SECTION STYLES
     ========================================================================= */
.hero {
    width: 100%;
    max-width: 600px;
    text-align: center;
    margin-bottom: 25px;
}

.hero-box {
    width: 100%;
    padding: 20px 15px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.6);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.04);
}

.hero h1 {
    font-size: 42px; 
    margin: 0 0 6px 0;
    font-weight: bold;
    font-family: "Georgia", "Times New Roman", serif; 
    background: linear-gradient(90deg, #1877F2, #00ba71);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero .sub-title {
    margin: 0;
    font-size: 11px;
    letter-spacing: 3px;
    color: #64748b;
    font-weight: bold;
    font-family: "Georgia", "Times New Roman", serif; 
}

/* =========================================================================
     📅 3. CALENDAR TOP SECTION
     ========================================================================= */
.calendar-top-section {
    width: 100%;
    max-width: 950px;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 12px; 
}

.calendar-title { 
    font-size: 18px; 
    color: #1e293b; 
    margin: 0 0 12px 0; 
    text-align: center;
    font-weight: 500;
}

.calendar {
    width: 100%;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(15px);
    border-radius: 24px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

iframe { 
    width: 100%; 
    height: 420px; 
    border: none; 
    border-radius: 16px; 
}

/* =========================================================================
     💎 4. BOTTOM SPLIT LAYOUT
     ========================================================================= */
.bottom-split-layout {
    display: flex;
    flex-direction: column; 
    align-items: center;
    gap: 15px; 
    width: 100%;
    max-width: 950px;
    margin-bottom: 35px;
}

.info-card-left {
    width: 100%;
    padding: 20px;
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.55);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid transparent;
    background-clip: padding-box;
    position: relative;
    display: flex;
    flex-direction: column;
}

.info-card-left::after {
    content: '';
    position: absolute;
    top: -1px; bottom: -1px; left: -1px; right: -1px;
    background: linear-gradient(135deg, #1877F2, rgba(255,255,255,0.5), #00ba71); 
    border-radius: 24px;
    z-index: -1;
    opacity: 0.35; 
}

.info-card-left h2 { 
    margin: 0 0 12px 0; 
    font-size: 15px; 
    color: #1e293b; 
    font-weight: 500;
    text-align: center;
}

.price-list {
    display: flex;
    flex-direction: row; 
    gap: 10px;
    width: 100%;
    justify-content: center;
}

.info-card-left p {
    flex: 1;
    background: rgba(255, 255, 255, 0.65);
    margin: 0;
    padding: 12px 10px;
    border-radius: 14px; 
    display: flex;
    flex-direction: column; 
    justify-content: center;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #475569;
    border: 1px solid rgba(255, 255, 255, 0.4);
    text-align: center;
}

.info-card-left b { 
    font-size: 15px; 
    color: #0f172a; 
    font-weight: 600;
}

.info-card-right-noborder {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.info-card-right-noborder h2 {
    margin: 0 0 10px 0; 
    font-size: 15px; 
    color: #1e293b; 
    font-weight: 500;
    text-align: center;
}

.btn-group-row {
    display: flex;
    flex-direction: row; 
    gap: 8px;
    width: 100%;
    max-width: 600px; 
    justify-content: center;
}

.btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 10px;
    border-radius: 14px; 
    font-weight: 500;
    font-size: 13px;
    text-decoration: none;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.btn.fb { background: rgba(255, 255, 255, 0.75); color: #1877F2; border: 1px solid rgba(24, 119, 242, 0.15); box-shadow: 0 4px 10px rgba(24, 119, 242, 0.02); }
.btn.line { background: rgba(255, 255, 255, 0.75); color: #06C755; border: 1px solid rgba(6, 199, 85, 0.15); box-shadow: 0 4px 10px rgba(6, 199, 85, 0.02); }
.btn.phone { background: rgba(255, 255, 255, 0.75); color: #334155; border: 1px solid rgba(51, 65, 85, 0.15); box-shadow: 0 4px 10px rgba(51, 65, 85, 0.02); }
.btn.map { background: rgba(255, 255, 255, 0.75); color: #ea4335; border: 1px solid rgba(234, 67, 53, 0.15); box-shadow: 0 4px 10px rgba(234, 67, 53, 0.02); }

.btn:hover {
    transform: translateY(-2px);
    background: #ffffff;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.05);
}

/* =========================================================================
     📸 5. MEDIA WORKSPACE ROW
     ========================================================================= */
.media-workspace-row {
    width: 100%;
    display: flex;
    flex-direction: row;
    gap: 20px;
    margin-top: 10px;
    margin-bottom: 30px;
    align-items: stretch;
    height: 480px; /* 🛠️ บังคับความสูงรวมบน PC ให้พอดีสายตา ไม่ใหญ่เกินไป */
}

.slider-container-box {
    flex: 1.5; /* 🛠️ สัดส่วนฝั่งซ้าย (ปรับเพิ่ม/ลดความกว้างตรงนี้ได้ตามชอบ) */
    display: flex;
    flex-direction: column;
    height: 100%;
}

.slider-wrapper {
    width: 100%;
    height: 100%; /* 🛠️ ให้สูงพอดีตามตัวแม่ 480px */
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    box-shadow: 0 8px 24px rgba(148, 163, 184, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.6);
}

/* บังคับรูปข้างในให้ขยายเต็มกรอบสวยงาม */
.slide-item img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* เต็มกรอบ ไม่มีขอบขาว */
    border-radius: 20px;
}

.gallery-slider {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory; 
    scroll-behavior: smooth;
    width: 100%;
    height: 100%;
    padding: 0 40px 0 0; 
    -ms-overflow-style: none;  
    scrollbar-width: none;  
}

.gallery-slider::-webkit-scrollbar { display: none; }

.slide-item {
    flex: 0 0 100%; 
    width: 100%;
    height: 100%;
    scroll-snap-align: start; 
    scroll-snap-stop: always;
    padding-right: 10px; 
}

.gallery-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px; 
    cursor: pointer;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    color: #1e293b;
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}
.slider-btn.prev { left: 10px; }
.slider-btn.next { right: 50px; } 

.slider-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 2px;
}

.slider-dots .dot {
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: rgba(100, 116, 139, 0.2);
    cursor: pointer;
}

.slider-dots .dot.active {
    background: #1877F2;
    width: 10px;
    border-radius: 2px;
}

.room-selector-side-scroll {
    flex: 1; /* 🛠️ สัดส่วนฝั่งขวา */
    display: flex;
    flex-direction: column;
    justify-content: space-between; /* 🛠️ กระจายกลุ่มห้องให้พอดีขอบบน-ล่างพอดี */
    max-height: none;
    overflow: hidden; /* 🛠️ ปิดสกอร์บาร์บน PC ตามที่ตั้งค่าไว้ */
    padding-right: 0px;
}

/* เพิ่มส่วนนี้เพื่อให้กลุ่มห้องแชร์พื้นที่ความสูงเท่าๆ กัน */
.room-thumb-group {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 6px 10px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.group-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

.thumb-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.overflow-wrap-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); 
    gap: 8px;
}

/* กล่องไอเท็มรูปย่อ + ชื่อภาพด้านใต้ */
.thumb-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    min-width: 45px;
}

.mini-img-btn {
    width: 100%;
    height: 32px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1.5px solid rgba(100, 116, 139, 0.2);
    opacity: 0.75;
    transition: all 0.15s ease;
}

.mini-img-btn:hover {
    opacity: 1;
    border-color: #1877F2;
}

.mini-img-btn.active {
    border-color: #1877F2;
    opacity: 1;
    box-shadow: 0 2px 6px rgba(24, 119, 242, 0.25);
}

/* กล่องชื่อภาพใต้รูปย่อ */
.thumb-caption {
    font-size: 9px;
    color: #64748b;
    text-align: center;
    margin-top: 3px;
    width: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-family: 'Inter', sans-serif;
}

.mini-img-btn.active + .thumb-caption {
    color: #1877F2;
    font-weight: 500;
}

/* =========================================================================
     🎥 6. LIGHTBOX SYSTEM STYLES
     ========================================================================= */
.lightbox {
    position: fixed; 
    inset: 0; 
    background: rgba(15, 23, 42, 0.98);
    backdrop-filter: blur(12px); 
    display: none; 
    justify-content: space-between;
    align-items: center; 
    z-index: 9999;
    padding: 0 20px;
}

.lightbox-content-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    width: 100%;
    max-width: 800px;
    z-index: 10000;
}

.lightbox-slider-window {
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
}

.lightbox-slider-wrapper {
    display: flex;
    width: 100%;
}

.lightbox-slide-item {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.lightbox img { 
    max-width: 100%; 
    max-height: 70vh; 
    border-radius: 12px; 
    user-select: none;
    pointer-events: none; 
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
    object-fit: contain;
}

.lightbox-caption {
    color: #f8fafc;
    font-size: 15px;
    font-weight: 400;
    background: rgba(0, 0, 0, 0.6);
    padding: 8px 20px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    text-align: center;
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 30px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 42px;
    cursor: pointer;
    z-index: 10002;
}
.lightbox-close:hover { color: #f43f5e; }

.lightbox-btn {
    background: rgba(255, 255, 255, 0.08); 
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: rgba(255, 255, 255, 0.8);
    font-size: 20px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    flex-shrink: 0;
}
.lightbox-btn:hover { background: #ffffff; color: #0f172a; }

/* =========================================================================
     📐 7. RESPONSIVE MEDIA QUERIES (สำหรับหน้าจอมือถือ) - ภาพเต็มกรอบ 70:30 ไม่มีขอบขาว
     ========================================================================= */
@media (max-width: 850px) {
    iframe { 
        height: 350px; 
    }

    .bottom-split-layout {
        gap: 12px;
        margin-bottom: 20px;
    }

    .info-card-left { padding: 12px; border-radius: 16px; }
    .price-list { gap: 4px; }
    .info-card-left p { padding: 8px 4px; font-size: 9px; border-radius: 8px; }
    .info-card-left b { font-size: 11px; }
    
    .btn-group-row {
        gap: 4px;
        flex-wrap: wrap; 
    }
    .btn { padding: 10px 6px; font-size: 11px; border-radius: 8px; }

    /* โครงสร้างแบ่ง 2 ฝั่งสัมพันธ์กัน ยืดความสูงกรอบเท่ากันเป๊ะ */
    .media-workspace-row {
        display: flex;
        flex-direction: row; 
        gap: 8px;
        align-items: stretch; 
    }

    /* ฝั่งซ้าย: กล่องครอบรูปภาพหลัก (ล็อกพื้นที่ไว้ที่ 70%) */
    .slider-container-box {
        flex: 7; 
        width: 70%;
    }

    /* กรอบรูปภาพ: มีความโค้งมนและใส่เงามีมิติเหมือนนอกเว็บ */
    .slider-wrapper {
        aspect-ratio: 0.75 / 1; 
        border-radius: 20px;            
        height: 100%;
        overflow: hidden;               
        box-shadow: 0 8px 24px rgba(148, 163, 184, 0.15); 
        border: 1px solid rgba(255, 255, 255, 0.6); 
    }

    /* 🛠️ รูปภาพหลักฝั่งซ้าย: ขยายภาพเต็มกรอบพอดี ไม่มีขอบขาวโผล่ */
    .slide-item img {
        width: 100%;
        height: 100%;
        object-fit: cover; /* ขยายภาพเต็มกรอบพอดี ไม่เหลือขอบขาว และยังคงสัดส่วนเดิมสวยงาม */
        border-radius: 20px;            
    }

    .slider-btn { display: none; } 

    .gallery-slider {
        padding-right: 0px; 
    }
    .slide-item {
        padding-right: 0px;
    }

    /* ฝั่งขวา: ปุ่มเลือกห้อง (ล็อกพื้นที่ไว้ที่ 30%) ปิดสกอร์ทิ้งถาวร */
    .room-selector-side-scroll {
        flex: 3; 
        width: 30%;
        max-height: none;       
        overflow: hidden;       /* ปิดแถบสกอร์บาร์ถาวร */
        display: flex;
        flex-direction: column; 
        justify-content: space-between; /* กระจายปุ่มให้พอดีขอบบนและขอบล่าง */
        gap: 4px;
        padding-right: 0px;
    }

    /* ปรับขนาดกล่องกลุ่มห้องพักแต่ละกลุ่มให้ยืดหยุ่นอัตโนมัติ */
    .room-thumb-group {
        padding: 4px 5px;
        border-radius: 8px;
        flex: 1; 
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    /* หัวข้อกลุ่มใหญ่ (เช่น 🏡ห้องพัก 1) ไม่ให้คำตกบรรทัด */
    .group-label {
        font-size: 8px;
        margin-bottom: 2px;
        font-weight: 600;
        text-align: center;
        white-space: nowrap; 
    }

    /* จัดเรียงรูปแบบ 2 คอลัมน์คู่เหมือนบน PC */
    .overflow-wrap-grid, .thumb-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr); 
        gap: 3px;
    }

    .thumb-item {
        width: 100%;
        min-width: 0;
    }

    /* ย่อความสูงของปุ่มกดรูปภาพลงเล็กน้อยเพื่อให้พอดีหน้าจอมือถือ */
    .mini-img-btn { 
        height: 18px; 
        border-radius: 4px;
    }

    /* ตัวอักษรแสดงผลขนาดเล็กจิ๋วพอดีปุ่ม + บังคับไม่ให้คำตกบรรทัด */
    .thumb-caption {
        display: block;          
        font-size: 6px;          
        text-align: center;
        margin-top: 2px;
        white-space: nowrap;     
        overflow: hidden;        
        text-overflow: ellipsis; 
        width: 100%;
    }

    .lightbox {
        padding: 0 10px;
    }
    .lightbox-content-box {
        max-width: 95%;
        gap: 15px;
    }
    .lightbox img { max-height: 60vh; }
    .lightbox-caption { font-size: 13px; padding: 6px 14px; }
    .lightbox-close { top: 15px; right: 20px; font-size: 36px; }
    .lightbox-btn { display: none; } 
}

@media (max-width: 480px) {
    iframe { height: 300px; }
    .btn { font-size: 10px; padding: 8px 4px; }
    
    /* ควบคุมขนาดเพิ่มเติมสำหรับมือถือจอเล็กเป็นพิเศษเพื่อความปลอดภัย */
    .mini-img-btn { 
        height: 15px; 
    }
    .group-label {
        font-size: 7.5px;
    }
    .thumb-caption {
        font-size: 5.5px;
    }
}