/* Cart page — reference layout (Your Cart + Order Summary) */

body.woocommerce-cart {
  background: #faf9f6;
}

.woocommerce-cart .breadcrumb,
.woocommerce-cart .legal-title {
  display: none;
}

.woocommerce-cart main.legal-page {
  width: min(100% - 2.5rem, 90%);
  max-width: 1360px;
  margin: 32px auto 72px;
}

.woocommerce-cart main.legal-page .container.legal-shell {
  width: 100%;
  max-width: none;
  padding: 0;
}

.woocommerce-cart .entry-content {
  margin: 0;
}

/* Two-column grid */
.woocommerce-cart .wc-block-cart,
.woocommerce-cart .wp-block-woocommerce-filled-cart-block {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 28px;
}

.woocommerce-cart .wc-block-components-sidebar-layout {
  flex-wrap: wrap;
  min-width: 0;
}

.woocommerce-cart .wc-block-cart__main.shop-cart-main-card {
  flex: 1 1 520px;
  min-width: 0;
  background: #fff;
  border: 1px solid #f0ebe3;
  border-radius: 16px;
  padding: 28px 32px 24px;
  box-shadow: 0 1px 4px rgba(28, 25, 23, 0.05);
}

/* Left header */
.shop-cart-page-header {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-bottom: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid #ede8e1;
}

.shop-cart-page-header__icon,
.shop-cart-order-summary__icon,
.shop-cart-guarantee__icon {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #ebe3d6;
  color: #8b7355;
}

.shop-cart-page-header__icon svg,
.shop-cart-order-summary__icon svg,
.shop-cart-guarantee__icon svg,
.shop-cart-trust__icon svg {
  display: block;
}

.shop-cart-page-header__title {
  margin: 0;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: #1c1917;
}

.shop-cart-page-header__subtitle {
  margin: 6px 0 0;
  font-size: 0.9375rem;
  line-height: 1.45;
  color: #78716c;
}

/* Cart items */
.woocommerce-cart .wc-block-cart-items__header {
  display: none !important;
}

.woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row {
  grid-template-columns: 110px minmax(0, 1fr) auto;
  column-gap: 20px;
  row-gap: 12px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid #ede8e1;
}

.woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row:last-child {
  border-bottom: 0;
}

.woocommerce-cart .wc-block-cart-item__image {
  width: 110px !important;
  min-width: 110px;
}

.woocommerce-cart .wc-block-cart-item__image img {
  border-radius: 10px;
  max-width: 110px !important;
  max-height: 150px !important;
}

.woocommerce-cart .wc-block-components-product-name {
  font-family: "Playfair Display", Georgia, "Times New Roman", serif !important;
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  color: #1c1917 !important;
  line-height: 1.35 !important;
}

.woocommerce-cart .cart-item-author {
  font-size: 0.9375rem;
  font-weight: 500;
  color: #78716c;
  margin-top: 4px;
}

.woocommerce-cart .cart-item-isbn {
  font-size: 0.875rem;
  color: #a8a29e;
  margin-top: 2px;
}

.woocommerce-cart .wc-block-cart-item__quantity {
  margin-top: 12px;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
}

.woocommerce-cart .wc-block-cart-item__remove-link {
  margin-left: 4px;
  color: #a8a29e !important;
  width: 28px;
  height: 28px;
  min-width: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  text-decoration: none !important;
  background: transparent !important;
  border: 0;
  padding: 0;
}

.woocommerce-cart .wc-block-cart-item__remove-link svg {
  width: 18px;
  height: 18px;
  fill: #a8a29e;
}

.woocommerce-cart .wc-block-cart-item__remove-link:hover svg {
  fill: #78716c;
}

/* WC Blocks 自带删除 SVG，勿再用 ::before 叠加图标 */
.woocommerce-cart .wc-block-components-product-details__remove-button {
  display: none !important;
}

.woocommerce-cart .wc-block-components-quantity-selector {
  border: 1px solid #d6d0c8;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.woocommerce-cart .wc-block-components-quantity-selector button {
  width: 34px;
  height: 34px;
  min-height: 34px;
  background: #fff;
  color: #57534e;
  border: 0;
}

.woocommerce-cart .wc-block-components-quantity-selector__input {
  width: 36px;
  min-height: 34px;
  border-left: 1px solid #d6d0c8;
  border-right: 1px solid #d6d0c8;
  font-size: 0.9375rem !important;
}

.woocommerce-cart .wc-block-cart-item__total,
.woocommerce-cart .wc-block-components-product-price {
  text-align: right;
  align-self: start;
  margin: 0 !important;
}

.woocommerce-cart .wc-block-components-product-price__value,
.woocommerce-cart .wc-block-components-product-price ins {
  font-size: 1.125rem !important;
  font-weight: 700 !important;
  color: #d93025 !important;
  text-decoration: none;
}

.woocommerce-cart .wc-block-components-product-price__regular {
  font-size: 0.9375rem !important;
  color: #a8a29e !important;
  text-decoration: line-through;
}

.woocommerce-cart .wc-block-components-sale-badge {
  display: inline-block;
  margin-top: 6px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #fce8e6;
  color: #d93025 !important;
  font-size: 0.75rem !important;
  font-weight: 600;
  line-height: 1.3;
}

/* Trust badges */
.shop-cart-trust {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid #ede8e1;
}

.shop-cart-trust__item {
  text-align: center;
}

.shop-cart-trust__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  margin-bottom: 8px;
  color: #8b7355;
}

.shop-cart-trust__item strong {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: #1c1917;
  line-height: 1.3;
  margin-bottom: 2px;
}

.shop-cart-trust__item span {
  display: block;
  font-size: 0.75rem;
  line-height: 1.35;
  color: #78716c;
}

/* Order summary sidebar */
.woocommerce-cart .wc-block-cart__sidebar {
  width: 360px;
  flex: 0 0 360px;
}

.woocommerce-cart .shop-cart-order-summary {
  width: 360px;
  flex: 0 0 360px;
  box-sizing: border-box;
  background: transparent;
  color: #1c1917;
  font-family: var(--font-body, Arial, Helvetica, sans-serif);
}

.shop-cart-order-summary__head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.shop-cart-order-summary__title {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif !important;
  font-size: 1.75rem !important;
  font-weight: 700 !important;
  line-height: 1.2 !important;
  color: #1c1917 !important;
}

.shop-cart-order-summary__card {
  background: #fff;
  border: 1px solid #f0ebe3;
  border-radius: 14px;
  padding: 8px 20px 4px;
  box-shadow: 0 1px 4px rgba(28, 25, 23, 0.04);
}

.woocommerce-cart .shop-cart-order-summary__rows {
  padding: 0;
}

.woocommerce-cart .shop-cart-order-summary__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 14px 0;
  font-size: 0.9375rem;
  font-weight: 400;
  color: #57534e;
  line-height: 1.4;
  border: 0;
}

.woocommerce-cart .shop-cart-order-summary__row--shipping {
  border-bottom: 0;
}

.woocommerce-cart .shop-cart-order-summary__shipping {
  font-weight: 600;
}

.woocommerce-cart .shop-cart-order-summary__shipping.is-free {
  color: #16a34a;
}

.shop-cart-order-summary__divider {
  border: 0;
  border-top: 1px dashed #d6d0c8;
  margin: 4px 0 0;
}

.woocommerce-cart .shop-cart-order-summary__row--total {
  font-size: 1rem;
  font-weight: 700;
  color: #1c1917;
  padding: 16px 0 14px;
}

.woocommerce-cart .shop-cart-order-summary__total {
  font-size: 1.375rem !important;
  font-weight: 700 !important;
  color: #d93025 !important;
}

.woocommerce-cart .shop-cart-order-summary__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  box-sizing: border-box;
  min-height: 52px;
  margin-top: 16px;
  padding: 14px 20px;
  background: #d93025;
  border: 1px solid #d93025;
  border-radius: 10px;
  color: #fff !important;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  text-decoration: none !important;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.woocommerce-cart .shop-cart-order-summary__checkout svg {
  flex-shrink: 0;
}

.woocommerce-cart .shop-cart-order-summary__checkout:hover {
  background: #b91c1c;
  border-color: #b91c1c;
  color: #fff !important;
}

.shop-cart-checkout-help__line {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 14px 0 0;
  font-size: 0.875rem;
  color: #78716c;
  text-align: center;
}

.shop-cart-checkout-help__line svg {
  flex-shrink: 0;
  color: #a8a29e;
}

.shop-cart-checkout-help__line a {
  color: #1e5bb8;
  font-weight: 600;
  text-decoration: none;
}

.shop-cart-checkout-help__line a:hover {
  text-decoration: underline;
}

.shop-cart-guarantee {
  margin-top: 16px;
  padding: 18px 18px 16px;
  background: #faf6f0;
  border: 1px solid #ede8e1;
  border-radius: 12px;
}

.shop-cart-guarantee__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.shop-cart-guarantee__icon {
  width: 32px;
  height: 32px;
  background: transparent;
  color: #8b7355;
}

.shop-cart-guarantee__title {
  margin: 0;
  font-family: "Playfair Display", Georgia, "Times New Roman", serif;
  font-size: 1rem;
  font-weight: 700;
  color: #1c1917;
}

.shop-cart-guarantee__text {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #57534e;
}

.shop-cart-guarantee__text a {
  color: #1e5bb8;
  text-decoration: underline;
}

.shop-cart-guarantee__text a:hover {
  color: #0f3f8c;
}

/* Empty cart card */
.woocommerce-cart .wc-block-cart__empty-cart,
.woocommerce-cart .wp-block-woocommerce-empty-cart-block {
  background: #fff;
  border: 1px solid #f0ebe3;
  border-radius: 16px;
  padding: 48px 32px;
  box-shadow: 0 1px 4px rgba(28, 25, 23, 0.05);
}

.woocommerce-cart .wc-block-cart__empty-cart__title {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.5rem;
  color: #1c1917;
}

/* ---------- You May Also Like ---------- */
.woocommerce-cart .shop-may-like {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 12px 0 8px;
  box-sizing: border-box;
}

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

.shop-may-like__title {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
  color: #111;
}

.shop-may-like__nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.shop-may-like__prev,
.shop-may-like__next {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #fff;
  color: #1c1917;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  cursor: pointer;
  pointer-events: auto;
  transition: background 0.2s ease, border-color 0.2s ease, opacity 0.2s ease;
}

.shop-may-like__prev:hover,
.shop-may-like__next:hover {
  background: #fafafa;
  border-color: #d4d4d4;
}

.shop-may-like__prev:disabled,
.shop-may-like__next:disabled {
  opacity: 0.4;
  cursor: default;
}

.shop-may-like__viewport {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.shop-may-like__track {
  display: flex;
  gap: var(--may-like-gap, 20px);
  width: max-content;
  transition: transform 0.35s ease;
  will-change: transform;
}

.shop-may-like__slide {
  --may-like-gap: 20px;
  --may-like-cols: 4;
  box-sizing: border-box;
  flex: 0 0 auto;
  width: 25%;
  min-width: 0;
}

.shop-may-like-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: transparent;
}

.shop-may-like-card__media {
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  padding: 18px;
  margin-bottom: 14px;
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
  text-decoration: none;
  overflow: hidden;
}

.shop-may-like-card__img {
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  display: block;
}

.shop-may-like-card__placeholder {
  display: block;
  padding: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.35;
  color: #78716c;
  text-align: center;
}

.shop-may-like-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.shop-may-like-card__title {
  margin: 0 0 4px;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  color: #111;
}

.shop-may-like-card__title a {
  color: inherit;
  text-decoration: none;
}

.shop-may-like-card__title a:hover {
  color: #1e5bb8;
}

.shop-may-like-card__author {
  margin: 0 0 8px;
  font-size: 0.875rem;
  line-height: 1.4;
  color: #666;
}

.shop-may-like-card__price {
  margin: 0 0 8px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
  color: #111;
}

.shop-may-like-card__price del {
  margin-right: 0.35em;
  font-weight: 400;
  color: #999;
}

.shop-may-like-card__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  margin-top: 14px;
  padding: 0.65rem 1rem;
  border: 0;
  border-radius: 6px;
  background: #e11d2e !important;
  color: #fff !important;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  text-decoration: none !important;
  cursor: pointer;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none;
  transition: background 0.2s ease;
}

.shop-may-like-card__btn:disabled {
  opacity: 0.7;
  cursor: wait;
}

.shop-may-like-card__btn:hover {
  background: #c41424 !important;
  color: #fff !important;
}

.shop-may-like-card__btn--view {
  background: #1c1917 !important;
}

.shop-may-like-card__btn--view:hover {
  background: #000 !important;
}

@media (max-width: 960px) {
  .woocommerce-cart .wc-block-cart__main.shop-cart-main-card,
  .woocommerce-cart .shop-cart-order-summary,
  .woocommerce-cart .wc-block-cart__sidebar {
    flex: 1 1 100%;
    width: 100%;
  }

  .shop-cart-trust {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }

  .woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row {
    grid-template-columns: 90px minmax(0, 1fr) !important;
    column-gap: 16px;
  }

  .woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__image {
    grid-column: 1;
    grid-row: 1;
  }

  .woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__product {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
  }

  .woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__quantity {
    grid-column: 2;
    grid-row: 2;
    padding-top: 8px;
  }

  /* Hide the side total on mobile — price already shows in .wc-block-cart-item__prices under the title */
  .woocommerce-cart table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,
  .woocommerce-cart.is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,
  .woocommerce-cart .is-mobile table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,
  .woocommerce-cart .is-small table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total,
  .woocommerce-cart .is-medium table.wc-block-cart-items .wc-block-cart-items__row .wc-block-cart-item__total {
    display: none !important;
  }

  .woocommerce-cart .wc-block-cart-item__prices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
  }

  .woocommerce-cart .wc-block-cart-item__prices .wc-block-components-product-price,
  .woocommerce-cart .wc-block-cart-item__prices .wc-block-components-product-price__value,
  .woocommerce-cart .wc-block-cart-item__prices .wc-block-components-product-price ins {
    text-align: left;
    margin: 0 !important;
  }

  .shop-may-like__title {
    font-size: 1.35rem;
  }
}

@media (max-width: 520px) {
  .woocommerce-cart .wc-block-cart__main.shop-cart-main-card {
    padding: 20px 16px;
  }

  .shop-cart-trust {
    grid-template-columns: 1fr 1fr;
  }
}
