/* Kế thừa theme từ hệ thống landing page phòng tập (cùng biến, cùng cảm giác thương hiệu) */
:root {
  --color-primary: #e4232b;
  --color-primary-dark: #b5171d;
  --color-dark: #0b0b0c;
  --color-dark2: #17181a;
  --color-light: #f5f5f3;
  --color-muted: #9a9a9e;
  --font-heading: "Bebas Neue", "Oswald", sans-serif;
  --font-body: "Inter", "Be Vietnam Pro", sans-serif;
  --radius: 10px;
  --seat-size: 22px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-dark);
  color: var(--color-light);
  line-height: 1.5;
}
h1, h2, h3 { font-family: var(--font-heading); letter-spacing: 0.5px; margin: 0 0 12px; }
p { margin: 0 0 10px; color: var(--color-muted); }
button { font-family: var(--font-body); }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid rgba(255,255,255,0.08);
  position: sticky; top: 0; background: rgba(11,11,12,0.95); z-index: 40;
}
.topbar__title { font-family: var(--font-heading); font-size: 22px; }
.topbar__title span { color: var(--color-primary); }

.mock-banner {
  background: #3a2a05; color: #ffd479; text-align: center;
  padding: 8px 16px; font-size: 13px; font-weight: 600;
}

.layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 24px;
  max-width: 1300px;
  margin: 0 auto;
  padding: 24px 20px 80px;
  align-items: start;
}
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
}

/* ---------- Legend ---------- */
.legend {
  display: flex; flex-wrap: wrap; gap: 10px 18px;
  padding: 12px 16px; margin-bottom: 16px;
  background: var(--color-dark2); border-radius: var(--radius);
  font-size: 13px;
}
.legend__item { display: flex; align-items: center; gap: 6px; }
.legend__swatch { width: 14px; height: 14px; border-radius: 3px; display: inline-block; }
.legend__swatch--held { background: #444; }
.legend__swatch--sold { background: #2a2a2a; border: 1px solid #555; }
.legend__swatch--blocked { background: repeating-linear-gradient(45deg,#333,#333 4px,#222 4px,#222 8px); }

/* ---------- Walkway / wayfinding labels ---------- */
.walkway {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: var(--color-muted);
  padding: 0 4px;
}
.walkway--top { margin-bottom: 4px; }
.walkway--bottom { justify-content: center; margin-top: 4px; }
.walkway__entrance { color: var(--color-primary); }

/* ---------- Arena ----------
   2 lớp: ".inner-cross" là 1 lưới 3x3 RIÊNG chỉ chứa sàn đấu + VVIP/VIP (4
   hướng) + Khu B (2 góc) - tự co theo đúng kích thước của chính nó nên sàn đấu
   canh giữa rất sát 4 hàng VVIP/VIP, không bị Khu A/Khán đài thường (cao gấp
   đôi) kéo giãn ra. Khu A/Khán đài thường nằm NGOÀI, 2 bên, trong ".arena"
   (flex hàng ngang đơn giản) - cột LUÔN "auto", không bao giờ dùng "1fr" (từng
   khiến sàn đấu bị dồn về mép cột co giãn tự do, tạo khoảng trống chết). */
.arena-wrap {
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
}
.arena {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: max-content;
  margin: 0 auto;
  padding: 10px;
}
.inner-cross {
  display: grid;
  grid-template-columns: auto auto auto;
  grid-template-rows: auto auto auto;
  grid-template-areas:
    "tl   top    tr"
    "left ring   right"
    ".    bottom .";
  column-gap: 4px;
  row-gap: 3px;
  align-items: center;
  justify-items: center;
}
.inner-cross__row { display: flex; flex-direction: column; gap: 3px; align-items: center; }
.inner-cross__row--top { grid-area: top; }
.inner-cross__row--bottom { grid-area: bottom; }
.inner-cross__side { display: flex; flex-direction: row; gap: 3px; align-items: center; }
.inner-cross__side--left { grid-area: left; justify-self: end; }
.inner-cross__side--right { grid-area: right; justify-self: start; }
.inner-cross__corner { display: flex; flex-direction: row; gap: 3px; }
.inner-cross__corner--tl { grid-area: tl; justify-self: end; }
.inner-cross__corner--tr { grid-area: tr; justify-self: start; }
.arena__ring {
  grid-area: ring;
  position: relative;
  width: 150px; height: 150px;
  border: 3px solid var(--color-primary);
  display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 10px; border-radius: 4px;
  background: repeating-linear-gradient(135deg, rgba(228,35,43,0.06), rgba(228,35,43,0.06) 10px, transparent 10px, transparent 20px);
}
.ring__title { font-family: var(--font-heading); font-size: 16px; max-width: 110px; }
.ring__post {
  position: absolute; width: 14px; height: 14px; border-radius: 50%;
  background: var(--color-dark); border: 2px solid var(--color-light);
}
.ring__post--tl { top: -8px; left: -8px; }
.ring__post--tr { top: -8px; right: -8px; }
.ring__post--bl { bottom: -8px; left: -8px; }
.ring__post--br { bottom: -8px; right: -8px; }
.ring__dots { position: absolute; display: flex; gap: 3px; }
.ring__dots i { width: 6px; height: 6px; border-radius: 50%; display: block; }
.ring__dots--red { top: 14px; left: 14px; }
.ring__dots--red i { background: var(--color-primary); }
.ring__dots--blue { bottom: 14px; right: 14px; }
.ring__dots--blue i { background: #3E7CB1; }
.ring__side-box {
  position: absolute; left: 6px; top: 6px;
  padding: 3px 5px; font-size: 7px; font-weight: 700; line-height: 1.2;
  background: #1c3b57; color: #fff; border-radius: 3px; text-align: left;
  max-width: 60px;
}

/* Tên hạng vé ("Khán đài thường (Đỏ)"...) dài hơn hẳn 1 cột ghế 22px - nếu để
   chữ không xuống dòng, nó ép cả khối rộng ra theo độ dài chữ, tạo khoảng đen
   rất lớn giữa các cột ghế cạnh nhau. Giới hạn max-width + cho chữ tự xuống
   dòng để khối chỉ rộng bằng đúng cột ghế bên dưới - vì màu sắc + chú thích ở
   legend phía trên đã đủ để phân biệt hạng vé, không cần tên đầy đủ 1 dòng. */
.seat-block { display: flex; flex-direction: column; align-items: center; gap: 3px; }
.seat-block__label {
  font-size: 8px; font-weight: 700; letter-spacing: 0.2px; line-height: 1.15;
  white-space: normal; text-align: center; max-width: 54px;
}
.seat-grid { display: grid; gap: 3px; }

.seat {
  width: var(--seat-size); height: var(--seat-size);
  border-radius: 5px; font-size: 9px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; border: 1.5px solid transparent; color: #111;
  transition: transform 0.1s ease;
}
.seat:hover:not(:disabled) { transform: scale(1.12); }
.seat:disabled { cursor: not-allowed; }
.seat--available { background: var(--seat-color, #ccc); border-color: rgba(255,255,255,0.3); }
.seat--selected { background: #fff; border-color: var(--color-primary); box-shadow: 0 0 0 2px var(--color-primary); color: #000; }
.seat--held { background: #444; color: #777; }
.seat--sold { background: #2a2a2a; color: #555; border-color: #444; }
.seat--blocked {
  background: repeating-linear-gradient(45deg,#333,#333 4px,#222 4px,#222 8px);
  color: #666;
}

/* ---------- Cart / checkout sidebar ---------- */
.cart {
  position: sticky; top: 84px;
  background: var(--color-dark2); border-radius: var(--radius);
  padding: 20px; border: 1px solid rgba(255,255,255,0.06);
}
.cart h3 { font-size: 18px; }
.cart__empty { font-size: 13px; color: var(--color-muted); }
.cart__item { display: flex; justify-content: space-between; align-items: center; font-size: 13px; padding: 8px 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
.cart__item-remove { background: none; border: none; color: var(--color-muted); cursor: pointer; font-size: 16px; line-height: 1; }
.cart__standing { display: flex; align-items: center; justify-content: space-between; margin: 14px 0; font-size: 13px; }
.cart__stepper { display: flex; align-items: center; gap: 10px; }
.cart__stepper button {
  width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(255,255,255,0.2);
  background: transparent; color: var(--color-light); cursor: pointer; font-size: 16px;
}
.cart__total { display: flex; justify-content: space-between; font-weight: 700; font-size: 16px; margin: 14px 0; padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); }
.cart__total span:last-child { color: var(--color-primary); }

.btn {
  display: block; width: 100%; text-align: center;
  padding: 14px; border-radius: var(--radius); border: none;
  background: var(--color-primary); color: #fff; font-weight: 700; font-size: 15px;
  cursor: pointer;
}
.btn:hover { background: var(--color-primary-dark); }
.btn:disabled { background: #444; cursor: not-allowed; }
.btn--ghost { background: transparent; border: 1px solid rgba(255,255,255,0.2); }

.hold-timer { font-size: 12px; color: var(--color-muted); text-align: center; margin-top: 8px; }
.hold-timer--warning { color: var(--color-primary); font-weight: 700; }

/* ---------- Checkout modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.7);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 16px;
}
.modal { background: var(--color-dark2); border-radius: var(--radius); padding: 24px; max-width: 420px; width: 100%; }
.modal .field { display: block; margin-bottom: 14px; font-size: 13px; font-weight: 600; }
.modal .field span { display: block; margin-bottom: 6px; }
.modal .field input {
  width: 100%; padding: 12px; border-radius: 8px; border: 1px solid rgba(255,255,255,0.15);
  background: var(--color-dark); color: var(--color-light); font-size: 15px;
}
.modal__error { color: var(--color-primary); font-size: 13px; margin-bottom: 10px; }
.modal__close { background: none; border: none; color: var(--color-muted); float: right; cursor: pointer; font-size: 20px; }
.modal .field--checkbox { display: flex; align-items: flex-start; gap: 8px; font-weight: 400; }
.modal .field--checkbox input { width: auto; margin-top: 2px; }
.modal .field--checkbox span { display: inline; margin-bottom: 0; font-size: 12px; color: var(--color-muted); font-weight: 400; }

/* ---------- success.html ---------- */
.status-page {
  max-width: 480px; margin: 60px auto; padding: 0 20px; text-align: center;
}
.status-page .spinner {
  width: 48px; height: 48px; border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.15); border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite; margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.status-page__badge { display: inline-block; padding: 6px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; margin-bottom: 16px; }
.status-page__badge--paid { background: rgba(76,175,80,0.15); color: #7fd68a; }
.status-page__badge--failed { background: rgba(228,35,43,0.15); color: #f08a8e; }
.status-page__badge--pending { background: rgba(255,193,7,0.15); color: #ffd479; }

/* ---------- Trang cảm ơn sau thanh toán (thay hẳn overlay, không bị gò trong .modal 420px) ---------- */
.receipt-card {
  background: var(--color-dark2); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); padding: 32px; max-width: 520px; width: 100%;
  margin: 40px auto; text-align: center;
}
.receipt-card__badge {
  display: inline-block; padding: 8px 20px; border-radius: 999px; font-size: 14px;
  font-weight: 700; margin-bottom: 16px; background: rgba(76,175,80,0.15); color: #7fd68a;
}
.receipt-card__title { font-size: 26px; margin-bottom: 6px; }
.receipt-card__sub { font-size: 14px; margin-bottom: 24px; }
.receipt-card__section {
  text-align: left; background: var(--color-dark); border-radius: 8px;
  padding: 16px 18px; margin-bottom: 20px;
}
.receipt-card__row {
  display: flex; justify-content: space-between; gap: 12px; font-size: 14px;
  padding: 6px 0; border-bottom: 1px solid rgba(255,255,255,0.06);
}
.receipt-card__row:last-child { border-bottom: none; }
.receipt-card__row span:first-child { color: var(--color-muted); }
.receipt-card__row b { color: var(--color-light); text-align: right; }
.receipt-card__tickets { text-align: left; margin-bottom: 20px; }
.receipt-card__tickets h3 { font-size: 15px; margin-bottom: 10px; color: var(--color-muted); }
.receipt-ticket {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  background: var(--color-dark); border-radius: 8px; padding: 12px 16px; margin-bottom: 8px;
  border-left: 3px solid var(--color-primary);
}
.receipt-ticket__seat { font-size: 13px; color: var(--color-light); }
.receipt-ticket__code { font-size: 12px; font-weight: 700; letter-spacing: 0.5px; color: var(--color-primary); }
.receipt-card__total {
  display: flex; justify-content: space-between; font-size: 18px; font-weight: 700;
  padding: 14px 0; border-top: 1px solid rgba(255,255,255,0.1); margin-bottom: 20px;
}
.receipt-card__total span:last-child { color: var(--color-primary); }
.receipt-card__note { font-size: 12px; margin-bottom: 20px; }

/* ---------- Responsive: thu gọn sơ đồ ghế cho vừa màn hình điện thoại,
   nơi đa số khách sẽ mua vé - không cần zoom out mới thấy hết. ---------- */
@media (max-width: 640px) {
  :root { --seat-size: 18px; }
  .topbar { padding: 12px 14px; }
  .topbar__title { font-size: 18px; }
  .layout { padding: 12px 10px 70px; gap: 14px; }
  .legend { font-size: 11px; gap: 6px 12px; padding: 8px 10px; }
  .legend__swatch { width: 11px; height: 11px; }
  .arena { gap: 3px; padding: 6px; }
  .inner-cross { column-gap: 3px; row-gap: 2px; }
  .inner-cross__side, .inner-cross__corner { gap: 2px; }
  .arena__ring { width: 100px; height: 100px; }
  .ring__title { font-size: 12px; max-width: 76px; }
  .ring__side-box { font-size: 6px; padding: 2px 3px; }
  .seat-block__label { font-size: 7px; max-width: 42px; }
  .seat { font-size: 6px; }
}
