/* BẢNG MÀU LUXURY: Xanh Lục Bảo, Vàng Gold, Đen Xám */
:root {
    --bg-dark: #0b1411;
    --bg-card: #12221c;
    --emerald: #1b4d3e;
    --gold-light: #f3e5ab;
    --gold: #d4af37;
    --gold-dark: #aa7c11;
    --text-light: #f5f7f6;
    --danger: #ff4d4d;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Montserrat', sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-light);
}

/* --- HEADER & NAVIGATION --- */
header {
    background: linear-gradient(180deg, rgba(11,20,17,1) 0%, rgba(18,34,28,0.8) 100%);
    border-bottom: 1px solid var(--gold-dark);
    padding: 15px 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.logo-container { display: flex; align-items: center; gap: 12px; }
.logo-box {
    background: linear-gradient(135deg, var(--emerald) 0%, #0b1411 100%);
    border: 2px solid var(--gold);
    width: 45px;
    height: 45px;
    border-radius: 8px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-weight: 900;
    font-size: 22px;
    color: var(--gold);
    box-shadow: 0 0 10px rgba(212, 175, 55, 0.3);
}
.logo-text {
    font-size: 20px;
    font-weight: 900;
    letter-spacing: 2px;
    background: linear-gradient(to right, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav ul { display: flex; list-style: none; gap: 25px; }
nav ul li a {
    color: var(--text-light);
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    cursor: pointer;
    padding: 5px 0;
    transition: 0.3s;
    text-transform: uppercase;
}
nav ul li a:hover, nav ul li a.active {
    color: var(--gold);
    border-bottom: 2px solid var(--gold);
}

.header-tools { display: flex; align-items: center; gap: 15px; }
.lang-switch select {
    background-color: rgba(27,77,62,0.3);
    color: var(--gold-light);
    border: 1px solid var(--gold-dark);
    padding: 8px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    outline: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 50%, var(--gold-light) 100%);
    color: #0b1411;
    border: none;
    padding: 12px 25px;
    font-size: 14px;
    font-weight: 900;
    border-radius: 30px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212,175,55,0.4);
    transition: all 0.3s ease;
    letter-spacing: 1px;
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(212,175,55,0.6); }

.btn-outline {
    border: 2px solid var(--gold);
    color: var(--gold);
    background: transparent;
    padding: 10px;
    font-weight: 700;
    border-radius: 8px;
    cursor: pointer;
    transition: 0.3s;
}
.btn-outline:hover { background-color: var(--gold); color: var(--bg-dark); }

/* --- CẤU TRÚC CHUYỂN TRANG 1 TRANG (SPA) --- */
.page-section { display: none; padding: 40px 5%; min-height: 70vh; }
.page-section.active { display: block; animation: fadeIn 0.5s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* --- 1. HOME PAGE --- */
.hero-banner {
    text-align: center;
    padding: 100px 20px;
    border-radius: 16px;
    border: 1px solid rgba(214, 175, 55, 0.2);
    background: radial-gradient(circle at center, rgba(27,77,62,0.4) 0%, rgba(11,20,17,1) 70%);
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    margin-bottom: 40px;
}
.hero-banner h1 {
    font-size: 48px;
    font-weight: 900;
    letter-spacing: 3px;
    background: linear-gradient(to right, #ffffff, var(--gold-light), var(--gold));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 15px;
}
.hero-banner h2 { font-size: 24px; color: var(--gold-light); margin-bottom: 25px; font-weight: 600; letter-spacing: 1px; }
.hero-banner p { color: #a0b0aa; margin-bottom: 40px; font-size: 16px; }

.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 40px;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- 2. TRANG SẢN PHẨM --- */
.grid-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; }
.product-card {
    background-color: var(--bg-card);
    border: 1px solid rgba(214, 175, 55, 0.15);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: all 0.4s ease;
    box-shadow: 0 10px 25px rgba(0,0,0,0.4);
}
.product-card:hover { transform: translateY(-10px); border-color: var(--gold); box-shadow: 0 15px 35px rgba(27,77,62,0.4); }

/* --- 3. TRANG MINI GAME --- */
.ticket-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-top: 25px; }
.ticket {
    background-color: var(--bg-card); border: 2px solid rgba(214, 175, 55, 0.3); border-radius: 12px;
    padding: 20px; text-align: center; transition: 0.3s; position: relative; overflow: hidden;
}
.ticket.sold { border-color: rgba(255, 77, 77, 0.4); opacity: 0.6; pointer-events: none; }

/* --- 5. TRANG KYC & PAYMENT --- */
.account-box {
    background-color: var(--bg-card); padding: 35px; border-radius: 16px;
    border: 1px solid rgba(214, 175, 55, 0.2); max-width: 800px; margin: 0 auto 40px auto;
    box-shadow: 0 15px 35px rgba(0,0,0,0.6);
}

.form-group { margin-bottom: 20px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--gold-light); margin-bottom: 8px; text-transform: uppercase; }
.form-group input {
    width: 100%; background-color: rgba(11,20,17,0.8); border: 1px solid var(--emerald);
    color: #fff; padding: 14px; border-radius: 8px; font-size: 14px; transition: 0.3s;
}
.form-group input[readonly] { border-color: var(--gold-dark); color: var(--gold); font-weight: 700; }

/* --- TỐI ƯU HÓA MOBILE RESPONSIVE --- */
@media screen and (max-width: 768px) {
    body { overflow-x: hidden; padding-bottom: 70px; }
    
    /* Ẩn footer liên hệ cũ trên điện thoại */
    footer { display: none !important; }

    header { padding: 10px 15px !important; flex-direction: row !important; justify-content: space-between !important; }
    header nav { display: none !important; }
    
    .grid-container { grid-template-columns: 1fr !important; gap: 15px !important; }
    .ticket-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 10px !important; }

    /* Bottom Nav */
    .mobile-bottom-nav {
        position: fixed; bottom: 0; left: 0; width: 100%; height: 65px;
        background: #000; display: flex; justify-content: space-around;
        align-items: center; border-top: 2px solid var(--gold); z-index: 9999;
    }
    .mobile-bottom-nav a {
        color: #fff; text-decoration: none; font-size: 10px;
        display: flex; flex-direction: column; align-items: center; gap: 4px;
    }
}

@media screen and (min-width: 769px) {
    .mobile-bottom-nav { display: none; }
}

/* Hiệu ứng nhấp chuột cho các nút bấm */
.btn-gold {
    transition: all 0.2s ease;
}

.btn-gold:active {
    transform: scale(0.95);
    background-color: #b8860b !important;
    outline: none;
}

/* Tối giản vùng chứa */
.user-action-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
    margin: 15px 0;
    padding: 0 10px;
}

/* Nút bấm tối giản */
.action-btn {
    padding: 10px 18px;
    background: #1a1a1a;
    color: #b0b0b0;
    text-decoration: none;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #333;
    transition: 0.3s;
}

.action-btn:hover {
    background: #252525;
    color: #d4af37;
    border-color: #d4af37;
}

/* Áp dụng cho các ô input và select */
#searchInput, #categoryFilter, #countryFilter {
    background: #121212;
    border: 1px solid #222;
    color: #fff;
    padding: 10px;
    border-radius: 4px;
}

/* Tối ưu hóa vùng bộ lọc */
.filter-section {
    padding: 10px 20px;
    text-align: center;
    background: rgba(0,0,0,0.2);
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 10px;
}

/* Làm nhỏ ô input và select */
.filter-section input, .filter-section select {
    padding: 3px 6px;
    font-size: 12px;
    border-radius: 4px;
}

/* Đưa phần quản lý sản phẩm lên gọn hơn */
.user-action-buttons {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-left: 10px;
}

/* Tối ưu riêng trên điện thoại để tránh bị tràn */
@media (max-width: 768px) {
    .filter-section {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
        gap: 5px;
    }

    .filter-section input, .filter-section select {
        width: 45%;
        padding: 8px 5px;
        font-size: 11px;
    }

    .user-action-buttons {
        width: 100%;
        display: flex;
        justify-content: center;
        gap: 10px;
        margin-top: 10px;
    }
}

.back-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #1a1a1a;
    color: #b0b0b0;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #333;
    font-size: 14px;
    transition: 0.3s;
}

.back-btn:hover {
    background: #252525;
    color: #d4af37;
    border-color: #d4af37;
}
#products {
    scroll-margin-top: 80px;
}

/* --- Cấu trúc Layout mới giúp không bị tràn màn hình --- */
html, body {
    height: 100%;
    margin: 0;
    display: flex;
    flex-direction: column;
}

#main-content {
    flex: 1;
    overflow-y: auto;
}

.page-section { 
    display: none; 
    padding: 40px 5%; 
    min-height: 70vh; 
}
.page-section.active { display: block; }

/* Footer chuẩn 4 cột */
.footer-custom { background: #000; border-top: 2px solid #d4af37; padding: 10px 5%; color: #fff; flex-shrink: 0; }
.footer-wrapper { display: flex; justify-content: space-between; max-width: 1200px; margin: 0 auto; gap: 20px; }
.footer-col { flex: 1; min-width: 200px; }
.title-gold { color: #d4af37; margin-bottom: 15px; font-size: 14px; text-transform: uppercase; }
.footer-col p, .footer-col a { display: block; color: #ccc; font-size: 13px; margin-bottom: 8px; text-decoration: none; }
.footer-col a:hover { color: #d4af37; }
.social-icons { display: flex; gap: 10px; }
.social-icons a { width: 30px; height: 30px; color: #ccc; }
.logo-box { width: 45px; height: 45px; border: 1px solid #d4af37; display: flex; align-items: center; justify-content: center; font-size: 24px; }

@media (max-width: 768px) { 
    .footer-custom { display: none !important; }
}
.logo-link:hover {
    opacity: 0.8;
    cursor: pointer;
}
/* Tối ưu cho Mobile */
@media (max-width: 768px) {
    .container { width: 100% !important; padding: 10px !important; }
    .card { margin-bottom: 10px; }
    img { max-width: 100%; height: auto; }
}

/* Tối ưu hóa liên kết logo */
header a:has(.logo-container) {
    text-decoration: none !important;
}

/* Hiệu ứng mượt mà khi di chuột vào logo (áp dụng cho cả laptop) */
.logo-container:hover {
    opacity: 0.8;
    transition: 0.3s ease;
    cursor: pointer;
}
#messenger-quick-link {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
}
.messenger-button {
    background: #0084ff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: 0.3s;
}
.messenger-button:hover {
    transform: scale(1.1);
}
@media (max-width: 768px) {
    #messenger-quick-link {
        bottom: 80px;
        right: 15px;
    }
}
/* Tối ưu hiển thị cho Mobile */
@media (max-width: 768px) {
    .product-detail-container {
        margin-top: 80px;
        padding: 15px;
        width: 95%;
        margin-left: auto;
        margin-right: auto;
    }

    .gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Lưới ảnh sản phẩm */
.product-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

/* Khung ảnh vuông */
.image-wrapper {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    border-radius: 8px;
    cursor: pointer;
    border: 1px solid rgba(212, 175, 55, 0.2);
    transition: all 0.3s ease;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* Tràn đều từ giữa ra */
    object-position: center;
    transition: transform 0.3s ease;
}

/* Hiệu ứng mờ/phóng to khi di chuột */
.image-wrapper:hover img {
    transform: scale(1.1);
    filter: brightness(0.8);
}

/* Lightbox Modal */
.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.9);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.lightbox-overlay img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(255,255,255,0.1);
}