/* Giỏ hàng, thanh toán, đơn hàng (kế hoạch 09 bước 4). Chỉ nạp trên /cart/, /thanh-toan/, /don-hang/. */

.shop-hero {
  padding-bottom: 12px;
}

.shop-page {
  padding: 8px 0 56px;
}

.shop-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 24px;
  align-items: start;
}

.shop-stack {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.shop-panel {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
}

.shop-panel h2 {
  margin: 0;
  color: #0b2b46;
  font-size: 21px;
}

.shop-panel--summary {
  position: sticky;
  top: 96px;
  background: #f8fcfc;
}

.shop-muted {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.shop-loading {
  color: var(--muted);
}

.shop-link {
  justify-self: center;
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.shop-cta {
  width: 100%;
  min-height: 52px;
  white-space: normal;
}

.shop-alert {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #f4d7a8;
  border-radius: 8px;
  background: #fff8eb;
  color: #7a4206;
  font-size: 14.5px;
}

.shop-alert p {
  margin: 0 0 10px;
}

.shop-empty {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 40px 16px;
  text-align: center;
}

.shop-empty h2 {
  margin: 0;
}

/* Dòng sản phẩm */
.cart-lines {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.cart-line {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr) auto;
  gap: 14px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid #e8f0f1;
}

.cart-line:last-child {
  border-bottom: 0;
}

.cart-line__media img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.cart-line__body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.cart-line__name {
  color: #0b2b46;
  font-weight: 800;
  line-height: 1.25;
}

.cart-line__meta,
.cart-line__price,
.cart-line__gift {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.cart-line__gift {
  color: #7a4206;
  font-weight: 700;
}

.cart-line--gift {
  background: #fffaf0;
}

.cart-line__total {
  color: var(--orange-dark);
  font-size: 17px;
  white-space: nowrap;
}

.cart-line__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 6px;
}

.qty-stepper {
  display: inline-grid;
  grid-template-columns: 38px 40px 38px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.qty-stepper button {
  height: 38px;
  border: 0;
  background: #f5fbfb;
  color: var(--teal-dark);
  font: inherit;
  font-size: 20px;
  font-weight: 800;
  cursor: pointer;
}

.qty-stepper button:disabled {
  color: #b8c7cc;
  cursor: not-allowed;
}

.qty-stepper span {
  text-align: center;
  font-weight: 800;
}

.cart-line__remove {
  border: 0;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: 14px;
  text-decoration: underline;
  cursor: pointer;
}

.cart-lines--compact .cart-line {
  grid-template-columns: 56px minmax(0, 1fr) auto;
  gap: 10px;
  padding: 10px 0;
}

.cart-lines--compact .cart-line__media img {
  width: 56px;
  height: 56px;
}

/* Tóm tắt tiền */
.shop-summary {
  display: grid;
  gap: 10px;
}

.shop-summary dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.shop-summary dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.shop-summary dt {
  color: var(--muted);
}

.shop-summary dd {
  margin: 0;
  font-weight: 700;
}

.shop-summary__total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-weight: 800;
}

.shop-summary__total strong {
  color: var(--orange-dark);
  font-size: 24px;
}

/* Form */
.shop-form {
  gap: 16px;
}

.shop-field {
  display: grid;
  gap: 6px;
}

.shop-field label {
  color: #0b2b46;
  font-weight: 800;
}

.shop-field input[type="text"],
.shop-field input[type="tel"],
.shop-field select,
.shop-field textarea {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #c9d8db;
  border-radius: 8px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
}

.shop-field textarea {
  min-height: 84px;
  resize: vertical;
}

.shop-field input:focus,
.shop-field select:focus,
.shop-field textarea:focus {
  outline: 3px solid rgba(10, 169, 178, 0.3);
  border-color: var(--teal);
}

.shop-field [aria-invalid="true"] {
  border-color: #c2410c;
}

.shop-field__error {
  margin: 0;
  color: #c2410c;
  font-size: 14px;
  font-weight: 700;
}

.shop-methods {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  border: 0;
}

.shop-methods legend {
  margin-bottom: 8px;
  padding: 0;
  color: #0b2b46;
  font-weight: 800;
}

.shop-method {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

.shop-method:has(input:checked) {
  border-color: var(--teal);
  background: var(--teal-soft);
}

.shop-method input {
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--teal);
}

.shop-method span {
  display: grid;
  gap: 4px;
}

.shop-method small {
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}

.shop-consent label {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  font-weight: 400;
  color: #334155;
  font-size: 14.5px;
}

.shop-consent input {
  width: 18px;
  height: 18px;
  margin: 2px 0 0;
  accent-color: var(--teal);
}

.shop-consent a {
  color: var(--teal-dark);
  font-weight: 700;
  text-decoration: underline;
}

/* Trang đơn */
.order-code {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.order-code strong {
  color: #0b2b46;
  font-size: 24px;
  letter-spacing: 0.04em;
}

.order-status .eyebrow {
  margin: 0;
}

.order-status p {
  margin: 0;
}

.order-status--da_thanh_toan,
.order-status--cho_xac_nhan,
.order-status--da_giao {
  border-color: rgba(10, 169, 178, 0.45);
  background: var(--teal-soft);
}

.order-status--het_han,
.order-status--can_xu_ly {
  border-color: #f4d7a8;
  background: #fff8eb;
}

.order-qr {
  justify-self: center;
  width: min(100%, 320px);
  height: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.order-timer {
  margin: 0;
  text-align: center;
}

.order-countdown {
  color: var(--orange-dark);
  font-size: 20px;
  font-variant-numeric: tabular-nums;
}

.order-bank {
  display: grid;
  margin: 0;
}

.order-bank div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid #e8f0f1;
}

.order-bank dt {
  color: var(--muted);
  font-weight: 700;
}

.order-bank dd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.copy-btn {
  padding: 4px 10px;
  border: 1px solid var(--teal);
  border-radius: 999px;
  background: var(--white);
  color: var(--teal-dark);
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.shop-lookup {
  max-width: 520px;
}

@media (max-width: 900px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }

  .shop-panel--summary {
    position: static;
  }
}

@media (max-width: 480px) {
  .shop-panel {
    padding: 16px;
  }

  .cart-line {
    grid-template-columns: 64px minmax(0, 1fr);
  }

  .cart-line__media img {
    width: 64px;
    height: 64px;
  }

  .cart-line__total {
    grid-column: 2;
  }

  .cart-lines--compact .cart-line {
    grid-template-columns: 48px minmax(0, 1fr) auto;
  }

  .cart-lines--compact .cart-line__total {
    grid-column: auto;
  }

  .cart-lines--compact .cart-line__media img {
    width: 48px;
    height: 48px;
  }

  .order-bank div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}
