/* 색상·치수 토큰. 포인트색은 (주)에이스전자 원본의 featured-color hsl(215 100% 30%) */
:root {
  --color-primary: #004099;
  --color-primary-dark: #002a66;
  --color-text: #111827;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --color-bg-soft: #f9fafb;
  --color-footer: #333;
  --container: 1080px;
  --gutter: 16px;
  font-family: 'Noto Sans KR', system-ui, -apple-system, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  color: var(--color-text);
  line-height: 1.6;
  word-break: keep-all;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: #fff; }
img { max-width: 100%; height: auto; }
a { color: inherit; }

.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }

.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: var(--gutter); top: 8px; z-index: 100; padding: 8px 12px; background: var(--color-primary); color: #fff; }

/* 헤더: 모바일은 로고 아래 메뉴 한 줄, 768px 이상은 한 줄 */
.site-header { position: sticky; top: 0; z-index: 10; background: #fff; border-bottom: 1px solid var(--color-border); }
.header-inner { display: flex; flex-direction: column; gap: 4px; padding-top: 12px; padding-bottom: 8px; }
.logo { font-size: 1.25rem; font-weight: 700; color: var(--color-primary); text-decoration: none; }
.site-nav ul { display: flex; justify-content: space-between; margin: 0; padding: 0; list-style: none; }
.site-nav a { display: block; padding: 6px 4px; font-size: 0.9375rem; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { color: var(--color-primary); font-weight: 700; }

@media (min-width: 768px) {
  .header-inner { flex-direction: row; justify-content: space-between; align-items: center; height: 72px; padding-top: 0; padding-bottom: 0; }
  .site-nav ul { gap: 40px; }
  .site-nav a { font-size: 1rem; }
}

/* 배경 사진 위에 남색 오버레이 (홈 히어로 · 서브페이지 배너 공용, 모바일은 작은 이미지) */
.hero, .page-banner {
  --overlay: linear-gradient(120deg, rgba(0, 26, 64, .88), rgba(0, 64, 153, .72));
  background: var(--overlay), url(/images/banner-960.webp) center / cover;
  color: #fff;
}
@media (min-width: 768px) {
  .hero, .page-banner { background-image: var(--overlay), url(/images/banner.webp); }
}

.page-banner { padding: 48px 0; }
.page-banner h1 { margin: 0; font-size: 1.75rem; }
.breadcrumb ol { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 12px 0; list-style: none; font-size: 0.875rem; color: var(--color-muted); }
.breadcrumb li + li::before { content: '›'; margin-right: 8px; }
.breadcrumb a { text-decoration: none; }

.page-body { padding-top: 32px; padding-bottom: 80px; }
.page-lead { margin: 0 0 32px; color: #374151; }
.lead-strong { margin: 0 0 12px; font-size: 1.25rem; font-weight: 700; color: var(--color-primary); }
.muted { color: var(--color-muted); font-size: 0.875rem; }
.center { text-align: center; }

.button { display: inline-block; padding: 10px 20px; border: 1px solid var(--color-primary); border-radius: 6px; background: var(--color-primary); color: #fff; text-decoration: none; }
.button:hover { background: var(--color-primary-dark); }
.button-outline { background: #fff; color: var(--color-primary); }
.button-outline:hover { background: var(--color-bg-soft); }
.button-light { border-color: #fff; background: transparent; }
.button-light:hover { background: rgba(255, 255, 255, .15); }
.button-row { display: flex; flex-wrap: wrap; gap: 8px; }

/* 홈 */
.hero { padding: 72px 0; }
.hero h1 { margin: 8px 0 16px; font-size: 2rem; line-height: 1.3; }
.hero-eyebrow { margin: 0; font-size: 0.9375rem; opacity: .85; }
.hero-lead { margin: 0 0 28px; max-width: 32em; opacity: .9; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; }
@media (min-width: 768px) {
  .hero { padding: 120px 0; }
  .hero h1 { font-size: 2.75rem; }
}

.section { padding: 64px 0; }
.section-soft { background: var(--color-bg-soft); }
.section-title { margin: 0 0 8px; font-size: 1.75rem; color: var(--color-primary); text-align: center; }
.section-lead { margin: 0 0 32px; color: #374151; text-align: center; }

.cert-strip { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin: 0 0 32px; padding: 0; list-style: none; }
.cert-strip li { width: calc((100% - 32px) / 3); max-width: 150px; }
.cert-strip a { display: flex; flex-direction: column; gap: 8px; font-size: 0.8125rem; text-align: center; text-decoration: none; }
.cert-strip img { aspect-ratio: 360 / 509; object-fit: contain; background: #fff; border: 1px solid var(--color-border); box-shadow: 0 4px 12px rgba(0, 0, 0, .08); }

.cs-card { display: grid; gap: 32px; padding: 40px 24px; border-radius: 16px; background: var(--color-primary); color: #fff; }
.cs-card h2 { margin: 0 0 12px; font-size: 1.75rem; }
.cs-info p { margin: 4px 0; }
.cs-card a { color: #fff; }
.cs-links { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; padding: 0; list-style: none; background: rgba(255, 255, 255, .25); }
.cs-links a { display: block; padding: 20px 8px; background: var(--color-primary); font-weight: 700; text-align: center; text-decoration: none; }
.cs-links a:hover { background: var(--color-primary-dark); }
@media (min-width: 768px) {
  .cs-card { grid-template-columns: 1fr 1fr; align-items: center; padding: 56px 64px; }
}

/* 서브페이지 공통 */
.content-section + .content-section { margin-top: 56px; }
.content-title { margin: 0 0 20px; padding-left: 10px; border-left: 4px solid var(--color-primary); font-size: 1.25rem; color: var(--color-primary); }

.info-table, .spec-table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--color-text); font-size: 0.9375rem; }
.info-table th, .info-table td, .spec-table th, .spec-table td { padding: 12px; border-bottom: 1px solid var(--color-border); text-align: left; vertical-align: top; }
.info-table th, .spec-table tbody th { width: 30%; background: var(--color-bg-soft); font-weight: 700; white-space: nowrap; }
.spec-table thead th { background: #eef2f9; }
.spec-table caption { padding: 16px 0 8px; font-weight: 700; text-align: left; }
.table-scroll { overflow-x: auto; }
/* 비교표(열 4개)는 모바일에서도 한 화면에 들어오도록 */
.spec-compare { table-layout: fixed; font-size: 0.8125rem; }
.spec-compare th, .spec-compare td { padding: 8px 6px; }
.spec-compare tbody th { width: auto; white-space: normal; }
@media (min-width: 768px) {
  .spec-compare { font-size: 0.9375rem; }
  .spec-compare th, .spec-compare td { padding: 12px; }
}
.table-scroll + .table-scroll { margin-top: 16px; }
.info-table a { white-space: nowrap; }
.address { margin: 0 0 16px; font-size: 1.0625rem; font-weight: 700; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 32px; }
.chips a { padding: 6px 14px; border: 1px solid var(--color-border); border-radius: 999px; font-size: 0.875rem; text-decoration: none; }
.chips a:hover { border-color: var(--color-primary); color: var(--color-primary); }
.chips a[aria-current] { border-color: var(--color-primary); background: var(--color-primary); color: #fff; font-weight: 700; }

/* 제품 카드 */
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .card-grid { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
.card { border: 1px solid var(--color-border); border-radius: 8px; background: #fff; overflow: hidden; }
.card > a { display: block; height: 100%; text-decoration: none; }
.card > a:hover { box-shadow: 0 6px 16px rgba(0, 0, 0, .08); }
.card > a:hover strong { color: var(--color-primary); }
.card-img { display: grid; place-items: center; aspect-ratio: 1; background: var(--color-bg-soft); }
.card-img img { width: 100%; }
.card-body { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px 16px; }
.card-body strong { font-size: 1.0625rem; }
.card-body span { font-size: 0.875rem; color: var(--color-muted); }

/* 제품 상세 */
.product-top { display: grid; gap: 32px; margin-bottom: 56px; }
@media (min-width: 768px) { .product-top { grid-template-columns: 2fr 3fr; align-items: start; } }
.product-img { border: 1px solid var(--color-border); border-radius: 8px; background: var(--color-bg-soft); }
.product-img img { display: block; width: 100%; }
.badges { display: flex; gap: 6px; margin: 0 0 8px; }
.badge { padding: 2px 8px; border-radius: 4px; background: #15803d; color: #fff; font-size: 0.75rem; font-weight: 700; }
.badge + .badge { background: #0369a1; }
.product-name { margin: 0 0 24px; font-size: 1.375rem; font-weight: 700; }
.info-title { margin: 24px 0 8px; font-size: 1rem; }
.feature-list { margin: 0; padding-left: 20px; }
.cert-list { margin: 0; padding: 0; list-style: none; }
.cert-list li { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 12px; border: 1px solid var(--color-border); border-radius: 8px; }
.cert-list li + li { margin-top: 8px; }
.cert-list .muted { display: block; }
.cert-links { display: flex; flex-wrap: wrap; gap: 12px; font-size: 0.875rem; }
.cert-links a { color: var(--color-primary); }
.product-info .button-row { margin-top: 24px; }

/* 인증 · 승인 */
.cert-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 24px; margin: 0; padding: 0; list-style: none; }
@media (min-width: 768px) { .cert-grid { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); } }
.cert-card { display: flex; flex-direction: column; gap: 4px; }
.cert-thumb { display: block; margin-bottom: 8px; }
.cert-thumb img { display: block; width: 100%; aspect-ratio: 360 / 509; object-fit: contain; background: #fff; border: 1px solid var(--color-border); box-shadow: 0 4px 12px rgba(0, 0, 0, .08); }
.cert-thumb:hover img { outline: 2px solid var(--color-primary); }

.viewer { width: min(92vw, 820px); max-height: 92vh; padding: 0; border: 0; border-radius: 8px; overflow: auto; }
.viewer::backdrop { background: rgba(0, 0, 0, .7); }
.viewer img { display: block; width: 100%; height: auto; }
.viewer form { position: sticky; top: 0; height: 0; text-align: right; }
.viewer-close { margin: 8px; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; font-size: 1.125rem; cursor: pointer; }

/* 고객지원 */
.contact-grid { display: grid; gap: 16px; margin: 0 0 56px; padding: 0; list-style: none; }
@media (min-width: 900px) { .contact-grid { grid-template-columns: repeat(3, 1fr); } }
.contact-card { display: flex; flex-direction: column; padding: 24px; border: 1px solid var(--color-border); border-top: 4px solid var(--color-primary); border-radius: 8px; }
.contact-card h2 { margin: 0 0 8px; font-size: 1.25rem; }
.contact-card p { margin: 0 0 12px; }
.contact-card .button-row { margin-top: auto; }

.not-found { text-align: center; }

/* 푸터 */
.site-footer { padding: 40px 0; background: var(--color-footer); color: #d1d5db; font-size: 0.875rem; }
.footer-name { margin: 0 0 12px; font-size: 1rem; font-weight: 700; color: #fff; }
.footer-info { display: flex; flex-wrap: wrap; gap: 4px 16px; margin: 0; padding: 0; list-style: none; }
.footer-info a { text-decoration: none; }
.copyright { margin: 16px 0 0; color: #9ca3af; }
