/* ── 기본 리셋 ── */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html, body {
  height: 100%;
}

/* ── 폰트 설정 ── */
@font-face {
  font-family: 'CaChildrenModu';
  src: url('../assets/fonts/cachildren modu.ttf') format('truetype'),
       url('../assets/fonts/cachildren-modu.otf') format('opentype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'MaruBuri';
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.eot');
  src: url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.eot?#iefix') format('embedded-opentype'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.woff2') format('woff2'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.woff') format('woff'),
       url('https://hangeul.pstatic.net/hangeul_static/webfont/MaruBuri/MaruBuri-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

/* ── 로딩 화면 ── */
body.with-loader #loading-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #000000;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  opacity: 1;
  transition: opacity 1s ease-out;
}
body.with-loader #loading-screen.hidden {
  opacity: 0;
  pointer-events: none;
}
.loading-text {
  font-family: 'MaruBuri', sans-serif;
  color: #ffffff;
  font-size: 1vw; /* 뷰포트 너비에 비례 */
  letter-spacing: 0.5em; /* 자간 조정 */
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 1s ease-in;
  max-width: 90%; /* 화면을 넘지 않도록 제한 */
  text-align: center; /* 수평 중앙 보완 */
  margin: 0 auto; /* 추가 중앙 정렬 보완 */
}
#loading-screen.loaded .loading-text {
  opacity: 1;
}

/* ── 본문 콘텐츠 초기 숨김 ── */
body.with-loader > *:not(#loading-screen) {
  opacity: 0;
  transition: opacity 1s ease-in;
}
body.with-loader.loaded > *:not(#loading-screen) {
  opacity: 1;
}

/* ── 전역 ── */
body, button, input, select {
  font-family: 'MaruBuri', sans-serif;
  color: #333;
}

/* ── Header ── */
header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1000;
  border-bottom: 1px solid #ddd;
}

/* Top-bar */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between; /* 왼쪽, 중앙, 오른쪽 배치 */
  padding: 10px 20px;
  position: relative;
}

/* 네비게이션 메뉴 (왼쪽) */
.nav-menu {
  flex: 1; /* 왼쪽 공간 차지 */
  background: #fff;
}
.nav-menu ul {
  display: flex;
  list-style: none;
  padding: 0;
  margin: 0;
}
.nav-menu li {
  margin: 0 10px;
}
.nav-menu a {
  text-decoration: none;
  color: #333;
  font-size: 14px;
}

/* 로고 (중앙) */
.logo {
  flex: none;
  text-align: center;
  display: flex;
  justify-content: center;
}

/* 사용자 액션 (오른쪽) */
.user-actions {
  flex: 1;
  text-align: right;
}
.user-actions a {
  margin-left: 15px;
  text-decoration: none;
  color: #333;
  font-size: 14px;
}

/* 로고 텍스트 */
.logo-text {
  font-size: 1rem;
  color: #333;
  text-decoration: none;
  letter-spacing: 1em;
}
.logo a {
  text-decoration: none;
}

/* 햄버거 (모바일) */
.hamburger {
  display: none;
  font-size: 24px;
  cursor: pointer;
}
/* 기본은 숨김 */
.user-mobile-icon {
  display: none;
}
/* ── Slider 전체 크기 맞춤 ── */
.slider {
  position: relative;
  width: 100%;
  height: calc(100vh - 4vh);
  overflow: hidden;
}

/* 슬라이드 컨테이너 */
.slides {
  height: 100%;
}

/* 각 슬라이드 */
.slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.5s ease-in-out;
}

/* 활성화된 슬라이드 */
.slide.active {
  opacity: 1;
}

/* 이미지 꽉 채우기 */
.slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  min-height: 100%; /* 최소 높이 보장 */
}

/* ── 이전/다음 버튼 & 카운터 ── */
.prev, .next {
  position: absolute;
  bottom: 20px;
  background: none;
  border: none;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  padding: 5px 10px;
}
.prev { left: 20px; }
.next { right: 20px; }

.slide-counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 14px;
}

/* ── Products Grid ── */
.products {
  padding: 20px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 20px;
}
.product-card {
  border: 1px solid #eaeaea;
  padding: 10px;
  position: relative;
  text-align: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-start; /* 이미지와 텍스트가 위에서 아래로 쌓임 */
}
.product-card a{
    color: #333;            /* 아주 진한 회색 */
    text-decoration: none;  /* 밑줄 제거 */
}
.product-card a:hover {
  color: #333;
  text-decoration: none;
}
.product-card-image {
  aspect-ratio: 1 / 1; /* 이미지만 정사각형 */
  overflow: hidden; /* 이미지 오버플로우 방지 */
  margin-bottom: 10px; /* 텍스트와의 간격 */
}
.product-card img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 잘리더라도 정사각형에 맞게 조정 */
}
.product-card h3 {
  font-size: 16px;
  margin: 10px 0;
  flex-shrink: 0;
}
.product-card p {
  font-size: 14px;
  margin-bottom: 10px;
  flex-shrink: 0;
}
.sold-out {
  position: absolute;
  top: 10px;
  left: 10px;
  background: rgba(255,255,255,0.8);
  padding: 5px;
  font-size: 12px;
  color: #999;
}
/* ── Footer ── */
footer {
  background: #f8f8f8;
  padding: 20px;
  text-align: center;
  font-size: 12px;
  color: #666;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ── Mobile 반응형 ── */
/* ── Mobile 반응형 ── */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background: #fff;
    z-index: 1000;
  }
  .nav-menu ul {
    flex-direction: column;
    text-align: center;
  }
  .nav-menu li {
    margin: 10px 0;
  }
  .hamburger {
    display: none;
  }
  .loading-text {
    font-size: 8vw; /* 모바일에서 더 작은 크기 */
    letter-spacing: 0.3em; /* 모바일 자간 조정 */
  }
  .top-bar {
    justify-content: center;   /* 로고 중앙에 */
    position: relative;        /* 자식 절대위치 기준 */
  }
  .user-actions {
    display: none;
  }
  .user-mobile-icon {
    display: block;
    position: absolute;
    right: 20px;               /* 우측에 고정 */
    top: 50%;
    transform: translateY(-50%);
  }
  .nav-menu.active {
    display: block;
  }
}