* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo", "Malgun Gothic", "Pretendard", "Noto Sans CJK KR", sans-serif;
  background: #fff;
  color: #1f2937;
  font-size: 15px;
  line-height: 1.6;
}
a { color: #1d4ed8; text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 15px; }
img { max-width: 100%; height: auto; display: block; }

/* Header */
.nav-bar {
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  padding: 16px 24px;
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-bar .brand { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; }
.nav-bar .brand a { color: #111827; }
.nav-bar .brand .accent { color: #2563eb; }
.nav-bar .menu { display: flex; gap: 24px; font-size: 14px; }
.nav-bar .menu a { color: #4b5563; font-weight: 500; }
.nav-bar .menu a:hover { color: #2563eb; }

/* Hero */
.hero {
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
  color: #fff;
  padding: 80px 24px 100px;
  text-align: center;
}
.hero h1 { font-size: 38px; margin: 0 0 16px 0; font-weight: 800; letter-spacing: -0.02em; }
.hero p { font-size: 17px; opacity: 0.92; margin: 0 0 24px 0; }
.hero .cta { display: inline-block; padding: 12px 28px; background: #fff; color: #1d4ed8; border-radius: 8px; font-weight: 700; }
.hero .cta:hover { background: #eff6ff; text-decoration: none; }

.container { max-width: 1200px; margin: 0 auto; padding: 48px 24px; }
.section-title { font-size: 24px; font-weight: 700; margin: 0 0 20px 0; color: #111827; }
.section-title .sub { font-size: 14px; color: #6b7280; font-weight: 400; margin-left: 10px; }

/* Categories grid */
.cat-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.cat-card {
  display: block; padding: 24px 20px; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 12px; text-align: center; color: #1f2937; transition: all 0.15s;
}
.cat-card:hover { background: #eff6ff; border-color: #93c5fd; transform: translateY(-2px); text-decoration: none; }
.cat-card .icon { font-size: 32px; margin-bottom: 8px; }
.cat-card .name { font-weight: 700; font-size: 15px; }
.cat-card .count { color: #6b7280; font-size: 13px; margin-top: 4px; }

/* Product grid */
.prod-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
}
.prod-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; overflow: hidden;
  transition: all 0.15s; display: block; color: inherit;
}
.prod-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,0.08); text-decoration: none; }
.prod-card .img-wrap {
  width: 100%; aspect-ratio: 1;
  background: #f3f4f6; display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.prod-card .img-wrap img { width: 100%; height: 100%; object-fit: contain; padding: 12px; }
.prod-card .img-wrap .placeholder { color: #d1d5db; font-size: 48px; }
.prod-card .info { padding: 14px 16px; }
.prod-card .cat { color: #2563eb; font-size: 12px; font-weight: 600; }
.prod-card .model { font-size: 15px; font-weight: 700; color: #111827; margin-top: 4px; }
.prod-card .desc { color: #6b7280; font-size: 13px; margin-top: 6px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.prod-card .price { color: #dc2626; font-weight: 700; font-size: 16px; margin-top: 8px; }
.prod-card .badge-feat {
  position: absolute; top: 8px; right: 8px; padding: 2px 8px;
  background: #fbbf24; color: #fff; font-size: 11px; font-weight: 700; border-radius: 4px;
}

/* Filter bar */
.filter-bar { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; align-items: center; }
.filter-bar select, .filter-bar input {
  padding: 8px 12px; border: 1px solid #d1d5db; border-radius: 6px; background: #fff;
}
.filter-bar .grow { flex: 1; min-width: 200px; }
.filter-bar .pill {
  padding: 6px 14px; border-radius: 999px; background: #f3f4f6; color: #4b5563;
  font-size: 13px; text-decoration: none;
}
.filter-bar .pill:hover { background: #e5e7eb; text-decoration: none; }
.filter-bar .pill.active { background: #2563eb; color: #fff; }

/* Product detail */
.detail-wrap {
  display: grid; grid-template-columns: 1fr 1fr; gap: 40px;
}
@media (max-width: 800px) { .detail-wrap { grid-template-columns: 1fr; } }
.gallery .main-img {
  width: 100%; aspect-ratio: 1; background: #f9fafb; border: 1px solid #e5e7eb;
  border-radius: 12px; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.gallery .main-img img { width: 100%; height: 100%; object-fit: contain; padding: 24px; }
.gallery .main-img .placeholder { color: #d1d5db; font-size: 80px; }
.gallery .thumbs { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.gallery .thumb {
  width: 64px; height: 64px; border: 2px solid #e5e7eb; border-radius: 6px; overflow: hidden;
  background: #fff; cursor: pointer; padding: 4px;
}
.gallery .thumb.active { border-color: #2563eb; }
.gallery .thumb img { width: 100%; height: 100%; object-fit: contain; }
.detail-info h1 { margin: 0 0 8px 0; font-size: 28px; font-weight: 800; }
.detail-info .cat-tag { display: inline-block; padding: 3px 10px; background: #dbeafe; color: #1e40af; border-radius: 4px; font-size: 12px; font-weight: 600; margin-bottom: 12px; }
.detail-info .series { color: #6b7280; margin-bottom: 12px; }
.detail-info .price { font-size: 26px; color: #dc2626; font-weight: 800; margin: 16px 0 4px; }
.detail-info .price-note { color: #6b7280; font-size: 13px; margin-bottom: 16px; }
.detail-info .short-desc { color: #374151; line-height: 1.6; margin: 16px 0; }
.detail-info .cta-row { display: flex; gap: 8px; margin: 20px 0; }
.detail-info .btn-inquire { padding: 12px 24px; background: #2563eb; color: #fff; border: none; border-radius: 8px; font-weight: 700; font-size: 15px; }
.detail-info .btn-inquire:hover { background: #1d4ed8; }
.detail-section { margin-top: 32px; padding-top: 24px; border-top: 1px solid #e5e7eb; }
.detail-section h2 { font-size: 18px; margin: 0 0 12px 0; }
.detail-section .content {
  white-space: pre-wrap; word-break: break-word; color: #374151;
}
.spec-table { width: 100%; border-collapse: collapse; }
.spec-table td { padding: 8px 12px; border-bottom: 1px solid #f3f4f6; vertical-align: top; }
.spec-table td.label { color: #6b7280; width: 30%; }

/* Inquiry modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal {
  background: #fff; border-radius: 12px; max-width: 480px; width: 100%;
  max-height: 90vh; overflow: auto;
}
.modal .head { padding: 18px 24px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.modal .head h3 { margin: 0; font-size: 18px; }
.modal .close { background: none; border: none; font-size: 24px; color: #6b7280; cursor: pointer; }
.modal .body { padding: 20px 24px; }
.modal .footer { padding: 14px 24px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; gap: 8px; }

.field { margin-bottom: 14px; }
.field label { display: block; margin-bottom: 4px; font-weight: 600; font-size: 13px; color: #374151; }
.field input[type="text"], .field input[type="email"], .field input[type="password"], .field input[type="tel"], .field input[type="number"], .field select, .field textarea {
  width: 100%; padding: 9px 11px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 14px;
}
.field textarea { resize: vertical; min-height: 90px; }

.btn {
  padding: 9px 16px; border: 1px solid #d1d5db; background: #fff; color: #374151;
  border-radius: 6px; font-size: 14px; font-weight: 500;
}
.btn:hover { background: #f9fafb; }
.btn-primary { background: #2563eb; color: #fff; border-color: #2563eb; }
.btn-primary:hover { background: #1d4ed8; }
.btn-danger { background: #fff; color: #dc2626; border-color: #fecaca; }
.btn-danger:hover { background: #fef2f2; }
.btn-sm { padding: 5px 11px; font-size: 13px; }

.footer-site {
  background: #1f2937; color: #9ca3af; padding: 32px 24px; text-align: center; font-size: 13px;
}
.footer-site a { color: #d1d5db; }
.footer-site .links { margin-bottom: 12px; }
.footer-site .links a { margin: 0 12px; }

.empty { text-align: center; color: #9ca3af; padding: 48px 20px; }

.muted { color: #9ca3af; }
.small { font-size: 13px; }

.toast {
  position: fixed; top: 20px; right: 20px; padding: 12px 18px;
  background: #1f2937; color: #fff; border-radius: 8px; z-index: 200;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.toast.error { background: #dc2626; }
.toast.success { background: #16a34a; }

/* Admin layout */
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-side { background: #1f2937; color: #fff; padding: 20px 0; }
.admin-side .brand { padding: 0 20px 20px; border-bottom: 1px solid #374151; font-weight: 700; }
.admin-side .brand a { color: #fff; }
.admin-side .brand .accent { color: #60a5fa; }
.admin-side nav a {
  display: block; padding: 11px 20px; color: #d1d5db; font-size: 14px;
}
.admin-side nav a:hover { background: #374151; color: #fff; text-decoration: none; }
.admin-side nav a.active { background: #2563eb; color: #fff; }
.admin-side .user-area { padding: 20px; border-top: 1px solid #374151; margin-top: 20px; color: #9ca3af; font-size: 13px; }
.admin-side .user-area a { color: #d1d5db; }
.admin-main { padding: 24px 32px; background: #f4f5f7; min-height: 100vh; }
.admin-main h1 { margin-top: 0; font-size: 22px; }
.admin-card { background: #fff; border: 1px solid #e5e7eb; border-radius: 8px; padding: 18px; margin-bottom: 16px; }
.admin-toolbar { display: flex; gap: 8px; margin-bottom: 14px; flex-wrap: wrap; align-items: center; }
.admin-table { width: 100%; border-collapse: collapse; }
.admin-table th, .admin-table td { padding: 10px 12px; text-align: left; border-bottom: 1px solid #f3f4f6; }
.admin-table th { background: #f9fafb; font-size: 13px; color: #374151; }
.admin-table tr:hover td { background: #fafafa; }
.badge-status { padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.badge-new { background: #fef3c7; color: #92400e; }
.badge-in_progress { background: #dbeafe; color: #1e40af; }
.badge-done { background: #dcfce7; color: #166534; }
@media (max-width: 800px) {
  .admin-shell { grid-template-columns: 1fr; }
  .admin-side { display: none; }
}

/* Login */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: #f4f5f7; padding: 20px; }
.login-card { width: 100%; max-width: 380px; background: #fff; border-radius: 12px; padding: 32px; box-shadow: 0 4px 12px rgba(0,0,0,0.05); }
.login-card h1 { margin: 0 0 24px 0; text-align: center; font-size: 20px; }
.login-card .accent { color: #2563eb; }
.login-card .btn-primary { width: 100%; padding: 11px; font-size: 15px; }
