/* ================================================================
   Cart — ヘッダーアイコン
================================================================ */
.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cart-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  color: var(--color-text-main);
  text-decoration: none;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}
.cart-btn:hover,
.cart-btn--active {
  color: var(--color-main);
}

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  background: var(--color-main);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  border-radius: 9px;
  font-family: var(--font-heading);
  transition: transform 0.2s;
}
.cart-count--hidden {
  display: none;
}

/* ================================================================
   template-detail.html — カートボタン共通
================================================================ */
.td-btn-cart {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  background: var(--color-main);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 15px;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s, opacity 0.2s;
}
.td-btn-cart:hover:not(:disabled) {
  background: var(--color-main-hover);
}
.td-btn-cart:disabled {
  background: #a8d5db;
  cursor: default;
  opacity: 0.8;
}

/* operationModes 用 */
.td-mode-cart-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 10px 20px;
  width: 100%;
  justify-content: center;
  background: var(--color-text-main);
  color: #fff;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 600;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
}
.td-mode-cart-btn:hover:not(:disabled) {
  background: #222;
}
.td-mode-cart-btn--accent {
  background: var(--color-main);
}
.td-mode-cart-btn--accent:hover:not(:disabled) {
  background: var(--color-main-hover);
}
.td-mode-cart-btn:disabled {
  background: #aaa;
  cursor: default;
  opacity: 0.75;
}

/* btn-primary に重ねる場合（includes セクション） */
button.btn.btn-primary.btn-float {
  border: none;
  cursor: pointer;
}

/* ================================================================
   Cart ページ
================================================================ */
.cart-main {
  min-height: calc(100vh - 220px);
  padding: 80px 0 120px;
  background: var(--color-bg-light);
}

.cart-page-header {
  margin-bottom: 40px;
}
.cart-page-title {
  font-size: clamp(28px, 4vw, 40px);
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-text-main);
}
.cart-page-sub {
  color: var(--color-text-muted);
  margin-top: 6px;
  font-size: 14px;
}

/* 2カラムレイアウト */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 768px) {
  .cart-layout {
    grid-template-columns: 1fr;
  }
}

/* ── カートアイテム ── */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 20px 24px;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  margin-bottom: 12px;
}
.cart-item-body {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}
.cart-item-badge {
  display: inline-block;
  padding: 3px 10px;
  background: var(--color-main);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  border-radius: 3px;
  white-space: nowrap;
  font-family: var(--font-heading);
  margin-top: 2px;
}
.cart-item-info {
  flex: 1;
}
.cart-item-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--color-text-main);
  line-height: 1.5;
}
.cart-item-includes {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 4px;
  line-height: 1.6;
}
.cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}
.cart-item-price {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-heading);
  color: var(--color-text-main);
  white-space: nowrap;
}
.cart-item-remove {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: none;
  border: 1px solid var(--color-sub);
  border-radius: 4px;
  color: var(--color-text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.cart-item-remove:hover {
  border-color: #e05252;
  color: #e05252;
}

/* ── カート操作 ── */
.cart-actions {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 12px 0 0;
}
.cart-clear-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  font-size: 13px;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}
.cart-clear-btn:hover { color: #e05252; }
.cart-continue-link {
  font-size: 13px;
  color: var(--color-main);
  text-decoration: none;
}
.cart-continue-link:hover { text-decoration: underline; }

/* ── サマリー ── */
.cart-summary {
  background: #fff;
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
  position: sticky;
  top: 90px;
}
.cart-summary-title {
  font-size: 17px;
  font-weight: 700;
  font-family: var(--font-heading);
  margin-bottom: 20px;
  color: var(--color-text-main);
}
.cart-summary-rows {
  border-top: 1px solid var(--color-sub);
  padding-top: 12px;
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.cart-summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--color-text-muted);
}
.cart-summary-name {
  flex: 1;
  line-height: 1.5;
}
.cart-summary-price {
  white-space: nowrap;
  font-weight: 600;
  font-family: var(--font-heading);
}
.cart-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 2px solid var(--color-text-main);
  padding-top: 14px;
  margin-bottom: 24px;
  font-weight: 700;
  font-size: 15px;
  font-family: var(--font-heading);
}
.cart-total-price {
  font-size: 22px;
  color: var(--color-main);
}
.cart-checkout-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 16px;
  background: var(--color-main);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  font-weight: 700;
  font-family: var(--font-heading);
  cursor: pointer;
  transition: background 0.2s;
}
.cart-checkout-btn:hover:not(:disabled) {
  background: var(--color-main-hover);
}
.cart-checkout-btn:disabled {
  background: #aaa;
  cursor: not-allowed;
}
.cart-note {
  margin-top: 14px;
  font-size: 11px;
  color: var(--color-text-muted);
  text-align: center;
  line-height: 1.7;
}

/* ── 空カート ── */
.cart-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 24px;
}
.cart-empty-icon {
  color: var(--color-sub);
  margin-bottom: 24px;
}
.cart-empty h2 {
  font-size: 22px;
  font-family: var(--font-heading);
  margin-bottom: 10px;
}
.cart-empty p {
  color: var(--color-text-muted);
  margin-bottom: 28px;
}
.cart-empty-btn {
  display: inline-flex;
  align-items: center;
  padding: 14px 32px;
  background: var(--color-main);
  color: #fff;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 600;
  font-family: var(--font-heading);
  transition: background 0.2s;
}
.cart-empty-btn:hover { background: var(--color-main-hover); }

/* ── ローディング ── */
.cart-loading {
  color: var(--color-text-muted);
  padding: 40px;
  text-align: center;
  font-size: 14px;
}
