/**
 * LKTD Order Quantity and Price Control — frontend styles.
 */

/* Gợi ý min/step dưới ô số lượng */
.lktd-oqpc-hint {
  margin-top: 6px;
  font-size: 13px;
  line-height: 1.4;
  color: #64748b;
}

.lktd-oqpc-hint--pdp {
  margin: 0 0 12px;
  color: #475569;
}

/* Nhắc đơn tối thiểu trong khối tổng cộng */
.lktd-oqpc-min-note {
  margin: 10px 0 0;
  padding: 10px 12px;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: 6px;
  font-size: 13.5px;
  color: #9a3412;
}

/* Nhấp nháy khi số lượng được tự nâng */
input.qty.lktd-oqpc-bumped {
  animation: lktd-oqpc-flash .8s ease;
}

@keyframes lktd-oqpc-flash {
  0%   { box-shadow: 0 0 0 0 rgba(30, 115, 190, .45); }
  100% { box-shadow: 0 0 0 8px rgba(30, 115, 190, 0); }
}

@media (max-width: 600px) {
}

/* ================= Bảng giá sỉ ở trang sản phẩm ================= */
/* Giá lẻ: bớt khoảng trống trên/dưới khi trang có bảng giá sỉ. */
body:has(.lktd-oqpc-tiers) .xl-sum-price {
  padding: 8px 14px !important;
  margin-bottom: 8px !important;
}

body:has(.lktd-oqpc-tiers) .xl-sum-meta {
  margin-bottom: 8px !important;
}

/* Giá bán lẻ LUÔN hiển thị (kể cả khi có bảng giá sỉ).
   Trước đây rule này ẩn giá lẻ → trên production theme cũ giá bị mất hẳn. */
.xl-sum-price--plain.is-hidden {
  display: block !important;
}

.lktd-oqpc-tiers {
  margin: 0 0 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  background: transparent;
  font-family: inherit;
}

.lktd-oqpc-tiers[hidden] {
  display: none !important;
}

.lktd-oqpc-tiers__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 6px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid #eff3f8;
  line-height: 1.2;
}

.lktd-oqpc-tiers__title {
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #1e73be;
}

.lktd-oqpc-tiers__group {
  padding: 1px 6px;
  border-radius: 999px;
  background: #e3ebf5;
  color: #1e293b;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.55;
}

.lktd-oqpc-tiers table {
  width: 100%;
  margin: 0;
  border: 0;
  border-collapse: collapse;
  table-layout: fixed;
}

/* Chừa lề 2 bên, không để chữ dính sát viền. */
.xl-pdp-price .lktd-oqpc-tiers td,
.lktd-oqpc-tiers td {
  padding: 5px 14px !important;
  border: 0;
  border-bottom: 1px solid #eff3f8;
  font-family: inherit !important;
  font-size: 17px;
  line-height: 1.3;
  background: transparent;
  vertical-align: middle;
}

.lktd-oqpc-tiers tr:last-child td {
  border-bottom: 0;
}

/* Ô trống (khi chưa đủ mốc) không kẻ viền cho sạch. */
.lktd-oqpc-tiers__cell.is-empty {
  border-bottom: 0 !important;
  background: transparent !important;
}

body .lktd-oqpc-tiers td.lktd-oqpc-tiers__qty {
  color: #475569;
  white-space: nowrap;
  width: 14%;
  text-align: right !important;
  padding-right: 12px !important;
}

.lktd-oqpc-tiers__price,
.lktd-oqpc-tiers__price strong,
.lktd-oqpc-tiers__price span,
.lktd-oqpc-tiers__price .amount {
  white-space: nowrap;
  font-weight: 700 !important;
  font-family: inherit !important;
  color: #17202e;
  text-align: right;
}

.lktd-oqpc-tiers__price.is-base span,
.lktd-oqpc-tiers__price.is-base .amount,
.lktd-oqpc-tiers__price.is-base strong {
  font-weight: 600 !important;
}

body .lktd-oqpc-tiers td.lktd-oqpc-tiers__price {
  width: 64%;
  text-align: left !important;
  padding-left: 26px !important;
}

body .lktd-oqpc-tiers--wide td.lktd-oqpc-tiers__qty {
  width: 13%;
  text-align: right !important;
  padding-right: 12px !important;
}

/* Giá nằm sát cột số lượng (không đẩy ra mép phải). */
body .lktd-oqpc-tiers--wide td.lktd-oqpc-tiers__price {
  width: 35%;
  text-align: left !important;
  padding-left: 26px !important;
}

.lktd-oqpc-tiers--wide td:nth-child(3) {
  border-left: 1px solid #eff3f8;
  padding-left: 14px !important;
}

/* Ô phải trống thì không kéo đường kẻ dọc vào khoảng trống. */
.lktd-oqpc-tiers--wide td:nth-child(3).is-empty {
  border-left: 0 !important;
}


.lktd-oqpc-tiers__cell.is-base .lktd-oqpc-tiers__price,
.lktd-oqpc-tiers__price.is-base,
.lktd-oqpc-tiers__cell.is-base .lktd-oqpc-tiers__price span,
.lktd-oqpc-tiers__cell.is-base .lktd-oqpc-tiers__price .amount {
  font-weight: 600 !important;
  color: #475569;
}

.lktd-oqpc-tiers__cell.is-active {
  background: transparent;
}

.lktd-oqpc-tiers__price.is-active {
  color: #1e73be;
}

@media (max-width: 600px) {
  .xl-pdp-price .lktd-oqpc-tiers td,
  .lktd-oqpc-tiers td {
    padding: 6px 8px !important;
    font-size: 16px;
  }

  /* Mobile: 2 cột (SL | Giá) — mỗi mốc 1 hàng, không cần 4 cột. */
  .lktd-oqpc-tiers table,
  .lktd-oqpc-tiers tbody {
    display: block !important;
    width: 100% !important;
  }

  .lktd-oqpc-tiers tr {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr);
    width: 100% !important;
  }

  .lktd-oqpc-tiers td {
    width: auto !important;
  }

  .lktd-oqpc-tiers td:nth-child(3) {
    border-left: 0 !important;
    padding-left: 10px !important;
  }


  .lktd-oqpc-tiers__cell.is-empty {
    display: none !important;
  }

  body .lktd-oqpc-tiers td.lktd-oqpc-tiers__qty {
    padding-right: 8px !important;
    text-align: right !important;
  }

  body .lktd-oqpc-tiers td.lktd-oqpc-tiers__price {
    padding-left: 16px !important;
    text-align: left !important;
  }
}

form.variations_form:has(> .lktd-oqpc-tiers) > table.variations th.label,
form.variations_form:has(> .lktd-oqpc-tiers) > table.variations .label {
  white-space: nowrap;
  vertical-align: middle !important;
  padding-right: 12px !important;
}

form.variations_form:has(> .lktd-oqpc-tiers) > table.variations td.value {
  width: 100% !important;
  vertical-align: middle !important;
}

/* Ẩn link "Xoá lựa chọn" để hàng Model + dropdown thẳng hàng (chọn lại "Chọn một tùy chọn" để xoá). */
form.variations_form:has(> .lktd-oqpc-tiers) > table.variations .reset_variations {
  display: none !important;
}

form.variations_form:has(> .lktd-oqpc-tiers) > table.variations select {
  width: 100% !important;
  max-width: 100% !important;
  margin: 0 !important;
  box-sizing: border-box;
}

form.variations_form .lktd-oqpc-tiers {
  width: 100%;
  margin-bottom: 8px;
}

/* Gợi ý số lượng: xuống hàng riêng thay vì chen vào hàng ô SL + nút
   (chen vào là nút bị co và tràn chữ). Nút giữ nguyên như theme. */
.xl-pdp .xl-buy-row form.cart {
  flex-wrap: wrap;
}

/* Gợi ý xuống hàng làm form cao hơn → canh giữa sẽ đẩy "Mua ngay" lệch xuống.
   Canh theo mép trên để 2 nút luôn cùng hàng. */
body .xl-pdp .xl-buy-row {
  align-items: flex-start;
}

/* Theme khai height 48px nhưng "Mua ngay" có viền 1.5px và chưa border-box → cao 54px.
   Ép border-box để 2 nút cùng chiều cao. */
body .xl-pdp .xl-buy-row .xl-buy-now {
  box-sizing: border-box;
}

/* Cùng chiều cao với nút Thêm vào giỏ (theme để Mua ngay 54px do padding dọc). */
@media (min-width: 768px) {
  body .xl-pdp .xl-buy-row .xl-buy-now {
    height: 48px !important;
    min-height: 48px;
    padding-top: 0;
    padding-bottom: 0;
  }
}

.xl-pdp .xl-buy-row form.cart .lktd-oqpc-hint--pdp {
  flex: 1 0 100%;
  order: 5;
  margin-top: 2px;
}

.lktd-oqpc-hint--pdp {
  min-width: 0;
}
