.md3-theme {
  --md-surface-container-high: #e8eaed;
  --border-light: rgba(0, 0, 0, 0.08);
}

/* === ページヘッダー === */
.md3-page-header {
  position: static;
  z-index: auto;
  margin-bottom: 32px;
  padding-bottom: 16px;
  border-bottom: 2px solid var(--md-primary);
}

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

/* === 上下の主要アクション === */
.md3-action-panel {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.md3-action-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 16px 8px;
  border-radius: var(--border-radius-lg);
  background-color: var(--md-surface-container-low);
  border: 1px solid var(--border-light);
  color: var(--md-secondary) !important;
  transition: all 0.2s;
}

.md3-action-item:hover { background-color: var(--md-surface-container); }

.md3-action-item.is-primary {
  background-color: var(--md-primary);
  color: #fff !important;
  border-color: var(--md-primary);
  box-shadow: var(--md-elevation-1);
}

.md3-action-item.is-primary:hover {
  background-color: var(--md-primary-hover);
  box-shadow: 0 4px 8px rgba(0,0,0,0.15);
  transform: translateY(-1px);
}

.md3-action-item.is-disabled {
  background-color: var(--md-surface-container) !important;
  color: var(--text-muted) !important;
  border-color: var(--border-light) !important;
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
  box-shadow: none !important;
  transform: none !important;
}

.md3-action-item.is-disabled .md3-action-icon { color: var(--text-muted) !important; }

.md3-action-icon { font-size: 26px; }

.md3-action-label {
  font-size: var(--typescale-label);
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
}

/* === 共通カード (Filled Card) === */
.md3-card {
  background-color: var(--md-surface-container-low);
  border: none;
  border-radius: var(--border-radius-lg);
  padding: 32px;
  margin-bottom: 24px;
  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);
  transform: translateY(-2px);
}

.md3-card-title {
  font-size: var(--typescale-title);
  line-height: var(--typescale-title-line-height);
  font-weight: 700;
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: 2px solid var(--border-light);
  padding-bottom: 8px;
}

.md3-card-title .material-symbols-outlined { color: var(--md-primary); }

/* === 電話番号・外部リンク === */
.md3-phone-link, .md3-external-link {
  color: var(--md-secondary) !important;
  text-decoration: none !important;
  font-weight: 700;
  letter-spacing: 0.05em;
}

@media (hover: hover) {
.md3-phone-link:hover, .md3-external-link:hover {
    color: var(--md-secondary) !important;
    text-decoration: underline !important;
  }
}

/* === CSSのみで実装する「NO PHOTO」プレースホルダー === */
.md3-no-photo {
  background-color: var(--md-surface-container-high);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border-radius: var(--border-radius-md);
  aspect-ratio: 4 / 3;
  width: 100%;
}

.md3-no-photo .material-symbols-outlined { font-size: 32px; margin-bottom: 4px; opacity: 0.6; }

.md3-no-photo span { font-size: var(--typescale-label-small);
  line-height: var(--typescale-label-small-line-height); font-weight: 700; letter-spacing: 0.05em; opacity: 0.8; }

/* === 画像全般 === */
.md3-img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--border-radius-md);
}

/* === 店舗写真集グリッド === */
.md3-gallery-main {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-bottom: 12px;
}

.md3-gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}

.md3-gallery-thumbs > div, .md3-gallery-thumbs > button {
  aspect-ratio: 4 / 3;
  border-radius: var(--border-radius-sm);
  overflow: hidden;
  position: relative;
}

.md3-gallery-thumb {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  transition: opacity 0.2s;
}

.md3-gallery-thumb:hover { opacity: 0.7; }

.md3-gallery-thumb::after {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  border: 2px solid transparent;
  border-radius: inherit;
  pointer-events: none;
  transition: border-color 0.2s;
}

.md3-gallery-thumb.is-active::after { border-color: var(--md-primary); }

.md3-gallery-thumb.is-active { opacity: 1 !important; }

.md3-gallery-thumb > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 0;
}

/* === チラシ・料金表グリッド === */
.md3-flyer-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 32px;
}

.md3-flyer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.md3-flyer-grid > div {
  aspect-ratio: 1 / 1;
}

/* === キャンペーン・ブログ バナーグリッド === */
.md3-banner-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  align-items: stretch;
}

.md3-banner-link {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--border-light);
  background-color: var(--md-surface);
  transition: opacity 0.2s, box-shadow 0.2s;
}

.md3-banner-link[href]:hover {
  opacity: 0.85;
  box-shadow: var(--md-elevation-1);
}

.md3-banner-img {
  max-width: 100%;
  max-height: 120px;
  height: auto;
  object-fit: contain;
}

/* === スタッフ紹介グリッド === */
.md3-staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.md3-staff-item {
  background-color: var(--md-surface);
  border: 1px solid var(--border-light);
  border-radius: var(--border-radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.md3-staff-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.md3-staff-img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
}

.md3-staff-info { display: flex; flex-direction: column; }

.md3-staff-role { font-size: var(--typescale-label-small);
  line-height: var(--typescale-label-small-line-height); color: var(--text-muted); font-weight: 700;}

.md3-staff-name { font-size: var(--typescale-title);
  line-height: var(--typescale-title-line-height); font-weight: 700; color: var(--text-main); }

.md3-staff-comment { font-size: var(--typescale-body); color: var(--text-muted); line-height: var(--typescale-body-line-height); }

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

.md3-info-table th, .md3-info-table td {
  padding: 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: 25%;
  font-size: var(--typescale-label);
  line-height: var(--typescale-label-line-height);
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

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

/* === 地図枠 === */
.md3-map-container {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--border-radius-md);
  overflow: hidden;
}

/* レスポンシブ */
@media (max-width: 600px) {
.md3-flyer-groups, .md3-flyer-grid { grid-template-columns: 1fr; }

.md3-card { padding: 20px 16px; }

.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-action-panel { gap: 8px; }

.md3-action-label { font-size: var(--typescale-label-small); }
}

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

.md3-theme .md3-card[id] { scroll-margin-top: 140px; }

.md3-theme a:focus-visible, .md3-theme button:focus-visible { outline: 3px solid var(--md-secondary); outline-offset: 3px; }

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

.md3-theme .md3-card[id] { scroll-margin-top: 100px; }
}

.md3-image-open { display: block; width: 100%; height: 100%; padding: 0; border: 0; border-radius: var(--border-radius-md); background: transparent; cursor: zoom-in; }

.md3-lightbox { box-sizing: border-box; position: fixed; inset: 0; width: fit-content; max-width: 95vw; max-height: 95vh; max-height: 95dvh; margin: auto; padding: 56px 24px 24px; border: none; border-radius: var(--border-radius-md); background: var(--md-surface); color: var(--text-main); }

.md3-lightbox::backdrop { background: rgba(0, 0, 0, 0.8); backdrop-filter: blur(4px); }

.md3-lightbox-content { display: flex; align-items: center; justify-content: center; }

.md3-lightbox-content img { display: block; width: auto; height: auto; max-width: 100%; max-height: calc(95vh - 80px); max-height: calc(95dvh - 80px); object-fit: contain; border-radius: var(--border-radius-md); }

.md3-lightbox-close { position: absolute; top: 12px; right: 12px; display: flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; background: var(--text-main); color: #fff; cursor: pointer; }

.md3-lightbox-close .material-symbols-outlined { font-size: 20px; }

.md3-lightbox-close:hover { background: var(--text-muted); transform: scale(1.05); transition: transform 0.2s; }

.md3-flyer-title, .md3-map-title { font-size: var(--typescale-title); line-height: var(--typescale-title-line-height); margin: 0 0 12px; }
.md3-map-title { margin-top: 32px; }
.md3-access { color: var(--text-muted); font-size: var(--typescale-body); line-height: var(--typescale-body-line-height); margin: 0 0 16px; }
.md3-campaign-image { display: block; max-width: 100%; height: auto; margin: 0 auto 24px; border-radius: var(--border-radius-md); }

.md3-rich-text { font-size: var(--typescale-body); line-height: var(--typescale-body-line-height); overflow-x: auto; }
.md3-rich-text h1, .md3-rich-text h2, .md3-rich-text h3, .md3-rich-text h4, .md3-rich-text h5, .md3-rich-text h6 { font-size: var(--typescale-title); line-height: var(--typescale-title-line-height); }
.md3-rich-text p { margin: 0 0 16px; }
.md3-rich-text img { max-width: 100%; height: auto; }
.md3-rich-text table { max-width: 100%; border-collapse: collapse; }
.md3-rich-text ul, .md3-rich-text ol { padding-left: 1.5em; }
