:root {
  --bg: #ffffff;
  --card: #f7f7f7;
  --fg: #111111;
  --muted: #666666;
  --primary: #3b82f6;
  --accent: #10b981;
  --danger: #d62828;
  --warning: #f59e0b;
  --border: #cccccc;
  --btn: #e6e6e6;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Meiryo", sans-serif;
  -webkit-font-smoothing: antialiased;
}

header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

header h1 {
  font-size: 22px;
  letter-spacing: .02em;
}

.cart-foot .cart-total {
  display: flex;
  gap: 18px;
  align-items: baseline;
}

.cart-foot .cart-total .label {
  font-size: 13px;
}

.cart-foot .cart-total .value-total {
  display: inline-block;
  width: 7ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cart-foot .cart-total .value-count {
  display: inline-block;
  width: 2ch;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.cart-list {
  overflow: hidden auto;
  border-radius: 10px;
  padding: 8px;
  min-height: 0;
  background: #ffffff;
}

.cart-row {
  font-size: 20px;
  min-height: 60px;
  display: grid;
  grid-template-columns: 1fr 120px 216px 60px;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-bottom: 1px dashed #1f2330;
  font-variant-numeric: tabular-nums;
}

.cart-row:last-child {
  border-bottom: none;
}

.qty-ctrl {
  display: inline-flex;
  border-radius: 10px;
  overflow: hidden;
}

.qty-ctrl button {
  width: 72px;
  height: 48px;
  background: var(--btn);
  border: none;
  cursor: pointer;
  font-size: 22px;
}

.qty-ctrl span {
  min-width: 72px;
  text-align: center;
  padding: 8px 10px;
  line-height: 32px;
}

.remove-btn {
  width: 48px;
  height: 48px;
  background: var(--btn);
  color: var(--danger);
  font-weight: 900;
  font-size: 24px;
  border-radius: 10px;
}

.change-box {
  text-align: right;
}

.change-label {
  font-size: 14px;
}

.change-emph {
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}

.change-warn {
  color: var(--warning);
}

/* ローディングオーバーレイ */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-overlay[hidden] {
  display: none;
}

.loading-spinner {
  text-align: center;
  background: white;
  padding: 40px;
  border-radius: 15px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.spinner {
  width: 50px;
  height: 50px;
  margin: 0 auto 20px;
  border: 4px solid #e0e0e0;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-spinner p {
  margin: 0;
  font-size: 16px;
  color: var(--fg);
  font-weight: 500;
}
