/* style.css - Luxe Mobile Edition (Final Master Version + Auto-Resize Fix) */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;1,400&family=Lato:wght@300;400;700&display=swap');

:root {
    --luxe-gold: #d4af37;
    --luxe-gold-dim: #aa8c2c;
    --luxe-black: #050505;
    --luxe-dark: #121212;
    --glass-bg: rgba(20, 20, 20, 0.85);
    --glass-border: rgba(255, 255, 255, 0.1);
}

body {
    background-color: var(--luxe-black);
    color: #e0e0e0;
    font-family: 'Lato', sans-serif;
    overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, .font-serif {
    font-family: 'Playfair Display', serif;
    letter-spacing: 0.5px;
}

.text-gold { color: var(--luxe-gold) !important; }
.tracking-widest { letter-spacing: 0.15em; }

/* Hero Section */
.hero-section {
    height: 60vh;
    min-height: 400px;
    position: relative;
}
.hero-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to top, var(--luxe-black), transparent);
}

/* Navigation Bar */
#menu-nav {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border) !important;
}

#pills-tab {
    padding-bottom: 0;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#pills-tab::-webkit-scrollbar {
    display: none;
}

.nav-pills .nav-link {
    color: #888;
    background: transparent !important;
    border: 1px solid transparent;
    border-radius: 50px;
    padding: 10px 24px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.nav-pills .nav-link.active {
    color: var(--luxe-black) !important;
    background: var(--luxe-gold) !important;
    font-weight: bold;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
}

/* Menu Item Cards */
.menu-card {
    background: #161616;
    border: 1px solid #2a2a2a;
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    height: 100%;
}
.menu-card:active {
    transform: scale(0.98);
}

.menu-img-container {
    position: relative;
    width: 100px;
    min-width: 100px;
    height: 100px;
}

.menu-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* คำอธิบายเมนู (หน้าหลัก) - บังคับสีสว่าง */
.menu-desc {
    color: #cccccc !important;
    font-weight: 300;
    letter-spacing: 0.5px;
    opacity: 0.9;
}

/* Animations */
.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
    opacity: 0;
    transform: translateY(20px);
}
.fade-in {
    animation: fadeIn 0.8s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    to { opacity: 1; transform: translateY(0); }
}
@keyframes fadeIn {
    to { opacity: 1; }
}

/* Separator Line */
.separator {
    height: 2px;
    width: 60px;
    background-color: var(--luxe-gold);
    margin: 20px auto;
}

/* Custom Buttons */
.btn-gold {
    background-color: var(--luxe-gold);
    color: #000;
    border: none;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s;
}
.btn-gold:hover {
    background-color: #fff;
    color: #000;
}
.btn-outline-light:hover {
    background-color: var(--luxe-gold);
    border-color: var(--luxe-gold);
    color: black;
}

/* --- 🌟 ส่วนสำหรับ Popup (สีตัวหนังสือ) --- */
#modalDesc {
    color: #e0e0e0 !important;
    font-weight: 300;
    line-height: 1.6;
}
.modal-content hr.border-secondary {
    border-color: rgba(255, 255, 255, 0.15) !important;
    opacity: 1;
}

/* 📱 Mobile Specific Tweaks (Layout ทั่วไป) */
@media (max-width: 768px) {
    .display-1 { font-size: 3rem; }
    .container { padding-left: 20px; padding-right: 20px; }
    .menu-item-row { flexDirection: row; alignItems: center; textAlign: left; }
    .menu-desc { fontSize: 0.85rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
}

/* --- 🧠 INTELLIGENT POPUP CONTROL (แก้ปัญหารูปหัวขาด) --- */

/* 1. สำหรับมือถือ (จอเล็กกว่า 768px) */
@media (max-width: 767.98px) {
    .responsive-popup-img {
        height: auto;           /* ปล่อยความสูงอิสระ */
        max-height: 40vh;       /* ห้ามสูงเกิน 40% ของหน้าจอมือถือ */
        object-fit: contain;    /* ✅ ย่อรูปให้เห็นทั้งใบ ห้ามตัด */
        width: 100%;
        background-color: #000; /* ถ้ารูปไม่เต็มกรอบ ให้ถมดำส่วนที่เหลือ */
    }
    #modalTitle { font-size: 1.8rem; }
    #modalPrice { font-size: 1.5rem; }
    #modalDesc  { font-size: 0.95rem; line-height: 1.4; }
}

/* 2. สำหรับ Tablet (จอ 768px - 1199px) - อันนี้ท่านบอกว่าสวยแล้ว */
@media (min-width: 768px) and (max-width: 1199.98px) {
    .responsive-popup-img {
        height: auto;
        max-height: 500px;
        object-fit: contain;    /* ✅ ย่อรูปให้เห็นทั้งใบ */
    }
}

/* 3. สำหรับ PC / Notebook (จอใหญ่กว่า 1200px) */
@media (min-width: 1200px) {
    .modal-dialog {
        max-width: 600px !important;
        margin: 1.75rem auto;
    }
    .responsive-popup-img {
        height: auto;           /* ปล่อยความสูงอิสระ */
        max-height: 55vh;       /* ห้ามสูงเกิน 55% ของหน้าจอคอม */
        object-fit: contain;    /* ✅ ย่อรูปให้เห็นทั้งใบ ห้ามตัด */
        width: 100%;
        background-color: #000; /* ถ้ารูปไม่เต็มกรอบ ให้ถมดำส่วนที่เหลือ */
    }
}