:root {
    /* Color Palette */
    --bg-body: #0f0f0f;      /* ดำเทาเข้มมาก */
    --bg-card: #1a1a1a;      /* ดำเทา */
    --bg-card-hover: #252525;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent: #ffffff;       /* สีขาวสำหรับจุดเด่น */
    --border: #333333;
    
    /* Status Colors */
    --status-avail: #4ade80; /* เขียวพาสเทล */
    --status-low: #fbbf24;   /* เหลืองทอง */
    --status-out: #f87171;   /* แดง */

    /* Effects */
    --shadow-card: 0 10px 30px -10px rgba(0,0,0,0.5);
    --glass-bg: rgba(15, 15, 15, 0.8);
    --glass-border: 1px solid rgba(255, 255, 255, 0.1);
}

body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 70px;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    border-bottom: var(--glass-border);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nav-container {
    width: 100%;
    max-width: 1200px;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 20px;
    font-weight: 800;
    letter-spacing: 2px;
    color: var(--text-primary);
    text-decoration: none;
    text-transform: uppercase;
}

.nav-links {
    display: flex;
    gap: 30px;
}

.nav-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.3s;
}

.nav-links a:hover, .nav-links a.active {
    color: var(--text-primary);
}

.nav-actions {
    display: flex;
    gap: 15px;
    align-items: center;
}

.icon-btn {
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    font-size: 16px;
}

.btn-primary-small {
    background: var(--text-primary);
    color: var(--bg-body);
    border: none;
    padding: 6px 16px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.3s;
}
.btn-primary-small:hover { opacity: 0.9; }

/* --- Hero Section --- */
.hero {
    height: 500px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('https://images.unsplash.com/photo-1492691527719-9d1e07e534b4?ixlib=rb-1.2.1&auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    margin-bottom: 60px;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(15,15,15,0.3), var(--bg-body));
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
    padding: 0 20px;
    margin-top: 40px;
}

.hero-subtitle {
    display: block;
    font-size: 12px;
    letter-spacing: 4px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: 48px;
    font-weight: 700;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.hero p {
    color: #cccccc;
    font-size: 16px;
    margin-bottom: 30px;
    font-weight: 300;
}

.btn-primary {
    background-color: var(--text-primary);
    color: #000;
    padding: 14px 32px;
    border: none;
    border-radius: 50px; /* ปุ่มมน */
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255,255,255,0.2);
}

/* --- Content --- */
.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

.section-header {
    margin-bottom: 40px;
    border-left: 3px solid var(--text-primary);
    padding-left: 20px;
}
.section-header h2 { margin: 0; font-size: 24px; font-weight: 600; }
.section-header p { margin: 5px 0 0 0; color: var(--text-secondary); font-size: 14px; }

/* --- Grid & Cards --- */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 30px;
    margin-bottom: 80px;
}

.item-card {
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.4s ease;
    border: 1px solid transparent;
}

.item-card:hover {
    background-color: var(--bg-card-hover);
    transform: translateY(-8px);
    box-shadow: var(--shadow-card);
    border-color: #333;
}

.card-image-container {
    height: 200px;
    background: #000;
    position: relative;
    overflow: hidden;
}

.card-image-container img {
    width: 100%; height: 100%; object-fit: cover;
    opacity: 0.8; transition: 0.5s;
}

.item-card:hover img { opacity: 1; transform: scale(1.05); }

/* Overlay on Hover */
.card-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.4);
    display: flex; align-items: center; justify-content: center;
    opacity: 0; transition: 0.3s;
}
.item-card:hover .card-overlay { opacity: 1; }

.view-btn {
    color: #fff; border: 1px solid #fff;
    padding: 8px 20px; border-radius: 30px;
    font-size: 12px; text-transform: uppercase; letter-spacing: 1px;
}

.out-of-stock-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex; align-items: center; justify-content: center;
    color: #fff; font-weight: 700; letter-spacing: 2px; font-size: 14px;
}

.card-content { padding: 20px; }

.card-top { display: flex; justify-content: space-between; margin-bottom: 8px; }
.item-code { font-size: 10px; color: var(--text-secondary); letter-spacing: 1px; text-transform: uppercase; }

.status-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.status-available { background: var(--status-avail); box-shadow: 0 0 5px var(--status-avail); }
.status-low { background: var(--status-low); }
.status-out { background: var(--status-out); }

.item-name {
    font-size: 16px; font-weight: 500; margin: 0 0 15px 0;
    line-height: 1.4; color: var(--text-primary);
}

.item-footer {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 15px; border-top: 1px solid #2a2a2a;
}
.stock-info { font-size: 12px; color: var(--text-secondary); display: flex; align-items: center; gap: 5px; }
.price-tag { font-size: 16px; font-weight: 700; color: var(--text-primary); }
.price-tag small { font-size: 12px; font-weight: 400; color: var(--text-secondary); }


/* --- Modal (Redesigned) --- */
.modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    z-index: 2000;
    display: flex; justify-content: center; align-items: center;
    opacity: 0; visibility: hidden; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-container {
    background: #151515; width: 90%; max-width: 900px;
    border-radius: 16px; overflow: hidden;
    position: relative; box-shadow: 0 25px 50px -12px rgba(0,0,0,0.7);
    border: 1px solid #333; transform: scale(0.95); transition: 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.modal-overlay.active .modal-container { transform: scale(1); }

.modal-grid { display: flex; }
.modal-image-col { flex: 4; background: #000; display: flex; align-items: center; overflow: hidden;}
.modal-image-col img { width: 100%; height: 100%; object-fit: cover; }
.modal-content-col { flex: 5; padding: 40px; position: relative; display: flex; flex-direction: column; }

.modal-close-btn {
    position: absolute; top: 20px; right: 20px;
    background: none; border: none; color: #666; font-size: 24px; cursor: pointer; transition: 0.2s;
    z-index: 10;
}
.modal-close-btn:hover { color: #fff; }

.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
#modal-code { color: #666; font-size: 12px; letter-spacing: 1px; }

.status-pill {
    padding: 4px 12px; border-radius: 20px;
    font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.st-available { background: rgba(74, 222, 128, 0.1); color: #4ade80; border: 1px solid rgba(74, 222, 128, 0.2); }
.st-low { background: rgba(251, 191, 36, 0.1); color: #fbbf24; border: 1px solid rgba(251, 191, 36, 0.2); }
.st-out { background: rgba(248, 113, 113, 0.1); color: #f87171; border: 1px solid rgba(248, 113, 113, 0.2); }

#modal-title { font-size: 28px; margin: 0 0 10px 0; font-weight: 600; line-height: 1.2; }
.modal-price { font-size: 16px; color: var(--text-secondary); margin: 0; }
.modal-price span { color: #fff; font-weight: 600; }

.divider { height: 1px; background: #2a2a2a; margin: 25px 0; }

.items-box h4 { margin: 0 0 15px 0; color: #fff; font-weight: 500; font-size: 14px; }
.styled-list { padding: 0; margin: 0; list-style: none; }
.styled-list li {
    padding: 8px 0; border-bottom: 1px solid #222; color: #bbb; font-size: 14px;
    display: flex; align-items: center;
}
.styled-list li::before { content: "•"; color: #444; margin-right: 10px; }
.styled-list li:last-child { border: none; }

.modal-actions { margin-top: auto; padding-top: 30px; }
.full-width { width: 100%; border-radius: 8px; font-size: 16px; padding: 16px; }

.site-footer { text-align: center; padding: 40px; color: #444; font-size: 12px; border-top: 1px solid #222; margin-top: 40px; }

/* Mobile Responsive */
@media (max-width: 768px) {
    .nav-links, .nav-actions { display: none; } /* ซ่อนเมนูสำหรับมือถือ (Simplified) */
    .hero h1 { font-size: 32px; }
    .modal-grid { flex-direction: column; }
    .modal-image-col { height: 250px; flex: none; }
    .modal-content-col { padding: 25px; }
}

/* --- Terms & Conditions Page --- */
.terms-box {
    background-color: var(--bg-card);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 40px;
    margin-top: 20px;
}

.terms-section {
    margin-bottom: 30px;
    border-bottom: 1px solid #2a2a2a;
    padding-bottom: 20px;
}

.terms-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.terms-section h3 {
    color: var(--text-primary);
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.terms-section h3 i {
    color: var(--text-secondary); /* หรือจะใช้สีทอง/สีแบรนด์ก็ได้ */
    font-size: 18px;
}

.terms-section ul {
    list-style: none;
    padding-left: 10px;
}

.terms-section ul li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
    color: #ccc;
    font-size: 15px;
    line-height: 1.6;
}

.terms-section ul li::before {
    content: "•";
    color: var(--text-secondary); /* สีจุด Bullet */
    font-weight: bold;
    font-size: 20px;
    position: absolute;
    left: 0;
    top: -2px;
}
.terms-section ul li strong {
    color: #fff;
    font-weight: 500;
}

/* ปรับ Responsive สำหรับมือถือ */
@media (max-width: 768px) {
    .terms-box {
        padding: 20px;
    }
}

/* ============================
   INVENTORY PAGE LAYOUT
   ============================ */

.inventory-layout {
    display: grid;
    grid-template-columns: 250px 1fr; /* ซ้าย 250px ขวาเต็มที่เหลือ */
    gap: 40px;
    align-items: start;
}

/* Sidebar Filters */
.sidebar-filters {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 25px;
    position: sticky;
    top: 100px; /* วิ่งตามลงมาเมื่อเลื่อนจอ */
}

.filter-group { margin-bottom: 30px; }
.filter-group:last-child { margin-bottom: 0; }
.filter-group h3 {
    font-size: 16px; margin-bottom: 15px;
    color: #fff; text-transform: uppercase; letter-spacing: 1px;
}

.category-list { list-style: none; padding: 0; margin: 0; }
.category-list li {
    padding: 10px 15px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 6px;
    color: var(--text-secondary);
    transition: 0.2s;
    font-size: 14px;
}
.category-list li:hover { background: #222; color: #fff; }
.category-list li.active {
    background: var(--text-primary);
    color: #000;
    font-weight: 600;
}

/* Checkbox Style */
.checkbox-wrapper label {
    display: block; margin-bottom: 10px;
    color: #ccc; font-size: 14px; cursor: pointer;
}
.checkbox-wrapper input { margin-right: 10px; accent-color: #fff; }

/* Toolbar (Search & Sort) */
.toolbar {
    display: flex; justify-content: space-between; gap: 20px;
    margin-bottom: 30px;
}
.search-box {
    flex-grow: 1; position: relative;
}
.search-box input {
    width: 100%;
    padding: 12px 12px 12px 45px; /* เว้นที่ให้ไอคอน */
    background: #111; border: 1px solid #333;
    border-radius: 50px; color: #fff;
    font-family: 'Sarabun';
    box-sizing: border-box;
}
.search-box i {
    position: absolute; left: 18px; top: 50%; transform: translateY(-50%);
    color: #666;
}
.search-box input:focus { outline: none; border-color: #fff; }

.sort-box select {
    padding: 12px 20px;
    background: var(--bg-card); border: 1px solid #333;
    color: #fff; border-radius: 50px;
    cursor: pointer; font-family: 'Sarabun';
}

/* Animation for Filtering */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Responsive */
@media (max-width: 900px) {
    .inventory-layout { grid-template-columns: 1fr; } /* มือถือเรียงลงมา */
    .sidebar-filters { position: static; margin-bottom: 30px; }
    .toolbar { flex-direction: column; }
    .search-box input { width: 100%; }
    .sort-box select { width: 100%; }
}

/* ============================
   CONTACT PAGE (CLEAN VERSION)
   ============================ */

/* จัด Grid ให้อยู่ตรงกลาง สวยงาม */
.contact-grid-center {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); /* ปรับขนาดอัตโนมัติ */
    gap: 30px;
    max-width: 1000px;
    margin: 0 auto; /* จัดกึ่งกลางหน้าจอ */
    padding: 20px 0;
}

/* ดีไซน์การ์ดติดต่อแบบใหม่ (ใหญ่และชัดขึ้น) */
.contact-card-large {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 30px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.contact-card-large:hover {
    transform: translateY(-5px);
    background: #222;
    border-color: #555;
    box-shadow: 0 10px 30px rgba(0,0,0,0.4);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: #151515;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    margin-right: 25px;
    flex-shrink: 0;
    transition: 0.3s;
}

.contact-card-large:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
    background: #000;
}

.card-details h3 {
    margin: 0 0 5px 0;
    font-size: 18px;
    color: #fff;
    font-weight: 600;
}

.card-details p {
    margin: 0 0 10px 0;
    font-size: 15px;
    color: #aaa;
}

.link-text {
    font-size: 13px;
    color: var(--text-primary); /* สีขาว */
    opacity: 0.5;
    display: flex;
    align-items: center;
    gap: 5px;
}
.link-text::after {
    content: '→';
    opacity: 0;
    transform: translateX(-5px);
    transition: 0.3s;
}
.contact-card-large:hover .link-text { opacity: 1; }
.contact-card-large:hover .link-text::after { opacity: 1; transform: translateX(0); }

/* สีเฉพาะของแต่ละ Platform */
.contact-card-large.facebook .card-icon i { color: #1877F2; }
.contact-card-large.line .card-icon i { color: #00C300; }
.contact-card-large.email .card-icon i { color: #EA4335; }
.contact-card-large.instagram .card-icon i { 
    background: -webkit-linear-gradient(#405DE6, #E1306C); 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent; 
}
.contact-card-large.youtube .card-icon i { color: #FF0000; }

/* Responsive */
@media (max-width: 600px) {
    .contact-grid-center {
        grid-template-columns: 1fr; /* มือถือแสดงเรียงเดี่ยว */
    }
    .contact-card-large {
        padding: 20px;
    }
}

/* ============================
   CART PAGE STYLES
   ============================ */

/* Layout แบ่งซ้ายขวา */
.cart-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    align-items: start;
}

/* Header ของตารางรายการ */
.cart-header-row {
    display: flex;
    justify-content: space-between;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
    margin-bottom: 20px;
    color: var(--text-secondary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ตัวการ์ดรายการสินค้าแต่ละชิ้น */
.cart-item {
    display: flex;
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 12px;
    padding: 15px;
    margin-bottom: 20px;
    transition: 0.3s;
}

.cart-item:hover {
    border-color: #555;
    background: #1f1f1f;
}

.item-image {
    width: 100px;
    height: 100px;
    border-radius: 8px;
    overflow: hidden;
    flex-shrink: 0;
    margin-right: 20px;
    background: #000;
}

.item-image img {
    width: 100%; height: 100%; object-fit: cover;
}

.item-details {
    flex-grow: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-info h3 { margin: 0 0 5px 0; font-size: 18px; color: #fff; }
.item-desc { margin: 0; color: #888; font-size: 14px; }
.item-code {
    display: block; font-size: 12px; color: var(--text-secondary);
    margin-bottom: 5px; letter-spacing: 0.5px;
}

.item-price-action {
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.item-price-action .price { font-size: 20px; font-weight: 700; color: #fff; }

.remove-btn {
    background: none; border: none;
    color: #ff5555; cursor: pointer;
    font-size: 13px; display: flex; align-items: center; gap: 5px;
    opacity: 0.7; transition: 0.2s;
}
.remove-btn:hover { opacity: 1; text-decoration: underline; }

.continue-shopping {
    display: inline-flex; align-items: center; gap: 8px;
    color: var(--text-secondary); text-decoration: none;
    margin-top: 10px; transition: 0.2s;
}
.continue-shopping:hover { color: #fff; }

/* Summary Box (ฝั่งขวา) */
.cart-summary-wrapper {
    position: sticky;
    top: 100px; /* วิ่งตามเมื่อเลื่อนหน้าจอ */
}

.summary-card {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 30px;
}

.summary-card h3 { margin: 0 0 25px 0; font-size: 20px; color: #fff; border-bottom: 1px solid #333; padding-bottom: 15px; }

.summary-row {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 15px; font-size: 14px; color: #ccc;
}

.date-input {
    background: #111; border: 1px solid #333; color: #fff;
    padding: 5px 10px; border-radius: 4px; font-family: 'Sarabun';
    cursor: pointer;
}

.summary-total {
    display: flex; justify-content: space-between; align-items: center;
    margin: 20px 0 30px 0; padding-top: 20px;
    border-top: 1px solid #333;
}
.summary-total span:first-child { font-size: 16px; color: #fff; }
.total-price { font-size: 24px; font-weight: 700; color: #4ade80; } /* สีเขียวเด่นๆ */

.terms-note {
    margin-top: 20px; font-size: 12px; color: #666;
    background: rgba(255,255,255,0.03); padding: 10px; border-radius: 6px;
    display: flex; gap: 8px; align-items: start;
}

/* Badge ตรงเมนู */
.badge {
    background: #ff5555; color: #fff;
    font-size: 10px; padding: 2px 6px;
    border-radius: 10px; position: absolute; top: 0; right: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .cart-layout { grid-template-columns: 1fr; } /* มือถือเรียงลงมา */
    .item-details { flex-direction: column; align-items: flex-start; gap: 15px; }
    .item-price-action { align-items: flex-start; flex-direction: row; justify-content: space-between; width: 100%; }
}

/* ============================
   PAYMENT PAGE STYLES
   ============================ */

.payment-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    align-items: start;
}

/* Payment Card (กล่องข้อมูล) */
.payment-card {
    background: var(--bg-card);
    border: 1px solid #333;
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.card-title {
    margin-top: 0;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #333;
    color: #fff;
    font-size: 18px;
    display: flex; align-items: center; gap: 10px;
}

/* Bank Info Box */
.bank-transfer-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #111;
    border: 1px solid #333;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.bank-info { display: flex; align-items: center; gap: 15px; }
.bank-logo { width: 50px; height: 50px; border-radius: 8px; }
.bank-info h4 { margin: 0 0 5px 0; color: #fff; font-size: 16px; }
.bank-info p { margin: 0; color: #aaa; font-size: 13px; }
.acc-number { font-size: 18px; color: #4ade80; font-weight: 700; margin-top: 5px !important; letter-spacing: 1px; }

.qr-box {
    text-align: center;
    background: #fff;
    padding: 10px;
    border-radius: 8px;
    width: 100px;
}
.qr-box img { width: 100%; display: block; }
.qr-box span { font-size: 10px; color: #000; display: block; margin-top: 5px; font-weight: 600; }

.alert-box {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    padding: 12px;
    border-radius: 8px;
    font-size: 13px;
    display: flex; align-items: center; gap: 10px;
}

/* Order Summary (Right Side) */
.sticky-card { position: sticky; top: 100px; }

.order-list { margin-bottom: 20px; }
.order-item {
    display: flex; justify-content: space-between;
    margin-bottom: 12px; font-size: 14px; color: #ccc;
    border-bottom: 1px solid #222; padding-bottom: 8px;
}
.order-item:last-child { border-bottom: none; }
.oi-name { font-weight: 500; color: #fff; }
.oi-qty { color: #888; font-size: 12px; margin-left: 5px; }

.total-row {
    display: flex; justify-content: space-between; align-items: center;
    font-size: 18px; color: #fff; font-weight: 600;
}
.total-row .total-price { color: #4ade80; font-size: 24px; }

.secure-badge {
    text-align: center; font-size: 12px; color: #666; margin-top: 20px;
    display: flex; align-items: center; justify-content: center; gap: 5px;
}

.mt-20 { margin-top: 20px; }

/* Success Modal Style */
.success-modal-content {
    text-align: center;
    padding: 50px 30px;
    max-width: 400px;
}
.success-icon {
    font-size: 60px; color: #4ade80;
    margin-bottom: 20px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.success-modal-content h2 { margin: 0 0 10px 0; color: #fff; }
.success-modal-content p { color: #aaa; margin-bottom: 30px; line-height: 1.6; }

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* Responsive */
@media (max-width: 900px) {
    .payment-layout { grid-template-columns: 1fr; }
    .bank-transfer-box { flex-direction: column; text-align: center; gap: 20px; }
    .bank-info { flex-direction: column; }
    .payment-right { order: -1; } /* เอาสรุปไว้บนสุดในมือถือ */
}

/* ============================
   MODERN FORM STYLES
   ============================ */

/* Container ของแต่ละ Input */
.input-group {
    position: relative;
    margin-bottom: 25px; /* ระยะห่างระหว่างช่อง */
}

/* ตัว Input Field */
.modern-input {
    width: 100%;
    padding: 12px 15px 12px 45px; /* เว้นซ้ายไว้ใส่ไอคอน */
    background: transparent;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-family: 'Sarabun', sans-serif;
    font-size: 15px;
    transition: 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

/* ไอคอนหน้าช่อง (User, Phone, Line) */
.input-icon {
    position: absolute;
    left: 15px;
    top: 14px;
    color: #666;
    font-size: 16px;
    transition: 0.3s;
    pointer-events: none; /* คลิกทะลุได้ */
}
.textarea-icon { top: 15px; } /* ปรับตำแหน่งไอคอนสำหรับ Textarea */

/* Label (ข้อความกำกับ) */
.modern-label {
    position: absolute;
    left: 42px; /* เริ่มหลังไอคอน */
    top: 12px;
    color: #888;
    font-size: 14px;
    transition: 0.3s ease;
    pointer-events: none;
    background-color: var(--bg-card); /* เอาสีพื้นหลังมาบังเส้นขอบตอนลอย */
    padding: 0 5px;
}

/* --- เอฟเฟกต์ตอน Focus หรือมีข้อความ --- */

/* เมื่อกดพิมพ์ หรือ มีข้อความอยู่ (ใช้ placeholder-shown trick) */
.modern-input:focus,
.modern-input:not(:placeholder-shown) {
    border-color: #4ade80; /* สีเขียวสว่าง หรือสีธีมทองก็ได้ */
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.2);
}

.modern-input:focus + .modern-label,
.modern-input:not(:placeholder-shown) + .modern-label {
    top: -10px; /* ลอยขึ้นไปข้างบน */
    left: 10px;
    font-size: 12px;
    color: #4ade80;
    font-weight: 600;
}

.modern-input:focus ~ .input-icon {
    color: #4ade80; /* ไอคอนเปลี่ยนสีตาม */
}

/* ปรับ Textarea */
textarea.modern-input {
    resize: vertical;
    min-height: 100px;
    line-height: 1.5;
}

/* ปุ่มกดส่ง */
.btn-primary i {
    margin-left: 8px;
    transition: 0.3s;
}
.btn-primary:hover i {
    transform: translateX(5px) rotate(-10deg);
}

/* ปรับ Responsive สำหรับ Form Row */
@media (max-width: 600px) {
    .form-row {
        display: block; /* เรียงลงมาในมือถือ */
    }
    .input-group {
        margin-bottom: 20px;
    }
}

/* --- MODERN FORM INPUT STYLES --- */

/* Container */
.input-group {
    position: relative;
    margin-bottom: 30px; /* ระยะห่างระหว่างบรรทัด */
}

/* Input Field */
.modern-input {
    width: 100%;
    padding: 12px 15px 12px 45px; /* เว้นซ้ายให้ไอคอน */
    background: transparent;
    border: 1px solid #444; /* สีเส้นขอบปกติ */
    border-radius: 8px;
    color: #fff;
    font-family: 'Sarabun', sans-serif;
    font-size: 15px;
    outline: none;
    transition: 0.3s;
    box-sizing: border-box;
}

/* Label (ข้อความกำกับ) */
.modern-label {
    position: absolute;
    left: 45px;
    top: 13px;
    color: #888;
    font-size: 14px;
    transition: 0.3s;
    pointer-events: none;
    background-color: var(--bg-card); /* สีพื้นหลังบังเส้น */
    padding: 0 5px;
}

/* Icon */
.input-icon {
    position: absolute;
    left: 15px;
    top: 15px;
    color: #666;
    transition: 0.3s;
}
.textarea-icon { top: 15px; }

/* Effects เมื่อคลิก หรือ มีข้อความ (Floating Label) */
.modern-input:focus,
.modern-input:not(:placeholder-shown) {
    border-color: #4ade80; /* สีเส้นขอบตอน Active */
    box-shadow: 0 0 8px rgba(74, 222, 128, 0.1);
}

.modern-input:focus + .modern-label,
.modern-input:not(:placeholder-shown) + .modern-label {
    top: -10px; /* ลอยขึ้นบน */
    left: 10px;
    font-size: 12px;
    color: #4ade80;
    font-weight: 600;
}

.modern-input:focus ~ .input-icon {
    color: #4ade80;
}

/* Textarea */
textarea.modern-input {
    min-height: 100px;
    resize: vertical;
    line-height: 1.5;
}

/* ============================
   MODAL & POPUP STYLES (Center Fixed)
   ============================ */

/* พื้นหลังมืด (Overlay) */
.modal-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.7); /* พื้นหลังสีดำโปร่งแสง */
    z-index: 2000;
    
    /* หัวใจสำคัญของการจัดกึ่งกลาง */
    display: none; /* ซ่อนไว้ก่อน */
    justify-content: center; /* กึ่งกลางแนวนอน */
    align-items: center;     /* กึ่งกลางแนวตั้ง */
    
    opacity: 0;
    transition: opacity 0.3s ease;
}

/* เมื่อ Modal ทำงาน (Active) */
.modal-overlay.active {
    display: flex; /* เปลี่ยนเป็น flex เพื่อให้จัดกลางทำงาน */
    opacity: 1;
}

/* กล่องเนื้อหา (Content Box) */
.success-modal-content {
    background: var(--bg-card, #1e1e1e); /* ใช้สีตามธีม หรือสีดำเทา */
    padding: 40px;
    border-radius: 16px;
    text-align: center;
    max-width: 400px;
    width: 90%; /* กันไม่ให้ล้นจอมือถือ */
    border: 1px solid var(--border-color, #333);
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    
    transform: scale(0.8);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.active .success-modal-content {
    transform: scale(1); /* เด้งขยายขนาดปกติ */
}

/* Icon และ Text */
.success-icon {
    font-size: 60px;
    color: #4ade80; /* สีเขียว */
    margin-bottom: 20px;
}
.success-modal-content h2 {
    color: var(--text-primary, #fff);
    margin: 0 0 10px 0;
}
.success-modal-content p {
    color: var(--text-secondary, #aaa);
    margin-bottom: 25px;
    line-height: 1.5;
}