/* ==========================================================================
   Trang đặt hàng gonut.vn/order — dùng chung biến màu với style.css
   Bố cục: giỏ hàng + danh sách sản phẩm bên trái, tóm tắt đơn bên phải
   ========================================================================== */

.order-page { background: var(--cream); padding-bottom: 40px; }

/* --- Dải breadcrumb --- */
.ord-crumb-band { background: var(--cream-2); border-bottom: 1px solid rgba(92, 61, 30, .08); }
.ord-crumb { display: flex; align-items: center; gap: 10px; padding: 18px 0; font-size: 14px; color: var(--text-soft); }
.ord-crumb a { color: var(--brown-700); font-weight: 600; text-decoration: none; }
.ord-crumb a:hover { color: var(--yellow-500); }
.ord-crumb span.sep { opacity: .5; }

/* --- Khung 2 cột --- */
.ord-wrap { display: grid; grid-template-columns: 1fr 330px; gap: 24px; align-items: start; padding-top: 26px; }
.ord-main { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.ord-card { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.ord-card-title { font-size: 19px; font-weight: 800; color: var(--brown-700); padding: 18px 20px 0; margin: 0; }

/* --- Bảng giỏ hàng --- */
.ord-thead {
  display: grid; grid-template-columns: 110px 1fr 132px 130px;
  background: var(--brown-700); color: #fff;
  font-size: 12.5px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
}
.ord-thead > div { padding: 15px 12px; text-align: center; }
.ord-thead > div:nth-child(2) { text-align: left; }

.ord-empty { padding: 26px 20px; text-align: center; color: var(--text-soft); font-size: 14.5px; }
.ord-empty a { color: var(--yellow-500); font-weight: 700; text-decoration: none; }
.ord-empty a:hover { text-decoration: underline; }

.ord-row {
  display: grid; grid-template-columns: 110px 1fr 132px 130px; align-items: center;
  border-bottom: 1px solid rgba(92, 61, 30, .07);
}
.ord-row:last-child { border-bottom: 0; }
.ord-row-thumb { padding: 12px; display: flex; justify-content: center; }
.ord-row-thumb img, .ord-thumb-box {
  width: 62px; height: 62px; object-fit: cover; border-radius: 10px;
  background: var(--yellow-100); display: block;
}
.ord-row-name { padding: 12px; min-width: 0; }
.ord-row-name b { display: block; font-size: 14.5px; color: var(--text); font-weight: 700; line-height: 1.35; }
.ord-row-name small { display: block; color: var(--text-soft); font-size: 12.5px; margin-top: 3px; }
.ord-row-qty { display: flex; justify-content: center; }
.ord-row-price { padding: 12px; text-align: right; font-weight: 800; color: var(--brown-700); font-size: 15px; }
.ord-row-price .ord-strike { display: block; font-weight: 500; font-size: 12px; color: var(--text-soft); text-decoration: line-through; }
.ord-row-del {
  background: none; border: 0; cursor: pointer; color: #c0392b; font-size: 13px;
  margin-top: 4px; padding: 0; font-family: inherit;
}
.ord-row-del:hover { text-decoration: underline; }

/* --- Nút tăng giảm số lượng --- */
.ord-step { display: inline-flex; align-items: center; border: 1.5px solid rgba(92, 61, 30, .18); border-radius: 10px; overflow: hidden; }
.ord-step button {
  width: 34px; height: 34px; border: 0; background: var(--cream-2); color: var(--brown-700);
  font-size: 18px; font-weight: 700; cursor: pointer; line-height: 1; font-family: inherit;
}
.ord-step button:hover:not(:disabled) { background: var(--yellow-100); }
.ord-step button:disabled { opacity: .4; cursor: not-allowed; }
.ord-step span { min-width: 38px; text-align: center; font-weight: 800; font-size: 15px; color: var(--text); }

.ord-add {
  border: 0; border-radius: 10px; background: var(--brown-700); color: #fff;
  font-weight: 700; font-size: 13.5px; padding: 9px 16px; cursor: pointer; font-family: inherit;
  white-space: nowrap;
}
.ord-add:hover { background: var(--brown-900); }
.ord-soldout { font-size: 12.5px; color: #c0392b; background: #fdecea; padding: 6px 12px; border-radius: 8px; }

/* --- Danh sách sản phẩm (nhóm gập/mở) --- */
.ord-group { border-top: 1px solid rgba(92, 61, 30, .07); }
.ord-group:first-of-type { border-top: 0; }
.ord-group-head {
  display: flex; align-items: center; gap: 14px; padding: 14px 20px; cursor: pointer;
  background: none; border: 0; width: 100%; text-align: left; font-family: inherit;
}
.ord-group-head:hover { background: var(--cream); }
.ord-group-head img, .ord-group-head .ord-thumb-box { width: 58px; height: 58px; border-radius: 10px; object-fit: cover; flex-shrink: 0; }
.ord-group-info { flex: 1; min-width: 0; }
.ord-group-info b { display: block; font-size: 15px; color: var(--text); font-weight: 700; }
.ord-group-info small { color: var(--text-soft); font-size: 12.5px; }
.ord-group-toggle { color: var(--brown-700); font-weight: 700; font-size: 14px; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.ord-group-toggle .caret { transition: transform .18s; display: inline-block; }
.ord-group.open .ord-group-toggle .caret { transform: rotate(90deg); }

.ord-variants { background: var(--cream); border-top: 1px solid rgba(92, 61, 30, .07); }
.ord-variant { display: flex; align-items: center; gap: 12px; padding: 12px 20px 12px 34px; border-bottom: 1px solid rgba(92, 61, 30, .05); }
.ord-variant:last-child { border-bottom: 0; }
.ord-variant img, .ord-variant .ord-thumb-box { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0; }
.ord-variant-info { flex: 1; min-width: 0; }
.ord-variant-info b { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.ord-price { font-weight: 800; color: var(--brown-700); font-size: 15px; }
.ord-price.sale { color: #c0392b; }
.ord-price-old { font-size: 12px; color: var(--text-soft); text-decoration: line-through; margin-left: 6px; }
.ord-badge-sale { background: #c0392b; color: #fff; font-size: 10.5px; font-weight: 700; padding: 2px 6px; border-radius: 5px; margin-left: 6px; }
.ord-stock { font-size: 11.5px; color: var(--green-600); margin-top: 2px; }
.ord-stock.out { color: #c0392b; }

/* --- Cột tóm tắt đơn --- */
.ord-side { position: sticky; top: 92px; display: flex; flex-direction: column; gap: 16px; }
.ord-summary { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; }
.ord-summary h3 { font-size: 16px; font-weight: 800; color: var(--brown-900); margin: 0 0 16px; letter-spacing: .02em; }
.ord-line { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--text-soft); padding: 6px 0; }
.ord-line b { color: var(--text); font-weight: 700; }
.ord-line.save { color: var(--green-600); font-weight: 700; }
.ord-line.save b { color: var(--green-600); }
.ord-total { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; border-top: 1.5px solid rgba(92, 61, 30, .12); margin-top: 10px; padding-top: 12px; }
.ord-total span { font-size: 14px; font-weight: 700; color: var(--text); }
.ord-total b { font-size: 23px; font-weight: 800; color: var(--brown-700); }

.ord-cta {
  display: block; width: 100%; margin-top: 16px; border: 0; border-radius: 12px;
  background: var(--yellow-500); color: var(--brown-900);
  font-weight: 800; font-size: 15.5px; padding: 14px; cursor: pointer; font-family: inherit;
  transition: background .18s, transform .18s;
}
.ord-cta:hover:not(:disabled) { background: var(--yellow-400); transform: translateY(-2px); }
.ord-cta:disabled { background: #e2ded6; color: #a89e91; cursor: not-allowed; }

/* --- Ô mã giảm giá --- */
.ord-promo { display: flex; gap: 8px; margin-top: 14px; }
.ord-promo input { flex: 1; min-width: 0; padding: 10px 12px; border: 1.5px solid rgba(92, 61, 30, .18); border-radius: 10px; font-size: 14px; font-family: inherit; }
.ord-promo input:focus { outline: 0; border-color: var(--yellow-500); }
.ord-promo button { border: 0; border-radius: 10px; background: var(--brown-700); color: #fff; font-weight: 700; font-size: 13.5px; padding: 0 14px; cursor: pointer; font-family: inherit; }
.ord-promo button:hover { background: var(--brown-900); }
.ord-note { font-size: 12.5px; margin-top: 8px; }
.ord-note.err { color: #c0392b; }
.ord-applied { display: flex; justify-content: space-between; align-items: center; gap: 8px; background: var(--yellow-100); color: var(--brown-700); font-size: 13px; padding: 8px 12px; border-radius: 9px; margin-top: 10px; }
.ord-applied button { background: none; border: 0; color: #c0392b; font-weight: 700; cursor: pointer; font-size: 15px; line-height: 1; }

/* --- Dải voucher ưu đãi theo giá trị đơn (kiểu Shopee) --- */
.ord-vouchers { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; }
.ord-vouchers-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
.ord-vouchers-head b { font-size: 15.5px; font-weight: 800; color: var(--brown-700); }
.ord-vouchers-head span { font-size: 12.5px; color: var(--text-soft); }

.ord-voucher-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(232px, 1fr)); gap: 12px; }

/* Hình vé: khối trái màu đậm ghi mức giảm, khối phải ghi điều kiện,
   khấc tròn hai bên đường răng cưa cho giống tem giảm giá */
.ord-voucher {
  display: flex; align-items: stretch; border-radius: 10px; overflow: hidden;
  border: 1.5px solid rgba(92, 61, 30, .16); background: var(--white);
  position: relative; transition: border-color .2s, box-shadow .2s, opacity .2s;
  opacity: .62;
}
.ord-voucher.reached { opacity: 1; border-color: var(--yellow-500); }
.ord-voucher.active  { opacity: 1; border-color: #c0392b; box-shadow: 0 4px 16px rgba(192, 57, 43, .18); }

.ord-voucher-left {
  flex: 0 0 92px; background: var(--cream-2); color: var(--brown-700);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 12px 6px; text-align: center; border-right: 1.5px dashed rgba(92, 61, 30, .25);
}
.ord-voucher.active .ord-voucher-left { background: #c0392b; color: #fff; border-right-color: rgba(255, 255, 255, .5); }
.ord-voucher.reached:not(.active) .ord-voucher-left { background: var(--yellow-100); }
.ord-voucher-left b { font-size: 26px; font-weight: 800; line-height: 1; letter-spacing: -.5px; }
.ord-voucher-left b i { font-size: 15px; font-style: normal; }
.ord-voucher-left b.ico { font-size: 27px; }
.ord-voucher-left span { font-size: 11.5px; margin-top: 5px; opacity: .9; }

/* Khấc tròn hai đầu đường răng cưa */
.ord-voucher-left::before, .ord-voucher-left::after {
  content: ''; position: absolute; left: 84px; width: 15px; height: 15px;
  background: var(--cream); border-radius: 50%;
  border: 1.5px solid rgba(92, 61, 30, .16);
}
.ord-voucher-left::before { top: -9px; }
.ord-voucher-left::after  { bottom: -9px; }
.ord-voucher.reached .ord-voucher-left::before, .ord-voucher.reached .ord-voucher-left::after { border-color: var(--yellow-500); }
.ord-voucher.active  .ord-voucher-left::before, .ord-voucher.active  .ord-voucher-left::after { border-color: #c0392b; }

.ord-voucher-body { flex: 1; min-width: 0; padding: 11px 13px; display: flex; flex-direction: column; justify-content: center; gap: 5px; }
.ord-voucher-body .perks { display: flex; flex-direction: column; gap: 2px; }
.ord-voucher-body .perks span { font-size: 12.5px; color: var(--text); line-height: 1.45; }
.ord-voucher-body .state { font-size: 12px; font-weight: 700; color: var(--text-soft); }
.ord-voucher.reached .ord-voucher-body .state { color: var(--green-600); }
.ord-voucher.active  .ord-voucher-body .state { color: #c0392b; }

.ord-goal { margin-top: 13px; }
.ord-goal p { font-size: 13px; color: var(--text-soft); text-align: center; margin: 7px 0 0; }
.ord-goal p b { color: #c0392b; font-weight: 800; }

/* --- Mốc ưu đãi --- */
.ord-tiers { display: flex; gap: 7px; margin-bottom: 6px; }
.ord-tier { flex: 1; border: 1.5px solid rgba(92, 61, 30, .14); border-radius: 10px; padding: 7px 3px; text-align: center; background: var(--cream); }
.ord-tier.reached { background: var(--yellow-100); border-color: var(--yellow-500); }
.ord-tier.active { background: var(--brown-700); border-color: var(--brown-700); color: #fff; }
.ord-tier em { display: block; font-style: normal; font-size: 11px; color: inherit; opacity: .85; }
.ord-tier b { display: block; font-size: 15px; font-weight: 800; line-height: 1.2; }
.ord-tier i { display: block; font-style: normal; font-size: 10px; }
.ord-progress { height: 7px; background: var(--cream-2); border-radius: 99px; overflow: hidden; margin: 8px 0 6px; }
.ord-progress > div { height: 100%; background: linear-gradient(90deg, var(--yellow-500), var(--yellow-400)); border-radius: 99px; transition: width .3s; }
.ord-progress-txt { font-size: 12.5px; color: var(--text-soft); text-align: center; }
.ord-progress-txt b { color: var(--brown-700); }

/* --- Điểm tin cậy dưới tóm tắt --- */
.ord-trust { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; font-size: 13px; color: var(--text-soft); }
.ord-trust div { display: flex; gap: 9px; padding: 5px 0; align-items: flex-start; }
.ord-trust span { flex-shrink: 0; }

/* --- Băng mã khuyến mãi --- */
.ord-promobar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 13px 18px; background: linear-gradient(90deg, var(--brown-700), var(--brown-500)); border-radius: var(--radius); color: #fff; }
.ord-promobar strong { font-size: 13.5px; }
.ord-promobar button { background: rgba(255, 255, 255, .18); border: 1px solid rgba(255, 255, 255, .35); color: #fff; border-radius: 99px; padding: 5px 13px; font-size: 12.5px; font-weight: 700; cursor: pointer; font-family: inherit; }
.ord-promobar button:hover { background: rgba(255, 255, 255, .3); }

/* --- Thông báo nổi --- */
.ord-toast { position: fixed; top: 84px; left: 50%; transform: translateX(-50%); z-index: 999; background: var(--brown-700); color: #fff; padding: 11px 22px; border-radius: 99px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); }
.ord-toast.err { background: #c0392b; }

/* --- Thanh tổng cố định trên điện thoại --- */
.ord-mobilebar { display: none; }

/* --- Hộp thoại thanh toán --- */
.ord-modal { position: fixed; inset: 0; z-index: 1000; background: rgba(62, 43, 26, .55); display: flex; align-items: center; justify-content: center; padding: 20px; overflow-y: auto; }
.ord-modal-box { background: var(--white); border-radius: 18px; width: 100%; max-width: 560px; max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); }
.ord-modal-head { position: sticky; top: 0; background: var(--brown-700); color: #fff; padding: 15px 20px; display: flex; align-items: center; justify-content: space-between; z-index: 2; }
.ord-modal-head h3 { margin: 0; font-size: 17px; font-weight: 800; }
.ord-modal-head button { background: rgba(255, 255, 255, .2); border: 0; color: #fff; width: 30px; height: 30px; border-radius: 50%; font-size: 17px; cursor: pointer; line-height: 1; }
.ord-modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.ord-modal-foot { position: sticky; bottom: 0; background: var(--white); border-top: 1px solid rgba(92, 61, 30, .1); padding: 14px 20px; }

.ord-fieldset { border: 1.5px solid rgba(92, 61, 30, .12); border-radius: 12px; padding: 15px; }
.ord-fieldset h4 { margin: 0 0 11px; font-size: 14.5px; font-weight: 800; color: var(--brown-700); }
.ord-field { margin-bottom: 10px; }
.ord-field:last-child { margin-bottom: 0; }
.ord-field input, .ord-field textarea {
  width: 100%; padding: 11px 13px; border: 1.5px solid rgba(92, 61, 30, .18);
  border-radius: 10px; font-size: 14.5px; font-family: inherit; color: var(--text);
}
.ord-field input:focus, .ord-field textarea:focus { outline: 0; border-color: var(--yellow-500); }
.ord-field.invalid input, .ord-field.invalid textarea { border-color: #c0392b; background: #fdf3f2; }
.ord-field .msg { color: #c0392b; font-size: 12.5px; margin-top: 4px; }

.ord-pay { display: flex; gap: 10px; }
.ord-pay label { flex: 1; display: flex; align-items: center; gap: 9px; border: 2px solid rgba(92, 61, 30, .14); border-radius: 12px; padding: 11px; cursor: pointer; font-size: 14px; }
.ord-pay label.on { border-color: var(--yellow-500); background: var(--yellow-100); }
.ord-pay input { display: none; }
.ord-bank { margin-top: 11px; background: var(--cream-2); border-radius: 10px; padding: 12px; font-size: 13.5px; line-height: 1.7; }

/* Hộp trấn an đổi trả — đặt ngay trên nút xác nhận đơn */
.ord-assure { background: #eef8f1; border: 1.5px solid #bfe3cc; border-radius: 12px; padding: 13px 15px; }
.ord-assure b { display: block; font-size: 14px; font-weight: 800; color: #1e7a45; }
.ord-assure p { font-size: 13px; color: #35624a; line-height: 1.55; margin: 6px 0 0; white-space: pre-line; }
.ord-assure p.hotline { margin-top: 7px; font-weight: 600; }
.ord-assure a { color: #1e7a45; text-decoration: underline; }

/* Dòng đổi trả trong hộp cam kết cột phải — cho nổi hơn các dòng khác */
.ord-trust div.hl { color: #1e7a45; font-weight: 700; }

.ord-mini { display: flex; align-items: center; gap: 9px; font-size: 13.5px; padding: 5px 0; }
.ord-mini img, .ord-mini .ord-thumb-box { width: 36px; height: 36px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.ord-mini span { flex: 1; min-width: 0; }
.ord-mini b { font-weight: 700; white-space: nowrap; }

.ord-success { text-align: center; padding: 32px 24px; }
.ord-success .ico { font-size: 52px; }
.ord-success h3 { font-size: 21px; font-weight: 800; color: var(--brown-700); margin: 10px 0 8px; }
.ord-success p { color: var(--text-soft); font-size: 14.5px; margin: 5px 0; }
.ord-success .code { font-size: 17px; font-weight: 800; color: var(--brown-900); }

.ord-loading { text-align: center; padding: 80px 20px; color: var(--text-soft); }
.ord-loading .ico { font-size: 44px; animation: ordBounce 1s infinite; display: inline-block; }
@keyframes ordBounce { 0%, 100% { transform: translateY(0) } 50% { transform: translateY(-12px) } }

/* ==========================  Điện thoại / tablet  ========================== */
@media (max-width: 900px) {
  .ord-wrap { grid-template-columns: 1fr; padding-top: 16px; gap: 16px; }
  .ord-side { position: static; order: 2; }
  .ord-main { order: 1; }

  /* Bảng giỏ chuyển sang dạng thẻ */
  .ord-thead { display: none; }
  .ord-row { grid-template-columns: 72px 1fr auto; grid-template-areas: "thumb name price" "thumb qty price"; padding: 6px 10px; }
  .ord-row-thumb { grid-area: thumb; padding: 8px 6px; }
  .ord-row-thumb img, .ord-row-thumb .ord-thumb-box { width: 54px; height: 54px; }
  .ord-row-name { grid-area: name; padding: 8px 6px 2px; }
  .ord-row-qty { grid-area: qty; justify-content: flex-start; padding: 0 6px 8px; }
  .ord-row-price { grid-area: price; padding: 8px 6px; }

  .ord-group-head { padding: 12px 14px; gap: 11px; }
  .ord-group-head img, .ord-group-head .ord-thumb-box { width: 50px; height: 50px; }
  .ord-variant { padding: 11px 14px 11px 20px; gap: 10px; }
  .ord-card-title { padding: 15px 15px 0; font-size: 17px; }

  /* Thanh tổng luôn hiện dưới màn hình */
  .ord-mobilebar {
    display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 900;
    background: var(--white); border-top: 2px solid var(--yellow-500);
    box-shadow: 0 -6px 24px rgba(92, 61, 30, .16);
  }
  .ord-mobilebar-in { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 14px; }
  .ord-mobilebar small { display: block; font-size: 11.5px; color: var(--text-soft); }
  .ord-mobilebar b { font-size: 19px; font-weight: 800; color: var(--brown-700); }
  .ord-mobilebar .ord-cta { width: auto; margin: 0; padding: 12px 22px; }
  .order-page { padding-bottom: 86px; }
  /* Nút tròn nổi của web chính bị thanh tổng che -> đẩy lên */
  .float-actions { bottom: 88px !important; }

  .ord-modal { padding: 0; align-items: stretch; }
  .ord-modal-box { max-width: none; max-height: none; min-height: 100%; border-radius: 0; }
}

@media (max-width: 480px) {
  .ord-summary { padding: 16px; }
  .ord-tier b { font-size: 13.5px; }
  .ord-pay { flex-direction: column; }
}
