/* ========================================
   Cart Page – 迋斯生技 Figma 購物車
   ======================================== */

.cart-main {
  margin-top: var(--header-height);
  background: var(--color-wants-dark);
}

/* ---------- Hero ---------- */
.cart-hero {
  position: relative;
  width: 100%;
  height: 130px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.cart-hero__content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 0 20px;
  text-align: center;
  color: #fff;
}

.cart-hero__title {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 26px;
  font-weight: 700;
  line-height: normal;
  margin: 0;
}

.cart-hero__underline {
  display: block;
  width: 40px;
  height: 5px;
  flex-shrink: 0;
}

.cart-hero__count {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  margin: 0;
}

/* ---------- Body ---------- */
.cart-body {
  position: relative;
  padding: 56px 20px 120px;
  overflow: hidden;
  background: var(--color-wants-dark);
}

.cart-body__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.cart-body__bg-layer {
  position: absolute;
  display: block;
  max-width: none;
  pointer-events: none;
}

.cart-body__bg-layer--1 {
  top: -2%;
  right: -5%;
  width: 50%;
  opacity: 0.3;
}

.cart-body__bg-layer--2 {
  top: 0;
  right: -3%;
  width: 48%;
  opacity: 0.3;
}

.cart-body__bg-layer--3 {
  top: 12%;
  left: -12%;
  width: 58%;
  opacity: 0.15;
}

.cart-body__bg-layer--4 {
  top: 13%;
  left: -11%;
  width: 56%;
  opacity: 0.15;
}

.cart-body__bg-layer--5 {
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  min-width: 1920px;
  opacity: 1;
}

.cart-body__bg-layer--main {
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  min-width: 1920px;
  height: auto;
  opacity: 1;
}

.cart-body__inner {
  position: relative;
  z-index: 1;
  max-width: 1081px;
  margin: 0 auto;
}

.cart-layout {
  display: flex;
  gap: 31px;
  align-items: flex-start;
  justify-content: center;
}

/* ---------- Product List ---------- */
.cart-list {
  flex: 0 0 750px;
  width: 750px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.cart-list__table {
  display: flex;
  flex-direction: column;
  gap: 24px;
  width: 100%;
}

.cart-list__header {
  width: 100%;
  height: 50px;
  background: #877c55;
  border-radius: 5px;
  box-shadow: 0 4px 2px rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}

.cart-list__header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 50px;
  padding: 0 30px;
}

.cart-list__header-label {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  color: #fff;
  white-space: nowrap;
}

.cart-item__meta {
  display: flex;
  align-items: center;
  gap: 44px;
  flex-shrink: 0;
  width: 316px;
  justify-content: flex-end;
}

.cart-list__header-meta {
  display: flex;
  align-items: center;
  gap: 44px;
  flex-shrink: 0;
  width: 316px;
  justify-content: flex-end;
}

.cart-list__items {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cart-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 130px;
  padding: 20px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 4px 2px rgba(0, 0, 0, 0.25);
}

.cart-item__product {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
  max-width: 280px;
}

.cart-item__image {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  object-fit: cover;
  display: block;
}

.cart-item__info {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  padding-top: 2px;
}

.cart-item__name {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  color: var(--color-wants-dark);
  margin: 0;
}

.cart-item__spec {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 12px;
  font-weight: 400;
  line-height: normal;
  color: #888;
  margin: 0;
}

.cart-list__header-meta .cart-list__header-label {
  display: block;
  text-align: center;
}

.cart-list__header-meta .cart-list__header-label:nth-child(1) {
  width: 50px;
}

.cart-list__header-meta .cart-list__header-label:nth-child(2) {
  width: 110px;
}

.cart-list__header-meta .cart-list__header-label:nth-child(3) {
  width: 50px;
}

.cart-list__header-meta .cart-list__header-label:nth-child(4) {
  width: 18px;
}

.cart-item__price,
.cart-item__subtotal {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 14px;
  font-weight: 700;
  line-height: normal;
  color: #877c55;
  margin: 0;
  text-align: center;
  white-space: nowrap;
  width: 50px;
  flex-shrink: 0;
}

.cart-item__qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  width: 110px;
  flex-shrink: 0;
}

.cart-item__qty-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid #d7ccc8;
  border-radius: 4px;
  background: #fff;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 12px;
  line-height: 1;
  color: #5d4037;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cart-item__qty-btn:hover {
  background: #fafafa;
}

.cart-item__qty-value {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 30px;
  border: 1px solid #d7ccc8;
  border-radius: 4px;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 12px;
  color: #5d4037;
  text-align: center;
  flex-shrink: 0;
}

.cart-item__remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  opacity: 1;
  flex-shrink: 0;
  transition: opacity 0.2s ease;
}

.cart-item__remove:hover {
  opacity: 0.7;
}

.cart-item__remove img {
  display: block;
  width: 18px;
  height: 18px;
}

/* ---------- Continue Shopping ---------- */
.cart-continue {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  flex-shrink: 0;
  width: 180px;
  height: 45px;
  border: 1px solid var(--color-wants-cream);
  border-radius: 23px;
  background: transparent;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 14px;
  font-weight: 400;
  color: var(--color-wants-cream);
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.2s ease;
}

.cart-continue:hover {
  opacity: 0.85;
  color: var(--color-wants-cream);
}

/* ---------- Order Summary ---------- */
.cart-summary {
  flex: 0 0 300px;
  width: 300px;
  max-width: 100%;
}

.cart-summary__card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 61px;
  min-height: 450px;
  padding: 29px 28px;
  background: #fff;
  border: 1px solid #eee;
  box-shadow: 0 4px 2px rgba(0, 0, 0, 0.25);
}

.cart-summary__upper {
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.cart-summary__title {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 18px;
  font-weight: 700;
  line-height: normal;
  color: #3e2723;
  margin: 0;
}

.cart-summary__details {
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.cart-summary__coupon {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cart-summary__coupon-label {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 14px;
  font-weight: 400;
  color: #666;
}

.cart-summary__coupon-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
}

.cart-summary__coupon-input {
  flex: 0 0 160px;
  width: 160px;
  height: 40px;
  padding: 0 12px;
  border: 1px solid #d7ccc8;
  border-radius: 4px;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 14px;
  color: var(--color-wants-dark);
  background: #fff;
}

.cart-summary__coupon-input:focus {
  outline: 2px solid #877c55;
  outline-offset: 1px;
}

.cart-summary__coupon-btn {
  flex-shrink: 0;
  width: 70px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 4px;
  background: #877c55;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 13px;
  font-weight: 400;
  color: #fff;
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.cart-summary__coupon-btn:hover {
  opacity: 0.9;
}

.cart-summary__divider {
  display: block;
  width: 100%;
  height: 1px;
  border: none;
  margin: 0;
  background: #eee;
}

.cart-summary__rows {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
}

.cart-summary__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 14px;
  line-height: normal;
}

.cart-summary__row dt {
  font-weight: 400;
  color: #666;
}

.cart-summary__row dd {
  margin: 0;
  font-weight: 400;
  color: var(--color-wants-dark);
  text-align: right;
}

.cart-summary__free-ship {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 14px;
  font-weight: 400;
  line-height: normal;
  color: #877c55;
  margin: 0;
}

.cart-summary__total {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-summary__total-label {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 16px;
  font-weight: 700;
  color: var(--color-wants-dark);
}

.cart-summary__total-value {
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 22px;
  font-weight: 700;
  color: #877c55;
  text-align: right;
}

.cart-summary__checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  border-radius: 60px;
  background: #877c55;
  font-family: 'Georgia', 'Noto Sans TC', serif;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: opacity 0.2s ease;
}

.cart-summary__checkout:hover {
  opacity: 0.9;
  color: #fff;
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .cart-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .cart-list,
  .cart-summary {
    flex: none;
    width: 100%;
  }
}

@media (max-width: 768px) {
  .cart-list__header {
    display: none;
  }

  .cart-item {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .cart-item__product {
    max-width: 100%;
  }

  .cart-item__meta {
    width: 100%;
    justify-content: flex-start;
    flex-wrap: wrap;
    gap: 16px;
  }

  .cart-body {
    padding: 36px 16px 60px;
  }
}
