/* ──────────────────────────────────────────────
   쿠키 동의 배너 + 쿠키 설정 패널
   섹션: 쿠키 동의 — 페이지 하단 고정
   ────────────────────────────────────────────── */

/* ── 배너 (하단 슬라이드업) ── */
.cookie-banner {
  position: fixed;
  z-index: 9999;
  bottom: 0;
  left: 0;
  width: 100%;
  background: rgba(0, 22, 45, 0.97);
  color: #fff;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  transform: translateY(100%);
  transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
  font-family: var(--artifact-font, Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif);
}
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-banner.is-hidden { transform: translateY(100%); pointer-events: none; }

.cookie-inner {
  max-width: 1320px;
  margin: 0 auto;
  padding: 26px clamp(22px, 3.3vw, 64px);
  display: flex;
  align-items: center;
  gap: 32px;
}

/* 텍스트 영역 */
.cookie-text { flex: 1; min-width: 0; }
.cookie-text p {
  font-size: 14px;
  line-height: 1.8;
  color: #C1CDDF;
  margin: 0;
  word-break: keep-all;
}
.cookie-text p strong {
  color: #fff;
  font-weight: 600;
}
.cookie-text a {
  color: #4DD4CE;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}
.cookie-text a:hover { color: #fff; }

/* 버튼 영역 */
.cookie-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 11px 24px;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
  white-space: nowrap;
}

.cookie-btn-accept {
  background: #6E37FA;
  color: #fff;
  border-color: #6E37FA;
}
.cookie-btn-accept:hover {
  background: #4D19C5;
  border-color: #4D19C5;
}

.cookie-btn-reject {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}
.cookie-btn-reject:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.6);
}

.cookie-btn-settings {
  background: transparent;
  color: #C1CDDF;
  border-color: transparent;
  padding: 11px 14px;
  font-size: 13px;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.cookie-btn-settings:hover { color: #fff; }

/* 포커스 */
.cookie-btn:focus-visible {
  outline: 3px solid #32BBB9;
  outline-offset: 3px;
}

/* ── 쿠키 설정 패널 (모달) ── */
.cookie-settings-overlay {
  position: fixed;
  z-index: 10000;
  inset: 0;
  background: rgba(0, 12, 31, 0.75);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.cookie-settings-overlay.is-open { display: flex; }

.cookie-settings-panel {
  background: #00162D;
  color: #fff;
  width: min(560px, 100%);
  max-height: 85vh;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.5);
}

.cookie-settings-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 28px 28px 0;
}
.cookie-settings-header h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.03em;
  margin: 0;
}
.cookie-settings-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  color: #C1CDDF;
  border: 0;
  cursor: pointer;
  flex-shrink: 0;
}
.cookie-settings-close:hover { color: #fff; }
.cookie-settings-close svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 1.8; fill: none; }
.cookie-settings-close:focus-visible { outline: 3px solid #32BBB9; outline-offset: 3px; }

.cookie-settings-body { padding: 24px 28px 28px; }
.cookie-settings-body > p {
  font-size: 13px;
  line-height: 1.85;
  color: #C1CDDF;
  margin: 0 0 24px;
  word-break: keep-all;
}

/* 카테고리 항목 */
.cookie-setting-item {
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}
.cookie-setting-item:last-child {
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.cookie-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-setting-info { flex: 1; min-width: 0; }
.cookie-setting-info h4 {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}
.cookie-setting-info p {
  font-size: 12px;
  line-height: 1.75;
  color: #C1CDDF;
  margin: 6px 0 0;
  word-break: keep-all;
}

.cookie-setting-badge {
  font-size: 11px;
  color: #4DD4CE;
  font-weight: 600;
  white-space: nowrap;
}

/* 토글 스위치 */
.cookie-toggle {
  position: relative;
  width: 44px;
  height: 24px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.cookie-toggle input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  margin: 0;
}
.cookie-toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s;
  pointer-events: none;
}
.cookie-toggle input:checked ~ .cookie-toggle-knob { transform: translateX(20px); }
.cookie-toggle:has(input:checked) { background: #6E37FA; border-color: #6E37FA; }
.cookie-toggle:has(input:disabled) { opacity: 0.5; cursor: default; }
.cookie-toggle:has(input:disabled) input { cursor: default; }
.cookie-toggle input:focus-visible ~ .cookie-toggle-knob { outline: 3px solid #32BBB9; outline-offset: 3px; }

/* 설정 패널 하단 버튼 */
.cookie-settings-footer {
  display: flex;
  gap: 10px;
  padding: 20px 28px 28px;
}
.cookie-settings-footer .cookie-btn { flex: 1; }

/* ── 푸터 쿠키 설정 링크 ── */
.cookie-reopen {
  background: transparent;
  color: inherit;
  border: 0;
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-align: left;
}
.cookie-reopen:hover { color: #4DD4CE; }

/* ── 반응형 ── */
@media screen and (max-width: 760px) {
  .cookie-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 18px;
    padding: 22px clamp(20px, 3.3vw, 40px);
  }
  .cookie-text p { font-size: 13px; }
  .cookie-actions { justify-content: stretch; }
  .cookie-btn { flex: 1; text-align: center; }
  .cookie-btn-settings { flex: 0; text-align: center; }

  .cookie-settings-panel { width: 100%; max-height: 90vh; }
  .cookie-settings-header { padding: 22px 22px 0; }
  .cookie-settings-header h3 { font-size: 19px; }
  .cookie-settings-body { padding: 20px 22px 22px; }
  .cookie-settings-footer { padding: 16px 22px 22px; }
}

@media screen and (max-width: 480px) {
  .cookie-inner { padding: 20px; gap: 14px; }
  .cookie-text p { font-size: 12px; }
  .cookie-actions { flex-wrap: wrap; }
  .cookie-btn { font-size: 13px; padding: 10px 18px; }
  .cookie-btn-settings { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-banner { transition: none; }
  .cookie-toggle-knob { transition: none; }
}

@media print {
  .cookie-banner,
  .cookie-settings-overlay { display: none !important; }
}
