@charset "UTF-8";
/*
 * pages/cart.css
 * ----------------------------------------
 * カートページ専用スタイル
 */

.p-cart-page {
  padding-bottom: 120px;
}

/* ==============================================
   1. Flow Indicator (購入画面と同一デザイン)
   ============================================== */
.p-cart-flow {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin: 60px 0 80px;
}

.p-flow-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  opacity: 0.3; /* 未完了は薄く */
  transition: opacity 0.3s;
}

.p-flow-step.is-current {
  opacity: 1; /* 現在位置 */
}

.p-flow-step__no {
  font-family: var(--font-family-heading);
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--color-ink);
}

.p-flow-step__label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-ink);
}

.p-flow-line {
  width: 40px;
  height: 1px;
  background: var(--color-border);
  margin-bottom: 18px; /* テキスト高さ調整 */
}

/* パンくず */
.cart-breadcrumb {
  font-size: 12px;
  color: var(--color-muted);
  margin-bottom: 32px;
}
.cart-breadcrumb a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ==============================================
   2. Layout Grid (Items + Summary)
   ============================================== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 380px; /* 右側固定幅 */
  gap: 60px;
  align-items: start;
}

@media (max-width: 900px) {
  .cart-layout {
    grid-template-columns: 1fr;
    gap: 60px;
  }
}

/* ==============================================
   3. Item List (Left Column)
   ============================================== */
.cart-item {
  display: flex;
  gap: 24px;
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--color-border);
  position: relative;
}

/* 画像 */
.cart-item__img {
  width: 100px;
  flex-shrink: 0;
}
.cart-item__img a {
  display: block;
  width: 100%;
  aspect-ratio: 1;
  background: #f4f4f4;
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cart-item__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}
.cart-item__img:hover img {
  transform: scale(1.05);
}

/* 詳細 */
.cart-item__body {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.cart-item__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
}

.cart-item__title {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.5;
  margin-right: 16px;
  font-family: var(--font-family-heading);
}

.cart-item__remove {
  font-size: 12px;
  color: #999;
  text-decoration: underline;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.2s;
}
.cart-item__remove:hover {
  color: var(--color-error);
}

.cart-item__price {
  font-size: 14px;
  color: var(--color-ink);
  margin-bottom: 16px;
  font-family: var(--font-family-en);
  display: flex;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
}

/* ✅ 追加：割引表示（単価） */
.cart-price-was{
  font-size: 12px;
  color: var(--color-muted);
  text-decoration: line-through;
}
.cart-discount-badge{
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--color-border);
  background: #fff;
  color: var(--color-ink);
}
.cart-tax{
  font-size: 12px;
  color: var(--color-muted);
}

/* コントロールエリア */
.cart-item__ctrl {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

/* 数量入力 */
.cart-qty {
  display: flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  background: #fff;
  overflow: hidden;
}
.cart-qty button {
  width: 32px;
  height: 32px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-ink);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.cart-qty button:hover {
  background: #f9f9f9;
}
.cart-qty input {
  width: 40px;
  height: 32px;
  text-align: center;
  border: none;
  border-left: 1px solid #eee;
  border-right: 1px solid #eee;
  font-family: var(--font-family-en);
  font-size: 14px;
  appearance: none;
  pointer-events: none; /* JS制御のみ */
  color: var(--color-ink);
  background: #fff;
}

.cart-item__subtotal {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-family-en);
  display: flex;
  align-items: baseline;
  gap: 10px;
}

/* ✅ 追加：割引表示（小計） */
.cart-sub-was{
  font-size: 12px;
  font-weight: 400;
  color: var(--color-muted);
  text-decoration: line-through;
}

/* 在庫アラート (インライン) */
.cart-item__alert {
  font-size: 12px;
  color: var(--color-warning);
  margin-top: 10px;
  line-height: 1.5;
  animation: fadeIn 0.3s ease-out;
}
.cart-item__alert--error {
  color: var(--color-error);
  font-weight: 500;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.cart-loading {
  display: none;
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.6);
  z-index: 5;
  cursor: wait;
}

/* ==============================================
   4. Summary (Right Column)
   ============================================== */
.cart-summary {
  position: sticky;
  top: 40px;
}
/* c-card 内部調整 */
.cart-summary__head {
  font-size: 16px;
  font-family: var(--font-family-heading);
  font-weight: 700;
  margin-bottom: 24px;
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
}

.cart-summary__row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 16px;
  font-size: 14px;
}
.cart-summary__row span:nth-child(2) {
  font-family: var(--font-family-en);
}

/* ✅ 追加：割引行 */
.cart-summary__row--discount span:nth-child(2){
  color: var(--color-error);
  font-weight: 700;
}

.cart-summary__total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  padding-top: 24px;
  border-top: 2px solid var(--color-ink);
  margin-bottom: 32px;
}
.cart-summary__total-label {
  font-weight: 700;
  font-size: 15px;
}
.cart-summary__total-price {
  font-family: var(--font-family-en);
  font-size: 20px;
  font-weight: 700;
}

/* Mobile */
@media (max-width: 600px) {
  .p-cart-flow {
    gap: 8px;
    margin: 40px 0 60px;
  }
  .p-flow-line {
    width: 20px;
  }
  .cart-item { gap: 16px; }
  .cart-item__img { width: 80px; }
}
