/* 공통 변수 */
:root {
  --primary-color: #4a6cf7;
  --secondary-color: #6c757d;
  --success-color: #28a745;
  --danger-color: #dc3545;
  --light-color: #f8f9fa;
  --dark-color: #343a40;
  --white: #ffffff;
  --gray-100: #f8f9fa;
  --gray-200: #e9ecef;
  --gray-300: #dee2e6;
  --gray-400: #ced4da;
  --gray-500: #adb5bd;
  --gray-600: #6c757d;
  --gray-700: #495057;
  --gray-800: #343a40;
  --gray-900: #212529;
  --font-sans: 'Noto Sans KR', sans-serif;
}

/* 기본 스타일 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-sans);
  line-height: 1.6;
  color: var(--gray-800);
  background-color: #fff;
}

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 15px;
}

/* 헤더 스타일 */
.header {
  width: 100%;
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 70px;
}

.logo a {
  display: inline-block;
}

.logo img {
  height: 60px;       /* 기본 높이 */
  width: auto;        /* 비율 유지 */
  max-width: 200px;   /* 최대 너비 제한 */
  object-fit: contain;
  display: block;
  transition: all 0.3s ease;
}

.logo a:hover {
  color: var(--primary-color);
}

.main-nav {
  display: flex;
  gap: 30px;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}


.main-nav a {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  padding: 10px 0;
  position: relative;
  transition: color 0.3s ease;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--primary-color);
  transition: width 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary-color);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 15px;
}
.header-auth { display: flex; align-items: center; gap: 8px; }
.header-auth #header-auth-buttons,
.header-auth #header-user-menu { display: flex; align-items: center; gap: 8px; }

/* 모바일에서는 헤더 인증 영역 숨김(드로어 전용) */
@media (max-width: 768px) {
  .header-auth { display: none; }
}

/* 햄버거 버튼 */
.hamburger {
  display: none;
  width: 40px;
  height: 40px;
  border-radius: 8px;
  border: 1px solid var(--gray-200);
  background: #fff;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--gray-800);
}

/* 헤더 인증 버튼 그룹 정렬 및 간격 */
.user-actions #auth-buttons,
.user-actions #user-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* 버튼 크기/라운딩/간격 일관화 */
#auth-buttons .btn,
#user-menu .btn {
  height: 36px;
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 600;
}

/* 접근성: 포커스 링 */
.btn:focus {
  outline: 2px solid rgba(74, 108, 247, 0.4);
  outline-offset: 2px;
}

/* hover 시 살짝 강조 (일관성) */
#auth-buttons .btn:hover,
#user-menu .btn:hover {
  transform: translateY(-1px);
}

.cart-icon {
  position: relative; /* 기준 위치 유지 */
  display: inline-block; /* flex 필요 없으면 inline-block */
  color: var(--gray-800);
  text-decoration: none;
  padding: 5px;
}

.cart-icon:hover {
  color: var(--primary-color);
}

.cart-count {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: var(--primary-color);
  color: white;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  display: flex;
  align-items: center;       /* 세로 중앙 */
  justify-content: center;   /* 가로 중앙 */
  font-size: 0.7rem;
  font-weight: bold;
  line-height: normal;       /* 숫자 세로 중앙 정렬용 */
  text-align: center;        /* 가로 중앙 정렬용 */
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;      /* 모든 버튼 동일 패딩 */
  height: 40px;            /* 높이 통일 */
  font-size: 0.9rem;       /* 폰트 크기 통일 */
  border-radius: 6px;      /* 라운딩 통일 */
  font-weight: 500;
  text-decoration: none;
  transition: all 0.3s ease;
  cursor: pointer;
  border: 1px solid transparent;
}

/* 아웃라인 버튼 */
.btn.btn-outline {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--primary-color);
}

.btn.btn-outline:hover {
  background-color: rgba(74, 108, 247, 0.1);
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.1);
  transform: translateY(-2px);
}

/* 프라이머리 버튼 */
.btn.btn-primary {
  background-color: var(--primary-color);
  color: white;
  border: 1px solid var(--primary-color);
}

.btn.btn-primary:hover {
  background-color: #3a5ce4;
  border-color: #3a5ce4;
  box-shadow: 0 4px 12px rgba(74, 108, 247, 0.3);
  transform: translateY(-2px);
}

/* 푸터 스타일 */
.footer {
  background-color: var(--dark-color, #343a40);
  color: #fff;
  padding: 60px 15px 20px;
}

.footer .container {
  max-width: 1200px;
  margin: 0 auto;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
  margin-bottom: 40px;
}

.footer-section h4 {
  font-size: 1.2rem;
  margin-bottom: 20px;
  color: #fff;
}

.footer-section a {
  display: block;
  color: #adb5bd;
  text-decoration: none;
  margin-bottom: 10px;
  transition: color 0.3s ease;
}

.footer-section a:hover {
  color: #fff;
}
.footer-section:first-child p {
  font-size: 0.9rem;
  color: #adb5bd;
  margin-bottom: 6px;
  line-height: 1.5;
}

/* 문장 간 여백 조금 더 자연스럽게 */
.footer-section:first-child p:first-of-type {
  margin-bottom: 10px;
  color: #ffffff; /* 첫 문장(슬로건)은 좀 더 강조 */
  font-weight: 500;
}
.footer-bottom {
  text-align: center;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 20px;
  color: #adb5bd;
  font-size: 0.9rem;
}

/* 반응형 스타일 */
@media (max-width: 768px) {

  .header .container {
    display: grid;
    grid-template-columns: 78px 1fr auto;
    align-items: center;
    height: auto;
    padding: 15px;
    column-gap: 8px;
  }
  .logo a { display: inline-block; }
  .logo img {
    height: 45px;       /* 모바일에서 로고 축소 */
    max-width: 150px;
  }
  .user-actions { grid-column: 3; justify-self: end; }

  .main-nav { display: none; }
  .header-divider { display: none; }
  
  .user-actions {
    width: auto;
    margin-top: 0;
    gap: 10px;
  }
  .hamburger { display: flex; }

  #auth-buttons .btn,
  #user-menu .btn {
    flex: 1 1 45%;
    min-width: 120px;
    max-width: 220px;
    height: 40px;
    padding: 10px 14px;
  }
  .cart-icon { padding: 8px; }

  /* 푸터 2열 */
  .footer-content {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    text-align: left;
  }

  .footer-section h4 {
    font-size: 1rem;
    margin-bottom: 10px;
  }

  .footer-section a {
    font-size: 0.9rem;
  }

  .footer-bottom {
    text-align: center;
    font-size: 0.85rem;
    padding-top: 12px;
  }
}
@media (max-width: 600px) {
  .footer-section:first-child p {
    font-size: 0.85rem;
    line-height: 1.6;
  }
  .footer-section:first-child p:first-of-type {
    margin-bottom: 12px;
  }
}

/* 드로어 */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
  z-index: 999;
}
.drawer-backdrop.show { opacity: 1; pointer-events: auto; }

.mobile-drawer {
  position: fixed;
  top: 0; right: -320px;
  width: 320px; max-width: 90vw;
  height: 100vh;
  background: #fff;
  box-shadow: -2px 0 12px rgba(0,0,0,0.12);
  transition: right .25s ease;
  z-index: 1000;
  display: flex;
  flex-direction: column;
}
.mobile-drawer.open { right: 0; }
.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--gray-200);
  font-weight: 700;
}
.drawer-close {
  background: transparent;
  border: none;
  font-size: 24px;
  cursor: pointer;
}
.drawer-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.drawer-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.drawer-nav a {
  color: #333;
  text-decoration: none;
  padding: 10px 6px;
  border-radius: 6px;
}
.drawer-nav a.active { color: var(--primary-color); }
.drawer-divider {
  border: 0;
  border-top: 1px solid var(--gray-200);
  margin: 4px 0 8px;
}
.drawer-body #auth-buttons, .drawer-body #user-menu { display: flex !important; }
.drawer-body #auth-buttons .btn, .drawer-body #user-menu .btn { width: 100%; }
