@charset "UTF-8";

/* ===== LAYER POPUP (개별 레이어 팝업 4종, 화면 정중앙 2x2 배치) ===== */
.layer-popup {
  position: fixed;
  z-index: 99996;
  --popup-gap: 24px;
  --popup-w: clamp(260px, 25vw, 480px);
  --popup-h: calc(var(--popup-w) * 0.697 + 40px);
  width: var(--popup-w);
}
.layer-popup.hidden { display: none; }

#layerPopup1 { left: calc(50% - var(--popup-w) - var(--popup-gap) / 2); top: calc(50vh - var(--popup-h) - var(--popup-gap) / 2); }
#layerPopup2 { left: calc(50% + var(--popup-gap) / 2);                 top: calc(50vh - var(--popup-h) - var(--popup-gap) / 2); }
#layerPopup3 { left: calc(50% - var(--popup-w) - var(--popup-gap) / 2); top: calc(50vh + var(--popup-gap) / 2); }
#layerPopup4 { left: calc(50% + var(--popup-gap) / 2);                 top: calc(50vh + var(--popup-gap) / 2); }

.layer-popup-wrap { background: #fff; box-shadow: 0 8px 30px rgba(0,0,0,0.3); border-radius: 8px; overflow: hidden; }
.layer-popup-wrap img { width: 100%; display: block; cursor: grab; user-select: none; -webkit-user-drag: none; }
.layer-popup-wrap.dragging img { cursor: grabbing; }

/* ===== BOTTOM BAR ===== */
.layer-popup-bottom { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; background: #1a1a1a; height: 40px; box-sizing: border-box; }
.layer-no-show { display: flex; align-items: center; gap: 6px; color: #ccc; font-size: 12px; cursor: pointer; user-select: none; }
.layer-no-show input[type="checkbox"] { cursor: pointer; accent-color: var(--main_color); width: 14px; height: 14px; }
.layer-popup-close { background: none; border: 1px solid #555; color: #ccc; font-size: 11px; cursor: pointer; padding: 4px 10px; border-radius: 2px; transition: all 0.2s; letter-spacing: 1px; }
.layer-popup-close:hover { border-color: #fff; color: #fff; }

/* ===== RESPONSIVE (동일한 2x2 중앙 배치, 크기/간격만 축소) ===== */
@media screen and (max-width: 1024px) {
  .layer-popup { --popup-gap: 16px; --popup-w: clamp(220px, 42vw, 380px); }
}

@media screen and (max-width: 767px) {
  /* 모바일: 4개를 세로 1열로 중앙 배치 */
  .layer-popup { --popup-gap: -24px; --popup-w: 70vw; }

  #layerPopup1, #layerPopup2, #layerPopup3, #layerPopup4 {
    left: calc(50% - var(--popup-w) / 2);
  }

  #layerPopup1 { top: clamp(8px, calc(50vh - 1.5 * var(--popup-h) - 1.5 * var(--popup-gap)), calc(100vh - var(--popup-h) - 8px)); z-index: 2;}
  #layerPopup2 { top: clamp(8px, calc(50vh - 1 * var(--popup-h) - 1.5 * var(--popup-gap)), calc(100vh - var(--popup-h) - 8px));  z-index: 3;}
  #layerPopup3 { top: clamp(8px, calc(50vh - 0.5 * var(--popup-h) - 1.5 * var(--popup-gap)), calc(100vh - var(--popup-h) - 8px)); z-index: 4;}
  #layerPopup4 { top: clamp(8px, calc(50vh - 0 * var(--popup-h) - 1.5 * var(--popup-gap)), calc(100vh - var(--popup-h) - 8px)); z-index: 5;}
}

/* ===== 비급여 진료비용 안내 모달 ===== */
.noncov-modal { position: fixed; inset: 0; z-index: 999998; }
.noncov-modal.hidden { display: none; }

.noncov-modal-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.55); }

.noncov-modal-wrap { position: relative; background: #fff; width: min(920px, 92vw); max-height: 85vh; margin: 7.5vh auto 0; border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35); display: flex; flex-direction: column; overflow: hidden; }

.noncov-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 18px 24px; border-bottom: 1px solid #eee; flex-shrink: 0; }
.noncov-modal-header h3 { font-size: clamp(16px, 1.6vw, 20px); font-weight: 700; color: #222; }
.noncov-modal-close { background: none; border: none; font-size: 22px; line-height: 1; color: #888; cursor: pointer; padding: 4px 6px; transition: color 0.2s; }
.noncov-modal-close:hover { color: var(--main_color); }

.noncov-modal-body { padding: 20px 24px 28px; overflow-y: auto; }
.noncov-modal-note { font-size: clamp(11px, 0.9vw, 13px); color: #888; margin: 0 0 14px; }

.noncov-table { width: 100%; border-collapse: collapse; font-size: clamp(12px, 0.95vw, 14px); }
.noncov-table th, .noncov-table td { padding: 10px 12px; border: 1px solid #e5e5e5; text-align: center; }
.noncov-table thead th { background: #fff1f4; color: #333; font-weight: 700; white-space: nowrap; position: sticky; top: 0; }
.noncov-table td:nth-child(4) { text-align: left; }
.noncov-table td:last-child { font-weight: 700; color: var(--main_color); white-space: nowrap; }
.noncov-table tbody tr:hover { background: #fffafb; }

body.noncov-modal-open { overflow: hidden; }

/* ===== 모바일: 표 → 카드 리스트 ===== */
@media screen and (max-width: 600px) {
  .noncov-modal-wrap { width: 94vw; max-height: 88vh; margin-top: 6vh; border-radius: 10px; }
  .noncov-modal-header { padding: 14px 16px; }
  .noncov-modal-body { padding: 14px 16px 20px; }

  .noncov-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .noncov-table, .noncov-table tbody, .noncov-table tr, .noncov-table td { display: block; width: 100%; }
  .noncov-table tr { border: 1px solid #e5e5e5; border-radius: 8px; margin-bottom: 10px; }
  .noncov-table td { position: relative; box-sizing: border-box; width: 100%; min-height: 36px; padding: 8px 12px 8px 42%; text-align: right; word-break: break-word; border: none; border-bottom: 1px solid #f0f0f0; }
  .noncov-table td:last-child { border-bottom: none; }
  .noncov-table td::before { content: attr(data-th); position: absolute; left: 12px; top: 8px; width: calc(42% - 20px); font-weight: 600; color: #888; text-align: left; }
  .noncov-table td:nth-child(4) { text-align: right; }
}
