.cart-page,
.checkout-page {
  background: #f5f5f5;
  min-height: 70vh;
  padding: 32px 0 60px;
}

.cart-container,
.checkout-container {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 16px;
}

.cart-heading,
.checkout-heading {
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
  margin: 0 0 24px;
}

.cart-empty {
  background: #fff;
  border-radius: 8px;
  padding: 64px 24px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
}

.cart-empty svg {
  margin-bottom: 16px;
}
.cart-empty p {
  font-size: 16px;
  color: #999;
  margin: 0 0 20px;
}

.cart-shop-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 20px;
  background: #1677ff;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 14px;
  transition: background 0.2s, color 0.2s;
}
.cart-shop-btn:hover {
  background: #0958d9;
  color: #fff;
}

.cart-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.cart-items-wrap {
  flex: 1;
  min-width: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.cart-table th {
  background: #fafafa;
  border-bottom: 1px solid #e8e8e8;
  padding: 12px 16px;
  font-weight: 600;
  color: #444;
  text-align: left;
  white-space: nowrap;
}

.cart-table td {
  padding: 16px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: middle;
}

.cart-table tbody tr:last-child td {
  border-bottom: none;
}

.cart-product-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.cart-product-img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 6px;
  border: 1px solid #e8e8e8;
  flex-shrink: 0;
  background: #fafafa;
}

.cart-product-img-placeholder {
  background: #f0f0f0;
}

.cart-product-name {
  font-size: 13px;
  color: #1a1a1a;
  line-height: 1.4;
}

.cart-product-link:hover .cart-product-name {
  color: #1677ff;
}

.cart-qty-wrap {
  display: flex;
  align-items: center;
  gap: 0;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  overflow: hidden;
  width: fit-content;
}

.cart-qty-btn {
  width: 30px;
  height: 32px;
  background: #f5f5f5;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #555;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.cart-qty-btn:hover {
  background: #e8e8e8;
}

.cart-qty-input {
  -moz-appearance: textfield;
  appearance: textfield;
  width: 44px;
  height: 32px;
  border: none;
  border-left: 1px solid #d9d9d9;
  border-right: 1px solid #d9d9d9;
  text-align: center;
  font-size: 13px;
  outline: none;
  background: #fff;
  color: #1a1a1a;
}

.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.cart-remove-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: #bbb;
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s;
}

.cart-remove-btn:hover {
  color: #cf1322;
  background: #fff2f0;
}

.cart-summary {
  width: 340px;
  min-width: 300px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 20px;
}

.cart-summary-title {
  font-size: 16px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0;
}

.cart-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #555;
}

.cart-summary-shipping {
  color: #999;
  font-size: 13px;
}

.cart-summary-total {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  padding-top: 10px;
  border-top: 1px solid #e8e8e8;
}

.cart-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  background: #1677ff;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  transition: background 0.2s;
}

.cart-checkout-btn:hover {
  background: #0958d9;
  color: #fff;
}

.cart-guest-note {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin: -4px 0 0;
}

.cart-continue-link {
  text-align: center;
  font-size: 13px;
  color: #1677ff;
  text-decoration: none;
}

.cart-continue-link:hover {
  text-decoration: underline;
}

.checkout-alert {
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 14px;
  margin-bottom: 16px;
}

.checkout-alert-error {
  background: #fff2f0;
  border: 1px solid #ffccc7;
  color: #cf1322;
}

.checkout-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.checkout-left {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.checkout-right {
  width: 340px;
  min-width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: 20px;
}

.checkout-section {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
  padding: 20px;
  box-sizing: border-box;
}

.checkout-section-title {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.checkout-saved-addresses {
  margin-bottom: 16px;
}
.checkout-label {
  font-size: 13px;
  color: #666;
  display: block;
  margin-bottom: 8px;
}

.checkout-addr-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout-addr-card {
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: border-color 0.2s;
}

.checkout-addr-card:hover {
  border-color: #1677ff;
}
.checkout-addr-default {
  border-color: #1677ff;
  background: #f0f7ff;
}
.checkout-addr-card strong {
  color: #1a1a1a;
  font-weight: 600;
}
.checkout-addr-card span {
  color: #666;
}

.checkout-addr-badge {
  display: inline-block;
  font-size: 11px;
  background: #1677ff;
  color: #fff !important;
  padding: 2px 6px;
  border-radius: 3px;
  margin-top: 4px;
}

.checkout-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
  box-sizing: border-box;
}

.checkout-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.checkout-field label {
  font-size: 13px;
  font-weight: 500;
  color: #333;
}

.checkout-field input,
.checkout-field select {
  height: 38px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 0 10px;
  font-size: 13px;
  outline: none;
  color: #1a1a1a;
  transition: border-color 0.2s;
  background: #fff;
  width: 100%;
  box-sizing: border-box;
}

.checkout-field input:focus,
.checkout-field select:focus {
  border-color: #1677ff;
}

.checkout-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.checkout-row-2 > .checkout-field {
  flex: 1;
  min-width: 160px;
}
.checkout-row-3 > .checkout-field {
  flex: 1;
  min-width: 140px;
}

.checkout-coupon-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout-coupon-item {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #e8e8e8;
  border-radius: 6px;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 0.2s;
}

.checkout-coupon-item:has(input:checked) {
  border-color: #1677ff;
  background: #f0f7ff;
}

.checkout-coupon-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 13px;
}

.checkout-coupon-info strong {
  color: #1a1a1a;
}
.checkout-coupon-info span {
  color: #f7931a;
  font-weight: 500;
}
.checkout-coupon-min {
  color: #999 !important;
  font-size: 12px !important;
  font-weight: 400 !important;
}
.checkout-no-coupon {
  font-size: 13px;
  color: #999;
}

.checkout-notes {
  width: 100%;
  height: 80px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  resize: vertical;
  outline: none;
  color: #1a1a1a;
  box-sizing: border-box;
}

.checkout-notes:focus {
  border-color: #1677ff;
}

.checkout-payment-method {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 14px;
  color: #555;
}

.checkout-payment-icon {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.checkout-order-summary {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.07);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-sizing: border-box;
}

.checkout-order-summary .checkout-section-title {
  margin: 0 0 0;
  padding-bottom: 12px;
  border-bottom: 1px solid #f0f0f0;
}

.checkout-items-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-height: 260px;
  overflow-y: auto;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.checkout-item {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
}

.checkout-item-name {
  flex: 1;
  color: #1a1a1a;
  line-height: 1.4;
}
.checkout-item-qty {
  color: #888;
  white-space: nowrap;
}
.checkout-item-price {
  font-weight: 500;
  white-space: nowrap;
}

.checkout-totals {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.checkout-total-row {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  color: #555;
}

.checkout-discount-val {
  color: #52c41a;
}

.checkout-grand-total {
  font-size: 16px;
  font-weight: 700;
  color: #1a1a1a;
  padding-top: 10px;
  border-top: 1px solid #e8e8e8;
}

.checkout-place-btn {
  width: 100%;
  height: 46px;
  background: #1677ff;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.checkout-place-btn:hover {
  background: #0958d9;
}

.checkout-btc-note {
  font-size: 12px;
  color: #999;
  text-align: center;
  margin: 0;
}

@media (max-width: 900px) {
  .cart-layout {
    flex-direction: column;
  }
  .cart-items-wrap {
    width: 100%;
    box-sizing: border-box;
  }
  .cart-summary {
    width: 100%;
    min-width: 0;
    position: static;
    box-sizing: border-box;
  }
  .checkout-layout {
    flex-direction: column;
  }
  .checkout-left {
    width: 100%;
    flex: none;
  }
  .checkout-right {
    width: 100%;
    min-width: 0;
    position: static;
  }
  .checkout-section,
  .checkout-order-summary {
    box-sizing: border-box;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .cart-page,
  .checkout-page {
    padding: 16px 0 40px;
  }
  .cart-container,
  .checkout-container {
    padding: 0 10px;
  }
  .cart-heading,
  .checkout-heading {
    font-size: 18px;
    margin-bottom: 16px;
  }

  .cart-items-wrap {
    border-radius: 6px;
  }
  .cart-table thead {
    display: none;
  }
  .cart-table,
  .cart-table tbody,
  .cart-table tr,
  .cart-table td {
    display: block;
    width: 100%;
  }
  .cart-row {
    padding: 14px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
  }
  .cart-row:last-child {
    border-bottom: none;
  }
  .cart-td-product {
    padding: 0 0 10px;
  }
  .cart-td-price {
    display: none;
  }
  .cart-td-qty {
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .cart-td-qty::before {
    content: "Qty";
    font-size: 12px;
    color: #888;
    font-weight: 500;
  }
  .cart-td-total {
    padding: 8px 0 0;
    font-weight: 600;
    font-size: 14px;
    color: #1a1a1a;
  }
  .cart-td-total::before {
    content: "Total: ";
    font-weight: 400;
    color: #888;
    font-size: 12px;
  }
  .cart-td-action {
    position: absolute;
    top: 14px;
    right: 14px;
    padding: 0;
  }
  .cart-product-img {
    width: 48px;
    height: 48px;
  }
  .cart-summary {
    border-radius: 6px;
    padding: 16px;
  }

  .checkout-section {
    padding: 16px;
    border-radius: 6px;
  }
  .checkout-section-title {
    font-size: 14px;
    margin-bottom: 12px;
    padding-bottom: 10px;
  }
  .checkout-order-summary {
    padding: 16px;
    border-radius: 6px;
  }
  .checkout-row,
  .checkout-row-2,
  .checkout-row-3 {
    flex-direction: column;
    gap: 10px;
  }
  .checkout-field input,
  .checkout-field select {
    height: 42px;
    font-size: 14px;
  }
  .checkout-notes {
    font-size: 14px;
  }
  .checkout-addr-list {
    gap: 6px;
  }
  .checkout-addr-card {
    padding: 10px;
    font-size: 12px;
  }
  .checkout-addr-card span {
    font-size: 12px;
    line-height: 1.4;
  }
  .checkout-coupon-item {
    padding: 10px;
    gap: 10px;
  }
  .checkout-coupon-info {
    font-size: 12px;
  }
  .checkout-payment-method {
    font-size: 13px;
    gap: 8px;
  }
  .checkout-payment-icon {
    width: 24px;
    height: 24px;
  }
  .checkout-item {
    font-size: 12px;
  }
  .checkout-items-list {
    max-height: 200px;
  }
  .checkout-total-row {
    font-size: 13px;
  }
  .checkout-grand-total {
    font-size: 15px;
  }
  .checkout-place-btn {
    height: 48px;
    font-size: 15px;
    border-radius: 8px;
  }
  .checkout-btc-note {
    font-size: 11px;
  }
  .checkout-alert {
    font-size: 13px;
  }

  .checkout-coupon-code-row {
    flex-direction: column;
  }
  .checkout-coupon-code-input {
    width: 100%;
    box-sizing: border-box;
  }
  .checkout-apply-coupon-btn {
    width: 100%;
  }
}
