/* 购物车页面 - 基于 NanoSoft Cart 参考设计 */

.cart-page {
  padding: 48px 0 72px;
  background: #fff;
}

.cart-title {
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 24px;
  font-weight: 500;
  color: #333;
  margin: 0 0 20px 0;
}

.cart-divider {
  border: none;
  border-top: 1px solid #e0e0e0;
  margin: 0 0 32px 0;
}

.cart-divider-bottom {
  margin-top: 32px;
}

.cart-summary-top-divider {
  margin: 0 0 24px 0;
}

/* 购物车商品列表 */
.cart-items-section {
  margin-bottom: 8px;
}

.cart-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 28px;
  align-items: start;
  padding: 28px 0;
}

.cart-item-image {
  width: 100px;
  height: 100px;
  flex-shrink: 0;
  background: #f5f5f5;
  overflow: hidden;
}

.cart-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-details {
  min-width: 0;
}

.cart-item-title {
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 16px;
  font-weight: 600;
  color: #333;
  margin: 0 0 6px 0;
}

/* 购物车页不显示任何价格 */
.cart-item-price,
.cart-item-subtotal,
[data-cart-subtotal],
[data-cart-total] {
  display: none !important;
}

.cart-item-price {
  font-size: 15px;
  color: #333;
  margin: 0 0 8px 0;
}

.cart-item-options {
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 13px;
  color: #666;
  margin: 0 0 4px 0;
}

.cart-item-remark {
  margin-top: 10px;
}

.cart-item-remark-label {
  display: block;
  font-size: 12px;
  color: #666;
  margin: 0 0 6px 0;
}

.cart-item-remark-input {
  width: 100%;
  max-width: 520px;
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  background: #fff;
}

.cart-item-remark-input:focus {
  outline: none;
  border-color: #999;
}

.cart-item-qty {
  display: inline-flex;
  align-items: center;
  margin-top: 12px;
  border: 1px solid #333;
}

.cart-item-qty .qty-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 16px;
  color: #333;
  background: #fff;
  border: none;
  border-right: 1px solid #333;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-item-qty .qty-btn:last-of-type {
  border-right: none;
  border-left: 1px solid #333;
}

.cart-item-qty input {
  width: 40px;
  height: 30px;
  padding: 0;
  font-size: 14px;
  text-align: center;
  border: none;
  background: #fff;
}

.cart-item-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
}

.cart-item-remove {
  width: 24px;
  height: 24px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #666;
}

.cart-item-remove:hover {
  color: #333;
}

.cart-item-remove svg {
  width: 18px;
  height: 18px;
}

.cart-item-subtotal {
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: #333;
  margin: 0;
}

/* Promo & Note 链接 */
.cart-promo-note {
  display: flex;
  flex-wrap: wrap;
  gap: 24px 40px;
  padding: 20px 0;
}

.cart-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 14px;
  color: #333;
}

.cart-link:hover {
  color: var(--color-primary);
}

.cart-link svg {
  width: 18px;
  height: 18px;
}

.cart-link-note {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Order Summary - 左对齐，与页面内容统一 */
.cart-summary-wrapper {
  max-width: 400px;
}

.cart-summary-title {
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 17px;
  font-weight: 600;
  color: #333;
  margin: 0 0 0 0;
  text-align: left;
}

.cart-summary {
  padding: 0 0 20px 0;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 15px;
  color: #333;
  margin-bottom: 12px;
}

.cart-summary-total {
  font-size: 17px;
  font-weight: 600;
  margin-top: 8px;
  margin-bottom: 0;
}

.cart-shipping-link {
  font-size: 14px;
  margin: 4px 0 16px 0;
}

.cart-shipping-link a {
  color: #333;
  text-decoration: underline;
}

.cart-shipping-link a:hover {
  color: var(--color-primary);
}

.cart-summary-divider {
  border: none;
  border-top: 1px solid #333;
  margin: 16px 0;
}

/* Checkout 按钮 */
.cart-checkout-btn {
  display: block;
  width: 100%;
  padding: 16px 28px;
  margin-top: 24px;
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  background: #1e3a5f;
  text-align: center;
  transition: background 0.25s ease;
}

.cart-checkout-btn:hover {
  background: #152a47;
}

.cart-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 13px;
  color: #333;
  margin: 16px 0 0 0;
}

.cart-secure svg {
  width: 16px;
  height: 16px;
}

.cart-quote-hint {
  display: block;
  text-align: center;
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 13px;
  color: #555;
  margin: 12px 0 0 0;
  line-height: 1.5;
}

/* 空购物车状态 */
.cart-empty {
  padding: 80px 20px;
  text-align: center;
}

.cart-empty.hidden {
  display: none !important;
}

.cart-has-items.hidden {
  display: none !important;
}

/* Checkout modal */
.cart-modal.is-hidden {
  display: none;
}

.cart-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
}

.cart-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.cart-modal-dialog {
  position: relative;
  width: min(560px, calc(100% - 32px));
  margin: 80px auto;
  background: #fff;
  border-radius: 12px;
  padding: 18px 18px 16px;
  box-shadow: 0 18px 48px rgba(0,0,0,0.25);
}

.cart-modal-close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 36px;
  cursor: pointer;
  color: #666;
}

.cart-modal-title {
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 18px;
  font-weight: 600;
  margin: 6px 0 6px;
  color: #333;
}

.cart-modal-subtitle {
  font-size: 13px;
  color: #666;
  margin: 0 0 14px;
}

.cart-modal-label {
  display: block;
  font-size: 13px;
  color: #333;
  margin: 10px 0 6px;
}

.cart-modal-input,
.cart-modal-textarea {
  width: 100%;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  outline: none;
}

.cart-modal-input:focus,
.cart-modal-textarea:focus {
  border-color: #bbb;
}

.cart-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 14px;
}

.cart-modal-btn {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  cursor: pointer;
}

.cart-modal-btn-secondary {
  background: #f1f1f1;
  color: #333;
}

.cart-modal-btn-primary {
  background: var(--color-accent);
  color: #fff;
}

.cart-modal-hint {
  margin-top: 10px;
  font-size: 13px;
  color: #c0392b;
  min-height: 18px;
}

.cart-empty-msg {
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 18px;
  color: #333;
  margin: 0 0 16px 0;
}

.cart-continue-link {
  font-family: 'Raleway', 'Helvetica', 'Arial', sans-serif;
  font-size: 15px;
  color: #333;
  text-decoration: underline;
}

.cart-continue-link:hover {
  color: var(--color-primary);
}

/* 响应式 */
@media (max-width: 768px) {
  .cart-page {
    padding: 24px 0 48px;
  }


  .cart-item {
    grid-template-columns: 80px 1fr;
    grid-template-rows: auto auto;
    gap: 12px 16px;
  }

  .cart-item-image {
    width: 80px;
    height: 80px;
    grid-row: 1 / -1;
  }

  .cart-item-details {
    grid-row: 1;
  }

  .cart-item-actions {
    grid-row: 2;
    grid-column: 2;
    flex-direction: row;
    align-items: center;
    justify-content: flex-end;
    gap: 16px;
  }
}
