/* NEUPL Components — 절제된 형태 */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  height: 36px;
  padding: 0 var(--space-4);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 500;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s;
  text-decoration: none;
}
.btn:hover { background: var(--surface); text-decoration: none; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: var(--accent-on);
  border-color: var(--accent);
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }

.btn-ghost {
  border: 0;
  background: transparent;
  height: auto;
  padding: 0;
  color: var(--text-muted);
}
.btn-ghost:hover { background: transparent; color: var(--text); text-decoration: underline; }

.btn-sm { height: 28px; padding: 0 var(--space-3); font-size: var(--text-xs); }
.btn-lg { height: 44px; padding: 0 var(--space-5); font-size: var(--text-base); }
.btn-block { width: 100%; }

/* Inputs */
.field { display: block; margin-bottom: var(--space-4); }
.field-label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 500;
  margin-bottom: var(--space-2);
}
.field-hint {
  display: block;
  font-size: var(--text-xs);
  color: var(--text-faint);
  margin-top: var(--space-1);
}
.field-error {
  display: block;
  font-size: var(--text-xs);
  color: var(--error);
  margin-top: var(--space-1);
}

.input,
.textarea,
.select {
  display: block;
  width: 100%;
  height: 40px;
  padding: 0 var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text);
  font-size: var(--text-base);
  transition: border-color 0.15s;
}
.input:focus,
.textarea:focus,
.select:focus {
  outline: none;
  border-color: var(--accent);
}

.textarea {
  height: auto;
  min-height: 100px;
  padding: var(--space-3);
  line-height: var(--leading);
  resize: vertical;
}

/* Card / Panel */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.card + .card { margin-top: var(--space-4); }

.card-title {
  font-size: var(--text-md);
  font-weight: 600;
  margin-bottom: var(--space-4);
}

/* Listing — 카드 대신 가로선 위주 */
.row-list {
  border-top: 1px solid var(--border);
}
.row-list .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}
.row .row-main { flex: 1; min-width: 0; }
.row .row-title {
  font-size: var(--text-base);
  font-weight: 500;
  margin-bottom: 2px;
}
.row .row-sub {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.row .row-meta {
  font-size: var(--text-xs);
  color: var(--text-muted);
}

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 var(--space-2);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: var(--text-xs);
  font-weight: 500;
}
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warn    { background: var(--warn-bg);    color: var(--warn); }
.badge-error   { background: var(--error-bg);   color: var(--error); }

/* Alerts (flash) */
.alert {
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  margin-bottom: var(--space-4);
  background: var(--surface);
}
.alert-success { border-left-color: var(--success); background: var(--success-bg); color: var(--success); }
.alert-warn    { border-left-color: var(--warn);    background: var(--warn-bg);    color: var(--warn); }
.alert .alert-link {
  margin-left: var(--space-2);
  color: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.alert .alert-link:hover {
  text-decoration: none;
}
.alert-error   { border-left-color: var(--error);   background: var(--error-bg);   color: var(--error); }

/* Empty state */
.empty {
  padding: var(--space-7) var(--space-4);
  text-align: center;
  color: var(--text-muted);
  font-size: var(--text-sm);
  border: 1px dashed var(--border);
  border-radius: var(--radius);
}

/* Auth pages (login/register) */
.auth-card {
  max-width: 380px;
  margin: var(--space-8) auto;
  padding: var(--space-6);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.auth-card h1 {
  font-size: var(--text-xl);
  font-weight: 600;
  margin-bottom: var(--space-2);
}
.auth-card .auth-sub {
  font-size: var(--text-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-6);
}
.auth-card form { margin-top: var(--space-4); }
.auth-card .auth-foot {
  margin-top: var(--space-5);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-align: center;
}

/* 헤더 브랜드 로고 접두사 (메인 사이트, 회원 워크스페이스) */
.brand-logo .brand-logo-prefix {
  color: var(--text-faint);
  font-weight: 400;
  margin-right: 6px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* 제품 카드 그리드 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-3);
}
.product-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  color: inherit;
  padding: 0;
  transition: border-color 0.15s;
}
.product-card:hover { border-color: var(--border-strong); }
.product-thumb {
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-thumb-empty { color: var(--text-faint); font-size: var(--text-sm); }
.product-meta { padding: var(--space-3); }
.product-title { font-size: var(--text-sm); font-weight: 600; margin-bottom: 4px; }
.product-summary { font-size: var(--text-xs); color: var(--text-muted); line-height: 1.4; }

/* 이미지 갤러리 (관리자 수정 화면) */
.image-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: var(--space-2);
}
.image-gallery-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--surface-2);
}
.image-gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
}
.image-gallery-item form {
  position: absolute; top: 4px; right: 4px; margin: 0;
}
.image-gallery-delete {
  width: 24px; height: 24px;
  background: rgba(0, 0, 0, 0.7);
  color: #fff;
  border: 0;
  border-radius: 50%;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.image-gallery-delete:hover { background: rgba(220, 38, 38, 0.9); }

/* 모달 (공통) */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex; align-items: center; justify-content: center;
  z-index: 2000;
  padding: var(--space-4);
}
.modal-overlay[hidden] { display: none; }
.modal {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute; top: var(--space-2); right: var(--space-2);
  width: 32px; height: 32px;
  background: transparent; border: 0; color: var(--text-muted);
  font-size: 24px; cursor: pointer; line-height: 1;
  z-index: 1;
}
.modal-close:hover { color: var(--text); }
.modal-image {
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
}
.modal-image img { width: 100%; height: 100%; object-fit: cover; }
.modal-image-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-faint);
}
.modal-body { padding: var(--space-5); }
.modal-title { font-size: var(--text-xl); font-weight: 600; margin-bottom: var(--space-2); }
.modal-summary { font-size: var(--text-sm); color: var(--text-muted); margin-bottom: var(--space-4); }
.modal-section { margin-bottom: var(--space-4); }
.modal-section h3 {
  font-size: var(--text-sm); font-weight: 600;
  color: var(--text-muted); text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}
.modal-specs {
  font-size: var(--text-sm); line-height: 1.7;
  white-space: pre-wrap;
}
.modal-actions { margin-top: var(--space-4); }
.modal-actions .btn { width: 100%; }

/* 모달 wide (제품 상세) */
.modal-wide { max-width: 600px; }

/* 모달 타이틀 이미지 슬라이드 */
.modal-title-slider {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--surface-2);
  overflow: hidden;
}
.modal-title-slider .title-slide {
  display: none;
  width: 100%; height: 100%;
}
.modal-title-slider .title-slide.active { display: block; }
.modal-title-slider .title-slide img {
  width: 100%; height: 100%; object-fit: cover;
}
.modal-title-slider .title-slide-dots {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.modal-title-slider .title-slide-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: background 0.2s;
}
.modal-title-slider .title-slide-dots span.active {
  background: #fff;
}

/* 상세 이미지 (세로 나열) */
.modal-detail-images {
  display: flex; flex-direction: column;
  gap: var(--space-2);
}
.modal-detail-images img {
  width: 100%;
  display: block;
  border-radius: var(--radius-sm);
}

/* 브랜드 카드 그리드 (회원 brands.php) */
.brand-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-3);
}
.brand-card-form { margin: 0; }
.brand-card {
  display: block;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
  cursor: pointer;
  color: inherit;
  transition: border-color 0.15s, background-color 0.15s;
}
.brand-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
}
.brand-card.is-active {
  border-color: var(--accent);
}
.brand-card-name {
  font-size: var(--text-lg);
  font-weight: 600;
  margin-bottom: 4px;
}
.brand-card-tagline {
  font-size: var(--text-sm);
  color: var(--text-muted);
}

/* Quick grid (빠른 진입 카드) */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--space-3);
}
.quick-card {
  display: block;
  text-decoration: none;
  color: inherit;
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s, background-color 0.15s;
}
.quick-card:hover {
  border-color: var(--border-strong);
  background: var(--surface-2);
  text-decoration: none;
}
.quick-card .quick-name {
  font-size: var(--text-base);
  font-weight: 600;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.quick-card .quick-desc {
  font-size: var(--text-xs);
  color: var(--text-muted);
}
.quick-card .quick-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  background: var(--accent);
  color: var(--accent-on);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* Utility */
.row-flex { display: flex; gap: var(--space-3); }
.row-flex.center { align-items: center; }
.row-flex.between { justify-content: space-between; }
.spacer { flex: 1; }
.text-right { text-align: right; }

/* ========== 우측 삼선 메뉴 + 팝업 (사이트 공통) ========== */
.site-header {
  position: relative;
}

.menu-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: transparent;
  border: 0;
  border-radius: var(--radius);
  color: var(--text);
  cursor: pointer;
  padding: 0;
  transition: background-color 0.15s, color 0.15s;
}
.menu-btn:hover {
  background: var(--surface);
}
.menu-btn[aria-expanded="true"] {
  background: var(--surface);
}

.menu-popup {
  position: absolute;
  top: calc(100% + 6px);
  right: var(--space-5);
  width: 240px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  padding: var(--space-2);
  z-index: 1000;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
.menu-popup[hidden] { display: none; }

.menu-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  padding: var(--space-2) var(--space-3) 4px;
}

.menu-item {
  display: block;
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-sm);
  color: var(--text);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: background-color 0.1s;
}
.menu-item:hover {
  background: var(--surface);
  text-decoration: none;
}
.menu-item.active {
  background: var(--surface-2);
  font-weight: 500;
}
.menu-item .menu-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  background: var(--accent);
  color: var(--accent-on);
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
}

/* 강조 메뉴 (인트로 슬라이드 등) — 시그니처 컬러 그라데이션 액센트 */
.menu-item-feature {
  font-weight: 600;
  background: linear-gradient(90deg, rgba(201,169,110,0.10), rgba(201,169,110,0.02));
  border-left: 2px solid #c9a96e;
  padding-left: calc(var(--space-3) - 2px);
}
.menu-item-feature:hover {
  background: linear-gradient(90deg, rgba(201,169,110,0.18), rgba(201,169,110,0.05));
}
.menu-item-feature.active {
  background: linear-gradient(90deg, rgba(201,169,110,0.22), rgba(201,169,110,0.06));
  border-left-color: #d8b87a;
}

.menu-info {
  padding: 4px var(--space-3) var(--space-2);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

.menu-divider {
  height: 1px;
  background: var(--border);
  margin: var(--space-2) 0;
}

/* 아코디언 섹션 (콘텐츠/브랜드 정보/소통) */
.menu-group {
  margin: 0;
}
.menu-group-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-2) var(--space-3);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-faint);
  cursor: pointer;
  border-radius: var(--radius-sm);
  list-style: none;
  user-select: none;
  transition: background-color 0.1s, color 0.1s;
}
.menu-group-summary::-webkit-details-marker { display: none; }
.menu-group-summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translate(-2px, -2px);
  transition: transform 0.15s;
}
.menu-group[open] .menu-group-summary {
  color: var(--text-muted);
}
.menu-group[open] .menu-group-summary::after {
  transform: rotate(-135deg) translate(-2px, -2px);
}
.menu-group-summary:hover {
  background: var(--surface);
  color: var(--text);
}
.menu-group-body {
  padding-top: 2px;
}

@media (max-width: 640px) {
  .menu-popup {
    right: var(--space-4);
    width: calc(100vw - var(--space-4) * 2);
    max-width: 280px;
  }
}

/* 팝업 메뉴 안의 브랜드 선택 폼 */
.menu-form {
  padding: 0 var(--space-3) var(--space-2);
}
.menu-form .menu-section-label {
  display: block;
  padding: var(--space-2) 0 4px;
}
.menu-form .menu-select {
  height: 32px;
  font-size: var(--text-sm);
  padding: 0 var(--space-2);
}

/* Tabs */
.tabs {
  display: flex;
  gap: var(--space-1);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--space-5);
}
.tab {
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.tab:hover { color: var(--text); text-decoration: none; }
.tab.active {
  color: var(--text);
  border-bottom-color: var(--accent);
  font-weight: 500;
}
.tab-count {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  background: var(--surface-2);
  border-radius: 10px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Shorts Grid */
.shorts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: var(--space-4);
}
@media (max-width: 640px) {
  .shorts-grid { grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
}
.shorts-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  transition: border-color 0.15s;
}
.shorts-card:hover { border-color: var(--border-strong); text-decoration: none; }
.shorts-card .thumb {
  position: relative;
  aspect-ratio: 9 / 16;
  background: var(--surface-2);
  overflow: hidden;
}
.shorts-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.shorts-card .thumb-empty {
  display: flex; align-items: center; justify-content: center;
  height: 100%; color: var(--text-faint); font-size: var(--text-xs);
}
.shorts-card .thumb-tag {
  position: absolute; left: 8px; top: 8px;
  padding: 2px 8px;
  font-size: 11px; font-weight: 500;
  background: rgba(11, 18, 32, 0.85); color: var(--text);
  border-radius: var(--radius-sm);
}
.shorts-card .thumb-duration {
  position: absolute; right: 8px; bottom: 8px;
  padding: 2px 6px;
  font-size: 11px;
  background: rgba(11, 18, 32, 0.85); color: var(--text);
  border-radius: var(--radius-sm);
  font-variant-numeric: tabular-nums;
}
.shorts-card .meta { padding: var(--space-3); }
.shorts-card .meta .title {
  font-size: var(--text-sm); font-weight: 500;
  margin-bottom: 4px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.shorts-card .meta .sub {
  font-size: var(--text-xs); color: var(--text-faint);
}

/* Video Player (상세) */
.video-frame {
  max-width: 380px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border);
}
.video-frame video {
  width: 100%; display: block;
  aspect-ratio: 9 / 16; object-fit: contain;
  background: #000;
}

/* Banner Slider */
.banner-slider {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  margin-bottom: var(--space-6);
}
.banner-slide { display: none; width: 100%; aspect-ratio: 16 / 5; position: relative; }
.banner-slide.active { display: block; }
.banner-slide img { width: 100%; height: 100%; object-fit: cover; }
.banner-slide .caption {
  position: absolute; left: var(--space-5); bottom: var(--space-4);
  font-size: var(--text-md); font-weight: 500;
  color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.6);
}
.banner-dots {
  position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%);
  display: flex; gap: 6px;
}
.banner-dots span {
  width: 6px; height: 6px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.4); cursor: pointer;
  transition: background 0.2s;
}
.banner-dots span.active { background: #fff; }

/* File input (custom) */
.file-input {
  display: block; width: 100%;
  padding: var(--space-3);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: var(--text-sm); color: var(--text-muted);
  cursor: pointer;
}
.file-input input[type="file"] {
  display: block; width: 100%; margin-top: var(--space-2);
  color: var(--text);
}

/* ========== 브랜드 인트로 ========== */
.intro-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: var(--space-4) 0 var(--space-6);
}
.intro-hero {
  text-align: center;
  padding: var(--space-5) 0 var(--space-3);
}
.intro-eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-faint);
}
.intro-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  color: var(--text);
}
.intro-lead {
  font-size: var(--text-lg);
  color: var(--text-muted);
  margin: 0;
}
.intro-lead strong { color: var(--text); font-weight: 600; }

.intro-pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.intro-pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-4);
}
.intro-num {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-bottom: var(--space-2);
}
.intro-name {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text);
  margin-bottom: var(--space-2);
}
.intro-desc {
  font-size: var(--text-sm);
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0;
}

.intro-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-5);
}
.intro-h2 {
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--text);
  margin: 0 0 var(--space-2);
}
.intro-body {
  font-size: var(--text-md);
  color: var(--text);
  line-height: 1.7;
  margin: 0;
}
.intro-body strong { color: var(--text); font-weight: 600; }
.intro-body.muted { color: var(--text-muted); }

.intro-cta {
  text-align: center;
  padding: var(--space-3) 0 var(--space-2);
}
.intro-callout {
  font-size: var(--text-md);
  color: var(--text-muted);
  margin: 0 0 var(--space-3);
}
.intro-callout strong { color: var(--text); font-weight: 600; }

@media (max-width: 640px) {
  .intro-pillars {
    grid-template-columns: 1fr;
  }
  .intro-title { font-size: var(--text-xl); }
  .intro-block { padding: var(--space-4); }
}
