/* MOTO ELITE 3000 - Catalog Styles */
:root {
  --brand-red: #cc1414;
  --checkout-red: var(--brand-red);
  --brand-dark: #0d0d12;
  --brand-dark-sub: #1a1a24;
  --neutral-50: #f8f8fb;
  --neutral-200: #e4e4ea;
  --neutral-500: #6b6b80;
  --neutral-700: #3a3a48;
  --neutral-900: #161620;
  --success: #16a34a;
  --warning: #a16207;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.12);
}

* { box-sizing: border-box; }
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--neutral-50);
  color: var(--neutral-900);
  padding-bottom: 80px; /* space for floating cart button */
}

/* Header */
.site-header {
  background: var(--brand-dark);
  color: white;
  padding: 10px 12px 8px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-md);
}
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}
.brand-logo {
  height: 32px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  flex-shrink: 0;
  background: white;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
}
.brand-text {
  min-width: 0;
  display: none; /* Hide redundant text since logo has company name */
}
.brand-text .subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--neutral-200);
  opacity: 0.8;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.vendedor-badge {
  display: inline-block;
  margin-top: 4px;
  background: var(--brand-red);
  color: white;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
/* 手机窄屏：徽章显示在 brand 下一行 */
@media (max-width: 639px) {
  .brand-text {
    display: block !important;
  }
  .brand-text .subtitle { display: none; }
  .vendedor-badge { font-size: 10px; padding: 2px 6px; }
}
@media (min-width: 640px) {
  .brand-text { display: block; }
  .brand-text .subtitle { display: block; }
}

/* Cart toggle in top-right */
.cart-toggle {
  background: var(--brand-red);
  color: white;
  border: none;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  font-weight: 700;
  transition: transform 0.1s;
  box-shadow: var(--shadow-sm);
}
.cart-toggle:active { transform: scale(0.95); }
.cart-toggle .cart-icon {
  flex-shrink: 0;
}
.cart-toggle .cart-count {
  background: white;
  color: var(--brand-red);
  padding: 1px 7px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 900;
  min-width: 20px;
  text-align: center;
}
.cart-toggle .cart-total {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.cart-toggle.empty .cart-count,
.cart-toggle.empty .cart-total {
  display: none;
}

.search-box {
  margin-top: 8px;
  position: relative;
}
.search-box input {
  width: 100%;
  padding: 8px 40px 8px 12px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 13px;
  background: white;
  color: var(--neutral-900);
}
.search-box input:focus {
  outline: 2px solid var(--brand-red);
}
.search-clear-btn {
  position: absolute;
  top: 50%;
  right: 6px;
  width: 28px;
  height: 28px;
  transform: translateY(-50%);
  border: none;
  border-radius: var(--radius-sm);
  background: var(--neutral-200);
  color: var(--neutral-700);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  font-weight: 700;
}
.search-clear-btn:hover { background: #d7d7df; }
.search-clear-btn:active { transform: translateY(-50%) scale(0.96); }
.search-clear-btn[hidden] { display: none; }
.category-select-btn {
  width: 100%;
  margin-top: 8px;
  min-height: 40px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.1);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  font-family: inherit;
  text-align: left;
}
.category-select-btn:active { background: rgba(255,255,255,0.18); }
.category-select-label {
  color: rgba(255,255,255,0.68);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  flex-shrink: 0;
}
.category-select-value {
  min-width: 0;
  flex: 1;
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.category-select-caret {
  color: rgba(255,255,255,0.72);
  font-size: 16px;
  line-height: 1;
  flex-shrink: 0;
}
.active-filter-tags {
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.active-filter-tags[hidden] { display: none; }
.filter-tag,
.filter-clear-all {
  min-height: 30px;
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
}
.filter-tag {
  border: 1px solid rgba(255,255,255,0.22);
  background: white;
  color: var(--neutral-900);
  padding: 5px 8px 5px 10px;
}
.filter-tag span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.filter-tag-remove {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--neutral-200);
  color: var(--neutral-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}
.filter-clear-all {
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.08);
  color: white;
  padding: 5px 10px;
}
.filter-tag:active,
.filter-clear-all:active {
  transform: scale(0.98);
}
.clear-filters-btn {
  margin-top: 8px;
  width: 100%;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.08);
  color: white;
  cursor: pointer;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
}
.clear-filters-btn:hover { background: rgba(255,255,255,0.14); }
.clear-filters-btn:active { background: rgba(255,255,255,0.2); }
.clear-filters-btn[hidden] { display: none; }

/* Customer info form — 委内瑞拉发票必填字段 */
.customer-form {
  padding: 16px 20px 18px;
  background: white;
  border-top: 1px solid var(--neutral-200);
  border-bottom: 1px solid var(--neutral-200);
}
.customer-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}
.customer-fields[hidden] { display: none; }
@media (min-width: 640px) {
  .customer-fields { grid-template-columns: 1fr 1fr; gap: 16px; }
  .customer-form-header,
  .customer-form-hint,
  .customer-form .cf-field[data-span="2"] { grid-column: 1 / -1; }
}
.customer-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  background: white;
  border: 0;
  border-radius: 0;
}
.customer-summary[hidden] { display: none; }
.customer-summary-text {
  min-width: 0;
  display: grid;
  gap: 3px;
}
.customer-summary-kicker {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  color: var(--neutral-900);
}
.customer-summary strong {
  min-width: 0;
  color: var(--neutral-900);
  font-size: 16px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.customer-summary span {
  font-size: 14px;
  color: var(--neutral-500);
  line-height: 1.25;
}
.customer-summary.is-empty strong,
.customer-summary.is-empty span {
  color: var(--neutral-500);
}
.customer-summary-edit {
  flex: 0 0 auto;
  align-self: center;
  border: 0;
  background: transparent;
  color: var(--checkout-red);
  border-radius: var(--radius-sm);
  padding: 8px 0 8px 12px;
  font-family: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.customer-summary-edit:hover { text-decoration: underline; }
.customer-summary-edit:active { transform: scale(0.98); }
.customer-form-header {
  position: relative;
  padding-left: 12px;
}
.customer-form-header::before {
  content: "";
  position: absolute;
  left: 0; top: 2px; bottom: 2px;
  width: 3px;
  background: var(--brand-red);
  border-radius: 2px;
}
.customer-form-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--neutral-900);
  letter-spacing: -0.01em;
}
.customer-form-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: var(--neutral-500);
  font-weight: 500;
}
.cf-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.cf-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  color: var(--neutral-500);
  font-weight: 700;
  text-transform: uppercase;
}
.cf-input-wrap {
  position: relative;
  display: block;
}
.cf-icon {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--neutral-500);
  pointer-events: none;
  transition: color 0.15s;
}
.customer-form input {
  width: 100%;
  height: 40px;
  padding: 0 12px 0 34px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  font-size: 14px;
  font-weight: 500;
  color: var(--neutral-900);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, background-color 0.15s, box-shadow 0.15s;
}
.customer-form input::placeholder {
  color: var(--neutral-500);
  font-weight: 400;
}
.customer-form input:hover {
  border-color: var(--neutral-500);
}
.customer-form input:focus {
  border-color: var(--brand-red);
  background: white;
  box-shadow: 0 0 0 3px rgba(204, 20, 20, 0.12);
}
/* 已填态：白底 + icon 变深 + label 变深 */
.customer-form input:not(:placeholder-shown) {
  background: white;
  color: var(--neutral-900);
}
.cf-field:has(input:not(:placeholder-shown)) .cf-icon { color: var(--neutral-900); }
.cf-field:has(input:focus) .cf-icon { color: var(--brand-red); }
.cf-field:has(input.is-invalid) .cf-icon { color: var(--brand-red); }
.cf-field:has(input:not(:placeholder-shown)) .cf-label { color: var(--neutral-900); }
/* 错误态 */
.customer-form input.is-invalid {
  border-color: var(--brand-red);
  border-width: 1.5px;
  background: #fef5f5;
  box-shadow: 0 0 0 3px rgba(204, 20, 20, 0.18);
}
.customer-form-hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: var(--neutral-500);
  font-weight: 500;
}
.customer-form-error {
  margin: 0;
  padding: 10px 12px;
  background: #fef5f5;
  border: 1px solid var(--brand-red);
  border-radius: var(--radius-md);
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 600;
}
.customer-form-error[hidden] { display: none; }

/* Category Nav — now inside header */
.category-nav {
  display: none;
  margin: 8px -12px -8px;
  padding: 8px 12px;
  overflow-x: auto;
  white-space: nowrap;
  background: var(--brand-dark-sub);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.category-nav::-webkit-scrollbar { display: none; }
.cat-link {
  display: inline-block;
  padding: 5px 10px;
  margin-right: 4px;
  color: var(--neutral-200);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  background: rgba(255,255,255,0.08);
  transition: all 0.15s;
}
.cat-link.active,
.cat-link:hover {
  background: var(--brand-red);
  color: white;
}
body.category-sheet-open { overflow: hidden; }
.category-sheet {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: none;
}
.category-sheet.open { display: block; }
.category-sheet[hidden] { display: none; }
.category-sheet-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(13, 13, 18, 0.62);
}
.category-sheet-panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 78dvh;
  background: white;
  color: var(--neutral-900);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -8px 24px rgba(0,0,0,0.22);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.category-sheet-header {
  padding: 16px 16px 10px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--neutral-200);
}
.category-sheet-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
}
.category-sheet-header p {
  margin: 2px 0 0;
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 600;
}
.category-sheet-close {
  width: 34px;
  height: 34px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  color: var(--neutral-700);
  cursor: pointer;
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
  flex-shrink: 0;
}
.category-sheet-search {
  padding: 12px 16px;
  border-bottom: 1px solid var(--neutral-200);
}
.category-sheet-search input {
  width: 100%;
  height: 40px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  background: var(--neutral-50);
  color: var(--neutral-900);
  font-family: inherit;
  font-size: 14px;
  padding: 0 12px;
  outline: none;
}
.category-sheet-search input:focus {
  border-color: var(--brand-red);
  background: white;
  box-shadow: 0 0 0 3px rgba(204, 20, 20, 0.12);
}
.category-sheet-list {
  padding: 8px 16px 18px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.category-sheet-option {
  width: 100%;
  min-height: 42px;
  border: none;
  border-bottom: 1px solid var(--neutral-200);
  background: white;
  color: var(--neutral-900);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  padding: 10px 2px;
}
.category-sheet-option:last-child { border-bottom: none; }
.category-sheet-option[hidden] { display: none; }
.category-sheet-option.active {
  color: var(--brand-red);
}
.category-sheet-option.active::after {
  content: "✓";
  color: var(--brand-red);
  font-size: 16px;
  font-weight: 900;
  flex-shrink: 0;
}
@media (min-width: 768px) {
  .category-select-btn { display: none; }
  .category-nav { display: block; }
  .active-filter-tags {
    margin-bottom: 8px;
  }
}

/* Product Grid */
main {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  padding: 12px;
}
@media (min-width: 640px) {
  main { grid-template-columns: repeat(3, 1fr); gap: 16px; padding: 16px; }
}
@media (min-width: 900px) {
  main { grid-template-columns: repeat(4, 1fr); }
}
@media (min-width: 1200px) {
  main { grid-template-columns: repeat(5, 1fr); }
}

/* Product Card */
.product-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.18s, transform 0.12s;
  display: flex;
  flex-direction: column;
  position: relative;
}
.product-card.hidden { display: none; }

/* Desktop hover — subtle lift */
@media (hover: hover) {
  .product-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
  }
}
/* Touch feedback */
.product-card:active {
  transform: scale(0.992);
}

/* Already-in-cart state (JS toggles .in-cart class) */
.product-card.in-cart {
  box-shadow: 0 0 0 2px var(--brand-red), var(--shadow-md);
}
.product-card.in-cart::after {
  content: "✓ En el pedido";
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  background: var(--brand-red);
  color: white;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 999px;
  box-shadow: var(--shadow-sm);
  pointer-events: none;
  animation: inCartPop 0.22s ease-out;
}
@keyframes inCartPop {
  0%   { transform: scale(0.6); opacity: 0; }
  60%  { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .product-card, .product-card:hover, .product-card:active { transition: none; transform: none; }
  .product-card.in-cart::after { animation: none; }
}

.product-image {
  background: #e9e9ef;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;     /* 显示完整图，不裁切（避免摩配零件细节被切掉） */
  display: block;
  background: white;       /* contain 会留白，给个白底好看 */
  padding: 6%;             /* 源图常紧贴边缘，留内边距避免视觉截断 */
  box-sizing: border-box;
}
.product-image-zoom-trigger {
  width: 100%;
  height: 100%;
  background: white;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: zoom-in;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.product-image-zoom-trigger img {
  transition: transform 0.16s ease;
}
.product-image-zoom-trigger:active img {
  transform: scale(0.985);
}
.product-image-zoom-trigger:focus-visible {
  outline: 3px solid var(--brand-red);
  outline-offset: -3px;
}
.product-image.no-image,
.product-image .placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-weight: bold;
  font-size: 18px;
  color: var(--neutral-500);
  background: linear-gradient(135deg, #e9e9ef 0%, #d4d4dc 100%);
  text-align: center;
  padding: 8px;
}

.product-info {
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
}
.product-code-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}
.product-code {
  font-size: 11px;
  font-weight: 800;
  color: var(--brand-red);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.product-unit {
  font-size: 10px;
  color: var(--neutral-500);
  font-style: italic;
  white-space: nowrap;
  background: var(--neutral-50);
  padding: 1px 6px;
  border-radius: 10px;
}
.product-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--neutral-900);
  line-height: 1.35;
  min-height: 52px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* Primary price (USD amount paid at BCV rate) */
.price-primary {
  font-size: 12px;
  color: var(--neutral-700);
  margin: 4px 0 2px;
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex-wrap: wrap;
}
.price-primary strong {
  color: var(--brand-red);
  font-size: 16px;
  font-weight: 900;
}
.price-primary-note {
  font-size: 10px;
  color: var(--neutral-500);
  font-weight: 600;
  font-style: italic;
}

/* Reference prices list (4 other options - single column, full width) */
.price-refs {
  list-style: none;
  margin: 0 0 6px;
  padding: 6px 8px;
  background: var(--neutral-50);
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 11px;
}
.price-ref {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  color: var(--neutral-700);
  line-height: 1.3;
}
.price-ref.is-credit {
  color: var(--warning);
}
.price-ref .ref-label {
  font-weight: 600;
  font-size: 10px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price-ref .ref-value {
  font-weight: 700;
  color: var(--success);
  white-space: nowrap;
  font-size: 11px;
}
.price-ref.is-credit .ref-value {
  color: var(--warning);
}

/* Quantity Control */
.qty-control {
  display: flex;
  align-items: center;
  gap: 0;
  margin-top: 6px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--neutral-50);
}
.qty-btn {
  width: 32px;
  height: 32px;
  border: none;
  background: white;
  font-size: 18px;
  font-weight: bold;
  color: var(--brand-red);
  cursor: pointer;
  flex-shrink: 0;
}
.qty-btn:active {
  background: var(--neutral-200);
}
.qty-input {
  flex: 1;
  border: none;
  background: transparent;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  min-width: 0;
  padding: 0;
  color: var(--neutral-900);
  -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* (Floating cart removed - cart toggle is now in header top-right) */

/* Checkout Panel */
.checkout-panel {
  position: fixed;
  inset: 0;
  background: var(--neutral-50);
  z-index: 300;
  display: none;
  flex-direction: column;
  overflow-y: auto;
  padding-bottom: 96px;
}
.checkout-panel.open { display: flex; }
.checkout-panel:has(.checkout-action-bar) {
  padding-bottom: calc(168px + env(safe-area-inset-bottom));
}

.checkout-header {
  background: white;
  color: var(--neutral-900);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--neutral-200);
}
.checkout-title-block { text-align: center; min-width: 0; }
.checkout-header h2 {
  margin: 0;
  font-size: 16px;
  color: var(--neutral-900);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.checkout-title-block p {
  margin: 1px 0 0;
  color: var(--neutral-500);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.checkout-header-spacer { display: block; }
.checkout-back-btn {
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  color: var(--neutral-900);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  justify-self: start;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.checkout-back-btn:hover { background: white; }
.checkout-back-btn:active { transform: scale(0.98); }
.checkout-back-arrow { font-size: 16px; line-height: 1; }
.checkout-clear-cart {
  justify-self: end;
  background: transparent;
  border: 1px solid var(--neutral-200);
  color: var(--neutral-700);
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.checkout-clear-cart:hover {
  background: #fff5f5;
  border-color: rgba(204, 20, 20, 0.24);
  color: var(--checkout-red);
}
.checkout-clear-cart:active { transform: scale(0.98); }
.checkout-clear-cart[hidden] { display: none; }
@media (max-width: 480px) {
  .checkout-back-text { display: none; }
  .checkout-back-btn { padding: 8px 10px; }
  .checkout-back-arrow { font-size: 18px; }
  .checkout-clear-cart { padding: 8px 10px; }
}

/* Cart section wrapper — 和 customer-form / payment-options 一致的 section 风格 */
.cart-section {
  padding: 16px;
  background: white;
  border-top: 1px solid var(--neutral-200);
}
.cart-section-header {
  position: relative;
  padding-left: 0;
  margin-bottom: 12px;
}
.cart-section-title {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  color: var(--neutral-900);
  letter-spacing: -0.01em;
}
.cart-items {
  padding: 0;
  /* 不要 flex:1 + overflow-y:auto — 父 .checkout-panel 已经 overflow-y:auto */
}
.cart-empty {
  padding: 40px 16px;
  text-align: center;
  color: var(--neutral-500);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-empty strong {
  font-size: 16px;
  color: var(--neutral-900);
  font-weight: 700;
}
.cart-empty span {
  font-size: 13px;
  color: var(--neutral-500);
}
.cart-empty kbd {
  display: inline-block;
  padding: 0 6px;
  background: var(--brand-red);
  color: white;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-weight: 700;
  font-size: 12px;
}
.cart-item {
  background: white;
  border-radius: 0;
  padding: 12px 0;
  margin-bottom: 0;
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 10px;
  border-bottom: 1px solid var(--neutral-200);
  box-shadow: none;
}
.cart-item-thumb {
  width: 58px;
  height: 58px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--neutral-200);
  flex-shrink: 0;
}
.cart-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: white;
}
.cart-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Courier New", monospace;
  font-weight: 700;
  font-size: 11px;
  color: var(--neutral-500);
  background: linear-gradient(135deg, #e9e9ef 0%, #d4d4dc 100%);
  padding: 4px;
  text-align: center;
  line-height: 1.1;
}
.cart-item-info {
  min-width: 0;
}
.cart-item-code {
  font-weight: 900;
  color: var(--checkout-red);
  font-size: 12px;
}
.cart-item-name {
  font-size: 13px;
  color: var(--neutral-700);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.28;
}
.cart-item-price {
  font-size: 11px;
  color: var(--neutral-500);
  margin-top: 2px;
}
.cart-item-price strong {
  color: var(--brand-red);
  font-size: 13px;
  font-weight: 700;
}
.cart-item-money {
  margin-top: 8px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  max-width: 270px;
}
.cart-item-money span {
  display: grid;
  gap: 2px;
}
.cart-item-money em {
  color: var(--neutral-500);
  font-size: 9px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.cart-item-money strong {
  color: var(--neutral-900);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.cart-item-unit-badge {
  display: inline-block;
  font-size: 9px;
  color: var(--neutral-500);
  background: var(--neutral-50);
  padding: 1px 5px;
  border-radius: 8px;
  margin-left: 6px;
  font-style: italic;
}
.cart-item-controls {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.cart-item-qty-ctrl {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--neutral-50);
}
.cart-item-qty-ctrl .qty-btn {
  width: 28px;
  height: 28px;
  font-size: 16px;
}
.cart-item-qty-ctrl .qty-input {
  width: 40px;
  font-size: 13px;
}
/* Cart 原价汇总条 — 购物车清单底部基线 */
.cart-summary-bar {
  margin-top: 12px;
  padding: 12px 14px;
  background: var(--neutral-50);
  color: var(--neutral-900);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cart-summary-stats {
  display: flex;
  gap: 16px;
  font-size: 12px;
  color: var(--neutral-500);
}
.cart-summary-stats strong {
  color: var(--neutral-900);
  font-weight: 800;
  margin-right: 4px;
}
.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-top: 1px solid var(--neutral-200);
  padding-top: 8px;
}
.cart-summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--neutral-500);
  font-weight: 700;
}
.cart-summary-value {
  font-size: 22px;
  font-weight: 800;
  color: var(--neutral-900);
  letter-spacing: -0.01em;
}
.cart-summary-value .unit-note {
  color: var(--neutral-500);
  font-size: 10px;
}

/* No search results state */

/* ── Shipping Info ── */
.shipping-info {
  margin: 12px 12px 8px;
  background: var(--brand-dark);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  color: white;
  font-size: 13px;
  line-height: 1.6;
}
.shipping-section-title {
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-red);
  margin-bottom: 8px;
  font-weight: 700;
}
.shipping-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 5px;
  color: rgba(255,255,255,0.85);
}
.shipping-row:last-child { margin-bottom: 0; }
.shipping-icon { flex-shrink: 0; font-size: 14px; line-height: 1.4; }
.shipping-row strong { color: white; font-weight: 600; }
.shipping-row span { flex: 1; }

.no-results {
  padding: 48px 24px;
  text-align: center;
}
.no-results[hidden] { display: none; }
.no-results-inner {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--neutral-500);
}
.no-results-inner svg {
  width: 32px;
  height: 32px;
  color: var(--neutral-500);
}
.no-results-inner strong {
  font-size: 16px;
  color: var(--neutral-900);
  font-weight: 700;
}
.no-results-inner span {
  font-size: 13px;
}
.no-results-clear {
  border: none;
  border-radius: var(--radius-md);
  background: var(--brand-red);
  color: white;
  cursor: pointer;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 700;
}
.no-results-clear:active { transform: scale(0.98); }

/* Post-send cart clearing prompt */
.post-send-prompt {
  position: fixed;
  inset: 0;
  z-index: 650;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(13, 13, 18, 0.62);
}
.post-send-prompt.open { display: flex; }
.post-send-prompt[hidden] { display: none; }
.post-send-dialog {
  width: min(100%, 360px);
  background: white;
  color: var(--neutral-900);
  border-radius: var(--radius-lg);
  padding: 18px;
  box-shadow: var(--shadow-md);
}
.post-send-dialog h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
}
.post-send-dialog p {
  margin: 0;
  color: var(--neutral-700);
  font-size: 14px;
  line-height: 1.45;
}
.post-send-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}
.post-send-actions button {
  border-radius: var(--radius-md);
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  padding: 10px 12px;
}
.post-send-secondary {
  background: white;
  border: 1px solid var(--neutral-200);
  color: var(--neutral-700);
}
.post-send-primary {
  background: var(--brand-red);
  border: 1px solid var(--brand-red);
  color: white;
}
.post-send-actions button:active { transform: scale(0.98); }
@media (max-width: 360px) {
  .post-send-actions { grid-template-columns: 1fr; }
}

/* Toast notifications (加购反馈) */
.toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
  max-width: calc(100vw - 32px);
}
.toast {
  background: var(--neutral-900);
  color: white;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-md);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.2s, transform 0.2s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.toast.show { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .toast,
  .product-image-zoom-trigger img { transition: opacity 0.1s; transform: none; }
  .toast.show { transform: none; }
}

.pswp__custom-caption {
  position: absolute;
  left: 50%;
  bottom: 18px;
  width: min(calc(100% - 28px), 560px);
  transform: translateX(-50%);
  background: rgba(248, 248, 251, 0.94);
  color: var(--neutral-900);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.25;
  text-align: left;
  box-shadow: 0 10px 28px rgba(0,0,0,0.24);
}

.unit-note {
  font-size: 9px;
  color: var(--neutral-500);
  font-weight: 500;
  font-style: italic;
}
.cart-item-remove {
  background: transparent;
  border: none;
  color: var(--neutral-500);
  font-size: 11px;
  cursor: pointer;
  padding: 2px 4px;
  text-decoration: underline;
}
.cart-empty {
  text-align: center;
  color: var(--neutral-500);
  padding: 40px 20px;
}

/* Payment Options */
.payment-options {
  padding: 16px;
  background: white;
  border-top: 1px solid var(--neutral-200);
}
.payment-options h3 {
  margin: 0 0 12px;
  font-size: 15px;
  color: var(--neutral-900);
}
.payment-options-mayor {
  padding-bottom: 18px;
}
.order-summary-card {
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: white;
}
.order-summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--neutral-200);
}
.order-summary-row span {
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 700;
}
.order-summary-row strong {
  color: var(--neutral-900);
  font-size: 14px;
  font-weight: 850;
  text-align: right;
  white-space: nowrap;
}
.money-with-unit {
  display: inline-flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 5px;
  white-space: nowrap;
}
.money-unit {
  font-size: 0.58em;
  font-weight: 850;
  letter-spacing: 0.02em;
  color: inherit;
}
.order-summary-row.total strong {
  color: var(--checkout-red);
  font-size: 22px;
  letter-spacing: -0.01em;
}
.payment-method-summary {
  width: 100%;
  border: none;
  background: var(--neutral-50);
  padding: 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
}
.payment-method-summary > span:first-child {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.payment-method-kicker {
  color: var(--neutral-500);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.payment-method-summary strong {
  min-width: 0;
  color: var(--neutral-900);
  font-size: 14px;
  font-weight: 850;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.payment-method-meta {
  color: var(--checkout-red);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.payment-method-change {
  border: 1px solid rgba(204, 20, 20, 0.2);
  border-radius: var(--radius-sm);
  color: var(--checkout-red);
  background: white;
  padding: 7px 9px;
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}
.payment-method-summary:active .payment-method-change { transform: scale(0.98); }
.payment-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}
@media (min-width: 480px) {
  .payment-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .payment-grid { grid-template-columns: repeat(5, 1fr); }
}
.payment-card {
  background: var(--neutral-50);
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
}
@media (min-width: 480px) {
  .payment-card { text-align: center; min-height: 300px; padding: 10px; }
}
.payment-card:hover {
  transform: translateY(-2px);
  border-color: var(--neutral-500);
  box-shadow: var(--shadow-md);
}
.payment-card:focus-within {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 3px rgba(204, 20, 20, 0.15);
}
.payment-card .pay-select-btn {
  margin-top: auto;
}
.payment-card[data-is-credit="1"] {
  background: #fff9ea;
  border-color: #f0d38a;
}
.pay-label {
  font-size: 11px;
  font-weight: bold;
  color: var(--neutral-700);
  text-transform: uppercase;
}
.pay-discount {
  font-size: 11px;
  color: var(--success);
  font-weight: 700;
}
.pay-breakdown {
  list-style: none;
  margin: 8px 0 0;
  padding: 6px 8px;
  background: white;
  border-radius: var(--radius-sm);
  font-size: 11px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.pay-breakdown li {
  display: flex;
  justify-content: space-between;
  color: var(--neutral-700);
  line-height: 1.3;
}
.pay-breakdown li span:first-child {
  color: var(--neutral-500);
}
.pay-breakdown .pay-subtotal {
  color: var(--neutral-900);
  font-weight: 600;
}
.pay-breakdown .pay-discount-amount {
  color: var(--success);
  font-weight: 700;
}
.pay-breakdown .pay-shipping {
  color: var(--neutral-500);
  font-style: italic;
  font-size: 10px;
}
.payment-card[data-is-credit="1"] .pay-breakdown .pay-discount-amount {
  color: var(--warning);
}
.pay-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 6px 8px;
  border-top: 2px solid var(--neutral-200);
  margin-top: 4px;
}
.pay-total-label {
  font-size: 10px;
  color: var(--neutral-700);
  text-transform: uppercase;
  font-weight: 700;
  letter-spacing: 0.03em;
}
.pay-total {
  font-size: 16px;
  font-weight: 900;
  color: var(--brand-red);
}
.pay-select-btn {
  background: var(--brand-red);
  color: white;
  border: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  font-size: 12px;
  font-weight: bold;
  cursor: pointer;
  text-transform: uppercase;
}
.pay-select-btn:active { opacity: 0.85; }
.pay-select-btn.full-width { width: 100%; padding: 12px; font-size: 14px; }
.pay-select-btn:disabled,
.pay-select-btn[disabled] {
  background: var(--neutral-200);
  color: var(--neutral-500);
  cursor: not-allowed;
}

/* Single-card summary (retail / vip layouts) */
.payment-grid.single-card {
  grid-template-columns: 1fr;
  max-width: 480px;
  margin: 0 auto;
}
.payment-card.single {
  min-height: auto;
  background: white;
  border: 2px solid var(--brand-red);
}
.payment-card.single .pay-label {
  font-size: 14px;
  color: var(--brand-red);
}
.payment-card.single .pay-total {
  font-size: 22px;
}

/* Min-order warning */
.min-order-note {
  margin: 8px 0 12px;
  padding: 8px 12px;
  font-size: 12px;
  background: #f0f4f8;
  border-radius: var(--radius-sm);
  color: var(--neutral-700);
}
.min-order-note.warning,
.min-order-hint.warning {
  background: #fff5e0;
  color: #b45309;
  font-weight: 700;
  border-left: 3px solid #f59e0b;
}

/* "Consultar precio" placeholder for VIP missing MAYOR price */
.price-primary.price-consult {
  color: var(--neutral-500);
  font-style: italic;
  font-size: 13px;
  font-weight: 600;
}
.credit-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  font-size: 11px;
  color: var(--warning);
  background: #fff9ea;
  border-left: 3px solid var(--warning);
  border-radius: var(--radius-sm);
  line-height: 1.5;
}
.credit-note strong {
  color: #7a4d00;
}
.credit-note.compact {
  margin: 10px 12px 12px;
  border-left-width: 2px;
}

.payment-drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 520;
  background: rgba(13, 13, 18, 0.32);
  display: none;
}
.payment-drawer-backdrop.open { display: block; }
.payment-drawer-backdrop[hidden] { display: none; }
.payment-drawer {
  position: fixed;
  inset: auto 0 0;
  z-index: 540;
  display: none;
  padding: 0 10px 88px;
}
.payment-drawer.open { display: block; }
.payment-drawer[hidden] { display: none; }
.payment-drawer-panel {
  max-width: 560px;
  margin: 0 auto;
  background: white;
  border: 1px solid var(--neutral-200);
  border-bottom: none;
  border-radius: 8px 8px 0 0;
  box-shadow: 0 -16px 40px rgba(13, 13, 18, 0.16);
  overflow: hidden;
}
.payment-drawer-handle {
  width: 42px;
  height: 4px;
  border-radius: 999px;
  background: var(--neutral-200);
  margin: 8px auto 6px;
}
.payment-drawer-header {
  padding: 0 14px 12px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 10px;
  border-bottom: 1px solid var(--neutral-200);
}
.payment-drawer-header h3 {
  margin: 0;
  color: var(--neutral-900);
  font-size: 16px;
  font-weight: 850;
}
.payment-drawer-header p {
  margin: 3px 0 0;
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.35;
}
.payment-drawer-close {
  width: 30px;
  height: 30px;
  border: 1px solid var(--neutral-200);
  border-radius: var(--radius-sm);
  background: white;
  color: var(--neutral-700);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.payment-drawer-close:active { transform: scale(0.96); }
.payment-option-list {
  display: grid;
  padding: 4px 0;
}
.payment-option-row {
  width: 100%;
  border: none;
  border-left: 3px solid transparent;
  background: white;
  padding: 10px 12px 10px 9px;
  display: grid;
  grid-template-columns: 18px minmax(96px, 1.2fr) minmax(92px, 0.95fr) minmax(78px, 0.8fr);
  align-items: center;
  gap: 8px;
  text-align: left;
  font-family: inherit;
  border-bottom: 1px solid var(--neutral-200);
  cursor: pointer;
}
.payment-option-row:last-child { border-bottom: none; }
.payment-option-row.is-selected {
  border-left-color: var(--checkout-red);
  background: #fff8f8;
}
.payment-radio {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 1.5px solid var(--neutral-500);
  position: relative;
}
.payment-option-row.is-selected .payment-radio {
  border-color: var(--checkout-red);
}
.payment-option-row.is-selected .payment-radio::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: var(--checkout-red);
}
.payment-option-main,
.payment-option-list-price,
.payment-option-payable {
  min-width: 0;
  display: grid;
  gap: 2px;
}
.payment-option-name {
  color: var(--neutral-900);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.18;
}
.payment-option-note {
  color: var(--neutral-500);
  font-size: 10px;
  font-weight: 650;
  line-height: 1.2;
}
.payment-option-pill {
  width: max-content;
  border: 1px solid rgba(204, 20, 20, 0.26);
  border-radius: 999px;
  color: var(--checkout-red);
  background: white;
  padding: 1px 6px;
  font-size: 9px;
  font-weight: 850;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.payment-option-list-price,
.payment-option-payable {
  text-align: right;
}
.payment-option-list-price > span:first-child,
.payment-option-payable > span:first-child {
  color: var(--neutral-500);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.payment-option-list-value {
  color: var(--neutral-900);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}
.payment-option-discount-line {
  color: var(--neutral-500);
  font-size: 10px;
  font-weight: 650;
}
.payment-option-discount-line b {
  color: var(--checkout-red);
  font-weight: 850;
}
.payment-option-payable-value {
  color: var(--neutral-900);
  font-size: 14px;
  font-weight: 900;
  white-space: nowrap;
}
.payment-option-payable-value.money-with-unit {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
  line-height: 1.05;
  white-space: normal;
}
.payment-option-payable-value .money-unit {
  font-size: 9px;
  letter-spacing: 0.04em;
}
.payment-option-row.is-selected .payment-option-payable-value {
  color: var(--checkout-red);
}

.checkout-action-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 500;
  background: white;
  border-top: 1px solid var(--neutral-200);
  box-shadow: 0 -10px 28px rgba(13, 13, 18, 0.12);
  padding: 10px 12px max(10px, env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: center;
}
.checkout-action-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}
.checkout-action-total {
  grid-column: 1 / -1;
  min-width: 0;
  display: grid;
  gap: 2px;
}
.checkout-action-total > span {
  color: var(--neutral-500);
  font-size: 10px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.checkout-action-total strong {
  color: var(--checkout-red);
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}
.checkout-action-total strong .money-unit {
  font-size: 10px;
}
.checkout-action-total small {
  color: var(--neutral-500);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.checkout-change-payment-btn {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid rgba(204, 20, 20, 0.32);
  background: #fff5f5;
  color: var(--checkout-red);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
}
.checkout-change-payment-btn:active { transform: scale(0.98); }
.checkout-action-btn {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  background: var(--checkout-red);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 13px;
  white-space: nowrap;
}
.checkout-action-btn:active { transform: scale(0.98); opacity: 1; }
.checkout-action-btn:disabled,
.checkout-action-btn[disabled] {
  background: var(--neutral-200);
  color: var(--neutral-500);
  border: 1px solid var(--neutral-200);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 1;
}
@media (max-width: 360px) {
  .checkout-panel:has(.checkout-action-bar) {
    padding-bottom: calc(190px + env(safe-area-inset-bottom));
  }
  .payment-option-row {
    grid-template-columns: 16px minmax(82px, 1.1fr) minmax(78px, 0.9fr) minmax(68px, 0.75fr);
    gap: 6px;
    padding-right: 9px;
  }
  .payment-option-name { font-size: 11px; }
  .payment-option-payable-value { font-size: 13px; }
  .checkout-action-bar {
    gap: 8px;
    padding: 8px 10px max(8px, env(safe-area-inset-bottom));
  }
  .checkout-action-total strong {
    font-size: 19px;
  }
  .checkout-action-total small {
    font-size: 10px;
  }
  .checkout-action-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    width: 100%;
  }
  .checkout-change-payment-btn,
  .checkout-action-btn {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    padding: 10px 8px;
    font-size: 12px;
    line-height: 1.1;
    white-space: normal;
  }
}

/* Payment card sub-text showing unit price context */
.payment-card .pay-hint {
  font-size: 9px;
  color: var(--neutral-500);
  font-style: italic;
  margin-top: 2px;
}
.payment-card[data-is-credit="1"] .pay-hint {
  color: var(--warning);
}

/* iOS Safari zooms the page when focused form controls are smaller than 16px. */
@media (max-width: 767px) {
  .search-box input,
  .category-sheet-search input,
  .customer-form input,
  .qty-input,
  .cart-item-qty-ctrl .qty-input,
  input,
  textarea,
  select {
    font-size: 16px;
  }
}

/* No-price summary */
.no-price-summary {
  padding: 16px;
  background: white;
  border-top: 2px solid var(--neutral-200);
  text-align: center;
}
.no-price-summary p {
  margin: 8px 0;
  font-size: 14px;
}

/* Internal WhatsApp order import page */
.import-page {
  background: #f5f6f8;
  color: #172033;
}

.import-shell {
  width: min(1120px, calc(100% - 24px));
  margin: 0 auto;
  padding: 24px 0 48px;
}

.import-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.import-kicker {
  margin: 0 0 4px;
  color: #5a6475;
  font-size: 13px;
}

.import-header h1 {
  margin: 0;
  font-size: clamp(24px, 4vw, 34px);
  letter-spacing: 0;
}

.import-back-link {
  color: #0b5cab;
  font-weight: 700;
  text-decoration: none;
}

.import-section {
  background: #fff;
  border: 1px solid #d8dee8;
  border-radius: 8px;
  padding: 18px;
  margin-bottom: 16px;
}

.import-section h2,
.import-section h3 {
  margin: 0 0 12px;
  letter-spacing: 0;
}

.import-password-row,
.import-actions,
.import-confirm {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.import-password-row input,
.import-field input,
#orderTextInput {
  width: 100%;
  border: 1px solid #c8d0dc;
  border-radius: 6px;
  padding: 12px;
  font: inherit;
  background: #fff;
}

.import-password-row input {
  max-width: 260px;
}

#orderTextInput {
  resize: vertical;
  min-height: 260px;
  line-height: 1.5;
}

.import-section button {
  border: 0;
  border-radius: 6px;
  padding: 12px 16px;
  font-weight: 800;
  cursor: pointer;
  background: #111827;
  color: #fff;
}

.import-section button:disabled {
  cursor: not-allowed;
  opacity: .5;
}

.import-error {
  color: #b42318;
  font-weight: 700;
}

.import-warning,
.import-missing {
  border-radius: 6px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fff5db;
  color: #714600;
  border: 1px solid #f4d27a;
}

.import-missing {
  background: #fff0f0;
  color: #9f1c1c;
  border-color: #f1b5b5;
}

.import-preview-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
}

.import-preview-block {
  border: 1px solid #e2e7ef;
  border-radius: 8px;
  padding: 14px;
}

.import-customer-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.import-customer-list div {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 8px;
}

.import-customer-list dt {
  color: #687386;
  font-weight: 700;
}

.import-customer-list dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.import-field {
  display: grid;
  gap: 8px;
}

.import-field span,
.import-note {
  color: #687386;
  font-size: 13px;
}

.import-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0;
}

.import-stats span {
  border: 1px solid #d8dee8;
  border-radius: 999px;
  padding: 8px 10px;
  background: #f8fafc;
}

.import-table-wrap {
  overflow-x: auto;
  border: 1px solid #d8dee8;
  border-radius: 8px;
}

.import-preview-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

.import-preview-table th,
.import-preview-table td {
  padding: 10px;
  border-bottom: 1px solid #e6ebf2;
  text-align: left;
  vertical-align: top;
}

.import-preview-table th {
  background: #f8fafc;
  color: #465266;
  font-size: 13px;
}

.import-confirm {
  justify-content: space-between;
  margin-top: 14px;
}

.import-confirm p {
  margin: 0;
  color: #5a6475;
}

@media (max-width: 720px) {
  .import-header,
  .import-preview-grid,
  .import-confirm {
    display: grid;
  }

  .import-customer-list div {
    grid-template-columns: 1fr;
  }
}
