* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: #014a7250;
    margin: 0;
    padding: 0;
    color: #333;
    align-items: center;
    min-height: 100vh;
    flex-direction: column;
}

.container {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

/* จัดตำแหน่ง Header ให้โลโก้อยู่ซ้าย รูปอยู่ขวา */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    text-align: center;
}

.logo {
    font-size: 28px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 5px;
}

header p {
    color: #666;
    margin: 0;
}

/* เลือกทุก Element ที่มี ID ขึ้นต้นด้วย package-list- */
[id^="package-list-"] {
    display: flex;
    flex-direction: column; /* เรียงลงมาเป็นแถว */
    gap: 15px;             /* ระยะห่างระหว่างการ์ดสินค้าแต่ละใบ */
    margin-bottom: 30px;    /* ระยะห่างระหว่างกลุ่มเกม (เช่น RoV ห่างจาก FreeFire) */
}

/* เพิ่มเติม: แต่งหัวข้อชื่อเกมให้ดูแยกโซนชัดเจน */
h3 {
    margin-top: 20px;
    margin-bottom: 10px;
    padding-left: 10px;
    border-left: 5px solid #00b900; /* เส้นสีเขียวหน้าชื่อเกม */
    font-size: 1.2rem;
}

.package-card {
    background: rgb(255, 255, 255);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px rgb(0, 0, 0);
    cursor: pointer; /* ทำให้เป็นรูปมือเมื่อชี้ */
    transition: transform 0.1s, background-color 0.2s;
    -webkit-tap-highlight-color: transparent; /* ลบแถบสีฟ้าเวลาแตะบนมือถือ */
}

.package-card:hover {
    -webkit-tap-highlight-color: transparent;
    transform: scale(0.95); /* ยุบตัวลงเล็กน้อยเวลาลัด */
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgb(0, 140, 255);;
}

.package-card:active {
    -webkit-tap-highlight-color: transparent;
    transform: scale(0.85); /* ยุบตัวลงเล็กน้อยเวลาลัด */
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgb(0, 140, 255);;
}

/* ส่วนแสดงราคา (เปลี่ยนจากปุ่มเป็นข้อความสวยๆ) */
.buy-price {
    background-color: #00b900;
    color: white;
    padding: 8px 15px;
    border-radius: 10px;
    font-weight: bold;
    font-size: 15px;
}

.package-card.featured {
    border: 2px solid #00b900;
    position: relative;
}

.gem-custom-img {
    width: 40px;      /* ปรับขนาดตามความเหมาะสม */
    height: 40px;
    object-fit: contain;
    border-radius: 4px; /* ถ้าอยากให้รูปมนนิดๆ */
    margin-right: 8px;
}

.gem-icon {
    display: flex;
    align-items: center;
}
.gem-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.gem-amount {
    font-size: 18px;
    font-weight: bold;
    color: #1a1a1a;
}

.gem-description {
    font-size: 13px;
    color: #00b900;
    font-weight: 500;
}

.buy-btn {
    background-color: #00b900;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 16px;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,185,0,0.2);
}

.buy-btn:hover {
    background-color: #00a000;
}

/* แถบตะกร้าสินค้าด้านล่าง */
/* ปรับแต่งแถบตะกร้าใหม่ */
.cart-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 95%;
    max-width: 450px;
    background: #ffffff;
    color: rgb(0, 0, 0);
    padding: 12px;
    border-radius: 15px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 1000;
}

/* ส่วนแสดงรายการสินค้าแบบสด */
.cart-live-items {
    max-height: 120px; /* จำกัดความสูงให้โชว์ได้ประมาณ 2-3 รายการ */
    overflow-y: auto;  /* ถ้าของเยอะเกินจะเลื่อน (scroll) ได้ในตัว */
    border-bottom: 1px solid #72727261;
    margin-bottom: 5px;
    padding-bottom: 5px;
}

/* ปรับแต่ง Scrollbar ให้ดูเล็กและสวย (สำหรับ Chrome/Safari) */
.cart-live-items::-webkit-scrollbar {
    width: 6px;
}
.cart-live-items::-webkit-scrollbar-thumb {
    background: #444;
    border-radius: 20px;
}

.live-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 30px;
    padding: 4px 0;
}

.live-item-remove {
    color: #e74c3c;
    cursor: pointer;
    font-weight: bold;
    padding: 2px 8px; /* เพิ่ม padding ให้พื้นที่กดกว้างขึ้น */
    border-radius: 4px; /* ทำให้ขอบมนเล็กน้อย */
    transition: all 0.1s; /* ให้การแสดงผลนุ่มนวล */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent; /* ลบเงาสีฟ้าพื้นฐานของ iOS */
}

/* เอฟเฟกต์ตอนเอาเมาส์ไปชี้ (สำหรับคอม) */
.live-item-remove:hover {
    background-color: rgba(231, 76, 60, 0.1); /* พื้นหลังสีแดงจางๆ */
}

/* เอฟเฟกต์ตอน "กด" (สำหรับ iPhone/Android) */
.live-item-remove:active {
    background-color: #e74c3c; /* พื้นหลังสีแดงเต็ม */
    color: white; /* เปลี่ยนตัว X เป็นสีขาว */
    transform: scale(0.9); /* ยุบตัวลงเล็กน้อย */
}

/* ช่องกรอก UID ในแถบสีดำ */
.cart-uid-input-container {
    width: 100%;
}

.cart-uid-input:focus {
    border-color: #27ae60;
}


.checkout-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.checkout-btn:disabled {
    background: #27ae5f79;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

/* ปรับระยะห่างด้านล่างของลิสต์ไม่ให้โดนแถบตะกร้าบัง */
.package-list {
    padding-bottom: 100px;
}

/* หน้าต่างรายการสินค้า (Modal) */
.cart-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: flex-end; /* ให้เด้งขึ้นมาจากด้านล่างแบบแอปมือถือ */
    z-index: 2000;
}

.modal-content {
    background: white;
    width: 100%;
    max-width: 500px;
    border-radius: 20px 20px 0 0;
    padding: 20px;
    max-height: 70vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
}

.cart-item-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #f9f9f9;
}

.remove-btn {
    background: #ff4d4d;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
}

.checkout-btn-full {
    width: 100%;
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: bold;
    margin-top: 20px;
}

.input-group {
    background: white;
    padding: 15px;
    border-radius: 16px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.input-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    font-size: 14px;
    color: #555;
}

.uid-input {
    flex: 1;
    width: 100%;
    padding: 12px;
    border: 2px solid #eee;
    border-radius: 10px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s;
}

.uid-input-wrapper {
    display: flex;
    align-items: center;
    gap: 8px; /* ระยะห่างระหว่างช่องกรอกกับปุ่ม */
    width: 100%;
}

.uid-input:focus {
    border-color: #00b900; /* เปลี่ยนเป็นสีเขียวเมื่อกำลังพิมพ์ */
}

.cart-uid-section {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cart-uid-input {
    width: 100%;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid #6e6e6e;
    background: #ffffff;
    color: rgb(0, 0, 0);
    font-size: 14px;
}

.cart-uid-caution {
    font-size: 10px;
    color: #ff7675; /* สีแดงอ่อนๆ */
    text-align: center;
}

.cart-main-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 5px;
    padding-top: 5px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.cart-info {
    display: flex;
    flex-direction: column;
}

.cart-count {
    font-size: 10px;
    opacity: 0.8;
}

.cart-total-price {
    font-size: 18px;
    font-weight: bold;
    color: #f1c40f;
}

.user-profile {
    width: 40px;
    height: 40px;
    border-radius: 50%; /* ทำให้เป็นวงกลม */
    overflow: hidden;
    border: 2px solid white; /* เพิ่มขอบสีขาวนิดหน่อย */
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.user-profile img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* ป้องกันรูปเบี้ยว */
}

/* เลือกผ่าน Class ที่เราตั้งไว้ใน HTML */
.shop-logo {
    width: 40px;      /* กำหนดความกว้าง */
    height: auto;       /* ให้ความสูงปรับตามสัดส่วนอัตโนมัติ (ภาพไม่เบี้ยว) */
    object-fit: contain; /* ช่วยให้ภาพรักษาหน้าตาเดิมไว้ในกรอบ */
}

.info-btn {
    background: #34495e;
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%; /* ทำให้เป็นปุ่มวงกลม */
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s;
    flex-shrink: 0; /* ป้องกันปุ่มโดนบีบจนเบี้ยว */
}

.info-btn:hover {
    background: #5d6d7e;
}

.banner-img {
    width: 100%;
    height: auto;
    display: flexbox;
    border-radius: 12px;
    margin: 15px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    object-fit: cover;
}