: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: 95%; 
    height: 90%; 
    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: rgba(255,255,255,0.9); border: none; width: 35px; height: 35px; border-radius: 50%; display: flex; align-items: center; justify-content: center; box-shadow: 0 2px 5px rgba(0,0,0,0.1); cursor: pointer; transition: transform 0.2s; }
.nav-btn:active { transform: scale(0.9); }
.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;
}

/* 🔥 ปรับแต่ง Input วันที่ให้สวยงาม (Input Design) */
#dateRange {
    background-color: #ffffff;
    border: 2px solid #ddd;
    border-radius: 8px;
    padding: 12px;
    font-size: 1rem;
    color: #333;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    /* ใส่ไอคอนปฏิทินใน Input */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%23777' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    background-size: 20px;
}
#dateRange:focus {
    border-color: #00C853;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 200, 83, 0.1);
}