/* ==========================================================================
   FROM K CAR - 공통 스타일
   ========================================================================== */

:root {
  --fk-navy: #0b1f3a;
  --fk-navy-light: #12294d;
  --fk-blue: #2563eb;
  --fk-blue-light: #3b82f6;
  --fk-gold: #d4af37;
  --fk-gray-50: #f8f9fb;
  --fk-gray-100: #eef1f5;
  --fk-gray-200: #e2e6ec;
  --fk-gray-400: #9aa5b1;
  --fk-gray-600: #5b6572;
  --fk-gray-800: #2b3340;
  --fk-red: #e11d48;
  --fk-green: #16a34a;
  --shadow-card: 0 4px 16px rgba(11, 31, 58, 0.08);
  --shadow-card-hover: 0 12px 28px rgba(11, 31, 58, 0.16);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

* { box-sizing: border-box; }

html, body {
  font-family: 'Pretendard', 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--fk-gray-50);
  color: var(--fk-gray-800);
  scroll-behavior: smooth;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--fk-gray-100); }
::-webkit-scrollbar-thumb { background: var(--fk-gray-400); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--fk-gray-600); }

a { text-decoration: none; color: inherit; }

/* ---------------- 로고 / 헤더 ---------------- */
.fk-logo {
  font-family: 'Poppins', 'Pretendard', sans-serif;
  font-weight: 800;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
}
.fk-logo .fk-logo-from { color: var(--fk-gray-400); font-weight: 600; font-size: 0.5em; letter-spacing: 0.15em; text-transform: uppercase; margin-right: 6px; }
.fk-logo .fk-logo-k { color: var(--fk-gold); }
.fk-logo .fk-logo-car { color: #ffffff; }

.fk-header {
  background: #000000;
  box-shadow: 0 2px 20px rgba(0,0,0,0.35);
}

/* ---------------- 업로드 로고 배지 ---------------- */
.fk-logo-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 8px;
  padding: 4px 6px;
  transition: transform .2s ease, opacity .2s ease;
}
.fk-logo-badge:hover { transform: translateY(-1px); opacity: 0.9; }
.fk-logo-badge img {
  height: 34px;
  width: auto;
  display: block;
}
.fk-logo-badge-footer {
  background: #000000;
  border-radius: 8px;
  padding: 6px 12px;
}
.fk-logo-badge-footer img { height: 24px; }

.fk-nav-link {
  color: rgba(255,255,255,0.75);
  font-weight: 500;
  font-size: 14px;
  padding: 8px 14px;
  border-radius: 999px;
  transition: all .2s ease;
}
.fk-nav-link:hover, .fk-nav-link.active {
  color: #fff;
  background: rgba(255,255,255,0.12);
}

/* ---------------- ADMIN 드롭다운 메뉴 ---------------- */
.admin-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--fk-gray-800);
  transition: background .15s ease;
}
.admin-menu-item:hover { background: var(--fk-gray-50); }
.admin-menu-item + .admin-menu-item { border-top: 1px solid var(--fk-gray-100); }

/* ---------------- 히어로 ---------------- */
.fk-hero {
  background: radial-gradient(circle at 20% 20%, rgba(59,130,246,0.25), transparent 45%),
              radial-gradient(circle at 80% 0%, rgba(212,175,55,0.18), transparent 40%),
              linear-gradient(160deg, var(--fk-navy) 0%, #0f2847 60%, var(--fk-navy-light) 100%);
  position: relative;
  overflow: hidden;
}
.fk-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                     linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 32px 32px;
  pointer-events: none;
}

/* ---------------- 카드 ---------------- */
.car-card {
  background: #fff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform .25s ease, box-shadow .25s ease;
  border: 1px solid var(--fk-gray-200);
  display: flex;
  flex-direction: column;
}
.car-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-card-hover);
}
.car-card-img-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: var(--fk-gray-100);
}
.car-card-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.car-card:hover .car-card-img-wrap img { transform: scale(1.07); }

.car-card-count {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(11,31,58,0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 4px;
  backdrop-filter: blur(2px);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 999px;
  letter-spacing: 0.02em;
}
.badge-blue { background: rgba(37,99,235,0.1); color: var(--fk-blue); }
.badge-gold { background: rgba(212,175,55,0.15); color: #a3821e; }
.badge-green { background: rgba(22,163,74,0.1); color: var(--fk-green); }
.badge-gray { background: var(--fk-gray-100); color: var(--fk-gray-600); }
.badge-red { background: rgba(225,29,72,0.1); color: var(--fk-red); }
.badge-nosplit {
  background: var(--fk-green);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 8px rgba(22,163,74,0.45);
  border: 1px solid rgba(255,255,255,0.4);
}

.spec-chip {
  background: var(--fk-gray-100);
  color: var(--fk-gray-600);
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 8px;
  font-weight: 500;
}

/* ---------------- 버튼 ---------------- */
.btn-primary {
  background: linear-gradient(135deg, var(--fk-blue) 0%, #1d4ed8 100%);
  color: #fff;
  font-weight: 600;
  border-radius: 10px;
  padding: 10px 22px;
  transition: all .2s ease;
  box-shadow: 0 4px 14px rgba(37,99,235,0.35);
}
.btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn-secondary {
  background: #fff;
  color: var(--fk-navy);
  font-weight: 600;
  border: 1.5px solid var(--fk-gray-200);
  border-radius: 10px;
  padding: 10px 22px;
  transition: all .2s ease;
}
.btn-secondary:hover { border-color: var(--fk-blue); color: var(--fk-blue); }
.btn-danger {
  background: rgba(225,29,72,0.08);
  color: var(--fk-red);
  font-weight: 600;
  border-radius: 8px;
  padding: 8px 14px;
  transition: all .2s ease;
}
.btn-danger:hover { background: rgba(225,29,72,0.16); }

/* ---------------- 로딩 스피너 ---------------- */
.fk-spinner {
  width: 20px; height: 20px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: fk-spin .7s linear infinite;
}
.fk-spinner-dark {
  border: 3px solid rgba(37,99,235,0.2);
  border-top-color: var(--fk-blue);
}
@keyframes fk-spin { to { transform: rotate(360deg); } }

/* ---------------- 스켈레톤 ---------------- */
.skeleton {
  background: linear-gradient(90deg, var(--fk-gray-100) 25%, var(--fk-gray-200) 37%, var(--fk-gray-100) 63%);
  background-size: 400% 100%;
  animation: fk-shimmer 1.4s ease infinite;
}
@keyframes fk-shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- 상세페이지 이미지 갤러리 ---------------- */
.gallery-main {
  position: relative;
  width: 100%;
  aspect-ratio: 4/3;
  max-height: 46vh;
  background: #0b1f3a;
  overflow: hidden;
}
.gallery-main img {
  width: 100%; height: 100%;
  object-fit: contain;
  background: #0b1f3a;
}
.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.9);
  border-radius: 50%;
  width: 42px; height: 42px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  cursor: pointer;
  transition: all .2s ease;
  color: var(--fk-navy);
  z-index: 5;
}
.gallery-nav-btn:hover { background: #fff; transform: translateY(-50%) scale(1.08); }
.gallery-counter {
  position: absolute;
  bottom: 14px; right: 14px;
  background: rgba(11,31,58,0.75);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 999px;
}
.thumb-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 2px 10px;
  scrollbar-width: thin;
}
.thumb-strip img {
  width: 92px; height: 68px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
  flex-shrink: 0;
  border: 2px solid transparent;
  transition: all .15s ease;
  opacity: 0.75;
}
.thumb-strip img:hover { opacity: 1; }
.thumb-strip img.active { border-color: var(--fk-blue); opacity: 1; }

/* ---------------- 스펙 테이블 ---------------- */
.spec-table {
  width: 100%;
  border-collapse: collapse;
}
.spec-table tr { border-bottom: 1px solid var(--fk-gray-200); }
.spec-table tr:last-child { border-bottom: none; }
.spec-table th {
  text-align: left;
  color: var(--fk-gray-600);
  font-weight: 500;
  font-size: 13px;
  padding: 12px 14px 12px 0;
  width: 110px;
  white-space: nowrap;
}
.spec-table td {
  font-weight: 700;
  font-size: 14px;
  padding: 12px 0;
  color: var(--fk-gray-800);
}

/* ---------------- 옵션 태그 ---------------- */
.option-tag {
  background: var(--fk-gray-50);
  border: 1px solid var(--fk-gray-200);
  color: var(--fk-gray-800);
  font-size: 13px;
  font-weight: 500;
  padding: 8px 14px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---------------- 관리자 페이지 ---------------- */
.admin-drop-zone {
  border: 2px dashed var(--fk-gray-200);
  border-radius: var(--radius-md);
  transition: all .2s ease;
}
.admin-drop-zone.drag-over {
  border-color: var(--fk-blue);
  background: rgba(37,99,235,0.04);
}
.admin-table th {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--fk-gray-600);
  font-weight: 700;
}
.admin-table tr:hover td { background: var(--fk-gray-50); }
.step-num {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--fk-blue);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700;
  flex-shrink: 0;
}

/* ---------------- 토스트 ---------------- */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fk-toast {
  min-width: 260px;
  max-width: 360px;
  background: var(--fk-navy);
  color: #fff;
  padding: 14px 16px;
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  font-size: 14px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  animation: fk-toast-in .25s ease;
}
.fk-toast.success { border-left: 4px solid var(--fk-green); }
.fk-toast.error { border-left: 4px solid var(--fk-red); }
.fk-toast.info { border-left: 4px solid var(--fk-blue-light); }
@keyframes fk-toast-in { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

/* ---------------- 유틸 ---------------- */
.fade-in { animation: fk-fade-in .4s ease; }
@keyframes fk-fade-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.shake { animation: fk-shake .4s ease; }
@keyframes fk-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-6px); }
  80% { transform: translateX(6px); }
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
