/* Cart + Checkout 暗色重设计。 */

/* ---- 共用骨架 ---- */
body.woocommerce-cart .site-content,
body.woocommerce-checkout .site-content {
  background: #080a0d;
}

body.woocommerce-cart .entry-hero,
body.woocommerce-checkout .entry-hero {
  background: #080a0d !important;
  border-bottom: 1px solid #28313b;
  padding: clamp(28px, 5vh, 52px) 24px;
}

body.woocommerce-cart .entry-hero .entry-title,
body.woocommerce-checkout .entry-hero .entry-title,
body.woocommerce-cart .entry-hero .page-title,
body.woocommerce-checkout .entry-hero .page-title {
  color: #f5f7f8 !important;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: 0;
  text-transform: uppercase;
}

body.woocommerce-cart .entry-content,
body.woocommerce-checkout .entry-content {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 5vh, 56px) 22px 90px;
  color: #c6ced6;
}

/* Kadence 白底包装压暗（Cart/Checkout 用的是 WC Blocks） */
body.woocommerce-cart .entry.content-bg,
body.woocommerce-checkout .entry.content-bg,
body.woocommerce-cart .entry-content-wrap,
body.woocommerce-checkout .entry-content-wrap {
  background: transparent !important;
  border: 0;
  box-shadow: none;
}

/* WC Blocks 文字/背景基色 */
body.woocommerce-cart .wp-block-woocommerce-cart,
body.woocommerce-checkout .wp-block-woocommerce-checkout {
  color: #c6ced6;
}

body.woocommerce-cart .wc-block-cart-items,
body.woocommerce-checkout .wc-block-components-order-summary,
body.woocommerce-checkout .wc-block-components-form {
  color: #c6ced6;
}

/* 行项目卡片 */
body.woocommerce-cart .wc-block-cart-items .wc-block-cart-items__row {
  border-bottom: 1px solid #1b222b;
}

body.woocommerce-cart .wc-block-cart-items td,
body.woocommerce-cart .wc-block-cart-items th {
  background: transparent;
  color: #c6ced6;
}

body.woocommerce-cart .wc-block-components-product-name,
body.woocommerce-checkout .wc-block-components-product-name {
  color: #f5f7f8 !important;
  font-weight: 600;
}

body.woocommerce-cart .wc-block-components-product-metadata,
body.woocommerce-checkout .wc-block-components-product-metadata {
  color: #98a3af !important;
}

body.woocommerce-cart .wc-block-components-product-price,
body.woocommerce-cart .wc-block-cart-item__prices,
body.woocommerce-checkout .wc-block-components-product-price {
  color: #f5f7f8 !important;
}

body.woocommerce-cart .wc-block-components-product-image img {
  border: 1px solid #28313b;
  border-radius: 4px;
}

/* 数量步进器 */
body.woocommerce-cart .wc-block-components-quantity-selector input,
body.woocommerce-cart .wc-block-components-quantity-selector button {
  background: #0a0e13 !important;
  border-color: #28313b !important;
  color: #f5f7f8 !important;
}

/* 汇总面板 */
body.woocommerce-cart .wc-block-components-sidebar,
body.woocommerce-checkout .wc-block-components-sidebar {
  background: #0e1217 !important;
  border: 1px solid #28313b !important;
  border-radius: 6px;
  color: #c6ced6 !important;
}

body.woocommerce-cart .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-item__label,
body.woocommerce-cart .wc-block-components-title,
body.woocommerce-checkout .wc-block-components-title {
  color: #bcc6d0 !important;
}

body.woocommerce-cart .wc-block-components-totals-item__value,
body.woocommerce-checkout .wc-block-components-totals-item__value,
body.woocommerce-cart .wc-block-components-totals-footer-item,
body.woocommerce-checkout .wc-block-components-totals-footer-item {
  color: #f5f7f8 !important;
}

/* Coupon 输入 */
body.woocommerce-cart .wc-block-components-totals-coupon__content input,
body.woocommerce-checkout input,
body.woocommerce-checkout select,
body.woocommerce-checkout textarea {
  background: #0a0e13 !important;
  border: 1px solid #28313b !important;
  color: #f5f7f8 !important;
}

body.woocommerce-checkout .wc-block-components-text-input label {
  color: #98a3af !important;
}

/* 主按钮：品牌红 */
body.woocommerce-cart .wc-block-cart__submit-button,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button,
body.woocommerce-cart .wc-block-components-button:not(.is-secondary) {
  background: #dd3139 !important;
  border: 0 !important;
  color: #fff !important;
  border-radius: 4px;
  font: 700 13px/1 Inter, sans-serif !important;
  letter-spacing: .1em;
  text-transform: uppercase;
  min-height: 54px;
}

body.woocommerce-cart .wc-block-cart__submit-button:hover,
body.woocommerce-checkout .wc-block-components-checkout-place-order-button:hover {
  background: #f0474f !important;
}

/* 次要链接按钮 */
body.woocommerce-cart .wc-block-components-button.is-secondary,
body.woocommerce-checkout .wc-block-components-button.is-secondary {
  background: transparent !important;
  border: 1px solid #3d4854 !important;
  color: #f5f7f8 !important;
}

/* 空购物车提示 */
body.woocommerce-cart .wc-block-cart__empty-cart__title,
body.woocommerce-cart .wc-block-cart__empty-cart__title.with-empty-cart-icon {
  color: #f5f7f8 !important;
}

/* 加载骨架别闪白 */
body.woocommerce-cart .is-loading .wc-block-components-skeleton,
body.woocommerce-checkout .is-loading .wc-block-components-skeleton {
  --skeleton-color: #131820;
}

/* ---- Cart 表格 ---- */
.woocommerce-cart .shop_table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid #28313b;
  background: #0e1217;
}

.woocommerce-cart .shop_table thead th {
  padding: 14px 16px;
  border-bottom: 1px solid #28313b;
  color: #98a3af;
  font: 700 11px/1 Inter, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-align: left;
}

.woocommerce-cart .shop_table td {
  padding: 16px;
  border-bottom: 1px solid #1b222b;
  color: #c6ced6;
  vertical-align: middle;
}

.woocommerce-cart .cart_item td.product-thumbnail img {
  width: 84px;
  height: 84px;
  object-fit: cover;
  border: 1px solid #28313b;
  border-radius: 4px;
}

.woocommerce-cart .cart_item td.product-name a {
  color: #f5f7f8;
  font: 600 15px/1.35 Inter, sans-serif;
  text-decoration: none;
}

.woocommerce-cart .cart_item td.product-name .variation {
  margin-top: 6px;
  color: #98a3af;
  font: 500 12px/1.4 Inter, sans-serif;
}

.woocommerce-cart .cart_item td.product-price,
.woocommerce-cart .cart_item td.product-subtotal {
  color: #f5f7f8;
  font: 600 14px/1 Inter, sans-serif;
}

.woocommerce-cart .quantity input.qty {
  width: 64px;
  padding: 8px;
  border: 1px solid #28313b;
  border-radius: 4px;
  background: #0a0e13;
  color: #f5f7f8;
}

.woocommerce-cart td.actions {
  padding: 16px;
}

.woocommerce-cart td.actions .button,
.woocommerce-cart td.actions button {
  border: 1px solid #3d4854;
  border-radius: 4px;
  background: transparent;
  color: #f5f7f8;
  padding: 12px 20px;
  font: 700 11px/1 Inter, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.woocommerce-cart .coupon input {
  padding: 12px 14px;
  border: 1px solid #28313b;
  border-radius: 4px;
  background: #0a0e13;
  color: #f5f7f8;
}

/* ---- Cart 汇总 ---- */
.woocommerce-cart .cart-collaterals .cart_totals {
  border: 1px solid #28313b;
  background: #0e1217;
  padding: 24px;
}

.woocommerce-cart .cart_totals h2 {
  color: #f5f7f8;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 30px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.woocommerce-cart .cart_totals table th,
.woocommerce-cart .cart_totals table td {
  padding: 12px 0;
  border-bottom: 1px solid #1b222b;
  color: #bcc6d0;
}

.woocommerce-cart .cart_totals .order-total th,
.woocommerce-cart .cart_totals .order-total td {
  color: #f5f7f8;
  font-size: 18px;
  font-weight: 700;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button,
.woocommerce-checkout #place_order {
  display: inline-flex;
  width: 100%;
  min-height: 54px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 4px;
  background: #dd3139;
  color: #fff;
  font: 700 13px/1 Inter, sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
}

.woocommerce-cart .wc-proceed-to-checkout .checkout-button:hover,
.woocommerce-checkout #place_order:hover {
  background: #f0474f;
}

/* ---- Checkout 表单 ---- */
.woocommerce-checkout .woocommerce-billing-fields h3,
.woocommerce-checkout .woocommerce-shipping-fields h3,
.woocommerce-checkout #order_review_heading,
.woocommerce-checkout .woocommerce-additional-fields h3 {
  color: #f5f7f8;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 26px;
  letter-spacing: 0;
  text-transform: uppercase;
}

.woocommerce-checkout .form-row label {
  color: #bcc6d0;
  font: 600 12px/1.5 Inter, sans-serif;
}

.woocommerce-checkout .form-row input.input-text,
.woocommerce-checkout .form-row select,
.woocommerce-checkout .form-row textarea {
  padding: 12px 14px;
  border: 1px solid #28313b;
  border-radius: 4px;
  background: #0a0e13;
  color: #f5f7f8;
  font: 400 14px/1.4 Inter, sans-serif;
}

.woocommerce-checkout .form-row input.input-text:focus,
.woocommerce-checkout .form-row select:focus,
.woocommerce-checkout .form-row textarea:focus {
  border-color: #38c9e8;
  outline: none;
}

.woocommerce-checkout #order_review {
  border: 1px solid #28313b;
  background: #0e1217;
  padding: 24px;
}

.woocommerce-checkout #order_review .shop_table th,
.woocommerce-checkout #order_review .shop_table td {
  padding: 12px 8px;
  border-bottom: 1px solid #1b222b;
  color: #bcc6d0;
}

.woocommerce-checkout #order_review .product-name { color: #f5f7f8; }
.woocommerce-checkout #order_review .order-total th,
.woocommerce-checkout #order_review .order-total td { color: #f5f7f8; font-weight: 700; }

.woocommerce-checkout .woocommerce-privacy-policy-text,
.woocommerce-checkout .woocommerce-terms-and-conditions-wrapper {
  color: #98a3af;
  font: 400 13px/1.6 Inter, sans-serif;
}

/* 支付盒 */
.woocommerce-checkout #payment {
  border: 1px solid #28313b;
  background: #0a0e13;
  border-radius: 6px;
}

.woocommerce-checkout #payment .wc_payment_methods {
  border-bottom: 1px solid #28313b;
}

.woocommerce-checkout #payment .wc_payment_method label {
  color: #f5f7f8;
  font-weight: 600;
}

/* ---- C02-03A Block layout hardening ---- */
body.woocommerce-cart .wc-block-components-main,
body.woocommerce-cart .wc-block-components-sidebar,
body.woocommerce-checkout .wc-block-checkout__form,
body.woocommerce-checkout .wc-block-components-sidebar {
  min-width: 0;
  box-sizing: border-box;
}

body.woocommerce-cart .wc-block-components-sidebar,
body.woocommerce-checkout .wc-block-components-sidebar {
  padding: 24px !important;
}

body.woocommerce-cart .wc-block-components-sidebar .wc-block-components-order-summary,
body.woocommerce-cart .wc-block-components-sidebar .wc-block-components-totals-item,
body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-order-summary,
body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-item {
  padding-inline: 0;
  min-width: 0;
}

body.woocommerce-cart .wc-block-components-totals-item,
body.woocommerce-checkout .wc-block-components-totals-item {
  min-width: 0;
  gap: 16px;
}

body.woocommerce-cart .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-item__label,
body.woocommerce-cart .wc-block-components-totals-item__value,
body.woocommerce-checkout .wc-block-components-totals-item__value {
  min-width: 0;
  overflow-wrap: anywhere;
}

body.woocommerce-cart .wc-block-components-totals-item__value,
body.woocommerce-checkout .wc-block-components-totals-item__value {
  text-align: right;
}

body.woocommerce-cart .wc-block-cart-items .wc-block-cart-item__product,
body.woocommerce-checkout .wc-block-components-order-summary-item {
  min-width: 0;
}

body.woocommerce-cart .wc-block-components-product-name,
body.woocommerce-checkout .wc-block-components-product-name {
  overflow-wrap: anywhere;
  white-space: normal;
}

body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-text-input select,
body.woocommerce-checkout .wc-block-components-text-input textarea,
body.woocommerce-checkout .wc-block-components-combobox .components-combobox-control__input {
  min-height: 52px;
  box-sizing: border-box;
}

body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-block-components-combobox label {
  max-width: calc(100% - 28px);
  overflow-wrap: anywhere;
}

body.woocommerce-checkout .wc-block-components-radio-control__option {
  border: 1px solid #3d4854;
  border-radius: 4px;
  background: #0e1217;
  color: #c6ced6;
}

body.woocommerce-checkout .wc-block-components-radio-control__option-checked {
	border-color: #36c9e8;
	background: #111c22;
	box-shadow: inset 0 0 0 1px #36c9e8;
}

/* C02-08R9: align Cart Total values and close every table edge. */
.woocommerce-cart .shop_table.cart {
	border: 1px solid #28313b;
	border-collapse: collapse;
	border-spacing: 0;
}
.woocommerce-cart .shop_table.cart th,
.woocommerce-cart .shop_table.cart td {
	border-right: 1px solid #28313b;
	border-bottom: 1px solid #28313b;
	vertical-align: middle;
}
.woocommerce-cart .shop_table.cart tr > :last-child { border-right: 1px solid #28313b; }
.woocommerce-cart .shop_table.cart thead .product-total,
.woocommerce-cart .shop_table.cart tbody .product-subtotal {
	text-align: center;
	vertical-align: middle;
}
.woocommerce-cart .shop_table.cart tbody .product-subtotal {
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
.woocommerce-cart .shop_table.cart tbody tr:last-child > * { border-bottom: 1px solid #28313b; }

body.woocommerce-checkout .wc-block-components-radio-control__option:has(input[type="radio"]:checked) {
  border-color: #36c9e8;
  background: #111c22;
  box-shadow: inset 0 0 0 1px #36c9e8;
}

body.woocommerce-checkout .wc-block-components-radio-control__input {
  accent-color: #36c9e8;
}

body.woocommerce-checkout input[type="radio"] {
  appearance: none !important;
  box-sizing: border-box;
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px;
  margin: 0 10px 0 0 !important;
  padding: 0 !important;
  border: 2px solid #aeb8c2 !important;
  border-radius: 50%;
  background: #0e1217 !important;
  display: inline-grid;
  place-content: center;
  accent-color: #36c9e8;
}

body.woocommerce-checkout input[type="radio"]::before {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #36c9e8;
  content: "";
  transform: scale(0);
}

body.woocommerce-checkout input[type="radio"]:checked {
  border-color: #36c9e8 !important;
}

body.woocommerce-checkout input[type="radio"]:checked::before {
  transform: scale(1);
}

body.woocommerce-checkout .wc-block-components-radio-control__option:focus-within,
body.woocommerce-checkout .wc-block-components-checkbox:focus-within {
  outline: 2px solid #36c9e8;
  outline-offset: 2px;
}

body.woocommerce-checkout .wc-block-components-checkbox__input {
  accent-color: #36c9e8;
}

body.woocommerce-checkout input[type="checkbox"] {
  appearance: none !important;
  box-sizing: border-box;
  width: 20px !important;
  height: 20px !important;
  flex: 0 0 20px;
  margin: 0 10px 0 0 !important;
  padding: 0 !important;
  border: 1px solid #aeb8c2 !important;
  border-radius: 3px;
  background: #0e1217 !important;
  display: inline-grid;
  place-content: center;
}

body.woocommerce-checkout input[type="checkbox"]:checked {
  border-color: #36c9e8 !important;
  background: #36c9e8 !important;
}

body.woocommerce-checkout .wc-block-components-checkbox .wc-block-components-checkbox__mark {
	fill: #080a0d;
}

body.woocommerce-checkout input[type="radio"]:focus-visible,
body.woocommerce-checkout input[type="checkbox"]:focus-visible {
  outline: 2px solid #36c9e8;
  outline-offset: 2px;
}

body.woocommerce-checkout label:has(> input[type="checkbox"]:checked) {
  color: #f5f7f8 !important;
}

body.woocommerce-checkout .wc-block-components-checkbox:has(input[type="checkbox"]:checked) .wc-block-components-checkbox__label {
  color: #f5f7f8;
}

body.woocommerce-checkout .wc-block-components-checkbox__label,
body.woocommerce-checkout .wc-block-components-radio-control__label {
  color: #dce3e9;
}

body.woocommerce-checkout .wc-block-components-sidebar {
  box-sizing: border-box;
  padding: 24px !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-order-summary,
body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-order-summary-item,
body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-item {
  min-width: 0;
  padding-inline: 0;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-order-summary-item {
  gap: 12px;
  padding: 12px;
  box-sizing: border-box;
  margin-inline: 0;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-item {
  box-sizing: border-box;
  gap: 12px;
  margin-inline: 0;
  padding: 12px !important;
}

body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-order-summary-item__image {
  margin-inline-end: 0;
}

body.woocommerce-checkout input:focus-visible,
body.woocommerce-checkout select:focus-visible,
body.woocommerce-checkout textarea:focus-visible,
body.woocommerce-checkout button:focus-visible,
body.woocommerce-checkout a:focus-visible,
body.woocommerce-cart button:focus-visible,
body.woocommerce-cart a:focus-visible {
  outline: 2px solid #38c9e8;
  outline-offset: 2px;
}

/* A sole checked free method is an applied result, not a meaningful choice. */
body.woocommerce-checkout .wc-block-checkout__shipping-option
  .wc-block-components-radio-control:has(> label:only-child > input:checked[value^="free_shipping:"])
  > .wc-block-components-radio-control__option-checked
  .wc-block-components-radio-control__label-group::after {
  grid-column: 1 / -1;
  display: block;
  margin-top: 0;
  color: #38c9e8;
  content: 'Free shipping applied';
  font: 700 11px/1.35 Inter, sans-serif;
  letter-spacing: .04em;
  text-transform: uppercase;
}

body.woocommerce-checkout .wc-block-checkout__shipping-option
  .wc-block-components-radio-control:has(> label:only-child > input:checked[value^="free_shipping:"])
  > .wc-block-components-radio-control__option-checked
  .wc-block-components-radio-control__label-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  column-gap: 16px;
  row-gap: 4px;
}

body.woocommerce-checkout .wc-block-checkout__shipping-option
  .wc-block-components-radio-control:has(> label:only-child > input:checked[value^="free_shipping:"])
  > .wc-block-components-radio-control__option-checked {
  border-color: #38c9e8;
  background: rgba(56, 201, 232, .04);
}

@media (max-width: 800px) {
  body.woocommerce-cart .entry-content,
  body.woocommerce-checkout .entry-content {
    padding-inline: 16px;
  }

  body.woocommerce-cart .wc-block-components-sidebar,
  body.woocommerce-checkout .wc-block-components-sidebar {
    padding: 16px !important;
  }

  body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-order-summary-item {
    padding: 10px;
    gap: 8px;
  }

  body.woocommerce-checkout .wc-block-components-sidebar .wc-block-components-totals-item {
    gap: 8px;
    padding: 10px !important;
  }

  body.woocommerce-cart .wc-block-cart-items td,
  body.woocommerce-cart .wc-block-cart-items th {
    padding-inline: 8px;
  }

  body.woocommerce-cart .wc-block-components-product-name,
  body.woocommerce-checkout .wc-block-components-product-name {
    font-size: 14px;
  }
}

/* C02-08R11: the Cart block's responsive grid separated Total into a short implicit track. */
body.woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items {
	display: table !important;
	width: 100%;
	max-width: 100%;
	table-layout: fixed;
	border: 1px solid #28313b;
	border-collapse: collapse;
	border-spacing: 0;
}
body.woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items thead {
	display: table-header-group !important;
}
body.woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items tbody { display: table-row-group !important; }
body.woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items tr.wc-block-cart-items__header { display: table-row !important; }
body.woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items tr.wc-block-cart-items__row {
	display: table-row !important;
	height: auto;
}
body.woocommerce-cart .wp-block-woocommerce-cart table.wc-block-cart-items tr > :is(th, td) {
	display: table-cell !important;
	box-sizing: border-box;
	min-width: 0;
	padding: 14px 10px;
	border: 1px solid #28313b;
	vertical-align: middle;
}
body.woocommerce-cart .wp-block-woocommerce-cart .wc-block-cart-items__header-image,
body.woocommerce-cart .wp-block-woocommerce-cart .wc-block-cart-item__image {
	width: clamp(56px, 8vw, 80px);
	padding-inline: 8px;
}
body.woocommerce-cart .wp-block-woocommerce-cart .wc-block-cart-item__image img {
	display: block;
	width: 100%;
	height: auto;
}
body.woocommerce-cart .wp-block-woocommerce-cart .wc-block-cart-item__product {
	width: auto;
	min-width: 0;
	word-break: normal;
	overflow-wrap: anywhere;
}
body.woocommerce-cart .wp-block-woocommerce-cart .wc-block-cart-items__header-total,
body.woocommerce-cart .wp-block-woocommerce-cart .wc-block-cart-item__total {
	width: clamp(92px, 12vw, 132px);
	text-align: center;
	vertical-align: middle;
	white-space: normal;
}
body.woocommerce-cart .wp-block-woocommerce-cart .wc-block-cart-items__header-total { text-align: center; }
body.woocommerce-cart .wp-block-woocommerce-cart .wc-block-cart-item__total-price-and-sale-badge-wrapper {
	display: flex;
	width: 100%;
	min-height: 100%;
	align-items: center;
	justify-content: center;
}
body.woocommerce-cart .wp-block-woocommerce-cart .wc-block-cart-item__total .wc-block-components-product-price {
	text-align: center;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
}
