/* ============================================
   DIADORA VIETNAM — Giao diện phần bán hàng
   Nạp SAU css/style.css. Chỉ thêm lớp mới, không đè lớp cũ,
   dùng lại bộ biến màu và font khai báo ở :root của style.css.
   ============================================ */

/* ── Thanh điều hướng: nút giỏ hàng ─────────────────────────── */

/* Trang trong không có ảnh nền hero nên thanh điều hướng luôn ở trạng thái đặc */
.navbar-solid {
  background: var(--bianco-pure);
  box-shadow: 0 1px 0 var(--grigio-lighter);
}

.nav-cart {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin-left: auto;
  color: var(--nero);
  border-radius: 50%;
  transition: var(--transition-base);
}

.nav-cart:hover { background: var(--grigio-lighter); }

.nav-cart-count {
  position: absolute;
  top: 3px;
  right: 1px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  color: #fff;
  background: var(--rosso);
  border-radius: 9px;
}

@media (max-width: 1024px) {
  /* Chừa chỗ cho nút mở menu ở góc phải */
  .nav-cart { margin-left: auto; margin-right: 8px; }
}

/* ── Khung trang trong ──────────────────────────────────────── */

.pdp-page,
.catalog-page,
.cart-page {
  padding: 120px 0 80px;
  background: var(--bianco);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 28px;
  font-size: 0.82rem;
  color: var(--grigio);
}

.breadcrumb a { color: var(--grigio-dark); transition: var(--transition-fast); }
.breadcrumb a:hover { color: var(--verde); }
.breadcrumb span[aria-current] { color: var(--nero); font-weight: 500; }

/* ── Trang chi tiết sản phẩm ────────────────────────────────── */

.pdp {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

/* min-width: 0 là bắt buộc: mặc định một ô lưới rộng tối thiểu bằng min-content
   của nội dung bên trong, nên dải ảnh nhỏ (7 ảnh × 72px) sẽ nong cả cột ra
   ~646px và làm trang tràn ngang trên điện thoại. */
.pdp-gallery {
  position: sticky;
  top: 100px;
  min-width: 0;
}

.pdp-anh-chinh {
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--bianco-pure);
  border: 1px solid var(--grigio-lighter);
  border-radius: 4px;
}

.pdp-anh-chinh img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pdp-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.pdp-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 0;
  overflow: hidden;
  background: var(--bianco-pure);
  border: 1px solid var(--grigio-lighter);
  border-radius: 4px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.pdp-thumb img { width: 100%; height: 100%; object-fit: contain; }
.pdp-thumb:hover { border-color: var(--grigio); }
.pdp-thumb.active { border-color: var(--verde); border-width: 2px; }

.pdp-info { padding-top: 4px; min-width: 0; }

.pdp-badge {
  display: inline-block;
  margin-bottom: 12px;
  padding: 4px 12px;
  font-family: var(--font-body);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  background: var(--verde);
  border-radius: 2px;
}

.pdp-badge-moi { background: var(--rosso); }

.pdp-danh-muc {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--grigio);
}

.pdp-ten {
  margin: 10px 0 8px;
  font-family: var(--font-heading);
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--nero);
}

.pdp-ma { margin-bottom: 20px; font-size: 0.85rem; color: var(--grigio-dark); }

.pdp-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--grigio-lighter);
}

.pdp-price-now { font-size: 1.75rem; font-weight: 700; color: var(--rosso); }
.pdp-price-old { font-size: 1.05rem; color: var(--grigio); text-decoration: line-through; }

.pdp-discount {
  padding: 3px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
  background: var(--rosso);
  border-radius: 2px;
}

.pdp-block { margin-top: 24px; }

.pdp-block-dau {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.pdp-nhan {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nero);
}

.pdp-link-size { font-size: 0.8rem; color: var(--verde); text-decoration: underline; }

.pdp-sizes { display: flex; flex-wrap: wrap; gap: 10px; }

.size-pill {
  min-width: 52px;
  height: 48px;
  padding: 0 12px;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--nero);
  background: var(--bianco-pure);
  border: 1px solid var(--grigio-light);
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.size-pill:hover:not(.disabled) { border-color: var(--nero); }

.size-pill.active {
  color: #fff;
  background: var(--nero);
  border-color: var(--nero);
}

.size-pill.disabled {
  color: var(--grigio-light);
  cursor: not-allowed;
  background: var(--grigio-lighter);
  border-color: var(--grigio-lighter);
  text-decoration: line-through;
}

.pdp-loi {
  margin-top: 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--rosso);
}

.pdp-block-mua { display: flex; gap: 12px; align-items: stretch; }

.qty-stepper {
  display: inline-flex;
  align-items: center;
  overflow: hidden;
  background: var(--bianco-pure);
  border: 1px solid var(--grigio-light);
  border-radius: 3px;
}

.qty-btn {
  width: 44px;
  height: 52px;
  font-size: 1.2rem;
  color: var(--nero);
  background: none;
  border: none;
  cursor: pointer;
  transition: var(--transition-fast);
}

.qty-btn:hover { background: var(--grigio-lighter); }

.qty-stepper input {
  width: 48px;
  height: 52px;
  font-family: var(--font-body);
  /* 16px là ngưỡng khiến iOS Safari KHÔNG tự phóng to khi bấm vào ô nhập */
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  color: var(--nero);
  background: none;
  border: none;
  -moz-appearance: textfield;
}

.qty-stepper input::-webkit-outer-spin-button,
.qty-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.btn-them-gio {
  flex: 1;
  min-height: 52px;
  padding: 0 28px;
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--verde);
  border: none;
  border-radius: 3px;
  cursor: pointer;
  transition: var(--transition-base);
}

.btn-them-gio:hover { background: var(--verde-dark); }
.btn-them-gio:disabled { cursor: not-allowed; background: var(--grigio-light); }

a.btn-them-gio {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pdp-canh-bao-mien {
  margin-top: 18px;
  padding: 12px 16px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--grigio-dark);
  background: var(--bianco-pure);
  border-left: 3px solid var(--gold);
  border-radius: 2px;
}

.pdp-trust {
  margin-top: 24px;
  padding-top: 22px;
  list-style: none;
  border-top: 1px solid var(--grigio-lighter);
}

.pdp-trust li {
  position: relative;
  padding-left: 24px;
  margin-bottom: 9px;
  font-size: 0.86rem;
  color: var(--grigio-dark);
}

.pdp-trust li::before {
  position: absolute;
  left: 0;
  font-weight: 700;
  color: var(--verde);
  content: '✓';
}

.pdp-specs { margin-top: 32px; }

.pdp-specs h2,
.pdp-mo-ta h2,
.pdp-related h2 {
  margin-bottom: 14px;
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--nero);
}

.pdp-specs table { width: 100%; border-collapse: collapse; }

.pdp-specs th,
.pdp-specs td {
  padding: 11px 0;
  font-size: 0.87rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--grigio-lighter);
}

.pdp-specs th { width: 34%; font-weight: 600; color: var(--nero); }
.pdp-specs td { color: var(--grigio-dark); }

.pdp-mo-ta { max-width: 780px; margin-top: 64px; }
.pdp-mo-ta p { margin-bottom: 14px; font-size: 0.94rem; line-height: 1.8; color: var(--grigio-dark); }

.pdp-related { margin-top: 72px; }

/* ── Trang danh mục ─────────────────────────────────────────── */

.catalog-loc {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-bottom: 40px;
}

.loc-btn {
  padding: 10px 22px;
  font-family: var(--font-body);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--grigio-dark);
  background: var(--bianco-pure);
  border: 1px solid var(--grigio-light);
  border-radius: 30px;
  cursor: pointer;
  transition: var(--transition-fast);
}

.loc-btn:hover { border-color: var(--nero); color: var(--nero); }

.loc-btn.active {
  color: #fff;
  background: var(--nero);
  border-color: var(--nero);
}

.catalog-grid .product-card { opacity: 1; transform: none; }
.product-name a { color: inherit; }
.product-name a:hover { color: var(--verde); }

/* ── Trang giỏ hàng ─────────────────────────────────────────── */

.cart-title {
  margin-bottom: 28px;
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  font-weight: 700;
  color: var(--nero);
}

.cart-thong-bao {
  margin-bottom: 22px;
  padding: 12px 16px;
  font-size: 0.86rem;
  color: var(--grigio-dark);
  background: var(--bianco-pure);
  border-left: 3px solid var(--gold);
}

.cart-trong { padding: 48px 0; text-align: center; }
.cart-trong p { margin-bottom: 22px; font-size: 1rem; color: var(--grigio-dark); }
.cart-trong .btn-them-gio { flex: 0 0 auto; }

.cart-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 40px;
  align-items: start;
}

.cart-line {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 20px 0;
  border-bottom: 1px solid var(--grigio-lighter);
}

.cart-line:first-child { border-top: 1px solid var(--grigio-lighter); }

.cart-line-anh {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: var(--bianco-pure);
  border: 1px solid var(--grigio-lighter);
  border-radius: 3px;
}

.cart-line-ten {
  margin-bottom: 5px;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--nero);
}

.cart-line-ten a:hover { color: var(--verde); }
.cart-line-meta { margin-bottom: 12px; font-size: 0.82rem; color: var(--grigio); }
.cart-line-dieu-khien { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.cart-line-dieu-khien .qty-stepper { transform: scale(0.86); transform-origin: left center; }

.cart-xoa {
  font-size: 0.8rem;
  color: var(--grigio);
  text-decoration: underline;
  background: none;
  border: none;
  cursor: pointer;
}

.cart-xoa:hover { color: var(--rosso); }

.cart-line-gia {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rosso);
  white-space: nowrap;
}

.cart-summary {
  position: sticky;
  top: 100px;
  padding: 26px;
  background: var(--bianco-pure);
  border: 1px solid var(--grigio-lighter);
  border-radius: 4px;
}

.cart-summary h2 {
  margin-bottom: 18px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--nero);
}

.cart-summary dl { margin-bottom: 16px; }

.cart-summary dl > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 0.88rem;
  color: var(--grigio-dark);
}

.cart-mien-phi { font-weight: 600; color: var(--verde); }

.cart-tong {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 16px;
  margin-bottom: 20px;
  font-size: 0.9rem;
  color: var(--nero);
  border-top: 1px solid var(--grigio-lighter);
}

.cart-tong strong { font-size: 1.45rem; color: var(--rosso); }
.btn-thanh-toan { width: 100%; }
.cart-summary .pdp-trust { margin-top: 20px; }

/* ── Thanh mua dính đáy trên điện thoại ─────────────────────── */

.sticky-atc {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 900;
  display: none;
  gap: 12px;
  align-items: center;
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
  background: var(--bianco-pure);
  border-top: 1px solid var(--grigio-lighter);
  box-shadow: 0 -4px 20px rgb(0 0 0 / 8%);
}

.sticky-atc .pdp-price-now { font-size: 1.15rem; }
.sticky-atc .btn-them-gio { flex: 1; min-height: 46px; }

/* ── Thông báo nổi ─────────────────────────────────────────── */

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  z-index: 1000;
  max-width: calc(100vw - 32px);
  padding: 13px 22px;
  font-size: 0.88rem;
  font-weight: 500;
  color: #fff;
  background: var(--nero);
  border-radius: 3px;
  box-shadow: 0 8px 30px rgb(0 0 0 / 22%);
  opacity: 0;
  transform: translate(-50%, 14px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── Màn hình nhỏ ──────────────────────────────────────────── */

@media (max-width: 1024px) {
  .pdp { grid-template-columns: minmax(0, 1fr); gap: 36px; }
  .pdp-gallery { position: static; }
  .cart-layout { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .cart-summary { position: static; }
}

@media (max-width: 768px) {
  .pdp-page,
  .catalog-page,
  .cart-page { padding: 96px 0 60px; }

  /* Nút mua chính đã cuộn khuất thì dùng thanh dính đáy thay thế */
  .sticky-atc { display: flex; }
  .pdp-related,
  .cart-page .container { padding-bottom: 76px; }

  .cart-line { grid-template-columns: 76px minmax(0, 1fr); }
  .cart-line-anh { width: 76px; height: 76px; }
  .cart-line-gia { grid-column: 2; text-align: right; }
}

@media (max-width: 480px) {
  .pdp-block-mua { flex-wrap: wrap; }
  .btn-them-gio { flex: 1 1 100%; }
  .size-pill { min-width: 48px; height: 46px; }
}

/* ── Trang thanh toán ───────────────────────────────────────── */

.checkout-form h2,
.cart-summary h2 {
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--nero);
}

.checkout-form h2:not(:first-child) {
  padding-top: 26px;
  margin-top: 30px;
  border-top: 1px solid var(--grigio-lighter);
}

.form-row { margin-bottom: 18px; }

.form-row label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--nero);
}

.form-row label span { color: var(--rosso); }

/* Ô nhập của phần bán hàng — 16px để iOS Safari không tự phóng to khi bấm vào */
.checkout-form .form-control {
  width: 100%;
  padding: 13px 15px;
  font-family: var(--font-body);
  font-size: 16px;
  color: var(--nero);
  background: var(--bianco-pure);
  border: 1px solid var(--grigio-light);
  border-radius: 3px;
  transition: var(--transition-fast);
}

.checkout-form .form-control:focus {
  outline: none;
  border-color: var(--verde);
  box-shadow: 0 0 0 3px rgb(0 146 70 / 10%);
}

.checkout-form .form-control.error { border-color: var(--rosso); }
.checkout-form textarea.form-control { resize: vertical; }

.checkout-form .form-error {
  display: none;
  margin-top: 6px;
  font-size: 0.8rem;
  color: var(--rosso);
}

.checkout-form .form-error.show { display: block; }

.ck-loi-chung {
  padding: 12px 15px;
  margin-top: 20px;
  font-weight: 500;
  background: rgb(206 43 55 / 8%);
  border-left: 3px solid var(--rosso);
}

.ck-canh-bao-mien {
  padding: 12px 16px;
  margin-top: 4px;
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--grigio-dark);
  background: var(--bianco-pure);
  border-left: 3px solid var(--gold);
}

.ck-thanh-toan { margin-bottom: 8px; }

.ck-radio {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 16px;
  cursor: pointer;
  background: var(--bianco-pure);
  border: 1px solid var(--verde);
  border-radius: 3px;
}

.ck-radio input { margin-top: 3px; accent-color: var(--verde); }
.ck-radio strong { display: block; font-size: 0.9rem; color: var(--nero); }
.ck-radio small { display: block; margin-top: 4px; font-size: 0.8rem; color: var(--grigio); }

/* Ẩn khỏi mắt người thật nhưng vẫn nằm trong DOM để bot tự điền vào */
.ck-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.ck-dong-hang {
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--grigio-lighter);
}

.ck-dong {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 12px;
}

.ck-dong img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: var(--bianco);
  border: 1px solid var(--grigio-lighter);
  border-radius: 3px;
}

.ck-dong > div { flex: 1; min-width: 0; }
.ck-dong-ten { display: block; font-size: 0.85rem; font-weight: 600; color: var(--nero); }
.ck-dong-meta { display: block; margin-top: 2px; font-size: 0.78rem; color: var(--grigio); }
.ck-dong-gia { font-size: 0.88rem; font-weight: 700; color: var(--rosso); white-space: nowrap; }

.ck-luu-y {
  margin-top: 14px;
  font-size: 0.78rem;
  line-height: 1.6;
  color: var(--grigio);
}

/* ── Trang đặt hàng thành công ──────────────────────────────── */

.order-success {
  max-width: 620px;
  margin: 0 auto;
  text-align: center;
}

.order-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
  font-size: 2.2rem;
  font-weight: 700;
  color: #fff;
  background: var(--verde);
  border-radius: 50%;
}

.order-success h1 {
  margin-bottom: 14px;
  font-family: var(--font-heading);
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700;
  color: var(--nero);
}

.order-success-ma { margin-bottom: 16px; font-size: 1rem; color: var(--grigio-dark); }
.order-success-ma strong { font-size: 1.15rem; letter-spacing: 0.04em; color: var(--rosso); }

.order-success-note {
  margin-bottom: 34px;
  font-size: 0.92rem;
  line-height: 1.8;
  color: var(--grigio-dark);
}

.order-success-tom-tat {
  padding: 24px;
  margin-bottom: 32px;
  text-align: left;
  background: var(--bianco-pure);
  border: 1px solid var(--grigio-lighter);
  border-radius: 4px;
}

.order-success-tom-tat h2 {
  margin-bottom: 16px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--nero);
}

.order-success-tom-tat .cart-mien-phi { margin-top: 10px; font-size: 0.82rem; }

.order-success-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 26px;
}

.order-success-cta .btn-them-gio { flex: 0 0 auto; }

.btn-phu {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 28px;
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--nero);
  background: none;
  border: 1px solid var(--grigio-light);
  border-radius: 3px;
  transition: var(--transition-base);
}

.btn-phu:hover { color: var(--verde); border-color: var(--verde); }

.order-success-ho-tro { font-size: 0.86rem; color: var(--grigio); }
.order-success-ho-tro a { font-weight: 600; color: var(--verde); }

@media (max-width: 768px) {
  .checkout-page .cart-layout { display: flex; flex-direction: column; }
  /* Trên điện thoại đưa phần tóm tắt + nút Đặt hàng xuống dưới biểu mẫu */
  .checkout-page .cart-summary { order: 2; }
  .checkout-page .checkout-form { order: 1; }
}
