/* 상점 모달. */
/* ────────────────────────────── 상점 모달 ────────────────────────────── */

.modal {
  position: fixed;
  inset: 0;
  z-index: 300;
  border: none;
  background: rgba(0, 0, 0, 0.7);
  padding: 0;
  margin: 0;
  /* dialog 의 기본값은 width/height: fit-content 라 inset:0 으로도 늘어나지
     않는다. 게다가 .modal-content 는 absolute 라 이 상자의 크기에 아무것도
     보태지 않아, 크기를 못 박지 않으면 dialog 가 0×0 으로 접히고 그 안에서
     가운데 정렬된 내용이 화면 왼쪽 위 밖으로 밀려난다. */
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}
.modal::backdrop {
  background: rgba(4, 6, 14, 0.85);
  backdrop-filter: blur(6px);
}
.modal-content {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 24px));
  max-height: 85vh;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #181f42 0%, #0d1226 100%);
  border: 1px solid var(--line);
  outline: 1px solid rgba(216, 180, 90, 0.15);
  outline-offset: 4px;
  display: flex;
  flex-direction: column;
  animation: modalIn 0.35s ease both;
}
@keyframes modalIn {
  from { opacity: 0; transform: translate(-50%, -48%) scale(0.96); }
  to   { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-soft);
}
.modal-header h2 {
  margin: 0;
  color: var(--gold-bright);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
}
.modal-tabs {
  display: flex;
  border-bottom: 1px solid var(--line-soft);
}
.modal-tab {
  flex: 1;
  font-family: inherit;
  font-size: 0.9rem;
  color: var(--muted);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 12px 16px;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}
.modal-tab:hover { color: var(--text); }
.modal-tab.active {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
}
.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  display: grid;
  gap: 16px;
}
.shop-tab[hidden] { display: none; }
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.product-card {
  display: flex;
  flex-direction: column;
  background: rgba(12, 16, 32, 0.65);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 16px 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.product-card:hover {
  border-color: var(--gold-dim);
  box-shadow: 0 4px 16px rgba(216, 180, 90, 0.12);
}
.product-name {
  font-size: 0.95rem;
  color: var(--gold-bright);
  margin: 0 0 4px;
  letter-spacing: 0.02em;
}
.product-desc {
  font-size: 0.78rem;
  color: var(--muted);
  margin: 0 0 10px;
  line-height: 1.4;
  flex: 1;
}
.product-price {
  font-size: 1.1rem;
  color: var(--gold);
  font-weight: 700;
  margin-bottom: 12px;
}
.product-btn {
  width: 100%;
  font-family: inherit;
  font-size: 0.88rem;
  color: var(--ink);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  font-weight: 600;
  transition: transform 0.08s, box-shadow 0.2s;
}
.product-btn:hover:not(:disabled) {
  box-shadow: 0 0 18px rgba(216, 180, 90, 0.4);
}
.product-btn:active:not(:disabled) { transform: translateY(1px); }
.product-btn:disabled { opacity: 0.5; cursor: not-allowed; }
