/*
 * checkout.css — MỘT bộ giao diện cho mọi trang mua (Đức 29/10/2026): checkout /shop (sản phẩm và
 * khóa học), đăng ký vé sự kiện, mua gói hội viên, link ưu đãi /uu-dai. Landing page sản phẩm chủ
 * lực không có form riêng nữa — nút mua dẫn về /shop/checkout.
 *
 * Bố cục: ĐƠN HÀNG bên trái (món đang mua, lựa chọn hạng vé / gói, mã giảm giá, tổng tiền), THÔNG
 * TIN bên phải (ô liên hệ trên cùng, câu hỏi riêng của từng món ở dưới), rồi ô hóa đơn GTGT, ô đồng
 * ý điều khoản và nút thanh toán. Màn hẹp: đơn hàng lên trước, form ở dưới.
 *
 * Màu theo thương hiệu, nền sáng: thẻ cream có viền mực + bóng "đóng dấu" (--stamp), nút cam. Bản
 * cũ của checkout /shop và landing là thẻ nền tối — Đức bỏ hẳn kiểu đó cho form mua.
 *
 * Markup do server/checkout-ui.ts dựng; class ở đây là ck-*. Hook JS (data-*) vẫn là của từng trang.
 */

.ck { max-width: 1120px; margin: 0 auto; padding: clamp(20px, 3vw, 36px) 0 clamp(36px, 5vw, 64px); color: var(--ink); }
.ck [hidden] { display: none !important; }
.ck-head { margin: 0 0 clamp(18px, 2.4vw, 26px); }
.ck-title { font-size: clamp(1.6rem, 3.4vw, 2.25rem); line-height: 1.15; margin: 0; font-weight: 800; letter-spacing: -.01em; }
.ck-sub { margin: 8px 0 0; font-size: 1rem; line-height: 1.55; color: var(--ink-soft); }
.ck-sub strong { color: var(--ink); }

.ck-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(20px, 2.6vw, 32px); align-items: start; margin: 0; }
.ck-col { display: grid; gap: clamp(18px, 2.2vw, 24px); min-width: 0; }
@media (max-width: 900px) {
  .ck-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ── thẻ ── */
.ck-card {
  background: var(--cream-card); border: 1.5px solid var(--ink); border-radius: var(--r-lg);
  box-shadow: var(--stamp); padding: clamp(18px, 2.6vw, 30px); min-width: 0;
}
@media (max-width: 520px) { .ck-card { box-shadow: var(--stamp-sm); } }
/* checkout.js chỉ bật dính khi cả thẻ lọt màn hình — thẻ dài hơn màn mà dính thì phần dưới không bao giờ cuộn tới được. */
.ck-order.is-sticky { position: sticky; top: 96px; }
.ck-card__h { font-size: 1.18rem; font-weight: 800; line-height: 1.3; margin: 0 0 16px; }
.ck-card__lead { margin: -8px 0 16px; font-size: .92rem; line-height: 1.55; color: var(--ink-soft); white-space: pre-line; }
.ck-step { font-size: .95rem; font-weight: 800; margin: 20px 0 10px; }
.ck-step:first-child { margin-top: 0; }

/* ── dòng món hàng (sản phẩm trong giỏ, sự kiện, sản phẩm của link ưu đãi) ── */
.ck-lines { margin: 0 0 4px; }
.ck-line { display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; gap: 14px; align-items: start; padding: 12px 0; border-bottom: 1px dashed var(--cream-300); }
.ck-line:first-child { padding-top: 0; }
.ck-line:last-child { border-bottom: 0; }
.ck-line--solo { grid-template-columns: 64px minmax(0, 1fr); }
/* Ô ảnh lấy cỡ từ CỘT LƯỚI (width 100% + vuông), không tự khai px. Trước 29/10/2026 nó khai riêng
   64px cho dòng --solo, nhưng ≤520px cột về 46px — ảnh tràn khỏi cột, đè lên tên sự kiện/sản
   phẩm. Giờ đổi cỡ ở đâu thì chỉ đổi grid-template-columns, ảnh tự theo. */
.ck-line__thumb { position: relative; width: 100%; aspect-ratio: 1; border-radius: 12px; border: 1.5px solid var(--ink); overflow: hidden; background: var(--cream-200); display: block; }
.ck-line__thumb img, .ck-line__thumb picture { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Sản phẩm chưa có ảnh: shop.js vẽ chữ cái đầu của tên (phTile) — to, cam, giữa ô. */
.ck-line__thumb .ph-tile { width: 100%; height: 100%; display: grid; place-items: center; font-size: 1.3rem; font-weight: 800; color: var(--ink); background: var(--orange-100); }
.ck-line__thumb .cover-ph { width: 100%; height: 100%; }
.ck-line__info { min-width: 0; }
.ck-line__name { display: block; font-weight: 800; line-height: 1.35; color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
a.ck-line__name:hover { text-decoration: underline; text-underline-offset: 3px; }
.ck-line__meta { display: block; margin-top: 4px; font-size: .86rem; line-height: 1.45; color: var(--ink-soft); }
.ck-line__ctl { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
.ck-line__total { font-weight: 800; white-space: nowrap; text-align: right; }
.ck-line__remove { background: none; border: 0; padding: 0; font: inherit; font-size: .84rem; color: var(--ink-soft); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.ck-line__remove:hover { color: #b3372a; }
@media (max-width: 520px) {
  .ck-line { grid-template-columns: 46px minmax(0, 1fr) auto; gap: 10px; }
  .ck-line--solo { grid-template-columns: 56px minmax(0, 1fr); }
  .ck-line__thumb { border-radius: 10px; }
}

/* ── ô số lượng ── */
.ck-qty { display: inline-flex; align-items: center; border: 1.5px solid var(--ink); border-radius: var(--r-pill); background: #fff; overflow: hidden; }
.ck-qty button { width: 34px; height: 32px; border: 0; background: none; font: inherit; font-size: 1.05rem; font-weight: 700; color: var(--ink); cursor: pointer; }
.ck-qty button:hover:not(:disabled) { background: var(--cream-200); }
.ck-qty button:disabled { opacity: .35; cursor: default; }
.ck-qty span, .ck-qty input { min-width: 30px; text-align: center; font-weight: 800; font-size: .95rem; }
.ck-qty input { width: 48px; height: 32px; border: 0; background: none; font-family: inherit; color: var(--ink); -moz-appearance: textfield; }
.ck-qty input:focus { outline: none; background: var(--cream-50); }
.ck-qty input::-webkit-outer-spin-button, .ck-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.ck-qty-fixed { margin: 0; font-weight: 700; }

/* ── thẻ lựa chọn (hạng vé, gói × kỳ hạn) ── */
.ck-choices { display: grid; gap: 10px; }
.ck-choice {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; background: #fff;
  border: 1.5px solid var(--cream-300); border-radius: var(--r); cursor: pointer;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.ck-choice:hover { border-color: var(--ink); }
.ck-choice:has(input:checked) { border-color: var(--orange-600); background: #fff9f3; box-shadow: var(--stamp-sm); }
.ck-choice.is-off { opacity: .5; cursor: not-allowed; border-color: var(--cream-300); }
.ck-choice input { accent-color: var(--orange); width: 18px; height: 18px; flex: none; margin: 2px 0 0; }
.ck-choice__body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.ck-choice__name { font-weight: 800; line-height: 1.35; }
.ck-choice__price { line-height: 1.35; color: var(--ink-soft); }
.ck-choice__price strong { color: var(--ink); font-weight: 800; font-size: 1.05rem; }
.ck-choice__price s { opacity: .6; margin-left: 6px; font-size: .88rem; }
.ck-choice__desc { font-size: .86rem; line-height: 1.5; color: var(--ink-soft); }
.ck-group { border: 0; margin: 0 0 18px; padding: 0; min-width: 0; }
.ck-group:last-child { margin-bottom: 0; }
.ck-group__name { padding: 0; font-weight: 800; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.ck-group__tag { margin: 2px 0 10px; font-size: .86rem; line-height: 1.5; color: var(--ink-soft); }
.ck-badge { display: inline-block; padding: 2px 9px; border-radius: var(--r-pill); background: var(--orange-100); border: 1px solid var(--orange); color: var(--orange-600); font-size: .74rem; font-weight: 800; letter-spacing: .01em; }
.ck-muted { color: var(--ink-soft); font-size: .9rem; line-height: 1.55; }

/* ── mã giảm giá ── */
.ck-coupon { display: flex; gap: 8px; margin-top: 18px; }
.ck-coupon .ck-input { flex: 1; min-width: 0; text-transform: uppercase; }
.ck-coupon .ck-input::placeholder { text-transform: none; }
.ck-coupon__msg { margin: 8px 0 0; font-size: .86rem; min-height: 0; }
.ck-coupon__msg:empty { display: none; }
.ck-coupon__msg.ok { color: var(--green-700); font-weight: 700; }
.ck-coupon__msg.bad { color: #b3372a; }
.ck-btn-ghost {
  flex: none; padding: 0 18px; border: 1.5px solid var(--ink); border-radius: var(--r-pill); background: #fff;
  font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
}
.ck-btn-ghost:hover { background: var(--cream-200); }
.ck-btn-ghost:disabled { opacity: .55; cursor: progress; }

/* ── tổng tiền ── */
.ck-totals { margin-top: 18px; padding-top: 12px; border-top: 1.5px solid var(--cream-300); font-size: .96rem; }
.ck-row { display: flex; justify-content: space-between; gap: 12px; padding: 5px 0; color: var(--ink-soft); }
.ck-row > :last-child { white-space: nowrap; font-weight: 700; color: var(--ink); }
.ck-row--disc, .ck-row--disc > :last-child { color: var(--green-700); }
.ck-row--total { margin-top: 8px; padding-top: 12px; border-top: 1.5px dashed var(--cream-300); font-size: 1.18rem; font-weight: 800; color: var(--ink); }
.ck-row--total > :last-child { font-weight: 800; }

/* ── ô nhập ── */
.ck-field { margin: 0 0 16px; }
.ck-field:last-child { margin-bottom: 0; }
.ck-label { display: block; margin: 0 0 7px; font-size: .92rem; font-weight: 700; color: var(--ink); }
.ck-req { color: var(--orange-600); }
.ck-opt { font-weight: 500; color: var(--ink-soft); opacity: .8; }
.ck-input {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 1rem; color: var(--ink); background: #fff;
  border: 1.5px solid var(--cream-300); border-radius: 12px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
textarea.ck-input { resize: vertical; min-height: 92px; line-height: 1.55; }
select.ck-input {
  -webkit-appearance: none; appearance: none; padding-right: 40px; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23090909' stroke-width='1.8' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 15px center;
}
.ck-input::placeholder { color: rgba(9, 9, 9, .38); }
.ck-input:focus { outline: none; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(244, 124, 48, .18); }
.ck-input[readonly] { background: var(--cream-50); color: var(--ink-soft); }
.ck-hint { display: block; margin: 6px 0 0; font-size: .82rem; line-height: 1.5; color: rgba(9, 9, 9, .6); }
.ck-check { display: flex; gap: 10px; align-items: flex-start; font-size: .94rem; line-height: 1.5; cursor: pointer; margin: 0 0 8px; }
.ck-check:last-child { margin-bottom: 0; }
.ck-check input { accent-color: var(--orange); width: 18px; height: 18px; flex: none; margin: 2px 0 0; }
.ck-check a { color: var(--ink); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
/* Ô bẫy bot (honeypot) — PHẢI ẩn: hiện ra là người thật điền vào và bị chặn oan. */
.ck .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ── đăng nhập để điền sẵn ── */
.ck-signin {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 18px; padding: 14px 16px;
  background: var(--cream-50); border: 1.5px dashed var(--cream-300); border-radius: var(--r);
}
.ck-signin__text { margin: 0; flex: 1 1 220px; font-size: .92rem; line-height: 1.5; }
.ck-signed { margin: 0 0 16px; font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.ck-signed strong, .ck-signed a { color: var(--ink); }

/* ── phần chốt: hóa đơn GTGT, điều khoản, tổng, nút ── */
.ck-finish { display: grid; gap: 14px; }
.ck-vat {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px 18px; cursor: pointer;
  background: var(--orange-100); border: 1.5px solid var(--ink); border-radius: var(--r);
  transition: background .15s var(--ease), border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.ck-vat:has(input:checked) { background: #fff; border-color: var(--orange-600); box-shadow: var(--stamp-sm); }
.ck-vat input { accent-color: var(--orange); width: 20px; height: 20px; flex: none; margin: 2px 0 0; }
.ck-vat__body { display: grid; gap: 4px; min-width: 0; }
.ck-vat__title { font-weight: 800; font-size: 1rem; }
.ck-vat__text { font-size: .9rem; line-height: 1.5; color: var(--ink-soft); }
.ck-vat__note { font-size: .84rem; line-height: 1.5; color: var(--ink-soft); }
.ck-vat strong { color: var(--ink); }
.ck-pay { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 2px 0; }
.ck-pay span { font-weight: 700; }
.ck-pay strong { font-size: 1.4rem; font-weight: 800; white-space: nowrap; }
.ck-error { margin: 0; padding: 12px 14px; border-radius: 12px; background: #fef2f2; border: 1px solid #fecaca; color: #b91c1c; font-weight: 600; font-size: .92rem; line-height: 1.5; }
.ck-submit {
  width: 100%; padding: 15px 20px; border: 1.5px solid var(--ink); border-radius: var(--r-pill);
  background: var(--orange); color: #fff; font: inherit; font-size: 1.06rem; font-weight: 800; cursor: pointer;
  box-shadow: var(--stamp-sm); transition: transform .16s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
}
.ck-submit:hover:not(:disabled) { background: var(--orange-600); transform: translate(-1px, -1px); box-shadow: var(--stamp); }
.ck-submit:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.ck-submit:disabled { opacity: .6; cursor: progress; }
.ck-notes { display: grid; gap: 4px; }
.ck-note { margin: 0; font-size: .82rem; line-height: 1.5; color: rgba(9, 9, 9, .6); text-align: center; }
.ck-note a { color: var(--ink); font-weight: 700; }

/* ── thông báo cả trang (giỏ trống, sản phẩm ngừng bán…) ── */
.ck-alert { max-width: 560px; }
.ck-alert p { margin: 0 0 16px; line-height: 1.6; }
.ck-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px;
  border: 1.5px solid var(--ink); border-radius: var(--r-pill); background: var(--orange); color: #fff;
  font: inherit; font-weight: 800; text-decoration: none; cursor: pointer; box-shadow: var(--stamp-sm); white-space: nowrap;
}
.ck-btn:hover { background: var(--orange-600); }
.ck-btn--sm { padding: 8px 16px; font-size: .9rem; }

/* "Gói của tôi" trên trang mua gói — thẻ mỏng phía trên bố cục hai cột. */
.ck-mine { margin: 0 0 clamp(18px, 2.4vw, 26px); padding-block: 16px; box-shadow: var(--stamp-sm); }
.ck-mine .ck-card__h { margin-bottom: 6px; font-size: 1rem; }
.ck-mine p { margin: 0; }
.ck-line__thumb--emoji { display: grid; place-items: center; font-size: 1.7rem; background: var(--orange-100); }
