/* Trang bán hàng: dùng lại biến màu, .ladi-wrap, .ladi-card, .ladi-btn của trang chủ và blog */

.ladi-sh-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ladi-sh-tabs a {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid #DCE5FF;
  background: #FFFFFF;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.ladi-sh-tabs a.ladi-on {
  background: var(--royal);
  border-color: var(--royal);
  color: #FFFFFF;
}

.ladi-sh-img {
  display: block;
  aspect-ratio: 4 / 5;
  background: var(--tint2);
  overflow: hidden;
}

.ladi-sh-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.ladi-sh-price {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.ladi-sh-price b {
  font-size: 17px;
  color: var(--royal);
}

.ladi-sh-price s {
  font-size: 13.5px;
  color: var(--muted);
}

.ladi-sh-price-lg b {
  font-size: 28px;
}

:where(.ladi-btn-sm) {
  min-height: 40px;
  padding: 0 16px;
  font-size: 14px;
  align-self: flex-start;
}

.ladi-sh-detail {
  padding: 40px 0 24px;
}

.ladi-sh-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  margin-top: 20px;
}

.ladi-sh-main {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  object-position: top;
  border-radius: 20px;
  border: 1px solid var(--line);
}

.ladi-sh-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.ladi-sh-thumbs img {
  width: 72px;
  height: 90px;
  object-fit: cover;
  object-position: top;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.ladi-sh-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.ladi-sh-info h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.ladi-sh-desc {
  margin: 0;
  font-size: 16px;
  line-height: 26px;
  color: #5A6178;
}

.ladi-sh-variants {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.ladi-sh-variant {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #DCE5FF;
  background: #FFFFFF;
  font-size: 14.5px;
  color: var(--ink);
  cursor: pointer;
}

.ladi-sh-variant span {
  flex: 1;
}

.ladi-sh-variant small {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}

.ladi-sh-variant input {
  accent-color: var(--royal);
}

.ladi-sh-buy {
  width: 100%;
  justify-content: center;
}

.ladi-sh-points {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  line-height: 22px;
  color: #5A6178;
}

.ladi-sh-page {
  padding: 40px 0 96px;
}

.ladi-sh-title {
  margin: 0 0 24px;
  font-size: 34px;
  color: var(--ink);
}

.ladi-sh-title span {
  color: var(--muted);
  font-weight: 600;
}

.ladi-sh-cart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.ladi-sh-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ladi-sh-box {
  padding: 20px 22px;
  border-radius: 20px;
  border: 1px solid #E6ECF7;
  background: #FFFFFF;
  box-shadow: var(--sh-1);
}

.ladi-sh-box h2 {
  margin: 0 0 14px;
  font-size: 18px;
  color: var(--ink);
}

.ladi-sh-box .ladi-sh-variant + .ladi-sh-variant {
  margin-top: 8px;
}

.ladi-sh-line {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid #EEF2FA;
}

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

.ladi-sh-line img {
  width: 56px;
  height: 70px;
  object-fit: cover;
  object-position: top;
  border-radius: 8px;
}

.ladi-sh-line-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ladi-sh-line-info a {
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.ladi-sh-line-info span,
.ladi-sh-qty {
  font-size: 13px;
  color: var(--muted);
}

.ladi-sh-summary {
  display: flex;
  flex-direction: column;
  gap: 10px;
  position: sticky;
  top: 88px;
}

.ladi-sh-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  color: #5A6178;
}

.ladi-sh-row b {
  color: var(--ink);
}

.ladi-sh-total {
  padding-top: 10px;
  border-top: 1px solid #EEF2FA;
  font-size: 16px;
}

.ladi-sh-total b {
  color: var(--royal);
  font-size: 20px;
}

.ladi-sh-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ladi-sh-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.ladi-sh-fields input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #DCE5FF;
  font: inherit;
  font-weight: 400;
}

.ladi-sh-full {
  grid-column: span 2;
}

/* Tài khoản: đăng nhập, đăng ký, mật khẩu */
.ladi-sh-auth {
  max-width: 440px;
  margin: 0 auto;
  padding: 32px;
}

.ladi-sh-auth .ladi-sh-title {
  margin-bottom: 8px;
}

.ladi-sh-auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 20px;
}

.ladi-sh-auth-form label,
.ladi-sh-fields label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.ladi-sh-auth-form input,
.ladi-sh-search input {
  min-height: 44px;
  padding: 0 12px;
  border-radius: 10px;
  border: 1px solid #DCE5FF;
  font: inherit;
  font-weight: 400;
}

.ladi-sh-auth-foot {
  margin: 18px 0 0;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
}

.ladi-sh-auth-foot a {
  color: var(--royal);
  font-weight: 600;
  text-decoration: none;
}

/* Trang tài khoản + đơn hàng của tôi */
.ladi-sh-account {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

.ladi-sh-account-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 88px;
}

.ladi-sh-account-nav a,
.ladi-sh-account-nav button {
  padding: 10px 14px;
  border: 0;
  border-radius: 10px;
  background: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 600;
  text-align: left;
  color: #5A6178;
  text-decoration: none;
  cursor: pointer;
}

.ladi-sh-account-nav a.ladi-on {
  background: var(--tint2);
  color: var(--royal);
}

.ladi-sh-account .ladi-sh-fields {
  margin-bottom: 16px;
}

.ladi-sh-order {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px 0;
  border-bottom: 1px solid #EEF2FA;
}

.ladi-sh-order:last-child {
  border-bottom: 0;
}

.ladi-sh-order-head {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
}

.ladi-sh-order-head b {
  color: var(--ink);
}

.ladi-sh-status {
  margin-left: auto;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--tint2);
  font-size: 12.5px;
  font-weight: 600;
  color: var(--royal);
}

.ladi-sh-order-head a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

/* Xác nhận đơn hàng */
.ladi-sh-done {
  margin-bottom: 24px;
  background: var(--tint2);
  border-color: transparent;
}

.ladi-sh-done .ladi-sh-title {
  margin-bottom: 8px;
}

.ladi-sh-bank {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

/* Tìm kiếm */
.ladi-sh-search {
  display: flex;
  gap: 10px;
  max-width: 640px;
  margin-bottom: 12px;
}

.ladi-sh-search input {
  flex: 1;
}

.ladi-sh-page .ladi-bl-h2 {
  margin: 32px 0 16px;
}

@media (max-width: 900px) {
  .ladi-sh-account {
    grid-template-columns: 1fr;
  }

  .ladi-sh-account-nav {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .ladi-sh-detail-grid,
  .ladi-sh-cart-grid {
    grid-template-columns: 1fr;
  }

  .ladi-sh-summary {
    position: static;
  }
}

/* Lớp DÙNG CHUNG với site.css (.ladi-wrap, .ladi-grid3, .ladi-bl-*, .ladi-card-bd, .ladi-btn-sm): shop.css nạp SAU site.css nên
   chỉ đặt MẶC ĐỊNH bằng :where() (độ ưu tiên 0) — site.css của web định nghĩa lớp nào thì lớp đó thắng, không bị đè lề / lưới. */
:where(.ladi-wrap) { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Header cửa hàng: giỏ + tài khoản; 360px không tràn (tìm kiếm xuống dòng riêng, menu cuộn ngang). */
.ladi-header--shop .ladi-header__shop { display: flex; align-items: center; gap: 12px; }
.ladi-header--shop .ladi-header__icon { position: relative; display: inline-flex; color: var(--ladi-color-text); }
.ladi-header--shop .ladi-header__badge { position: absolute; top: -6px; right: -8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #e11d48; color: #fff; font-size: 11px; line-height: 18px; text-align: center; }
.ladi-header--shop .ladi-header__badge[hidden], .ladi-header--shop .ladi-header__badge:empty { display: none; }
.ladi-sh-buy-row { display: flex; gap: 12px; align-items: stretch; }
.ladi-sh-qty-input { width: 72px; border: 1px solid var(--ladi-color-line); border-radius: 8px; padding: 8px; font: inherit; }
.ladi-sh-qty-edit { display: inline-flex; align-items: center; gap: 4px; }
.ladi-sh-qty-edit input { width: 48px; text-align: center; border: 1px solid var(--ladi-color-line); border-radius: 6px; padding: 4px; font: inherit; }
.ladi-sh-qty-edit button, .ladi-sh-remove { border: 1px solid var(--ladi-color-line); background: none; border-radius: 6px; min-width: 28px; height: 28px; cursor: pointer; font: inherit; }
.ladi-sh-line-variant { display: block; margin-top: 4px; max-width: 100%; border: 1px solid var(--ladi-color-line); border-radius: 6px; padding: 4px 8px; font: inherit; font-size: .875rem; background: #fff; }
.ladi-sh-line-variant[hidden], .ladi-sh-line-variant:empty { display: none; }
.ladi-sh-stock { color: #b91c1c; font-weight: 600; }
@media (max-width: 600px) {
  .ladi-header--shop .ladi-container { gap: 12px; }
  .ladi-header--shop nav { order: 3; width: 100%; overflow-x: auto; white-space: nowrap; }
  .ladi-header--shop .ladi-header__shop { margin-left: auto; }
  .ladi-header--shop .ladi-header__search { order: 4; width: 100%; margin-left: 0; }
  .ladi-header--shop .ladi-header__search input { width: 100%; box-sizing: border-box; }
  .ladi-sh-line { flex-wrap: wrap; }
}
/* Lưới SP / danh sách (trang chủ cửa hàng, danh mục, SP tương tự) + ô ảnh khi SP không có ảnh trong LadiSales. */
:where(.ladi-bl-list) { padding: 32px 0; }
:where(.ladi-bl-h2) { font-size: 1.5rem; margin: 0 0 16px; }
:where(.ladi-grid3) { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
:where(.ladi-card-bd) { padding: 12px 14px 16px; }
:where(.ladi-card-bd h3) { font-size: 1rem; margin: 0 0 6px; line-height: 1.4; }
.ladi-sh-noimg { display: block; aspect-ratio: 4 / 5; background: var(--ladi-color-line, #eee); }
.ladi-sh-cat-img { display: block; width: 100%; max-height: 320px; object-fit: cover; border-radius: var(--ladi-radius, 12px); margin: 0 0 16px; }
.ladi-sh-hint { margin: 0 0 8px; color: var(--ladi-color-muted, #666); font-size: .9rem; }
@media (max-width: 600px) { :where(.ladi-grid3) { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
/* Checkout in-page: ô chọn địa chỉ, thông báo lỗi. */
.ladi-sh-fields select { width: 100%; box-sizing: border-box; border: 1px solid var(--ladi-color-line); border-radius: 8px; padding: 8px 10px; font: inherit; background: #fff; }
.ladi-sh-error { color: #b91c1c; margin: 8px 0; }
.ladi-sh-error[hidden] { display: none; }
.ladi-sh-fields textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--ladi-color-line); border-radius: 8px; padding: 8px 10px; font: inherit; }
.ladi-sh-success[hidden] { display: none; }

/* Đặt hàng thành công (checkout) */
#ladi-checkout:has(> .ladi-ok:not([hidden])) > .ladi-sh-title,
#ladi-checkout:has(> .ladi-ok:not([hidden])) > [data-ladi-bind="cart.empty"],
#ladi-checkout:has(> .ladi-ok:not([hidden])) > [data-ladi-skeleton],
#ladi-checkout:has(> .ladi-ok:not([hidden])) > form,
[data-ladi-checkout-form][hidden] { display: none; }
.ladi-ok { max-width: 880px; margin: 0 auto; outline: none; animation: ladi-ok-in .45s ease both; }
@keyframes ladi-ok-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.ladi-ok__hero { display: flex; flex-direction: column; align-items: center; padding: 44px 24px 36px; border-radius: 24px; background: linear-gradient(180deg, #eef8f1 0%, #f4f6fb 100%); text-align: center; }
.ladi-ok__icon { display: inline-grid; place-items: center; width: 84px; height: 84px; margin-bottom: 20px; border-radius: 50%; background: #16a34a; color: #fff; box-shadow: 0 0 0 10px rgba(22, 163, 74, .14), 0 14px 30px rgba(22, 163, 74, .25); }
.ladi-ok__icon svg { stroke-dasharray: 30; stroke-dashoffset: 30; animation: ladi-ok-check .5s .25s ease forwards; }
@keyframes ladi-ok-check { to { stroke-dashoffset: 0; } }
.ladi-ok__title { margin: 0 0 10px; font-size: clamp(26px, 4vw, 36px); line-height: 1.15; font-weight: 800; letter-spacing: -.01em; color: var(--ink); }
.ladi-ok__lead { max-width: 520px; margin: 0 0 22px; font-size: 15.5px; line-height: 1.6; color: #474f60; }
.ladi-ok__code { display: inline-flex; align-items: center; gap: 14px; padding: 10px 10px 10px 20px; border: 1px dashed #b9c3d6; border-radius: 999px; background: #fff; }
.ladi-ok__code > span { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.ladi-ok__code b { padding: 6px 16px; border-radius: 999px; background: var(--royal); color: #fff; font-size: 18px; font-weight: 800; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.ladi-ok__body { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 20px; }
@media (min-width: 760px) { .ladi-ok__body { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); } }
.ladi-ok__panel { padding: 24px; border: 1px solid var(--line); border-radius: 20px; background: #fff; }
.ladi-ok__panel--soft { background: var(--tint2); border-color: transparent; }
.ladi-ok__panel h3 { margin: 0 0 18px; font-size: 16px; font-weight: 800; color: var(--ink); }
.ladi-ok__steps { margin: 0; padding: 0; list-style: none; display: grid; gap: 0; }
.ladi-ok__steps li { position: relative; display: flex; gap: 14px; padding-bottom: 18px; }
.ladi-ok__steps li:last-child { padding-bottom: 0; }
.ladi-ok__steps li:not(:last-child)::after { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--line); }
.ladi-ok__steps b { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border: 2px solid var(--line); border-radius: 50%; background: #fff; font-size: 12.5px; color: var(--muted); }
.ladi-ok__steps .ladi-ok__done b { border-color: #16a34a; background: #16a34a; color: #fff; }
.ladi-ok__steps .ladi-ok__done::after { background: #16a34a; }
.ladi-ok__steps div { display: flex; flex-direction: column; gap: 2px; padding-top: 3px; }
.ladi-ok__steps strong { font-size: 14.5px; color: var(--ink); }
.ladi-ok__steps span { font-size: 13.5px; line-height: 1.5; color: var(--muted); }
.ladi-ok__notes { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.ladi-ok__notes li { display: flex; gap: 12px; font-size: 14px; line-height: 1.55; color: #474f60; }
.ladi-ok__notes svg { flex: none; margin-top: 1px; color: var(--royal); }
.ladi-ok--page { max-width: none; margin-bottom: 24px; }
.ladi-ok__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 28px; }
.ladi-ok__actions .ladi-btn { min-width: 200px; justify-content: center; }
@media (max-width: 599px) { .ladi-ok__hero { padding: 32px 16px 28px; border-radius: 18px; } .ladi-ok__code { flex-direction: column; gap: 6px; padding: 10px 14px; border-radius: 16px; } .ladi-ok__actions .ladi-btn { flex: 1 1 100%; } }
@media (prefers-reduced-motion: reduce) { .ladi-ok, .ladi-ok__icon svg { animation: none; stroke-dashoffset: 0; } }

/* Đang nạp (ux-loading): html.ladi-hydrating do <head> gắn, ladi.sdk gỡ khi giỏ / tài khoản / checkout hydrate xong (tự gỡ sau
   4s). Trong lúc đó ẩn cả "giỏ trống" lẫn danh sách, che khối tài khoản, hiện khung xám [data-ladi-skeleton] để không nháy sai. */
[data-ladi-skeleton] { display: none; }
.ladi-hydrating [data-ladi-skeleton] { display: block; }
.ladi-hydrating [data-ladi-bind="cart.empty"], .ladi-hydrating [data-ladi-bind="cart.not_empty"],
.ladi-hydrating [data-ladi-slot="account-profile"], .ladi-hydrating [data-ladi-slot="order-items"] { display: none; }
:where(.ladi-skeleton) { padding: 8px 0; }
:where(.ladi-skeleton) span { display: block; height: 16px; margin: 0 0 12px; border-radius: 6px; background: linear-gradient(90deg, var(--ladi-color-line, #eee) 25%, #f6f6f6 50%, var(--ladi-color-line, #eee) 75%); background-size: 200% 100%; animation: ladi-shimmer 1.2s linear infinite; }
:where(.ladi-skeleton) span:nth-child(2) { width: 80%; }
:where(.ladi-skeleton) span:nth-child(3) { width: 60%; }
@keyframes ladi-shimmer { to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { :where(.ladi-skeleton) span { animation: none; } }
/* Lỗi từng ô do ladi.sdk ghi (form cửa hàng novalidate): chữ đỏ dưới ô + viền đỏ ô sai. */
:where(.ladi-field-error) { display: block; margin-top: 4px; color: #d92d20; font-size: .85rem; }
:where([aria-invalid="true"]) { border-color: #d92d20; }
/* Chống giật footer (CLS — ui-test đo checkout 375px = 0.519): khung trang giỏ / checkout / tài khoản giữ tối thiểu 1 màn hình,
   khung chờ giữ chỗ cho nội dung SDK đổ vào. */
:where(.ladi-sh-page) { min-height: calc(100vh - var(--ladi-header-h, 64px)); }
.ladi-hydrating :where(.ladi-skeleton) { min-height: 42rem; }