p {
  font-size: 18px;
  letter-spacing: -0.035em;
  line-height: 1.65;
  color: #666 !important;
}
h2 {
  letter-spacing: -0.035em !important;
}
@media screen and (max-width: 768px) {
  p {
    font-size: 16px !important;
  }
}

/* 메인 페이지 스타일 */
#header-wrap .fixed {
  background-color: #fff;
  top: 0;
}
#header-wrap .fixed .logo a {
  background: url(../img/logo.png) no-repeat;
  background-size: contain;
}
#header-wrap .fixed #mobile-menu-btn span {
  background-color: #1a1a1a;
}
#header-wrap .fixed #sitemap span {
  background-color: #1a1a1a;
}
#header-wrap .fixed #pc-nav > ul > li > a {
  color: #1a1a1a;
  font-weight: 600;
}
#header-wrap.scrolled #mobile-menu-btn span {
  background-color: #1a1a1a;
}

/* 헤더 스타일 */
#header-wrap {
  width: 100%;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: all 0.3s ease;
}
#header-wrap.scrolled {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  z-index: 1000;
}
#header {
  margin: 0 auto;
  padding: 0 50px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 90px;
  gap: 30px;
}

/* 로고 스타일 */
.logo {
  flex-shrink: 0;
  margin-right: 50px;
}
.logo a {
  display: inline-block;
  padding: 10px 0;
  text-decoration: none;
  background: url(../img/logo_w.png) no-repeat;
  background-size: contain;
  width: 150px;
  height: 40px;
}

/* 헤더 우측 영역 스타일 */
.header-right {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 20px;
}

/* PC 네비게이션 스타일 */
#pc-nav {
  margin-right: 0;
  flex-shrink: 0;
}
#pc-nav > ul {
  display: flex;
  list-style-type: none;
  margin: 0;
  padding: 0;
}
#pc-nav > ul > li {
  position: relative;
  margin-right: 50px;
}
#pc-nav > ul > li:last-child {
  margin-right: 0;
}
#pc-nav > ul > li > a {
  display: block;
  padding: 10px 0;
  text-decoration: none;
  color: #232323;
  font-weight: 500;
  font-size: 18px;
  cursor: pointer;
  opacity: 0.8;
}
#pc-nav > ul > li > a:hover {
  opacity: 1;
  color: #232323;
}

/* 검색 컨테이너 스타일 */
/* 헤더 내부의 .search-container에만 적용되도록 구체화 */
#header-wrap .search-container,
#header .search-container,
.header-right .search-container {
  margin: 0 80px 0 80px;
  flex-shrink: 0;
  position: relative;
}
.book-search-input-wrapper {
  position: relative;
  width: 400px;
}
.book-search-input {
  width: 400px;
  padding: 10px 15px;
  border: 2px solid #073d38;
  border-radius: 25px;
  font-size: 14px;
  outline: none;
  transition: all 0.3s ease;
  background-color: transparent;
  color: #232323;
}
.book-search-input::placeholder {
  color: #999;
  opacity: 0.8;
}
.book-search-input:focus {
  border-color: #073d38;
  box-shadow: 0 0 0 3px rgba(7, 61, 56, 0.1);
}

/* 검색 결과 스타일 */
.book-search-results {
  position: absolute;
  top: 100%;
  left: 0;
  width: 400px;
  background: #fff;
  border: 2px solid #073d38;
  border-top: none;
  border-radius: 0 0 25px 25px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  margin-top: 2px;
}
.book-search-results.show {
  display: block;
}
.book-search-item {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 15px;
  border-bottom: 1px solid #eee;
  cursor: pointer;
  transition: background 0.2s ease;
}
.book-search-item:hover {
  background: #f8f9fa;
}
.book-search-item.selected {
  background: #e7f3ff;
  border-left: 3px solid #073d38;
}
.book-search-item:last-child {
  border-bottom: none;
}
.book-search-item-image {
  width: 60px;
  height: 80px;
  object-fit: cover;
  border: 1px solid #ddd;
  border-radius: 4px;
  flex-shrink: 0;
}
.book-search-item-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.book-search-item-title {
  font-size: 14px;
  font-weight: 600;
  color: #333;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  margin: 0;
}
.book-search-item-author {
  font-size: 13px;
  color: #666;
  margin: 0;
}
.book-search-item-price {
  font-size: 14px;
  font-weight: 600;
  color: #073d38;
  margin: 0;
}

/* PC 네비게이션 서브메뉴 스타일 */
#pc-nav > ul > li > ul {
  position: absolute;
  top: 100%;
  left: 128%;
  transform: translateX(-50%);
  background-color: #073d38;
  padding: 15px 0;
  min-width: 220px;
  z-index: 1000;
  visibility: hidden;
  opacity: 0;
  border-radius: 10px;
  transition: visibility 0s, opacity 0.3s linear;
}
#pc-nav > ul > li:hover > ul {
  visibility: visible;
  opacity: 1;
}
#pc-nav > ul > li > ul > li {
  position: relative;
  padding: 5px 10px;
  opacity: 0;
  transform: translateX(-20px);
}
#pc-nav > ul > li > ul > li.show {
  animation: slideInRight 0.3s ease forwards;
}
#pc-nav > ul > li > ul > li > a {
  display: block;
  padding: 8px 20px;
  color: #fff;
  opacity: 0.8;
  text-decoration: none;
  font-size: 17px;
  transition: background-color 0.3s ease;
}
#pc-nav > ul > li > ul > li > a:hover {
  background-color: transparent;
  opacity: 1;
}
#pc-nav > ul > li > ul > li > a.has-submenu {
  padding-right: 30px;
  position: relative;
}
#pc-nav > ul > li > ul > li > a.has-submenu::after {
  content: "+";
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  color: #ddd;
  font-weight: 600;
}
#pc-nav > ul > li > ul > li > a.has-submenu.submenu-open::after {
  content: "-";
}

/* 3단 메뉴 스타일 */
#pc-nav > ul > li > ul > li > ul.third-level {
  display: none;
  position: static;
  background-color: #333;
  box-shadow: none;
  padding: 10px 0;
  line-height: 2.1;
  list-style: none;
  margin: 0;
  padding-left: 0;
}
#pc-nav > ul > li > ul > li > ul.third-level > li {
  opacity: 1;
  transform: none;
  list-style: none;
  margin: 0;
  padding: 0;
  padding-left: 0;
  text-align: left;
}
#pc-nav > ul > li > ul > li > ul.third-level > li.show {
  animation: none;
}
#pc-nav > ul > li > ul > li > ul.third-level > li > a {
  display: block;
  padding: 2px 30px;
  font-size: 14px;
  color: #fff;
  opacity: 0.8;
  transition: background-color 0.3s ease;
  text-align: left;
  white-space: normal;
  word-wrap: break-word;
}
#pc-nav > ul > li > ul > li > ul.third-level > li > a:hover {
  background-color: transparent;
  color: #fff;
  opacity: 1;
}

/* 서브메뉴 애니메이션 스타일 */
@keyframes slideInRight {
  0% {
    opacity: 0;
    transform: translateX(-20px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* 로그인 및 사이트맵 컨테이너 스타일 */
.login-sitemap-container {
  display: flex;
  align-items: center;
  margin-left: auto;
}
.login-sitemap-container .sitemap-button {
  color: #0a0a0a;
}
#login-box {
  display: flex;
  align-items: center;
  margin-right: 15px;
}
#login-box ul {
  display: flex;
  align-items: center;
  list-style: none;
  margin: 0;
  padding: 0;
}
#login-box ul li {
  margin: 0;
  padding: 0;
}
#login-box ul li:first-child a {
  margin-left: 0;
}
#login-box ul li:not(:first-child) a {
  margin-left: 15px;
}
#login-box a {
  text-decoration: none;
  color: #fff;
  padding: 14px 26px;
  background-color: #073d38;
  border-radius: 50px;
  text-align: center;
  display: inline-block;
}

/* 사이트맵 버튼 스타일 */
#sitemap-container {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
}
.sitemap-button {
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  z-index: 1001;
  position: relative;
  color: #fff;
}
#sitemap span,
#sitemap_close span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #474747;
  margin: 6px 0;
  transition: all 0.3s ease-in-out;
}
#sitemap-container #sitemap_close span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: #000;
  margin: 6px 0;
  transition: all 0.3s ease-in-out;
}
#sitemap_close {
  display: none;
  position: relative;
  z-index: 1002;
}
#sitemap_close span:first-child {
  transform: rotate(45deg);
  position: absolute;
  top: 50%;
}
#sitemap_close span:last-child {
  transform: rotate(-45deg);
  position: absolute;
  top: 50%;
}

/* 스크롤 시 사이트맵 버튼 색상 변경 */
#header-wrap.scrolled #sitemap span,
#header-wrap.scrolled #sitemap_close span {
  background-color: #333;
}

/* 모바일 네비게이션 스타일 */
#mobile-menu-btn {
  display: none;
  position: fixed;
  top: 30px;
  right: 20px;
  z-index: 1003;
  background: none;
  border: none;
  cursor: pointer;
  width: 30px;
  height: 30px;
}
#mobile-menu-btn span {
  display: block;
  width: 25px;
  height: 3px;
  background-color: #fff;
  margin: 5px 0;
  transition: all 0.3s ease;
}
#mobile-menu-btn.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
#mobile-menu-btn.active span:nth-child(2) {
  opacity: 0;
}
#mobile-menu-btn.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -6px);
}
#mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 1002;
  overflow-y: auto;
  padding-top: 60px;
}
#mobile-nav.active {
  display: block;
}
#mobile-nav ul {
  list-style-type: none;
  padding: 0 30px;
}
#mobile-nav ul ul {
  display: none;
  padding: 10px 0 10px 15px;
}
#mobile-nav ul ul li > a {
  padding: 15px 0;
  color: #fff;
  opacity: 0.8;
}
#mobile-nav ul li > ul > li > a > .third-level {
  background-color: #333;
}
#mobile-nav ul li {
  position: relative;
}
#mobile-nav ul li > a {
  display: block;
  padding: 18px 0;
  color: #fff;
  text-decoration: none;
  font-size: 18px;
  position: relative;
}
#mobile-nav ul li > a::after {
  content: none;
}
#mobile-nav > ul > li > a.has-submenu::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  transition: transform 0.3s ease;
}
#mobile-nav > ul > li > ul > li > a.has-submenu::after {
  content: "+";
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  font-size: 20px;
  transition: transform 0.3s ease;
}
#mobile-nav ul li > a.has-submenu.submenu-open::after {
  content: "-";
  transform: translateY(-50%) rotate(180deg);
}
#mobile-nav > ul > li > ul > li > ul.third-level {
  display: none;
  position: static;
  background-color: #333;
  box-shadow: none;
  padding: 10px 0;
  line-height: 2.1;
}
#mobile-nav > ul > li > ul > li > ul.third-level > li > a {
  padding: 8px 20px 8px 30px;
  font-size: 16px;
  color: #f2f2f2;
  opacity: 1;
}
#mobile-nav > ul > li > ul > li > ul.third-level > li > a::after {
  content: none;
}
#mobile-nav > ul > li > ul > li > ul.third-level > li > a:hover {
  opacity: 0.8;
}

/* 3단계 메뉴가 열렸을 때의 스타일 */
#mobile-nav ul.third-level-m {
  display: none;
  background-color: #373737;
  padding-left: 20px;
  margin: 0;
  list-style-type: none;
}

#mobile-nav ul.third-level-m a {
  display: block;
  padding: 13px 15px;
  font-size: 16px;
  color: #fff;
  text-decoration: none;
  transition: all 0.3s ease;
}

/* 모바일 네비게이션 닫기 버튼 스타일 */
#mobile-nav-close {
  position: fixed;
  top: 20px;
  right: 20px;
  color: #fff;
  font-size: 30px;
  cursor: pointer;
  background: none;
  border: none;
  z-index: 1005;
  display: none;
}
#mobile-nav.active #mobile-nav-close {
  display: block;
}

/* 모바일 로그인 박스 스타일 */
#mobile-login-box {
  padding: 20px 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 20px;
}
#mobile-login-box ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  list-style: none;
  margin: 0;
  padding: 0;
}
#mobile-login-box ul li {
  margin: 0;
  padding: 0;
}
#mobile-login-box ul li a {
  display: block;
  padding: 14px 26px;
  background-color: #073d38;
  border-radius: 50px;
  text-align: center;
  text-decoration: none;
  color: #fff;
  font-size: 16px;
}
#mobile-login-box ul li.login a {
  background-color: transparent;
  border: 1px solid rgba(255, 255, 255, 0.3);
}

/* 프로필 랩 스타일 */
#profileWrap {
  display: none;
  position: fixed;
  top: 0;
  left: -100%;
  z-index: 100;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(10px);
  opacity: 0;
  transition: left 0.3s ease, opacity 0.3s ease;
}
#profileWrap.show {
  left: 0;
  opacity: 1;
}
#profileWrap .background_wrap {
  position: absolute;
  z-index: 1;
  left: 0;
  top: 0;
  width: 30%;
  height: 100%;
}
#profileWrap .background {
  position: absolute;
  left: 0;
  top: 0;
  width: 0;
  height: 100%;
  background: url(../img/bg.jpg) left no-repeat;
  background-size: cover;
  transition: width 0.3s ease;
}
#profileWrap.show .background {
  width: 100%;
}

/* 카테고리 랩 스타일 */
.category_wrap {
  position: absolute;
  right: 0;
  top: 0;
  width: 70%;
  height: 100%;
  z-index: 2;
}

/* 카테고리 스타일 */
.category {
  position: absolute;
  right: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: #fff;
  overflow-y: auto;
}
.category > ul {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 100%;
  padding: 0 10%;
  max-height: 90vh;
}
.category > ul > li {
  opacity: 1;
  margin-left: 0;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}
.category > ul > li + li {
  margin-top: 20px;
}
.category > ul > li > a {
  display: block;
  width: max-content;
  margin-bottom: 15px;
  font-size: 24px;
  color: #333;
  text-decoration: none;
  font-weight: 600;
}
.category > ul > li ul {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  align-items: flex-start;
  margin-top: 10px;
}
.category > ul > li ul li {
  margin: 0;
  padding: 0;
}
.category > ul > li ul a {
  opacity: 0.8;
  font-size: 17px;
  color: #222;
  text-decoration: none;
  transition: all 0.2s;
  white-space: nowrap;
}
.category > ul > li ul a:hover {
  opacity: 1;
  color: #073d38;
}

/* 3단 메뉴 스타일 */
.category > ul > li ul .third-level {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  margin-top: 10px;
  padding: 8px 12px;
  border-left: none;
  background-color: rgba(0, 0, 0, 0.05);
  border-radius: 4px;
  gap: 12px;
  align-items: center;
}
.category > ul > li ul .third-level li {
  margin: 0;
  padding: 0;
}
.category > ul > li ul .third-level a {
  font-size: 14px;
  opacity: 0.8;
  white-space: nowrap;
}
.category > ul > li ul .third-level a:hover {
  opacity: 1;
  color: #073d38;
}

/* 반응형 스타일 */
@media screen and (min-width: 769px) {
  #mobile-menu-btn,
  #mobile-nav-close {
    display: none;
  }
}

@media screen and (max-width: 1300px) {
  #pc-nav > ul > li {
    margin-right: 20px;
  }
  #pc-nav > ul > li > a {
    font-size: 14px;
  }
  #header .book-search-input,
  .header-right .book-search-input {
    width: 200px;
    font-size: 13px;
  }
  #header .book-search-input-wrapper,
  .header-right .book-search-input-wrapper {
    width: 200px;
  }
  .book-search-results {
    width: 200px;
    max-height: 350px;
  }
  .book-search-item-image {
    width: 50px;
    height: 70px;
  }
  .book-search-item-title {
    font-size: 13px;
  }
  .book-search-item-author {
    font-size: 12px;
  }
  .book-search-item-price {
    font-size: 13px;
  }
}

@media screen and (max-width: 1020px) {
  #pc-nav {
    display: none;
  }
  .header-right {
    display: flex;
    align-items: center;
  }
  .login-sitemap-container {
    display: none;
  }
  /* 모바일 검색 컨테이너 */
  /* 헤더 내부의 .search-container에만 적용되도록 구체화 */
  #header-wrap .search-container,
  #header .search-container,
  .header-right .search-container {
    display: block;
    position: absolute;
    left: 60%;
    top: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    width: auto;
    z-index: 10;
  }
  .book-search-input-wrapper {
    width: 180px;
  }
  .book-search-input {
    width: 180px;
    font-size: 12px;
    padding: 10px 10px;
  }
  .book-search-results {
    width: 180px;
    left: 0;
    transform: none;
    max-height: 300px;
  }
  .book-search-item {
    padding: 12px;
  }
  .book-search-item-image {
    width: 50px;
    height: 65px;
  }
  .book-search-item-title {
    font-size: 13px;
  }
  .book-search-item-author {
    font-size: 12px;
  }
  .book-search-item-price {
    font-size: 12px;
  }
  #mobile-menu-btn {
    display: block !important;
  }
  #mobile-menu-btn span {
    background-color: #000 !important;
  }
  #mobile-menu-btn.active span {
    background-color: #fff !important;
  }
  #profileWrap .category_wrap {
    width: 100%;
  }
  .category > ul {
    padding: 0 10%;
  }
  .category > ul > li > a {
    font-size: 20px;
  }
  .category > ul > li ul a {
    font-size: 14px;
  }
  #header {
    padding: 0 20px;
    position: relative;
    justify-content: space-between;
  }
  .logo a {
    width: 120px;
    height: 30px;
  }
  #sitemap-container {
    right: 60px;
  }
  #mobile-nav-close {
    display: none !important;
  }
  /* 모바일에서 사이트맵 닫기 버튼 스타일 */
  #sitemap_close {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1002;
  }
  #sitemap_close span {
    background-color: #000 !important;
  }
}

/* 프린트 스타일 */
@media print {
  #header-wrap,
  #mobile-nav,
  #profileWrap {
    display: none !important;
  }
  body {
    font-size: 12pt;
  }
  a[href]:after {
    content: " (" attr(href) ")";
  }
}

/* 포커스 가시성 향상 */
a:focus-visible,
button:focus-visible {
  outline: 2px solid #007bff;
  outline-offset: 2px;
}

/* 키보드 네비게이션을 위한 포커스 스타일 */
#pc-nav > ul > li > a:focus + ul {
  visibility: visible;
  opacity: 1;
}
/*#pc-nav > ul > li > ul > li > a:focus + ul.third-level { display: block; }*/

/* 애니메이션 리셋을 위한 스타일 */
#pc-nav > ul > li > ul.reset-animation > li {
  animation: none;
  opacity: 1;
  transform: translateY(0);
  transition: none;
}

/* 스크롤바 스타일 (웹킷 기반 브라우저) */
#mobile-nav::-webkit-scrollbar {
  width: 5px;
}
#mobile-nav::-webkit-scrollbar-track {
  background: #f1f1f1;
}
#mobile-nav::-webkit-scrollbar-thumb {
  background: #888;
}
#mobile-nav::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* 헤더 스크롤 스타일 */
#header-wrap.scrolled #pc-nav > ul > li > a {
  color: #232323;
}
#header-wrap.scrolled .logo a {
  background-image: url(../img/logo.png);
}
#header-wrap.scrolled #login-box a {
  color: #fff;
  background-color: #073d38;
}

/* 로딩 인디케이터 스타일 */
#loading {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.8);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
}
#loading::after {
  content: "";
  width: 50px;
  height: 50px;
  border: 5px solid #f3f3f3;
  border-top: 5px solid #3498db;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* 추가적인 접근성 개선 스타일 */
.visually-hidden {
  position: absolute !important;
  height: 1px;
  width: 1px;
  overflow: hidden;
  clip: rect(1px 1px 1px 1px);
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

/* 고대비 모드 지원 */
@media (forced-colors: active) {
  #header-wrap,
  #mobile-nav,
  #profileWrap {
    border: 1px solid currentColor;
  }
  .sitemap-button span,
  #mobile-menu-btn span {
    background-color: currentColor;
  }
}
