/* ========================================
   overlay-modal-1.css
   商品一覧カード + 詳細モーダル
======================================== */

:root {
  --mdl-primary: #2563EB;
  --mdl-radius:  12px;
}

/* ===== デモコンテナ上書き ===== */
.demo-container {
  max-width: 760px;
  flex-direction: column;
  align-items: stretch;
  padding: 24px;
}

/* ===== 商品カードグリッド ===== */
.mdl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  width: 100%;
  margin-bottom: 16px;
}

/* ===== 商品カード ===== */
.mdl-card {
  background: #fff;
  border: 1.5px solid #E5E7EB;
  border-radius: var(--mdl-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s;
}

.mdl-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

/* 絵文字エリア（上部カラーブロック） */
.mdl-card-emoji-area {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100px;
  font-size: 48px;
}

/* カード本体 */
.mdl-card-body {
  padding: 12px 14px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.mdl-card-name {
  font-size: 13px;
  font-weight: 700;
  color: #1A2332;
  margin: 0;
  line-height: 1.4;
}

.mdl-card-price {
  font-size: 14px;
  font-weight: 700;
  color: #1A2332;
  margin: 0;
}

/* ===== バッジ共通 ===== */
.mdl-cat-badge {
  display: inline-block;
  padding: 2px 8px;
  background: #EFF6FF;
  color: #2563EB;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
  align-self: flex-start;
}

.mdl-stock-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 11px;
  font-weight: 600;
}

.mdl-stock-badge--in-stock    { background: #DCFCE7; color: #166534; }
.mdl-stock-badge--low-stock   { background: #FEF3C7; color: #92400E; }
.mdl-stock-badge--out-of-stock { background: #FEE2E2; color: #991B1B; }

/* ===== 詳細ボタン ===== */
.mdl-detail-btn {
  margin-top: auto;
  padding: 8px 0;
  background: var(--mdl-primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 13px;
  font-family: sans-serif;
  cursor: pointer;
  transition: background 0.15s;
  width: 100%;
}

.mdl-detail-btn:hover { background: #1D4ED8; }

/* ===== モーダルオーバーレイ ===== */
.mdl-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 16px;
}

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

/* ===== モーダルダイアログ ===== */
.mdl-dialog {
  position: relative;
  background: #fff;
  border-radius: var(--mdl-radius);
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
}

/* × 閉じるボタン */
.mdl-close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 32px;
  height: 32px;
  background: rgba(0, 0, 0, 0.08);
  border: none;
  border-radius: 50%;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  transition: background 0.15s;
  color: #1A2332;
  line-height: 1;
}

.mdl-close-btn:hover { background: rgba(0, 0, 0, 0.16); }

/* 絵文字エリア（モーダル上部） */
.mdl-img-area {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  border-radius: var(--mdl-radius) var(--mdl-radius) 0 0;
  font-size: 72px;
}

/* モーダル本文 */
.mdl-dialog-body { padding: 20px 24px 24px; }

.mdl-name-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.mdl-dialog-name {
  font-size: 18px;
  font-weight: 700;
  color: #1A2332;
  margin: 0;
  line-height: 1.3;
}

.mdl-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.mdl-price {
  font-size: 15px;
  font-weight: 700;
  color: #1A2332;
}

.mdl-desc {
  font-size: 14px;
  color: #5A6A7A;
  line-height: 1.7;
  margin: 0 0 18px;
}

.mdl-specs-title {
  font-size: 12px;
  font-weight: 700;
  color: #5A6A7A;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0 0 8px;
}

/* ===== スペックテーブル ===== */
.mdl-specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.mdl-specs-table th,
.mdl-specs-table td {
  padding: 8px 10px;
  text-align: left;
  border-bottom: 1px solid #F1F5F9;
}

.mdl-specs-table th {
  width: 40%;
  color: #5A6A7A;
  font-weight: 600;
  background: #F8FAFC;
}

.mdl-specs-table td { color: #1A2332; }

.mdl-specs-table tr:last-child th,
.mdl-specs-table tr:last-child td { border-bottom: none; }

/* ===== モーダル表示中はスクロールをロック ===== */
body.mdl-scroll-lock { overflow: hidden; }

/* ===== スマホ対応 ===== */
@media (max-width: 480px) {
  .mdl-grid { grid-template-columns: repeat(2, 1fr); }
  .mdl-dialog-name { font-size: 16px; }
  .mdl-img-area { height: 110px; font-size: 56px; }
}
