/* =========================================================
   BASE / RESET
   ========================================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont,
                 "Segoe UI", Roboto, "Noto Sans KR",
                 Arial, sans-serif;
    background: #f5f6f7;
    color: #222;
}

/* =========================================================
   LAYOUT CORE
   ========================================================= */
.wrapper {
    max-width: 1280px;          /* ⭐ 기준 폭 */
    margin: 0 auto;
    padding: 0 16px;
}

main {
    min-height: calc(80vh - 160px);  /* header + nav + footer 여유 */
    /* padding-top: 20px; */
}

/* =========================================================
   TOP HEADER (로그인 바)
   ========================================================= */
.top-header {
    background: #1f2937;
    color: #fff;
    z-index: 10;
}

.top-header a {
    color: #fff;
    text-decoration: none;
}

.top-header .wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}

/* =========================================================
   TS NAVIGATION (Bootstrap 완전 분리)
   ========================================================= */
.ts-nav {
    background: #fff;
    border-bottom: 1px solid #eee;
    position: relative;
    z-index: 100; /* 팝업/본문보다 위 */
}

.ts-menu {
    display: flex;
    list-style: none;
    gap: 32px;
    margin: 0 auto;
    padding: 0 16px;
    max-width: 1280px;
}

.ts-item {
    position: relative;
}

.ts-item > a {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 16px 0;
    color: #222;
    font-weight: 600;
    text-decoration: none;
}

/* 화살표 */
.ts-item .arrow {
    font-size: 12px;
    transition: transform 0.2s ease;
}

/* =========================================================
   SUB MENU
   ========================================================= */
.ts-submenu {
    position: absolute;
    top: 100%;
    left: 0;

    min-width: 240px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
    padding: 8px 0;
    list-style: none;

    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity .2s ease, transform .2s ease;

    z-index: 9999;
    pointer-events: none;
}

.ts-submenu li a {
    display: block;
    padding: 10px 18px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
}

.ts-submenu li a:hover {
    background: #f5f6f8;
}

/* =========================================================
   HOVER ACTION
   ========================================================= */
.ts-item.has-sub:hover > .ts-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.ts-item.has-sub:hover > a .arrow {
    transform: rotate(180deg);
}



/* =========================================================
   FOOTER
   ========================================================= */
footer {
    background: #f1f1f1;
    color: #666;
    font-size: 13px;
    margin-top: 40px;
}

footer .wrapper {
    padding: 20px 0;
    text-align: center;
}

/* =========================================================
   RESPONSIVE (MOBILE)
   ========================================================= */
@media (max-width: 768px) {

    .top-header .wrapper {
        flex-direction: column;
        height: auto;
        padding: 10px 0;
        gap: 6px;
    }

    .top-nav .menu {
        flex-wrap: wrap;
        gap: 16px;
    }

    /* 모바일에서는 hover 불안정 → 드롭다운 기본 숨김 유지
       (필요 시 JS click 방식으로 확장 권장) */
}



/* '맨 위로 이동(Scroll to Top)' 버튼 구현 시작 */

/* ==============================
   Scroll To Top Button (FINAL)
   ============================== */

#scrollTopBtn {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 2147483647; /* 최상위 */

  width: 48px;
  height: 48px;
  border-radius: 50%;

  background-color: #e11d48;
  color: #ffffff;
  font-size: 16px;
  font-weight: bold;

  display: flex;
  align-items: center;
  justify-content: center;

  cursor: pointer;
  user-select: none;

  /* 기본 상태: 숨김 */
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);

  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    visibility 0.25s ease;
}

/* 표시 상태 */
#scrollTopBtn.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Hover 효과 */
#scrollTopBtn:hover {
  background-color: #be123c;
}




/* '맨 위로 이동(Scroll to Top)' 버튼 구현 끝 */


