@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.min.css");

/* CSS 변수 */
:root {
  --color-primary: #0054a6;
  --color-primary-light: #3b82f6;
  --color-text: #1a1a1a;
  --color-text-sub: #666666;
  --color-bg: #ffffff;
  --color-bg-section: #f8f9fa;
  --color-border: #e5e7eb;
  --header-height: 80px;

  --font-xs: 0.875rem;
  --font-sm: 1rem;
  --font-md: 1.1rem;
  --font-lg: 1.25rem;
  --font-xl: 1.75rem;
  --font-2xl: 2rem;
}

/* 스크린리더 전용 (시각적 숨김, SEO용 h1 등) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* 기본 리셋 */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Pretendard", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button { cursor: pointer; border: none; background: none; font-family: inherit; padding: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, h4, h5, h6, p { margin: 0; }
input, select, textarea { font-family: inherit; }

/* 컨테이너 */
.container { max-width: 1200px; margin: 0 auto; padding: 0 20px; }

/* 섹션 공통 */
.section { padding: 80px 0; }
.section-title { font-size: var(--font-2xl); font-weight: 700; color: var(--color-text); margin-bottom: 12px; }
.section-subtitle { font-size: var(--font-md); color: var(--color-text-sub); margin-bottom: 48px; }

/* 버튼 */
.btn-primary {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--color-primary); color: #fff;
  font-size: var(--font-md); font-weight: 600;
  padding: 14px 32px; border-radius: 4px;
  transition: background 0.2s, transform 0.2s;
}
.btn-primary:hover { background: #003d82; transform: translateY(-2px); }

/* Fade-up 애니메이션 */
.fade-up {
  opacity: 0; transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.fade-up.visible { opacity: 1; transform: translateY(0); }

/* 서브페이지 공통 헤더 */
.page-header-bg {
  position: relative; overflow: hidden;
  padding: calc(var(--header-height) + 64px) 0 44px;
  background-size: cover; background-position: center;
}
.page-header-bg::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0.45) 50%, rgba(0,0,0,0.55) 100%);
}
.page-header-bg .container { position: relative; z-index: 1; text-align: center; }
.page-header-bg h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem); font-weight: 800; color: #fff; margin-bottom: 8px;
}
.page-header-bg p {
  font-size: var(--font-sm); color: rgba(255,255,255,0.8);
}

/* 카드 호버 효과 */
.feature-card {
  background: #fff; border-radius: 12px; padding: 32px 24px; text-align: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
}
.feature-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,84,166,0.12); }

/* 호버카드 (product, work 등) */
.hover-card {
  transition: transform 0.2s, box-shadow 0.2s;
}
.hover-card:hover { transform: translateY(-4px); box-shadow: 0 8px 30px rgba(0,84,166,0.12); }

/* ===== Swiper 커스텀 ===== */
/* 메인 슬라이더 */
.main-slider .swiper-pagination-bullet {
  background: rgba(255,255,255,0.6) !important; opacity: 1 !important;
  width: 10px !important; height: 10px !important;
}
.main-slider .swiper-pagination-bullet-active {
  background: #fff !important; width: 28px !important;
  border-radius: 5px !important; transition: width 0.3s !important;
}

/* 헤더 전화 버튼 호버 */
.header-phone-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(0,0,0,0.25) !important;
  background: linear-gradient(135deg, #1a1a1a 0%, #444 100%) !important;
  border-color: transparent !important;
  backdrop-filter: none !important;
}

/* 헤더 반응형 */
@media (max-width: 1024px) {
  .desktop-nav { display: none !important; }
  .mobile-menu-btn { display: flex !important; }
}

/* 푸터 블로그 링크 */
.footer-blog-link { flex-shrink: 0; opacity: 0.8; transition: opacity 0.2s; }
.footer-blog-link:hover { opacity: 1; }

/* 상담폼 input */
.contact-input::placeholder { color: rgba(255,255,255,0.5); }
.contact-input:focus {
  border-color: rgba(255,255,255,0.7) !important;
  background: rgba(255,255,255,0.18) !important;
  outline: none;
}

/* IntroSection 반응형 그리드 */
@media (max-width: 768px) {
  .intro-stats-grid { grid-template-columns: 1fr !important; }
}

/* FactoryShowcase 반응형 */
@media (max-width: 900px) {
  .factory-top-grid { grid-template-columns: 1fr !important; }
}

/* ===== 장치품목 ===== */
.device-nav-sidebar {
  display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 100px; align-self: flex-start;
  min-width: 180px; flex-shrink: 0;
}
.device-nav-link {
  padding: 10px 16px; font-size: var(--font-sm);
  color: var(--color-text-sub); border: none; border-left: 3px solid transparent;
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  border-radius: 0 6px 6px 0; cursor: pointer;
  background: none; text-align: left; display: block; width: 100%;
  font-family: inherit; margin-bottom: 4px;
}
.device-nav-link:hover { color: var(--color-text); background: var(--color-bg-section); }
.device-nav-link.active {
  color: var(--color-primary); font-weight: 700;
  border-left-color: var(--color-primary);
  background: rgba(0,84,166,0.06);
}

.device-nav-pills {
  display: none; gap: 8px; overflow-x: auto;
  padding-bottom: 12px; margin-bottom: 24px;
  -webkit-overflow-scrolling: touch; scrollbar-width: none;
}
.device-nav-pills::-webkit-scrollbar { display: none; }

.device-pill {
  padding: 8px 18px; border-radius: 20px; font-size: var(--font-xs);
  white-space: nowrap; border: 1px solid var(--color-border);
  color: var(--color-text-sub); background: #fff;
  transition: all 0.2s; flex-shrink: 0; cursor: pointer;
}
.device-pill:hover { border-color: var(--color-primary); color: var(--color-primary); background: rgba(0,84,166,0.05); }
.device-pill.active { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.device-pill.active:hover { background: #003d82; }

.device-item-card {
  background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05); border: 1px solid var(--color-border);
  transition: transform 0.2s, box-shadow 0.2s;
}
.device-item-card:hover { transform: translateY(-3px); box-shadow: 0 8px 24px rgba(0,84,166,0.1); }

@media (max-width: 768px) {
  .device-nav-sidebar { display: none !important; }
  .device-nav-pills { display: flex !important; }
  .device-content-wrapper { flex-direction: column !important; }
}

@media (max-width: 768px) {
  /* 모바일에서 섹션 상하 여백 축소 */
  .device-page-section { padding: 40px 0 32px !important; }
}

/* 스크롤바 */
::-webkit-scrollbar { width: 12px; }
::-webkit-scrollbar-track { background: #f1f1f1; }
::-webkit-scrollbar-thumb { background: #aaa; border-radius: 6px; border: 2px solid #f1f1f1; }
::-webkit-scrollbar-thumb:hover { background: #888; }

/* ===== 메인 슬라이더 ===== */
.main-slider {
  position: relative; width: 100%; height: 100vh; min-height: 560px; overflow: hidden;
}
.main-slider .swiper, .main-slider .swiper-wrapper, .main-slider .swiper-slide {
  width: 100%; height: 100%;
}
.main-slider .swiper-button-prev,
.main-slider .swiper-button-next {
  color: rgba(255,255,255,0.8); transition: color 0.2s;
}
.main-slider .swiper-button-prev:hover,
.main-slider .swiper-button-next:hover { color: #fff; }
.main-slider .swiper-pagination { bottom: 24px !important; }

.slide-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
}
.slide-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.35) 0%, rgba(0,0,0,0.2) 50%, rgba(0,0,0,0.4) 100%);
  z-index: 1;
}
.slide-typing-layer {
  position: absolute; inset: 0; z-index: 3;
  display: flex; align-items: center; pointer-events: none;
}
.slide-typing-inner {
  width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 40px;
}
.slide-sub-text {
  display: block; font-size: clamp(1.2rem, 2.5vw, 1.7rem);
  color: rgba(255,255,255,0.92); margin-bottom: 2px;
  letter-spacing: 0.01em; font-weight: 400; line-height: 1.5;
}
.slide-title-text {
  display: block; font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 800; color: #fff; letter-spacing: -0.02em; line-height: 1.2;
}
.type-char {
  display: inline-block; opacity: 0; filter: blur(4px); transform: translateY(6px);
  animation: charReveal ease-out forwards;
}
@keyframes charReveal {
  0% { opacity: 0; filter: blur(4px); transform: translateY(6px); }
  60% { filter: blur(0); }
  100% { opacity: 1; filter: blur(0); transform: translateY(0); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@media (max-width: 768px) {
  .slide-typing-inner { padding: 0 24px; }
}

/* ===== 상담 패널 반응형 ===== */
@media (min-width: 768px) {
  .consult-panel-mobile, .consult-panel-mobile-dim { display: none !important; }
}
@media (max-width: 767px) {
  .consult-panel-desktop { display: none !important; }
}

/* ===== 페이지네이션 ===== */
.pagination {
  display: flex; align-items: center; justify-content: center; gap: 4px; margin-top: 48px;
}
.pagination a, .pagination span {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 36px; height: 36px; padding: 0 10px;
  border-radius: 6px; font-size: var(--font-xs); font-weight: 500;
  color: var(--color-text-sub); transition: all 0.2s;
}
.pagination a:hover { background: var(--color-bg-section); color: var(--color-text); }
.pagination .active {
  background: var(--color-primary); color: #fff; font-weight: 700;
}
.pagination .disabled { opacity: 0.4; pointer-events: none; }

/* panel input */
.panel-input {
  width: 100%; padding: 12px 14px; background: #fff;
  border: 1.5px solid var(--color-border); border-radius: 8px;
  color: var(--color-text); font-size: var(--font-xs);
  outline: none; transition: border-color 0.2s;
}
.panel-input:focus { border-color: var(--color-primary); }

/* ===== 팝업 위치 ===== */
#popup-modal.popup-center {
  display: flex; align-items: center; justify-content: center;
}
#popup-modal.popup-corner {
  display: block; background: none; pointer-events: none;
}
#popup-modal.popup-corner > div { pointer-events: auto; }
#popup-modal.popup-top-left > div { position: fixed; top: 20px; left: 20px; }
#popup-modal.popup-top-right > div { position: fixed; top: 20px; right: 20px; }
#popup-modal.popup-bottom-left > div { position: fixed; bottom: 80px; left: 20px; }
#popup-modal.popup-bottom-right > div { position: fixed; bottom: 80px; right: 20px; }

@media (max-width: 768px) {
  #popup-modal.popup-top-left > div,
  #popup-modal.popup-top-right > div { top: 10px; left: 10px; right: 10px; max-width: calc(100% - 20px) !important; }
  #popup-modal.popup-bottom-left > div,
  #popup-modal.popup-bottom-right > div { bottom: 80px; left: 10px; right: 10px; max-width: calc(100% - 20px) !important; }
}
