/* ====== Page styles (เฉพาะหน้า buyer) ====== */
.mx-container{ max-width:1200px; margin:0 auto; padding:18px; color:#e9ecff; }

/* กล่อง */
.mx-card{
  background:#171a2a;
  border:1px solid rgba(255,255,255,.10);
  border-radius:18px;
  box-shadow:0 10px 30px rgba(0,0,0,.28), inset 0 1px 0 rgba(255,255,255,.02);
  padding:16px; margin-bottom:18px;
}
.mx-head{ display:flex; align-items:center; gap:8px; margin:0 0 10px; font-weight:900; font-size:18px; }
.mx-label{ font-size:12px; opacity:.9; margin-bottom:6px; display:block; }
.mx-input, .mx-select{
  width:100%; background:#0f1321; color:#fff; border:1px solid rgba(255,255,255,.12);
  border-radius:12px; padding:12px 14px; font-weight:800;
}
.mx-btn{ display:inline-flex; align-items:center; justify-content:center; gap:8px;
  padding:10px 16px; border-radius:12px; background:#ff0033; color:#fff; border:1px solid #ff0033; font-weight:900; }
.mx-btn-ghost{ padding:10px 16px; border-radius:12px; border:1px solid rgba(255,255,255,.15); background:#0f1321; color:#fff; font-weight:800; }
.mx-btn:hover{ filter:brightness(1.05); }
.mx-btn-ghost:hover{ background:#151a2a; }
.mx-hint{ opacity:.75; font-size:12px; margin-top:6px; display:block; }

.grid-2{ display:grid; grid-template-columns: 1.4fr .6fr; gap:16px; }
@media (max-width: 992px){ .grid-2{ grid-template-columns: 1fr; } }

/* ========= Banner แบบ V1 (ห้ามคลิก / เต็มความกว้าง card) ========= */
.asset__item{ border-radius:18px; overflow:hidden; background:#0f1321; }
.asset__img{ display:block; width:100%; }
.asset__img img{ width:100%; height:auto; display:block; }

/* คำอธิบายเกม */
.game-desc{ color:#d6dbff; line-height:1.6; }
.game-desc p{ margin:6px 0; }

/* การ์ดแพ็กเกจ (โครง V1 + สกิน V2) */
.pkg-grid{ display:grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap:14px; }
@media (max-width:1100px){ .pkg-grid{ grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width:740px){ .pkg-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); } }

.product{
  position:relative; cursor:pointer;
  background:linear-gradient(180deg,#0f1321 0%, #0d101a 100%);
  border:1px solid rgba(255,255,255,.10); border-radius:16px;
  padding:14px 12px; display:flex; flex-direction:column; align-items:center; gap:10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.03); transition:.15s ease;
  min-height: 172px;
}
.product:hover{ border-color:rgba(255,255,255,.22); transform: translateY(-1px); }
.product.active{ border-color:#ff0033; box-shadow:0 0 0 3px rgba(255,0,51,.15) inset, 0 12px 32px rgba(0,0,0,.35); }
.product.cart-pulse{ animation: cartPulse .28s ease; }
@keyframes cartPulse{ 50%{ transform: translateY(-2px) scale(1.025); border-color:#7cf2a4; } }
.product img{ width:52px; height:52px; border-radius:12px; object-fit:cover; background:#151a2a; }
.font_product{ font-weight:900; text-align:center; min-height:36px; }
.price-block{ display:grid; gap:4px; place-items:center; position: relative; }
.amount{ font-weight:900; font-size:18px; background:#ff0033; color:#fff; padding:2px 8px; border-radius:8px; }
.original-price{ color:#a7afc9; text-decoration:line-through; font-weight:700; font-size:12px; }
.flashsale-tag{ position:absolute; top:8px; right:8px; padding:4px 10px; font-size:11px; font-weight:900; border-radius:999px; background:#0ea5ff; color:#fff; }
.countdown,.countstock{ font-size:12px; opacity:.95; background:#222; color:#ffcc00; padding:2px 6px; border-radius:6px; }

/* ช่องทางชำระเงิน (โครงเดิม) */
.pay-grid{ display:grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap:10px; }
@media (max-width:460px){ .pay-grid{ grid-template-columns: repeat(2, minmax(0,1fr)); } }
.product2{
  display:flex; flex-direction:column; align-items:center; gap:8px;
  background:#0f1321; border:1px solid rgba(255,255,255,.12); border-radius:14px; padding:12px;
  cursor:pointer; transition:.15s ease; min-height:110px; justify-content:center; text-align:center;
}
.product2:hover{ border-color:#ff0033; }
.product2.active{ border-color:#ff0033; box-shadow:0 0 0 3px rgba(255,0,51,.12) inset; }
.product2 img{ width:38px; height:38px; object-fit:contain; }
.product2 span{ font-weight:800; }

/* สรุปรายการ + ปุ่ม */
.text_price_product,
.text_price,
.text_price_dis,
.text_price_total {
  display: block;
  margin: 2px 0;
  font-size: 14px;
  font-weight: 500;
  color: #d0d3df;
}
/* ราคา */
.text_price {
  color: #d0d3df;
}

/* ส่วนลด */
.text_price_dis {
  color: #ff6666; /* แดงอ่อน */
}

/* ยอดชำระทั้งหมด */
.text_price_total {
  color: #66FF99;           /* เขียวสดเหมือนเก่า */
  font-weight: 700;
  margin-top: 6px;
  border-top: 1px solid rgba(255,255,255,.08);
  padding-top: 4px;
  font-size: 15px;
}

/* หัวข้อสรุปรายการ */
.text_price_product {
  font-weight: 600;
  color: #e5e8f0;
  margin-bottom: 6px;
}
.text_price {
  font-weight: 600;
  color: #e5e8f0;
  margin-bottom: 6px;
}
.text_price_dis {
  font-weight: 600;
  color: #FFFF00;
  margin-bottom: 6px;
}

.asset__btns{ display:grid; grid-template-columns: 1fr auto; gap:10px; }
.asset__btn_buy{ background:#ff0033; color:#fff; border:1px solid #ff0033; padding:10px 16px; border-radius:12px; font-weight:900; }
.asset__btn{ border:1px solid rgba(255,255,255,.15); background:#0f1321; color:#fff; padding:10px 16px; border-radius:12px; font-weight:800; }

.input-with-button{ display:grid; grid-template-columns: 1fr auto auto; gap:8px; }
@media (max-width:520px){ .input-with-button{ grid-template-columns:1fr; } }
.btn--check,.btn--history,.btn--apply,.btn--mycoupons{
  background:#0f1321; color:#fff; border:1px solid rgba(255,255,255,.15); padding:10px 12px; border-radius:10px; font-weight:800; cursor:pointer;
}
.btn--apply{ background:#ff0033; border-color:#ff0033; }

/* ===== ปุ่มตรวจสอบ (btn--check) ===== */
.btn--check {
  background: linear-gradient(90deg, rgb(207, 43, 22) 0%, #ff0033 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

/* ✅ เอฟเฟกต์แสงพาดผ่าน (hover) */
.btn--check::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.6s ease;
}
.btn--check:hover::before { left: 130%; }

/* ✅ สีตอน hover */
.btn--check:hover {
  border-color: #ff0033;
  background: linear-gradient(90deg, #ff0033 0%, #b80028 100%);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 12px rgba(255,0,51,0.35);
}

/* ✅ เอฟเฟกต์คลิก */
.btn--check:active {
  transform: scale(0.97);
  box-shadow: 0 0 6px rgba(255,0,51,0.5) inset;
}


/* ===== ปุ่มตกลง (btn--apply) ===== */
.btn--apply {
  background: linear-gradient(90deg, rgb(207, 43, 22) 0%, #ff0033 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

/* แสงพาดผ่าน */
.btn--apply::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.6s ease;
}
.btn--apply:hover::before { left: 130%; }

/* Hover */
.btn--apply:hover {
  border-color: #ff0033;
  background: linear-gradient(90deg, #ff0033 0%, #b80028 100%);
  transform: translateY(-1px) scale(1.02);
  box-shadow: 0 0 12px rgba(255,0,51,0.35);
}

/* Active */
.btn--apply:active {
  transform: scale(0.97);
  box-shadow: 0 0 6px rgba(255,0,51,0.5) inset;
}


/* ===== ปุ่มสั่งซื้อ (asset__btn_buy) ===== */
.asset__btn_buy {
  background: linear-gradient(90deg, rgb(207, 43, 22) 0%, #ff0033 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: 900;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
}

/* แสงพาดผ่าน */
.asset__btn_buy::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.25) 0%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.6s ease;
}
.asset__btn_buy:hover::before { left: 130%; }

/* Hover */
.asset__btn_buy:hover {
  border-color: #ff0033;
  background: linear-gradient(90deg, #ff0033 0%, #b80028 100%);
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 16px rgba(255,0,51,0.4);
}

/* Active */
.asset__btn_buy:active {
  transform: scale(0.96);
  box-shadow: 0 0 8px rgba(255,0,51,0.55) inset;
}






/* ===== ปุ่มประวัติ (btn--history) ===== */
.btn--history {
  background: linear-gradient(90deg, #1b1e2d 0%, #10131f 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  animation: btnHistoryPulse 3s ease-in-out infinite; /* pulse เบา ๆ */
}

/* แสงพาดผ่านตอน hover */
.btn--history::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.6s ease;
}
.btn--history:hover::before { left: 130%; }

/* Hover → โทนน้ำเงินม่วง + ยกนิด ๆ + glow */
.btn--history:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 15px rgba(99,102,241,0.35);
}

/* Active → ยุบลงเล็กน้อย + inset glow */
.btn--history:active {
  transform: scale(0.96);
  box-shadow: 0 0 8px rgba(99,102,241,0.45) inset;
}

/* Pulse glow ตอน idle */
@keyframes btnHistoryPulse {
  0%, 100% { box-shadow: 0 0 6px rgba(99,102,241,0.15); }
  50%      { box-shadow: 0 0 14px rgba(99,102,241,0.35); }
}

/* ลดแอนิเมชันสำหรับผู้ใช้ที่ตั้งค่าลด motion */
@media (prefers-reduced-motion: reduce) {
  .btn--history,
  .btn--history::before {
    transition: none !important;
    animation: none !important;
  }
}



/* ===== ปุ่มคูปองของฉัน (badge ลอยได้ หมอกไม่หลุด) ===== */
.btn--mycoupons {
  background: linear-gradient(90deg, #1b1e2d 0%, #10131f 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: hidden; /* ✅ กันหมอกให้อยู่ในขอบ */
  transition: all 0.25s ease;
}

.btn--mycoupons {
  position: relative;
  overflow: hidden; /* กันหมอก */
}

.badge-wrapper {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  overflow: visible; /* ✅ ปล่อย badge ให้ออกนอกได้ */
  z-index: 3;
}

/* หมอกพาดผ่านในขอบ */
.btn--mycoupons::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.6s ease;
}
.btn--mycoupons:hover::before { left: 130%; }

/* badge */
#couponCountBadge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff0033;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 6px rgba(255,0,51,.45);
  pointer-events: none;
  transition: transform 0.25s ease;
}

#myCouponsBtn:hover #couponCountBadge {
  transform: scale(1.15);
}




/* Hover → โทนน้ำเงินม่วง + ยกนิด ๆ + glow */
.btn--mycoupons:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 15px rgba(99,102,241,0.35);
}

/* Active → ยุบลงเล็กน้อย + inset glow */
.btn--mycoupons:active {
  transform: scale(0.96);
  box-shadow: 0 0 8px rgba(99,102,241,0.45) inset;
}

/* ===== ปุ่มย้อนกลับ / ปุ่มรอง (asset__btn) ===== */
.asset__btn {
  background: linear-gradient(90deg, #1b1e2d 0%, #10131f 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 16px;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  animation: btnHistoryPulse 3s ease-in-out infinite;
}

/* แสงพาดผ่านตอน hover */
.asset__btn::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.6s ease;
}
.asset__btn:hover::before { left: 130%; }

/* Hover → โทนน้ำเงินม่วง + ยกนิด ๆ + glow */
.asset__btn:hover {
  transform: translateY(-1px) scale(1.03);
  box-shadow: 0 0 15px rgba(99,102,241,0.35);
}

/* Active → ยุบลงเล็กน้อย + inset glow */
.asset__btn:active {
  transform: scale(0.96);
  box-shadow: 0 0 8px rgba(99,102,241,0.45) inset;
}
/*///////////////////////////////////////////////*/

/* กรณีเป็น Flash Sale ให้ amount เป็นสีเขียว */
.product:has(.flashsale-tag) .amount {
  background: linear-gradient(90deg, #00aa44 0%, #01db6e 100%);
  color: #fff;
  box-shadow: 0 0 12px rgba(51,255,153,0.35);
}

/* Toast */
.toast-container {
  position: fixed;
  top: 8%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast{ padding:10px 14px; border-radius:10px; color:#fff; font-weight:800; box-shadow:0 6px 20px rgba(0,0,0,.3); }
.toast--success{ background:#0ea95e; } .toast--error{ background:#e02828; }
/* ✅ เอฟเฟกต์ตอน toast โผล่ */
.toast {
  padding: 10px 14px;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 6px 20px rgba(0,0,0,.3);
  opacity: 0;
  transform: translateY(-15px);
  animation: toastIn .4s ease forwards;
}

@keyframes toastIn {
  0% { opacity: 0; transform: translateY(-15px) scale(0.95); }
  60% { opacity: 1; transform: translateY(0) scale(1.03); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

/* ✅ เอฟเฟกต์ตอน toast หาย */
.toast.hide {
  animation: toastOut .3s ease forwards;
}

@keyframes toastOut {
  0% { opacity: 1; transform: translateY(0) scale(1); }
  100% { opacity: 0; transform: translateY(-10px) scale(0.9); }
}

/* ===== Popup (ของเก่าจาก buyer_old.html — 100%) ===== */
.coupon-popup-overlay{
  position:fixed; inset:0;
  background:rgba(0,0,0,.55) !important;
  opacity:0; visibility:hidden; transition:.2s ease; z-index:9998;
}
.coupon-popup-overlay.active{ opacity:1; visibility:visible; }

.coupon-popup{
  position:fixed; top:50%; left:50%;
  transform:translate(-50%,-50%) scale(.98);
  width:min(480px,94vw);
  background: #0e0d0f;        /* สีพื้นแบบเดิม */
  color:#fff !important;
  border:1px solid rgba(255,255,255,.08) !important;
  border-radius: 16px; padding:14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.8);
  opacity:0; visibility:hidden; transition:all .2s ease; z-index:9999;
  
  
}
.coupon-popup.active{ opacity:1; visibility:visible; transform:translate(-50%,-50%) scale(1); }

.coupon-popup h3{
  margin:0 0 10px; font-size:16px; font-weight:700;
}
.coupon-search{
  width:100%; background:#191c27 !important; color:#fff !important;
  border:1px solid rgba(255,255,255,.12) !important;
  border-radius:10px; padding:10px 12px; font-weight:700; margin-bottom:10px;
}
.coupon-list{ max-height:60vh; overflow-y:auto; padding-right:6px;scrollbar-color: #ff0033 #191c27; }

/* กล่องแต่ละ UID */
.coupon-item{
  display:grid; grid-template-columns:26px 48px 1fr; gap:10px; align-items:center;
  padding:10px;
  border:1px solid rgba(255,255,255,.10) !important;
  border-radius:10px;
  background:#0e0d0f !important;
  margin-bottom:5px;
  transition:.15s ease;
}
.coupon-item:hover{ border-color:#ff0033 !important;background:#252837 !important; background:#2d3041 !important; }

/* checkbox แบบเดิม */
.coupon-item label{ display:flex; align-items:center; justify-content:center; }
.coupon-item input[type="radio"]{ display:none; }
.coupon-item .checkmark{
  width:16px; height:16px; border-radius:4px;
  border:2px solid rgba(255,255,255,.35) !important;
  background:transparent; position:relative; transition:.15s ease;
}
.coupon-item:hover .checkmark{ border-color:#ff0033 !important; }
.coupon-item input[type="radio"]:checked + .checkmark{
  background:#ff0033 !important; border-color:#b10023 !important;
  box-shadow:0 0 4px rgba(67,255,120,.3) !important;
}
.coupon-item input[type="radio"]:checked + .checkmark::after{
  content:""; position:absolute; left:3px; top:-1px;
  width:4px; height:9px;
  border-right:3px solid #fff; border-bottom:3px solid #fff;
  transform:rotate(45deg);
}

/* icon + text */
.coupon-item .icon{ width:48px; height:48px; border-radius:8px; object-fit:cover; background:#151a2a; }
.coupon-item .title{ font-weight:600; color:#fff; }
.coupon-item .desc{ opacity:.8; font-size:13px; color:#c9ccdc; }

/* ปุ่มล่าง */
.coupon-popup .btn-group{ display:flex; gap:10px; justify-content:flex-end; margin-top:10px; }
.asset__btn_buy--clr{ background:linear-gradient(90deg,#cc002b 0%,#ff0033 100%) !important; border-color:#ff0033 !important; }



.btn-primary{ background:#6366f1; border:1px solid #6366f1; color:#fff; padding:10px 16px; border-radius:12px; font-weight:900; }
.btn-dark{ background:#1f2435; border:1px solid rgba(255,255,255,.12); color:#fff; padding:10px 16px; border-radius:12px; font-weight:800; }

/* UID ล่าสุด (chip) */
.uid-recent{ margin-top:8px; display:flex; flex-wrap:wrap; gap:8px; }
.uid-chip{ background:#0f1321; border:1px solid rgba(255,255,255,.12); padding:6px 10px; border-radius:999px; font-weight:800; cursor:pointer; }

.spinner{ display:inline-block; width:14px; height:14px; border:2px solid rgba(255,255,255,.35); border-top-color:#fff; border-radius:999px; animation: spin 1s linear infinite; margin-left:8px; }
@keyframes spin{ to { transform: rotate(360deg); } }

@keyframes selectPop{0%{transform:scale(1);}50%{transform:scale(1.15);}100%{transform:scale(1);}}


/* === FIX FINAL: หมอกอยู่ในปุ่ม / badge ลอยออกได้ === */

/* 1. สร้างเลเยอร์ซ่อนหมอกข้างในปุ่ม */
.btn--mycoupons {
  position: relative;
  border-radius: 10px;
  background: linear-gradient(90deg, #1b1e2d 0%, #10131f 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 10px 14px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.25s ease;
  z-index: 1;
}

/* ✅ สร้าง wrapper สำหรับหมอก (ตัดขอบเฉพาะข้างใน) */
.btn--mycoupons::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, white 50%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, white 50%, transparent 100%);
  background: linear-gradient(120deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 100%);
  transform: translateX(-100%) skewX(-25deg);
  transition: transform 0.6s ease;
  z-index: 0;
}
.btn--mycoupons:hover::before {
  transform: translateX(130%) skewX(-25deg);
}

/* ✅ badge: อยู่บนสุดและลอยออกนอกขอบได้ */
#couponCountBadge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff0033;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 6px rgba(255,0,51,.45);
  z-index: 5;
  pointer-events: none;
  transition: transform 0.25s ease;
}
#myCouponsBtn:hover #couponCountBadge {
  transform: scale(1.15);
}

/* ✅ ให้กริดไม่ตัดขอบ badge */
.input-with-button {
  overflow: visible !important;
}

/* === FIX สุดท้าย: หมอกอยู่ในปุ่ม / badge โผล่ออกนอกขอบได้ === */

.btn-coupon-wrap {
  position: relative;
  display: inline-block;
}

/* ปุ่มคูปอง (หมอกอยู่ในขอบ) */
.btn-coupon-wrap .btn--mycoupons {
  background: linear-gradient(90deg, #1b1e2d 0%, #10131f 100%);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
  padding: 12px 14px;
  border-radius: 10px;
  font-weight: 800;
  cursor: pointer;
  position: relative;
  overflow: hidden; /* ✅ กันหมอก */
  transition: all 0.25s ease;
}

/* หมอกพาดผ่านภายในขอบ */
.btn-coupon-wrap .btn--mycoupons::before {
  content: "";
  position: absolute;
  top: 0;
  left: -75%;
  width: 50%;
  height: 100%;
  background: linear-gradient(120deg, rgba(255,255,255,0.22) 0%, rgba(255,255,255,0) 100%);
  transform: skewX(-25deg);
  transition: all 0.6s ease;
}
.btn-coupon-wrap .btn--mycoupons:hover::before { left: 130%; }

/* badge โผล่พ้นขอบปุ่มได้ */
.btn-coupon-wrap #couponCountBadge {
  position: absolute;
  top: -8px;
  right: -8px;
  background: #ff0033;
  color: #fff;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 0 6px rgba(255,0,51,.45);
  pointer-events: none;
  z-index: 3;
  transition: transform 0.25s ease;
}

.btn-coupon-wrap:hover #couponCountBadge {
  transform: scale(1.15);
}

/* ให้ parent grid ไม่ตัดขอบ */
.input-with-button { overflow: visible !important; }

/* ==========================================================
   ✅ Popup: คูปองของฉัน (.mx-modal) เหมือนประวัติ UID 100%
   ========================================================== */

.mx-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  opacity: 0;
  visibility: hidden;
  transition: .2s ease;
  z-index: 9998;
}
.mx-modal-overlay.active { opacity: 1; visibility: visible; }

.mx-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(.98);
  width: min(480px, 94vw);
  background: #0e0d0f;
  color: #fff;
  border: 2px solid rgba(255,255,255,.08);
  border-radius: 16px;
  padding: 14px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.8);
  opacity: 0;
  visibility: hidden;
  transition: all .2s ease;
  z-index: 9999;
}
.mx-modal.active {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, -50%) scale(1);
}

/* ---------- Head / Search ---------- */
.mx-modal .modal-head {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 10px;
}
.mx-modal .search {
  width: 100%;
  background: #2e2e3a;
  color: #fff;
  border: 2px solid #44475a;
  border-radius: 10px;
  padding: 10px 12px;
  font-weight: 700;
  margin-bottom: 10px;
}

/* ---------- Coupon rows ---------- */
.mx-modal .list-scroll {
  max-height: 60vh;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-color: #ff0033 #191c27;
  
}

.mx-modal .mx-row {
  position: relative;
  display: grid;
  grid-template-columns: 26px 48px 1fr;
  gap: 10px;
  align-items: center;
  padding: 10px;
  margin-bottom: 6px;
  background: #0e0d0f;
  /*border-bottom: 1px solid #44475a;*/
  border-color: #44475a;
  border: 2px solid rgba(255,255,255,.08);
  cursor: pointer;
  border-radius: 10px;
  transition: .15s ease;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.8);
}
.mx-modal .mx-row:hover {
  background: #2d3041;
  /*border-color: #ff0033;*/
}

/* จุดเลือก (checkbox style) */
.mx-modal .mx-row .left { display: flex; align-items: center; justify-content: center; }
.mx-modal .mx-row .dot {
  position: relative;
  width: 16px;
  height: 16px;
  border-radius: 4px;
  border: 2px solid rgba(255,255,255,.35);
  background: transparent;
  transition: .15s ease;
}
.mx-modal .mx-row.is-selected .dot {
  background: #ff0033;
  border-color: #c00026;
  box-shadow: 0 0 4px rgba(255, 67, 67, 0.3);
  animation: selectPop .25s ease;
}
@keyframes selectPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

/* ติ๊กถูก */
.mx-modal .mx-row .dot::after {
  content: "";
  position: absolute;
  display: none;
  left: 3px;
  top: -1px;
  width: 4px;
  height: 9px;
  border-right: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: rotate(45deg);
}
.mx-modal .mx-row.is-selected .dot::after { display: block; }

/* ไอคอน */
.mx-modal .mx-row .icon {
  width: 48px;
  height: 48px;
  border-radius: 8px;
  object-fit: cover;
  background: #151a2a;
}

/* เนื้อหา */
.mx-modal .mx-row .title { font-weight: 600; color: #fff; }
.mx-modal .mx-row .desc { font-size: 13px; color: #c9ccdc; opacity: .85; }
.mx-modal .mx-row .muted { font-size: 12px; color: #a7afc9; opacity: .65; margin-top: 2px; }

/* ขอบตอนเลือก */
.mx-modal .mx-row.is-selected {
  background-color: #22232a;
  /*border-color: #ff0033;
  box-shadow: 0 0 0 2px rgba(255, 0, 0, 0.18) inset;*/
}

/* ---------- ปุ่มท้าย popup ---------- */
.mx-modal .modal-foot {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 10px;
}
.mx-modal .btn-primary {
  background: linear-gradient(90deg, #cc002b 0%, #ff0033 100%);
  border: 1px solid #ff0033;
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 900;
}
.mx-modal .btn-dark {
  background: #1f2435;
  border: 1px solid rgba(255,255,255,.12);
  color: #fff;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 800;
}

.cart-float-btn{
  position:fixed;
  right:28px;
  bottom:22px;
  z-index:9997;
  width:54px;
  height:54px;
  border-radius:18px;
  border:1px solid rgba(255,255,255,.16);
  background:linear-gradient(135deg,#ff0033,#b80024);
  color:#fff;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:0 16px 34px rgba(0,0,0,.42),0 0 22px rgba(255,0,51,.28);
  cursor:pointer;
}
.cart-float-btn i{font-size:20px;}
.cart-count-badge{
  position:absolute;
  right:-7px;
  top:-7px;
  min-width:22px;
  height:22px;
  padding:0 6px;
  border-radius:999px;
  background:#fff;
  color:#ff0033;
  font-size:12px;
  font-weight:900;
  display:flex;
  align-items:center;
  justify-content:center;
  border:2px solid #ff0033;
}
.cart-fly-img{
  position:fixed;
  z-index:10020;
  width:46px;
  height:46px;
  border-radius:12px;
  object-fit:cover;
  pointer-events:none;
  transition:transform .55s cubic-bezier(.2,.8,.2,1), opacity .55s ease;
  box-shadow:0 12px 26px rgba(0,0,0,.38);
}
.cart-modal{max-width:560px;}
.cart-close-x{
  position:absolute;
  right:14px;
  top:12px;
  z-index:2;
}
.cart-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:380px;
  overflow:auto;
  padding-right:2px;
}
.cart-empty{
  padding:22px 10px;
  text-align:center;
  color:#a7afc9;
}
.cart-row{
  display:grid;
  grid-template-columns:48px 1fr auto 32px;
  gap:10px;
  align-items:center;
  padding:10px;
  border:1px solid rgba(255,255,255,.1);
  border-radius:12px;
  background:rgba(255,255,255,.04);
}
.cart-row img{
  width:48px;
  height:48px;
  border-radius:10px;
  object-fit:cover;
  background:#151a2a;
}
.cart-row-title{
  font-weight:900;
  line-height:1.25;
}
.cart-qty-badge{
  display:inline-flex;
  align-items:center;
  margin-left:6px;
  padding:2px 8px;
  border-radius:999px;
  background:linear-gradient(135deg,#ff0033,#ff8a00);
  color:#fff;
  font-size:12px;
  font-weight:900;
  line-height:1;
  box-shadow:0 0 14px rgba(255,0,72,.35);
}
.cart-row-meta{
  font-size:12px;
  color:#a7afc9;
  margin-top:2px;
}
.cart-row-price{
  font-weight:900;
  color:#7cf2a4;
  white-space:nowrap;
}
.cart-remove{
  width:30px;
  height:30px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.05);
  color:#fff;
  cursor:pointer;
}
.cart-summary-row{
  display:flex;
  justify-content:space-between;
  gap:12px;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid rgba(255,255,255,.1);
  font-size:16px;
}
.cart-summary-row strong{color:#7cf2a4;font-size:20px;}
.cart-modal-foot{gap:8px;flex-wrap:wrap;}
.summary-cart-view{
  border:0;
  background:rgba(255,255,255,.08);
  color:#fff;
  border-radius:999px;
  padding:3px 8px;
  font-weight:900;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  gap:5px;
}
@media (max-width:740px){
  .cart-float-btn{
    left:auto;
    right:16px;
    top:640px;
    bottom:auto;
    width:48px;
    height:48px;
    border-radius:16px;
  }
  .cart-row{grid-template-columns:44px 1fr auto 30px;}
  .cart-row img{width:44px;height:44px;}
}



/* === ความเร็วจัดส่ง === */
.speed-box {
  background: #101323;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.speed-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
}

.speed-label {
  opacity: 0.9;
}

.speed-latest {
  color: #4ef58a;
  font-weight: 900;
  font-size: 14px;
}

.speed-graph-wrap {
  margin-top: 6px;
  height: 32px;
}

.speed-graph {
  width: 100%;
  height: 100%;
  display: block;
}

.speed-graph polyline {
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.speed-sub {
  margin-top: 4px;
  font-size: 11px;
  opacity: 0.8;
}


.speed-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.speed-header-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

.speed-latest-sub {
  font-size: 11px;
  opacity: 0.75;
  margin-top: 2px;
}



/* ===== Sup Product (Server Selector) - FINAL GRID 6/4 + 90x90 ===== */

/* Grid: PC 6 ต่อแถว */
.server-grid{
  display:grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap:14px;
  align-items:stretch;
}

/* Mobile: 4 ต่อแถว */
@media (max-width: 520px){
  .server-grid{
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap:10px;
  }
}

/* Card */
.server-item{
  width:100%;
  height:156px;

  cursor:pointer;
  position:relative;
  overflow:hidden;

  background: radial-gradient(120% 120% at 30% 10%, #1b2238 0%, #0d101a 70%);
  border:1px solid rgba(255,255,255,.12);
  border-radius:18px;

  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;

  padding:12px;
  gap:10px;

  transition:.15s ease;
}

@media (max-width: 520px){
  .server-item{
    height:132px;
    padding:10px;
    border-radius:16px;
    gap:8px;
  }
}

/* Icon 90x90 */
.server-item img{
  width:90px;
  height:90px;
  border-radius:18px;
  object-fit:cover;
  background:#151a2a;
}

/* Name: 2 lines clamp */
/* Name: 2 lines clamp */
.server-name{
  width:100%;
  text-align:center;
  font-weight:900;
  line-height:1.15;
  font-size:14px;
  color:#fff;

  display: -webkit-box;
  -webkit-box-orient: vertical;
  --webkit-line-clamp: 2;   /* 👈 ต้องมีขีด 2 ตัว */
  overflow: hidden;

  min-height:34px; /* กันการ์ดสูงไม่เท่ากัน */
}



@media (max-width: 520px){
  .server-name{
    font-size:12px;
    min-height:30px;
  }
}

/* Hover */
.server-item:hover{
  border-color: rgba(255,255,255,.22);
  transform: translateY(-1px);
}

/* Active state */
.server-item.active{
  border-color:#ff0033;
  box-shadow:0 0 0 3px rgba(255,0,51,.15) inset, 0 12px 32px rgba(0,0,0,.35);
}

/* ❌ ไม่ใช้ badge ตัวหนังสือแล้ว */
.server-badge{ display:none !important; }

/* ✅ Check icon (show only when active - JS ใส่มาเฉพาะ active) */
.server-check{
  position:absolute;
  top:10px;
  left:10px;

  width:22px;
  height:22px;
  border-radius:50%;

  background:#ff0033;
  display:flex;
  align-items:center;
  justify-content:center;

  z-index:3;
  box-shadow:0 6px 16px rgba(0,0,0,.35);
}

.server-check i{
  color:#fff;
  font-size:12px;
  line-height:1;
}

/* Mobile: ติ๊กเล็กลงนิดให้บาลานซ์ */
@media (max-width: 520px){
  .server-check{
    top:8px;
    left:8px;
    width:20px;
    height:20px;
  }
  .server-check i{ font-size:11px; }
}


/* ปุ่ม ? มุมซ้ายบนของการ์ดแพ็กเกจ */
.pkg-detail-btn{
  position:absolute;
  top:10px;
  left:10px;
  width:22px;
  height:22px;
  border-radius:50%;
  background:#ff0033;
  border:none;
  color:#fff;
  font-weight:900;
  cursor:pointer;
  z-index:6;
  box-shadow:0 6px 16px rgba(0,0,0,.35);
}
.pkg-detail-btn:hover{ transform: scale(1.08); }

/* ปุ่ม X มุมขวาบน popup */
.mx-close-x{
  position:absolute;
  top:10px;
  right:10px;
  width:32px;
  height:32px;
  border-radius:10px;
  border:1px solid rgba(255,255,255,.12);
  background:rgba(255,255,255,.06);
  color:#fff;
  cursor:pointer;
}
.mx-close-x:hover{ background:rgba(255,255,255,.12); }
.btn-dark:hover{ background:rgba(255,255,255,.12); }



/* ===============================
   Disable package (Not Available)
   =============================== */
/* ===== Not Available / Disabled package ===== */
.product.disabled{
  opacity: .38;
  filter: grayscale(85%);
  pointer-events: none;
  transform: none !important;
}

.not-available-badge{
  position:absolute;
  top:10px;
  left:10px;
  z-index: 7;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(0,0,0,.75);
  border: 1px solid rgba(255,255,255,.18);
  color: #fff;
}


.dynamic-input-group {
  margin-top: 12px;
}

.dynamic-input-group label {
  display: block;
  font-size: 13px;
  margin-bottom: 6px;
  opacity: .85;
}

/* ===== Fix select hover/focus ให้เข้าธีม ===== */

.mx-select:hover,
.mx-input:hover {
  border-color: rgba(255,255,255,.28);
  background: #14182a;
}

.mx-select:focus,
.mx-input:focus {
  outline: none;
  border-color: #ff0033;
  background: #14182a;
  box-shadow: 0 0 0 2px rgba(255,0,51,.15);
}

/* ปรับลูกศร select ให้เข้าธีม */
.mx-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image: url("data:image/svg+xml;utf8,<svg fill='white' height='20' viewBox='0 0 24 24' width='20' xmlns='http://www.w3.org/2000/svg'><path d='M7 10l5 5 5-5z'/></svg>");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 18px;
  padding-right: 40px;
}

/* ===== PUBG VIP Floating Ad (StockIDX 168 / 169) ===== */
.pubg-vip-float-ad{
  position:fixed;
  right:18px;
  bottom:88px;
  width:min(360px, calc(100vw - 28px));
  min-height:132px;
  z-index:9997;
  cursor:pointer;
  border-radius:24px;
  overflow:hidden;
  color:#fff;
  border:1px solid rgba(255,226,178,.55);
  background:
    radial-gradient(circle at 18% 12%, rgba(255,237,196,.75), transparent 28%),
    linear-gradient(135deg, rgba(57,32,48,.96), rgba(107,62,74,.96) 48%, rgba(24,28,48,.96));
  box-shadow:0 18px 46px rgba(0,0,0,.42), 0 0 28px rgba(255,190,94,.35);
  animation: pubgVipIn .55s cubic-bezier(.2,.9,.2,1), pubgVipFloat 3.2s ease-in-out infinite;
  isolation:isolate;
}
.pubg-vip-float-ad::before{
  content:"";
  position:absolute;
  inset:-2px;
  background:linear-gradient(115deg, transparent 0%, transparent 33%, rgba(255,255,255,.42) 46%, transparent 60%, transparent 100%);
  transform:translateX(-120%) skewX(-18deg);
  animation: pubgVipShine 2.6s ease-in-out infinite;
  z-index:1;
  pointer-events:none;
}
.pubg-vip-float-ad::after{
  content:"";
  position:absolute;
  inset:0;
  background:radial-gradient(circle at 82% 20%, rgba(255,215,134,.35), transparent 30%);
  pointer-events:none;
}
.pubg-vip-float-ad:hover{
  transform:translateY(-4px) scale(1.015);
  box-shadow:0 22px 56px rgba(0,0,0,.48), 0 0 36px rgba(255,204,113,.52);
}
.pubg-vip-main{
  position:relative;
  z-index:2;
  display:grid;
  grid-template-columns:96px 1fr;
  gap:12px;
  align-items:center;
  padding:18px 18px 16px 16px;
}
.pubg-vip-icon-wrap{
  width:92px;
  height:92px;
  border-radius:28px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:linear-gradient(135deg, rgba(255,207,151,.95), rgba(135,73,58,.65));
  box-shadow:inset 0 1px 0 rgba(255,255,255,.45), 0 10px 22px rgba(0,0,0,.28);
  animation: pubgVipIconPulse 1.85s ease-in-out infinite;
}
.pubg-vip-icon{
  width:82px;
  height:auto;
  filter:drop-shadow(0 7px 10px rgba(0,0,0,.35));
}
.pubg-vip-title{
  font-size:18px;
  line-height:1.2;
  font-weight:900;
  color:#fff4ce;
  text-shadow:0 2px 10px rgba(0,0,0,.35);
  margin-bottom:4px;
}
.pubg-vip-desc{
  font-size:13px;
  line-height:1.35;
  font-weight:800;
  color:#ffffff;
  opacity:.95;
}
.pubg-vip-chip{
  display:inline-flex;
  align-items:center;
  margin-top:8px;
  padding:5px 10px;
  border-radius:999px;
  color:#fff;
  font-size:13px;
  font-weight:900;
  background:linear-gradient(90deg, #f0b77f, #b26b58);
  box-shadow:0 0 14px rgba(255,195,118,.38);
}
.pubg-vip-cta{
  margin-top:6px;
  color:#ffe39d;
  font-size:13px;
  font-weight:900;
  text-decoration:underline;
  text-underline-offset:3px;
}
.pubg-vip-close{
  position:absolute;
  top:8px;
  right:10px;
  z-index:5;
  width:26px;
  height:26px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.28);
  background:rgba(0,0,0,.25);
  color:#fff;
  font-size:20px;
  line-height:20px;
  cursor:pointer;
}
.pubg-vip-close:hover{ background:rgba(255,255,255,.18); }
.pubg-vip-glow{
  position:absolute;
  width:180px;
  height:180px;
  left:-58px;
  bottom:-80px;
  border-radius:50%;
  background:rgba(255,189,94,.18);
  filter:blur(12px);
  animation: pubgVipGlow 2.4s ease-in-out infinite;
  pointer-events:none;
}
.pubg-vip-float-ad.is-hide{
  animation: pubgVipOut .24s ease forwards;
}
@keyframes pubgVipIn{
  from{ opacity:0; transform:translate(24px, 22px) scale(.88); }
  to{ opacity:1; transform:translate(0, 0) scale(1); }
}
@keyframes pubgVipOut{
  to{ opacity:0; transform:translate(24px, 16px) scale(.9); }
}
@keyframes pubgVipFloat{
  0%,100%{ translate:0 0; }
  50%{ translate:0 -6px; }
}
@keyframes pubgVipShine{
  0%, 38%{ transform:translateX(-125%) skewX(-18deg); }
  72%, 100%{ transform:translateX(135%) skewX(-18deg); }
}
@keyframes pubgVipIconPulse{
  0%,100%{ transform:scale(1); box-shadow:inset 0 1px 0 rgba(255,255,255,.45), 0 10px 22px rgba(0,0,0,.28), 0 0 0 rgba(255,218,150,0); }
  50%{ transform:scale(1.05); box-shadow:inset 0 1px 0 rgba(255,255,255,.55), 0 12px 26px rgba(0,0,0,.32), 0 0 22px rgba(255,218,150,.38); }
}
@keyframes pubgVipGlow{
  0%,100%{ opacity:.5; transform:scale(.94); }
  50%{ opacity:1; transform:scale(1.08); }
}
@media (max-width: 560px){
  .pubg-vip-float-ad{
    right:10px;
    bottom:76px;
    width:calc(100vw - 20px);
    border-radius:20px;
  }
  .pubg-vip-main{
    grid-template-columns:76px 1fr;
    padding:14px 38px 14px 12px;
  }
  .pubg-vip-icon-wrap{ width:74px; height:74px; border-radius:22px; }
  .pubg-vip-icon{ width:66px; }
  .pubg-vip-title{ font-size:16px; }
  .pubg-vip-desc{ font-size:12px; }
}
@media (prefers-reduced-motion: reduce){
  .pubg-vip-float-ad,
  .pubg-vip-float-ad::before,
  .pubg-vip-icon-wrap,
  .pubg-vip-glow{ animation:none !important; }
}
