/* ==========================================================================
   ระบบสไตล์พื้นฐานและโครงสร้าง Grid (ไม่พึ่งพาอินเทอร์เน็ต)
   ========================================================================== */
* { box-sizing: border-box; margin: 0; padding: 0; font-family: system-ui, -apple-system, sans-serif; }
body { background-color: #0f172a; 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: #1e293b; 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: linear-gradient(135deg, #1e1b4b 0%, #0f172a 100%); 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); } }
