.md3-theme {
  --border-light: rgba(0, 0, 0, 0.12);
}

/* === ページヘッダー (戻る導線を統合したTop App Bar風) === */
.md3-page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--md-primary);
}

.md3-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-muted) !important;
  font-size: var(--typescale-label);
  line-height: var(--typescale-label-line-height);
  font-weight: 700;
  margin-bottom: 12px;
  transition: color 0.2s;
}

.md3-back-link:hover {
  color: var(--md-primary) !important;
}

.md3-page-title {
  font-size: var(--typescale-headline);
  font-weight: 700;
  margin: 0;
  line-height: var(--typescale-headline-line-height);
}

.md3-page-subtitle {
  font-size: var(--typescale-body);
  line-height: var(--typescale-body-line-height);
  color: var(--text-muted);
  margin: 8px 0 0 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-weight: 500;
}

/* === 共通カード (Filled Card) === */
.md3-card {
  background-color: var(--md-surface-container-low);
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 36px;
  margin-bottom: 32px;
  transition: background-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.md3-card:hover {
  background-color: var(--md-surface);
  box-shadow: var(--md-elevation-3);
}

/* === キャンペーン画像（ラッパー不要・自己完結スタイル） === */
.md3-campaign-img {
  display: block;
  margin: 0 auto 36px auto; /* 自身で中央配置と下部余白を作る */
  max-width: 100%;
  max-height: 440px; 
  height: auto;
  object-fit: contain;
  border-radius: var(--border-radius-md);
  box-shadow: var(--md-elevation-1);
  border: 1px solid var(--border-light);
}

/* テーブルの直前に画像がある場合の全体余白調整（ボーダーは引かずマージンで距離を保つ） */
.md3-campaign-img + .md3-info-table {
  margin-top: 8px;
}

/* === 詳細情報テーブル === */
.md3-info-table {
  width: 100%;
  border-collapse: collapse;
}

.md3-info-table th, .md3-info-table td {
  padding: 20px 16px;
  border-bottom: 1px solid var(--border-light);
  text-align: left;
  vertical-align: top;
}

/* 最後の行の罫線のみ非表示（パディングは削らない） */
.md3-info-table tr:last-child th, .md3-info-table tr:last-child td {
  border-bottom: none;
}

.md3-info-table th {
  width: 22%;
  font-size: var(--typescale-label);
  line-height: var(--typescale-label-line-height);
  color: var(--text-muted);
  font-weight: 700;
  white-space: nowrap;
}

.md3-info-table td {
  color: var(--text-main);
  font-size: var(--typescale-label);
  line-height: var(--typescale-label-line-height);
}

/* === 底部アクションエリア === */
.md3-bottom-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.md3-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 16px;
  border-radius: var(--border-radius-full);
  font-size: var(--typescale-label);
  line-height: var(--typescale-label-line-height);
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: all 0.2s;
  text-align: center;
  gap: 8px;
}

.md3-btn-primary { background-color: var(--md-primary); color: #fff !important; }

.md3-btn-primary:hover { background-color: var(--md-primary-hover); box-shadow: 0 2px 4px rgba(0,0,0,0.15); }

.md3-btn-outlined { background-color: transparent; border: 1px solid var(--border-light); color: var(--text-main) !important; }

.md3-btn-outlined:hover { background-color: var(--md-surface-container); border-color: var(--text-muted); }

/* レスポンシブ対応 */
@media (max-width: 600px) {
.md3-card { padding: 24px 16px; }

.md3-campaign-img { margin-bottom: 16px; }

.md3-campaign-img + .md3-info-table { margin-top: 8px; }

.md3-info-table th, .md3-info-table td { display: block; width: 100%; padding: 12px 0; }

.md3-info-table th { padding-bottom: 4px; border-bottom: none; font-weight: 700; }

.md3-bottom-actions { grid-template-columns: 1fr; }
}

body.shop-campaign #main .md3-theme { padding: 8px 0 40px; text-align: left; min-width: 0; overflow-wrap: anywhere; }

.md3-theme .md3-page-header { position: static; z-index: auto; }

@media (max-width: 737px) {
body.shop-campaign #main .md3-theme { padding: 16px 4% 32px; }
}
