/* ====== 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 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;
}



/* === ความเร็วจัดส่ง === */
.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); }
