:root {
    --primary: #222222;
    --accent: #E51D54;
    --bg: #ffffff;
    --text-main: #222222;
    --text-sub: #717171;
    --border: #dddddd;
    --radius: 12px;
}

body {
    font-family: 'Kanit', sans-serif;
    background: var(--bg);
    color: var(--text-main);
    margin: 0; padding: 0;
    padding-bottom: 100px;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    user-select: auto !important;
    -webkit-user-select: auto !important;
}

/* --- Tabs System --- */
.tabs-nav {
    display: flex;
    border-bottom: 1px solid #eee;
    background: white;
    position: sticky; top: 0; z-index: 50;
}
.tab-btn {
    flex: 1; padding: 15px;
    background: none; border: none;
    font-family: 'Kanit'; font-size: 1rem; color: #717171;
    cursor: pointer; position: relative; transition: 0.3s;
}
.tab-btn.active { color: var(--primary); font-weight: 600; }
.tab-btn.active::after {
    content: ''; position: absolute; bottom: 0; left: 20%; right: 20%;
    height: 3px; background: var(--primary); border-radius: 3px 3px 0 0;
}

/* View Section Control */
.view-section { display: none; animation: fadeIn 0.4s ease; }
.view-section.active { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } }

/* --- Gallery --- */
.gallery-container { 
    position: relative; 
    width: 100%; 
    height: 620px;
    overflow: hidden; 
    background: #ffffff;
}

.gallery-scroll { 
    display: flex; 
    overflow-x: auto; 
    scroll-snap-type: x mandatory; 
    height: 100%; 
    -webkit-overflow-scrolling: touch; 
    scrollbar-width: none; 
}

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

.gallery-item { 
    flex: 0 0 100%; 
    scroll-snap-align: center; 
    position: relative; 
    display: flex; 
    align-items: center;
    justify-content: center;
    background: #ffffff; 
    height: 100%; 
}

.gallery-item img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover;
}
.top-nav { position: absolute; top: 15px; left: 15px; right: 15px; display: flex; justify-content: space-between; z-index: 10; }
/* 🔥 ปรับปุ่มแชร์ให้เด่นขึ้น (พื้นหลังเขียว + ขอบขาว) */
.nav-btn {
    background: #00C853;      /* สีพื้นหลังเขียว (เปลี่ยนเป็น #E51D54 ถ้าชอบสีชมพู) */
    color: white;             /* ไอคอนสีขาว */
    border: 2px solid white;  /* เพิ่มขอบขาวให้ตัดกับพื้นหลัง */
    
    width: 40px;              /* ขยายขนาดขึ้นนิดนึง (เดิม 35px) */
    height: 40px;
    border-radius: 50%;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    box-shadow: 0 4px 12px rgba(0,0,0,0.3); /* เพิ่มเงาให้ดูมีมิติ ลอยออกมา */
    cursor: pointer;
    transition: transform 0.2s;
    font-size: 1.1rem;        /* ขนาดไอคอน */
}

/* เอฟเฟกต์ตอนกด */
.nav-btn:active {
    transform: scale(0.95);
    background: #00a042;      /* เปลี่ยนสีเข้มขึ้นตอนกด */
}
.photo-count { position: absolute; bottom: 15px; right: 15px; background: rgba(34, 34, 34, 0.7); color: white; padding: 4px 12px; border-radius: 15px; font-size: 0.8rem; }

/* --- Content --- */
.container { padding: 20px; max-width: 600px; margin: 0 auto; }
h1 { font-size: 1.6rem; margin: 0 0 5px 0; font-weight: 600; }
.location { color: var(--text-sub); font-size: 0.9rem; margin-bottom: 15px; }

/* Highlights */
.highlights-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 25px; }
.highlight-item { display: flex; flex-direction: column; align-items: center; padding: 10px 5px; border: 1px solid var(--border); border-radius: var(--radius); text-align: center; font-size: 0.75rem; color: var(--text-main); }
.highlight-item i { font-size: 1.2rem; margin-bottom: 5px; color: #444; }

/* Rules List */
.rules-box { background: #f9f9f9; padding: 20px; border-radius: var(--radius); border: 1px solid #eee; }
.rule-item { display: flex; gap: 12px; margin-bottom: 12px; font-size: 0.9rem; color: #444; align-items: flex-start; }
.rule-number { background: #222; color: white; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0.75rem; flex-shrink: 0; margin-top: 1px; }

/* Time Box */
.time-box { background: #F0F8FF; border: 1px solid #B0E0E6; padding: 15px; border-radius: 12px; display: flex; justify-content: space-around; margin-bottom: 25px; }
.time-item { text-align: center; }
.time-label { font-size: 0.8rem; color: #555; display: block; margin-bottom: 5px; }
.time-val { font-size: 1.1rem; font-weight: bold; color: #222; }

/* Review Styles */
.review-summary { display: flex; justify-content: space-between; align-items: center; background: #fff; padding: 15px; border: 1px solid #eee; border-radius: 12px; margin-bottom: 20px; }
.big-rating { font-size: 2.5rem; font-weight: bold; margin-right: 10px; }
.btn-write-review { background: var(--primary); color: white; border: none; padding: 8px 18px; border-radius: 20px; cursor: pointer; font-size: 0.9rem; }

.review-card { padding: 15px 0; border-bottom: 1px solid #eee; }
.review-header { display: flex; gap: 10px; margin-bottom: 8px; align-items: center; }
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; border: 1px solid #ddd; }
.review-name { font-weight: 600; font-size: 0.95rem; }
.review-date { font-size: 0.75rem; color: #999; }
.review-stars { color: #FFD700; font-size: 0.9rem; margin-top: 2px; }
.review-body { color: #333; font-size: 0.95rem; line-height: 1.5; }

/* --- Details & Modal --- */
.detail-section { margin-bottom: 25px; }
.detail-header { font-size: 1.1rem; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 8px; }
.detail-header i { color: var(--accent); }
.info-card { background: #f8f8f8; border-radius: var(--radius); padding: 15px; display: flex; flex-direction: column; gap: 10px; }
.info-row { display: flex; align-items: flex-start; gap: 10px; font-size: 0.95rem; color: #444; }
.info-row i { margin-top: 3px; width: 20px; text-align: center; color: #717171; }

.bottom-bar { position: fixed; bottom: 0; left: 0; width: 100%; background: white; border-top: 1px solid var(--border); padding: 15px 20px; box-sizing: border-box; display: flex; justify-content: space-between; align-items: center; z-index: 100; box-shadow: 0 -2px 10px rgba(0,0,0,0.05); }
.price-info span:first-child { display: block; font-size: 1.1rem; font-weight: 600; }
.price-info small { color: var(--text-sub); }
.btn-reserve { background: linear-gradient(90deg, #E61E4D 0%, #D80565 100%); color: white; border: none; padding: 12px 24px; border-radius: 8px; font-weight: 600; font-size: 1rem; cursor: pointer; }

.booking-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); z-index: 200; display: none; justify-content: center; align-items: flex-end; }
.modal-content { background: white; width: 100%; max-width: 600px; height: 90vh; border-radius: 20px 20px 0 0; padding: 20px; box-sizing: border-box; overflow-y: auto; position: relative; animation: slideUp 0.3s ease-out; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.modal-header { display: flex; justify-content: space-between; margin-bottom: 20px; border-bottom: 1px solid #eee; padding-bottom: 15px; }
.close-btn { background: none; border: none; font-size: 1.5rem; cursor: pointer; }
.input-group { margin-bottom: 15px; }
.input-group label { display: block; font-weight: 500; margin-bottom: 8px; font-size: 0.9rem; }
input[type="text"], input[type="tel"], textarea { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 8px; font-family: 'Kanit'; font-size: 1rem; box-sizing: border-box; }
.addon-card { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--border); padding: 15px; border-radius: 8px; }
.counter-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid #ccc; background: white; font-size: 1.2rem; cursor: pointer; }
.summary-box { background: #f9f9f9; padding: 15px; border-radius: 8px; margin-top: 20px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.9rem; }
.summary-total { display: flex; justify-content: space-between; font-weight: 600; font-size: 1.1rem; border-top: 1px solid #ddd; padding-top: 10px; margin-top: 10px; }
.btn-confirm { width: 100%; background: #222; color: white; padding: 15px; border: none; border-radius: 8px; font-size: 1.1rem; font-weight: 600; margin-top: 20px; cursor: pointer; }
.btn-confirm:disabled { background: #999; }

/* 🔥 ปุ่ม Reset Date */
.btn-reset-date {
    background: none;
    border: none;
    color: #E61E4D;
    font-family: 'Kanit';
    font-size: 0.85rem;
    cursor: pointer;
    text-decoration: underline;
    padding: 0 5px;
}
.btn-reset-date:active {
    opacity: 0.7;
}

/* --- Calendar Custom Styles --- */
.flatpickr-calendar {
    width: 340px !important;
    font-family: 'Kanit', sans-serif;
    font-size: 1.1rem !important; 
}

.flatpickr-day {
    height: 46px !important;
    line-height: 46px !important;
    font-size: 1rem;
}

.flatpickr-day:not(.flatpickr-disabled) {
    background: #00C853 !important; 
    color: white !important;
    border: 1px solid #fff !important; 
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    background: #f3f3f3 !important;
    color: #d9d9d9 !important;
    border-color: transparent !important;
    cursor: not-allowed !important;
}
.flatpickr-day.prevMonthDay, 
.flatpickr-day.nextMonthDay {
    background: transparent !important;
    color: rgba(57,57,57,0.1) !important;
    border-color: transparent !important;
}
.flatpickr-day.status-booked {
    background-color: #ff4d4f !important;
    border-color: #ff4d4f !important;
    color: white !important;
    pointer-events: none; 
}
.flatpickr-day.status-pending {
    background-color: #ffa940 !important;
    border-color: #ffa940 !important;
    color: white !important;
    pointer-events: none; 
}
.flatpickr-day.status-blocked {
    background-color: #4a4a4a !important; 
    border-color: #4a4a4a !important;
    color: #aaaaaa !important;
    pointer-events: none; 
    text-decoration: line-through; 
}

.flatpickr-day.selected, 
.flatpickr-day.startRange, 
.flatpickr-day.endRange, 
.flatpickr-day.selected.inRange, 
.flatpickr-day.startRange.inRange, 
.flatpickr-day.endRange.inRange, 
.flatpickr-day.focus {
    background: #ffa940 !important; 
    border-color: #ffa940 !important;
    color: white !important;
    box-shadow: none !important;
}

.flatpickr-day.inRange {
    background: #ffe7ba !important; 
    border-color: #ffe7ba !important;
    color: #d46b08 !important;
    box-shadow: -5px 0 0 #ffe7ba, 5px 0 0 #ffe7ba !important;
}

.flatpickr-day.selected.status-booked,
.flatpickr-day.startRange.status-booked,
.flatpickr-day.endRange.status-booked,
.flatpickr-day.selected.status-blocked,
.flatpickr-day.startRange.status-blocked,
.flatpickr-day.endRange.status-blocked {
    background: #ffa940 !important;
    border-color: #ffa940 !important;
}

.calendar-legend {
    display: flex; gap: 10px; margin-bottom: 10px; font-size: 0.8rem;
}
.legend-item { display: flex; align-items: center; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.dot.green { background: #00C853; }
.dot.orange { background: #ffa940; }
.dot.red { background: #ff4d4f; }
.dot.black { background: #4a4a4a; }

.map-container {
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
    background: #eee;
}
.map-container iframe {
    width: 100%;
    height: 300px; 
    display: block;
}

.btn-navigate {
    display: block;
    width: 100%;
    background: #4285F4;
    color: white;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
    text-decoration: none;
    font-family: 'Kanit';
    font-weight: 600;
    margin-top: 15px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    box-sizing: border-box;
    transition: background 0.2s;
}
.btn-navigate:active { background: #3367D6; transform: scale(0.98); }
.btn-navigate i { margin-right: 8px; }

.feature-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
}
.feature-box {
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.02);
    transition: transform 0.2s;
}
.feature-box:active { transform: scale(0.98); }
.feature-box i {
    font-size: 1.5rem;
    color: var(--accent);
    background: #fff0f3;
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.feature-text { display: flex; flex-direction: column; }
.feature-text strong { font-size: 0.95rem; color: #333; }
.feature-text small { font-size: 0.75rem; color: #888; }
.description-box {
    background: #fcfcfc;
    border-left: 4px solid var(--accent);
    padding: 15px 20px;
    border-radius: 4px 12px 12px 4px;
    font-size: 0.95rem;
    line-height: 1.7;
    color: #555;
    font-style: italic;
    margin-bottom: 20px;
}

/* ในไฟล์ style.css */

/* 🔥 ปรับแต่ง Input วันที่ (แก้ไขไอคอนใหม่ สีเขียว #11AA4C) */
#dateRange {
    background-color: #ffffff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    
    color: #000000; 
    font-weight: bold; 
    
    cursor: pointer;
    transition: all 0.2s;

    /* ✅ แก้ตรงนี้: ใช้ SVG ตัวใหม่ที่แมนให้มา + เปลี่ยนสีเป็น #11AA4C */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='24px' viewBox='0 -960 960 960' width='24px' fill='%2311AA4C'%3E%3Cpath d='M200-80q-33 0-56.5-23.5T120-160v-560q0-33 23.5-56.5T200-800h40v-80h80v80h320v-80h80v80h40q33 0 56.5 23.5T840-720v560q0 33-23.5 56.5T760-80H200Zm0-80h560v-400H200v400Zm0-480h560v-80H200v80Zm0 0v-80 80Zm280 240q-17 0-28.5-11.5T440-440q0-17 11.5-28.5T480-480q17 0 28.5 11.5T520-440q0 17-11.5 28.5T480-400Zm-160 0q-17 0-28.5-11.5T280-440q0-17 11.5-28.5T320-480q17 0 28.5 11.5T360-440q0 17-11.5 28.5T320-400Zm320 0q-17 0-28.5-11.5T600-440q0-17 11.5-28.5T640-480q17 0 28.5 11.5T680-440q0 17-11.5 28.5T640-400ZM480-240q-17 0-28.5-11.5T440-280q0-17 11.5-28.5T480-320q17 0 28.5 11.5T520-280q0 17-11.5 28.5T480-240Zm-160 0q-17 0-28.5-11.5T280-280q0-17 11.5-28.5T320-320q17 0 28.5 11.5T360-280q0 17-11.5 28.5T320-240Zm320 0q-17 0-28.5-11.5T600-280q0-17 11.5-28.5T640-320q17 0 28.5 11.5T680-280q0 17-11.5 28.5T640-240Z'/%3E%3C/svg%3E");
    
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 24px; 
}

/* อย่าลืมตัวช่วย Placeholder เหมือนเดิม */
#dateRange::placeholder {
    color: #333333;
    font-weight: bold;
    opacity: 1;
}
#dateRange:focus {
    border-color: #00C853;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.1);
}


/* --- Booking Summary View (New) --- */
.summary-card-final {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    position: relative;
    border: 1px solid #eee;
}

.summary-divider {
    height: 1px;
    background: #eee;
    margin: 15px 0;
}

.summary-divider-dash {
    height: 1px;
    border-bottom: 2px dashed #eee;
    margin: 15px 0;
}

.summary-details-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sum-item {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    color: #333;
}

.sum-item i {
    width: 25px;
    text-align: center;
    font-size: 1.1rem;
}

.btn-close-app {
    background: #222;
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s;
    width: 100%;
}
.btn-close-app:active {
    transform: scale(0.95);
}

/* 🔥 แก้ไขขนาดหัวปฏิทิน (เดือน/ปี) ให้เล็กลง */
.flatpickr-current-month {
    font-size: 0.9rem !important; /* ปรับขนาดตรงนี้ (เดิมมันใหญ่ไป) */
    padding-top: 15px !important; /* ดันลงมานิดนึงให้สวย */
}

/* แก้ขนาดชื่อเดือน (มกราคม ฯลฯ) */
.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

/* แก้ขนาดเลขปี (2026) */
.flatpickr-current-month input.cur-year {
    font-size: 1.1rem !important;
    font-weight: 600 !important;
}

/* (แถม) ปรับขนาด "ชื่อวัน" (จ, อ, พ) ให้พอดีกันด้วย */
span.flatpickr-weekday {
    font-size: 0.9rem !important;
    color: #555 !important;
}

/* 🔥 แก้ไขใหม่: แก้ปัญหาแถบขาวบังตัวหนังสือ */

/* 1. จัดการส่วนหัว (เดือน/ปี) ให้ลอยอยู่ชั้นบนสุด และมีความสูงพอดี */
.flatpickr-months {
    height: 60px !important;       /* เพิ่มพื้นที่ความสูงให้ส่วนหัว */
    position: relative !important;
    z-index: 10 !important;        /* บังคับให้อยู่บนสุด ห้ามมีอะไรมาบัง */
    background: white !important;  /* พื้นหลังขาว */
    display: flex;
    align-items: center;
}

/* 2. ดันกล่องตารางวันที่ (ทั้งก้อน) ลงมาด้านล่าง */
.flatpickr-innerContainer {
    margin-top: 20px !important;   /* ถอยห่างจากส่วนหัว 20px */
    padding-top: 10px !important;  /* เพิ่มช่องว่างหายใจอีกนิด */
    position: relative;
    z-index: 1 !important;         /* ให้อยู่ชั้นล่างกว่าส่วนหัว */
}

/* 3. รีเซ็ตค่าเก่าที่อาจจะทำให้เพี้ยน */
.flatpickr-weekdays {
    margin-top: 0 !important;      
    height: 30px !important;
}

/* ปรับตำแหน่งตัวหนังสือเดือนปีให้สวยงาม */
.flatpickr-current-month {
    padding-top: 5px !important;
    height: auto !important;
}


/* --- History Card Styles --- */
.history-card {
    background: white;
    border: 1px solid #eee;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 15px;
    box-shadow: 0 4px 10px rgba(0,0,0,0.03);
    position: relative;
    transition: transform 0.2s;
}

.history-card:active {
    transform: scale(0.98);
}

.h-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px dashed #eee;
}

.h-id {
    font-size: 0.85rem;
    color: #888;
    font-weight: 500;
}

.h-status {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 20px;
    font-weight: 600;
}

/* สีของสถานะต่างๆ */
.st-pending { background: #fff7e6; color: #ffa940; border: 1px solid #ffe7ba; } /* รอยืนยัน */
.st-waiting_payment { background: #e6f7ff; color: #1890ff; border: 1px solid #91d5ff; } /* รอชำระ */
.st-payment_review { background: #fff0f6; color: #c41d7f; border: 1px solid #ffadd2; } /* รอตรวจสลิป */
.st-confirmed { background: #f6ffed; color: #52c41a; border: 1px solid #b7eb8f; } /* เรียบร้อย */
.st-cancelled { background: #f5f5f5; color: #999; border: 1px solid #d9d9d9; } /* ยกเลิก */

.h-body {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.h-date {
    font-size: 0.95rem;
    color: #333;
    line-height: 1.5;
}

.h-price {
    font-size: 1.2rem;
    font-weight: bold;
    color: #00C853; /* สีเขียวเหมือนธีม */
}

.hide {
    display: none;
}

/* --- 🔥 CSS สำหรับหน้า Gallery (เพิ่มใหม่) --- */
.gallery-zone {
    margin-bottom: 30px;
}

.zone-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 15px;
    padding-bottom: 8px;
    border-bottom: 2px solid #eee;
    color: var(--primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.zone-title i {
    color: var(--accent);
}

.photo-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 รูปต่อแถว */
    gap: 10px;
}

.photo-grid img {
    width: 100%;
    height: 120px; /* ความสูงเท่ากัน */
    object-fit: cover;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.photo-grid img:active {
    transform: scale(0.98);
}

/* ถ้าจอใหญ่หน่อย ให้แสดง 3 รูปต่อแถว */
@media (min-width: 500px) {
    .photo-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .photo-grid img {
        height: 150px;
    }
}