/* ==========================================================================
   à¸£à¸°à¸šà¸šà¸ªà¹„à¸•à¸¥à¹Œà¸žà¸·à¹‰à¸™à¸à¸²à¸™à¹à¸¥à¸°à¹‚à¸„à¸£à¸‡à¸ªà¸£à¹‰à¸²à¸‡ Grid (à¹„à¸¡à¹ˆà¸žà¸¶à¹ˆà¸‡à¸žà¸²à¸­à¸´à¸™à¹€à¸—à¸­à¸£à¹Œà¹€à¸™à¹‡à¸•)
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background-color: #0d0e0e;
    color: #f8fafc;
    line-height: 1.5;
    padding-bottom: 60px;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation Bar */
.navbar {
    background-color: #101010;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid #334155;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-weight: bold;
    color: #38bdf8;
    text-decoration: none;
    font-size: 1.3rem;
}

.navbar-nav {
    display: flex;
    list-style: none;
    gap: 20px;
    align-items: center;
}

.nav-link {
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.nav-link:hover, .nav-link.active {
    color: #f8fafc;
}

/* Hero Banner */
.hero-section {
    background: #282c2d;
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid #1e293b;
}

.hero-section h1 {
    font-size: 2.3rem;
    margin-bottom: 10px;
    color: #ffffff;
}

.hero-section p {
    color: #94a3b8;
    font-size: 1.05rem;
    margin-bottom: 25px;
}

.input-group {
    display: flex;
    max-width: 500px;
    margin: 0 auto;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3);
    border-radius: 6px;
    overflow: hidden;
}

.form-control {
    flex: 1;
    padding: 12px 15px;
    background-color: #020617;
    border: 1px solid #334155;
    color: white;
    outline: none;
    font-size: 0.95rem;
}

.btn-search {
    background-color: #38bdf8;
    border: none;
    padding: 0 20px;
    color: #0f172a;
    font-weight: bold;
    cursor: pointer;
}

/* Product Layout */
.section-title {
    color: #38bdf8;
    margin: 40px 0 20px 0;
    font-size: 1.4rem;
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
}

/* à¸à¸¥à¹ˆà¸­à¸‡à¸ªà¸´à¸™à¸„à¹‰à¸² (Card) */
.card-game {
    background: #1e293b;
    border: 1px solid #334155;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.card-game:hover {
    transform: translateY(-5px);
    border-color: #38bdf8;
}

.card-img-placeholder {
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
}

.bg-razer {
    background: linear-gradient(135deg, #115e59, #042f2e);
}

.bg-true {
    background: linear-gradient(135deg, #ea580c, #7c2d12);
}

.bg-garena {
    background: linear-gradient(135deg, #dc2626, #7f1d1d);
}

.bg-steam {
    background: linear-gradient(135deg, #1e40af, #172554);
}

.card-body {
    padding: 18px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-title {
    font-size: 1.05rem;
    margin-bottom: 6px;
    color: #f1f5f9;
}

.card-text {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.card-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.text-price {
    color: #f59e0b;
    font-weight: bold;
    font-size: 1.1rem;
}

/* Buttons & Elements */
.btn {
    padding: 8px 16px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-primary {
    background-color: #3b82f6;
    color: white;
}

.btn-primary:hover {
    background-color: #2563eb;
}

.btn-login {
    border: 1px solid #38bdf8;
    color: #38bdf8;
    background: transparent;
}

.btn-login:hover {
    background: #38bdf8;
    color: #0f172a;
}

.btn-success {
    background-color: #22c55e;
    color: white;
    width: 100%;
    padding: 12px;
    font-size: 1rem;
    margin-top: 15px;
}

.btn-success:hover {
    background-color: #16a34a;
}

.badge-hot {
    position: absolute;
    top: 12px;
    right: 12px;
    background-color: #ef4444;
    color: white;
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: bold;
    z-index: 10;
}

footer {
    text-align: center;
    padding: 25px 0;
    color: #64748b;
    border-top: 1px solid #1e293b;
    font-size: 0.85rem;
    margin-top: 60px;
}

/* ==========================================================================
   à¸£à¸°à¸šà¸šà¸„à¸§à¸šà¸„à¸¸à¸¡à¸«à¸™à¹‰à¸²à¸•à¹ˆà¸²à¸‡à¸›à¹Šà¸­à¸›à¸­à¸±à¸› (Modal UI)
   ========================================================================== */
.custom-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(2, 6, 17, 0.75);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.modal-content {
    background-color: #ffffff;
    color: #1e293b;
    width: 100%;
    max-width: 450px;
    border-radius: 12px;
    overflow: hidden;
    animation: fadeIn 0.2s ease-out;
    box-shadow: 0 20px 25px -5px rgba(0,0,0,0.5);
}

.modal-header {
    padding: 15px 20px;
    background-color: #f1f5f9;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-weight: bold;
    font-size: 1.15rem;
    color: #0f172a;
}

.close-modal {
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #64748b;
}

.close-modal:hover {
    color: #0f172a;
}

.modal-body {
    padding: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-label {
    display: block;
    font-weight: bold;
    margin-bottom: 6px;
    font-size: 0.9rem;
    color: #334155;
}

.form-select, .form-input-text {
    width: 100%;
    padding: 10px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    outline: none;
}

.payment-option {
    border: 1px solid #e2e8f0;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.payment-option:hover {
    background-color: #f8fafc;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}
/* ==========================================================================
   สไตล์เมนูบล็อกสี่เหลี่ยมจัตุรัสแบบเทพทรู (Square Grid Menu Style)
   ========================================================================== */

/* แถบตัวกรองหมวดหมู่สินค้าด้านบน */
.category-filter {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin: 30px 0 10px 0;
    flex-wrap: wrap;
}

.btn-filter {
    background-color: #1a2333;
    color: #a0aec0;
    border: 1px solid #233044;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.2s ease;
}

.btn-filter:hover, .btn-filter.active {
    background: linear-gradient(135deg, #00e5ff, #0084ff);
    color: #ffffff;
    border-color: transparent;
    box-shadow: 0 4px 12px rgba(0, 229, 255, 0.2);
}

/* ตั้งค่ากริดแบบไอคอนจำนวนมาก */
.game-menu-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); /* ทำให้ไอคอนมีขนาดเท่าๆ กัน */
    gap: 15px;
    margin-bottom: 50px;
}

/* กล่องเมนูเกมสี่เหลี่ยม */
.game-item-block {
    background-color: #1a2333;
    border: 1px solid #233044;
    border-radius: 12px;
    padding: 12px;
    text-align: center;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: all 0.2s ease;
    aspect-ratio: 1 / 1; /* กำหนดให้เป็นสี่เหลี่ยมจัตุรัสอย่างสมบูรณ์ */
    justify-content: center;
}

.game-item-block:hover {
    transform: translateY(-5px);
    border-color: #00e5ff;
    box-shadow: 0 6px 20px rgba(0, 229, 255, 0.2);
    background-color: #1e293b;
}

/* กรอบตัดรูปภาพให้พอดีกล่องสี่เหลี่ยม */
.game-img-wrapper {
    width: 75px;
    height: 75px;
    border-radius: 14px;
    overflow: hidden;
    margin-bottom: 10px;
    border: 2px solid #233044;
    background-color: #121824;
    transition: border-color 0.2s ease;
}

.game-item-block:hover .game-img-wrapper {
    border-color: #00e5ff;
}

.game-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ทำให้รูปภาพครอบคลุมกรอบสี่เหลี่ยมพอดี */
}

/* ข้อความชื่อเกมด้านล่างไอคอน */
.game-item-title {
    color: #e2e8f0;
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* หากชื่อยาวเกินจะตัดบรรทัดให้ไม่หลุดเฟรม */
    -webkit-box-orient: vertical;
    line-height: 1.3;
}

/* ป้ายแท็กสถานะขนาดเล็ก */
.badge-hot-mini {
    position: absolute;
    top: 6px;
    right: 6px;
    background: linear-gradient(135deg, #ff3838, #ff6b6b);
    color: #ffffff;
    font-size: 9px;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 4px;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(255, 56, 56, 0.4);
}

/* ปรับปรุงขนาดกริดสำหรับมือถือขนาดเล็กมาก */
@media (max-width: 480px) {
    .game-menu-grid {
        grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
        gap: 10px;
    }
    .game-img-wrapper {
        width: 55px;
        height: 55px;
    }
    .game-item-title {
        font-size: 11px;
    }
}
/* ==========================================================================
   แถบข้อความวิ่งแจ้งเตือนล่าสุด (RFM Marquee Styles)
   ========================================================================== */
.rfm-marquee-container {
    width: 100%;
    background-color: #1a2333;
    border-bottom: 1px solid #233044;
    height: 40px;
    display: flex;
    align-items: center;
    overflow: hidden;
    position: relative;
}

/* ป้ายกำกับด้านหน้า (ยึดอยู่กับที่ ไม่วิ่งตาม) */
.marquee-label {
    background: linear-gradient(135deg, #ff3838, #ff6b6b);
    color: #ffffff;
    padding: 0 15px;
    height: 100%;
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: bold;
    z-index: 10;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.4);
    white-space: nowrap;
}

/* กรอบตัดข้อความที่หลุดหน้าจอ */
.marquee-content-wrapper {
    overflow: hidden;
    width: 100%;
    display: flex;
    align-items: center;
}

/* บล็อกข้อความทั้งหมดที่จะสั่งให้วิ่ง */
.marquee-text-slide {
    display: flex;
    white-space: nowrap;
    padding-left: 100%; /* เริ่มต้นวิ่งมาจากนอกจอด้านขวา */
    animation: rfmMarqueeScroll 25s linear infinite; /* ปรับเวลา (25s) เพื่อเพิ่ม/ลด ความเร็วได้ */
}

/* หยุดวิ่งเมื่อผู้ใช้งานเอาเมาส์ไปวาง (Hover เพื่ออ่าน) */
.marquee-text-slide:hover {
    animation-play-state: paused;
}

/* ไอเทมข้อความแต่ละตัว */
.marquee-item {
    color: #cbd5e1;
    font-size: 14px;
    margin-right: 50px; /* เว้นระยะห่างระหว่างข้อความ */
    display: inline-flex;
    align-items: center;
}

.marquee-item b {
    color: #00e5ff; /* ไฮไลท์ตัวหนา เช่น ชื่อ หรือ จำนวนเงิน ให้เป็นสีฟ้าเรืองแสง */
    margin: 0 4px;
}

/* คำสั่งควบคุมทิศทางแอนิเมชันให้วิ่งจากขวาไปซ้าย (CSS Keyframes) */
@keyframes rfmMarqueeScroll {
    0% {
        transform: translate3d(0, 0, 0);
    }
    100% {
        transform: translate3d(-100%, 0, 0);
    }
}
/* คัดลอกไปวางทับใน style.css เพื่อเปลี่ยนธีม */
body {
    background-color: #0f141c; /* ดำอมเทาเข้มสไตล์ Valorant */
    color: #ece8e1; /* ขาวนวล */
}
.navbar {
    background-color: #161d27;
    border-bottom: 2px solid #ff4655; /* แดง Valorant */
}
.nav-link:hover, .nav-link.active, .navbar-brand {
    color: #ff4655;
}
.btn-login {
    background: #ff4655;
    border-radius: 0px; /* ทรงเหลี่ยมแบบ Valorant */
}
.btn-login:hover {
    background: #e23e4b;
    box-shadow: 0 4px 15px rgba(255, 70, 85, 0.4);
}
.hero-section {
    background: #111720;
    border-bottom: 1px solid #242e3d;
}
.hero-section h1 {
    background: linear-gradient(to right, #ece8e1, #ff4655);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.form-control {
    background-color: #161d27;
    border: 2px solid #242e3d;
    border-radius: 0px;
}
.form-control:focus {
    border-color: #ff4655;
}
.btn-search {
    background-color: #ff4655;
    color: #ffffff;
    border-radius: 0px;
}
.btn-search:hover {
    background-color: #e23e4b;
}
.btn-filter {
    background-color: #161d27;
    border: 1px solid #242e3d;
    border-radius: 0px;
}
.btn-filter:hover, .btn-filter.active, .btn-filter-item.active .filter-img-box {
    background: #ff4655;
    color: #ffffff;
    border-color: #ff4655;
    box-shadow: 0 4px 12px rgba(255, 70, 85, 0.3);
}
.btn-filter-item:hover .filter-img-box {
    border-color: #ff4655;
}
.btn-filter-item:hover .filter-item-text, .btn-filter-item.active .filter-item-text, .text-price, #totalAmountDisplay, .modal-header h3 {
    color: #ff4655;
}
.game-item-block, .filter-img-box {
    background-color: #161d27;
    border: 1px solid #242e3d;
    border-radius: 4px; /* มนเล็กน้อย */
}
.game-item-block:hover {
    border-color: #ff4655;
    box-shadow: 0 6px 20px rgba(255, 70, 85, 0.15);
    background-color: #1b2532;
}
.game-item-block:hover .game-img-wrapper {
    border-color: #ff4655;
}
.game-img-wrapper {
    border: 2px solid #242e3d;
    background-color: #0f141c;
    border-radius: 4px;
}
.badge-hot-mini {
    background: #ff4655;
    border-radius: 0px;
}
.modal-overlay {
    background-color: rgba(15, 20, 28, 0.9);
}
.modal-card {
    background-color: #161d27;
    border: 1px solid #242e3d;
    border-radius: 0px;
}
.modal-header {
    background-color: #111720;
    border-bottom: 1px solid #242e3d;
}
.modal-input, .price-option-label, .total-price-box {
    background-color: #0f141c;
    border: 1px solid #242e3d;
    border-radius: 0px;
}
.modal-input:focus, .price-option-label:hover, .price-option-item input[type="radio"]:checked + .price-option-label {
    border-color: #ff4655;
    color: #ff4655;
}
.price-option-item input[type="radio"]:checked + .price-option-label {
    background-color: rgba(255, 70, 85, 0.1);
}
footer {
    background-color: #0a0d12;
    border-top: 2px solid #242e3d;
}
