/* ==========================================================
   layout.css — 전체 사이트 공통 레이아웃 + 반응형
   ----------------------------------------------------------
   섹션은 페이지 상단→하단의 시각 순서로 배치:
     1. Base (html, body, font)
     2. Header (.head_ad / .main_util / .main_logo / .sub_logo)
     3. GNB / Mobile menu (.gnb_* / .mobile-menu / .m_gnb)
     4. LNB (.lnb_*)
     5. Sidebar (좌측 quick_menu.jsp / 우측 right_consult.jsp)
     6. Footer
     7. Bottom consult (뷰포트 하단 고정 — bottom_consult.jsp)

   하단은 Responsive (1335px → 1000px → 768px → 660px) 통합 블록.
   ========================================================== */

/* ----------------------------------------------------------
   1. Base (html, body, font)
----------------------------------------------------------- */

body {
    font-family: "Pretendard", sans-serif;
}
html {
    font-size: 16px;
}
body {
    font-size: 1rem;
    min-width: 350px;
    color: #333;
}

/* ----------------------------------------------------------
   2. Header
----------------------------------------------------------- */

.head_ad {
    background: #01102d;
    text-align: center;
}
.head_ad .dis_pc {
    height: 90px;
}

.main_util {
    background-color: #f9f9f9;
    border-bottom: 1px solid #dadada;
}
.main_util ul {
    display: flex;
    justify-content: end;
    padding: 10px 0;
}
.main_util li a {
    display: inline-block;
    padding: 0 15px;
    border-right: 1px solid #dadada;
    font-size: 0.8rem;
}
.main_util li:last-child a {
    border: none;
}

.main_logo {
    border-bottom: 1px solid #dadada;
}
.main_logo .cont_maxW {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 80px;
}
.logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
}

.sub_logo {
    width: 20%;
    overflow: hidden;
    height: 64px;
}
.sub_logo ul {
    margin: 0;
    padding: 0;
    transition: 0.6s ease-in-out;
}
.sub_logo li {
    display: flex;
    height: 64px;
    align-items: center;
}
.sub_logo li:first-child img {
    width: 100%;
}

/* ----------------------------------------------------------
   3. GNB / Mobile menu
----------------------------------------------------------- */

.gnb_wrap {
    border-bottom: 1px solid #dadada;
    overflow: visible;
}
#gnb {
    position: relative;
}
.gnb_list {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    grid-template-rows: repeat(2, 50px);
    margin: 0;
    padding: 0;
    list-style: none;
}
.gnb_item {
    position: relative;
    width: auto;
    min-width: 0;
    text-align: center;
}
.gnb_item > .dep_1 {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-size: 1rem;
    color: #222;
    text-decoration: none;
    white-space: nowrap;
}
.gnb_item:hover {
    z-index: 1000;
}
.gnb_item .dep_2 {
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease;
    background: #fff;
    border: 1px solid #777;
    border-radius: 16px;
    padding: 16px 20px;
    white-space: nowrap;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
    z-index: 9999;
}
.gnb_item:hover > .dep_2 {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}
.gnb_item .dep_2 a {
    color: #333;
    text-decoration: none;
    font-size: 0.9rem;
}
.gnb_item .dep_2 a:hover {
    font-weight: bold;
}
.gnb_util {
    background: #f2f4f6;
    min-width: 0;
}
.gnb_util > .dep_1 {
    height: 50px;
    color: #0974db;
}
.gnb_apply {
    background: #072453;
}
.gnb_apply > .dep_1 {
    color: #fff;
    font-weight: bold;
    height: 50px;
}

/* 모바일 메뉴 */
.menu-btn-icon {
    width: 1.8rem;
}
.mobile-menu {
    width: 280px;
    height: 100%;
    position: fixed;
    top: 0;
    left: -280px;
    background: #fff;
    z-index: 10001;
    transition: left 0.3s ease;
    overflow-y: auto;
}
.mobile-menu.active {
    left: 0;
}
.user-info {
    padding: 15px 20px;
    background: #f8f8f8;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #eee;
}
.user-name > a {
    font-size: 0.9rem;
}
.menu-header button {
    background: none;
}
.menu-header .close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background: transparent;
    color: #555;
    border: none;
    width: 30px;
    height: 30px;
    font-size: 18px;
    cursor: pointer;
    line-height: 30px;
    text-align: center;
    transition: color 0.15s ease;
}
.menu-header .close-btn:hover,
.menu-header .close-btn:focus {
    color: #000;
}
.logout-btn {
    text-decoration: none;
    color: #777;
    font-size: 0.9rem;
    margin-left: 10px;
}
.join-link {
    margin-left: 10px;
}
.main-menu-list > li > a {
    display: block;
    padding: 15px 20px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #eee;
    font-size: 0.9rem;
}
.tab-btn {
    background-color: #5483eb;
    font-weight: bold;
    font-size: 0.9rem;
    color: #fff !important;
    border-bottom: 1px solid #76a1ff !important;
}
.sub-menu {
    list-style: none;
    background-color: #fff;
    display: none;
}
.sub-menu li a {
    display: block;
    padding: 10px 20px 10px 40px;
    font-size: 0.9rem;
    text-decoration: none;
}
.sub-menu.active {
    display: block;
}
.overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
}
.overlay.active {
    display: block;
}
.body-scroll-lock {
    position: fixed;
    top: var(--scroll-lock-top, 0);
    overflow: hidden;
    width: 100%;
}

/* 모바일 하단 탭형 GNB */
.m_gnb ul {
    display: flex;
    border-bottom: 1px solid #dadada;
}
.m_gnb ul li {
    flex: 1;
    text-align: center;
}
.m_gnb ul li a {
    display: block;
    font-size: 1rem;
    padding: 14px 10px;
}

/* ----------------------------------------------------------
   4. LNB
----------------------------------------------------------- */

.lnb {
    width: 100%;
    background: #0974db;
}
.lnb_inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}
.lnb_inner > p {
    color: #fff;
    font-size: 1.2rem;
    font-weight: bold;
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
}
.lnb_inner > ul {
    display: flex;
    align-items: stretch;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}
.lnb_inner > ul > li {
    display: flex;
}
.lnb_inner > ul > li > a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0 16px;
    color: #fff;
    font-size: 1rem;
    font-weight: bold;
    text-decoration: none;
    padding: 12px;
}
.lnb_inner ul li.is-active {
    background: #fff;
}
.lnb_inner ul li.is-active > a {
    color: #000;
}

/* ----------------------------------------------------------
   5. Sidebar (좌·우 부유 영역)
----------------------------------------------------------- */

/* 좌측: 간편 메뉴 (quick_menu.jsp) */
.quick_menu_wrap {
    width: 170px;
    overflow: hidden;
    position: absolute;
    left: 50%;
    top: 830px;
    margin-left: -690px;
    background: #fff;
    border: 1px solid #dfdfdf;
    z-index: 8;
}
.side_head {
    background: #5483eb;
    color: #fff;
    text-align: center;
    height: 40px;
    padding: 12px 0;
    font-weight: bold;
}
#quick_menu_list > li {
    line-height: 20px;
    text-align: left;
    transform: skew(-0.03deg);
    font-weight: 600;
    margin-top: 10px;
}
#quick_menu_list > li > span {
    display: inline-block;
    margin-left: 15px;
    font-size: 12px;
    border: 1px solid #ddd;
    width: 20px;
    height: 20px;
    line-height: 20px;
    text-align: -webkit-center;
}
#quick_menu_list > li > a {
    transform: skew(-0.03deg);
    font-weight: 600;
    font-size: 14px;
    padding-left: 5px;
}
.quick_menu_sns {
    margin-top: 20px;
    border-top: 1px solid #dfdfdf;
    padding: 12px;
}
.sns_icon {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-around;
}
.sns_icon a:last-child {
    margin-top: 8px;
}

/* 우측: 무료빠른상담 (right_consult.jsp) */
.right_consult_wrap {
    position: fixed;
    left: 50%;
    top: 50%;
    width: 170px;
    margin-left: 520px;
    transform: translateY(-50%);
    overflow: hidden;
    background: #fff;
    z-index: 10;
    border: 1px solid #ebebeb;
}
.right_consult_wrap > li {
    box-sizing: border-box;
    margin: 10px 10px;
    color: #000;
}
.right_consult_wrap li select,
.right_consult_wrap li input {
    width: 100%;
    border: 1px solid #ddd;
    font-size: 14px;
    background: #fafafa;
    border-radius: 5px;
}
.right_consult_wrap li:nth-child(4) input {
    width: 45%;
    margin-top: 10px;
}
.right_consult_wrap li:nth-child(5) {
    display: flex;
    align-items: center;
}
.right_consult_wrap li:nth-child(5) input {
    width: auto;
    margin-right: 4px;
}
.right_consult_wrap li:nth-child(5) label,
.right_consult_wrap li:nth-child(5) label a {
    font-size: 12px;
}
input[type="button"].submit_btn {
    border: none;
    padding: 10px;
    font-size: 16px;
}

/* ----------------------------------------------------------
   6. Footer
----------------------------------------------------------- */

footer {
    padding-bottom: 120px;
    border-top: 1px solid #f1f1f1;
}
.footer_wrap {
    position: relative;
}
.footer_wrap > section {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    margin: 20px 0;
}
.footer_wrap > a {
    display: block;
    padding: 22px;
    font-size: 15px;
    font-weight: 800;
}
.logo_f {
    width: 20%;
    padding-top: 18px;
}
.logo_f img {
    width: 100%;
}
.foot-inner {
    display: flex;
    width: 80%;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
}
.foot-inner li {
    width: calc(100% / 6);
    list-style: none;
}
.foot-inner li a {
    width: 100%;
    font-weight: 600;
    display: block;
    padding: 24px 0;
    text-align: center;
    word-break: keep-all;
}
.foot-inner li:nth-child(2) > a {
    color: #fa4400;
}
.address {
    width: 100%;
    line-height: 1.5;
    font-size: 14px;
    transform: skew(-0.3deg);
    word-break: keep-all;
    margin-bottom: 10px;
    display: flex;
}

/* ----------------------------------------------------------
   7. Bottom consult (bottom_consult.jsp)
----------------------------------------------------------- */

#bottom_consult {
    position: fixed;
    left: 0;
    bottom: 0;
    width: 100%;
    background: #5c5f6c;
    z-index: 20;
}
#bottom_consult .bottom_btn {
    display: flex;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}
#bottom_consult .bottom_btn a {
    display: block;
    margin: 0;
    padding: 0;
    line-height: 0;
}
#bottom_consult .bottom_btn img {
    display: block;
    margin: 0;
    padding: 0;
}
#bottom_consult .counsling {
    width: 1000px;
    height: 100px;
    margin: 0 auto;
    padding: 0 10px;
    display: flex;
    align-items: center;
    overflow: visible;
}
#bottom_consult .txt-wrap {
    width: 100%;
    max-width: 420px;
    padding: 10px 0;
    margin: 0 auto;
    box-sizing: border-box;
}
#bottom_consult .txt-wrap p {
    font-size: 20px;
    line-height: 32px;
    color: #fff;
    font-weight: 600;
}
#bottom_consult .counsling_privacy {
    display: flex;
}
#bottom_consult .counsling_privacy div {
    display: flex;
}
#bottom_consult .counsling_privacy label,
#bottom_consult .txt-wrap div a {
    color: #fff;
}
#bottom_consult .txt-wrap div a {
    font-size: 14px;
    padding: 0 10px;
    text-decoration: underline;
}
#bottom_consult .counsling-form {
    display: flex;
    justify-content: space-between;
    width: 100%;
}
#bottom_consult .counsling-form li {
    width: 23%;
}
#bottom_consult .counsling-form input,
#bottom_consult .counsling-form select {
    display: block;
    width: 100%;
    padding: 1rem;
    border-radius: 4px;
    box-sizing: border-box;
    transition:
        border-color 0.15s ease-in-out,
        box-shadow 0.15s ease-in-out;
}
#bottom_consult .counsling-form li:last-child input {
    background: #5483eb !important;
    color: #fff !important;
    font-weight: 600;
    text-align: center;
    border: none;
}

/* 위로가기 버튼 */
.top_btn {
    position: fixed;
    right: calc(var(--floating-right) - var(--top-btn-size) - var(--cart-floating-gap));
    bottom: calc(var(--bottom-consult-offset) + var(--cart-floating-gap));
    width: 60px;
    height: 60px;
    background: #3a3a3a;
    border-radius: 16px;
    box-shadow: 0 0 10px rgb(0 0 0 / 40%);
    z-index: 99;
}
.top_btn a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    color: white;
    font-size: 0.8rem;
}
.top_btn img {
    max-width: 24px;
    max-height: 24px;
}

/* ══════════════════════════════════════════════════════════
   Responsive  (1399px → 1200px → 1000px → 768px → 660px)
   ══════════════════════════════════════════════════════════ */

/* ── max-width: 1399px (사이드바 숨김) ─────────────────── */

@media (max-width: 1399px) {
    #quick_menu_list,
    .quick_menu_wrap,
    .right_consult_wrap {
        display: none;
    }
}

/* ── max-width: 1200px (위로가기/장바구니 세로 스택 전환) ── */

@media (max-width: 1200px) {
    .top_btn {
        right: 12px;
        bottom: calc(var(--bottom-consult-offset) + var(--cart-floating-gap));
    }
}

/* ── Tablet: max-width: 1000px ────────────────────────── */

@media (max-width: 1000px) {
    /* Footer 하단 여백 제거 */
    footer {
        padding-bottom: 0;
    }

    /* 모바일 GNB 슬라이드 */
    #gnb_mo {
        height: 4rem;
        position: relative;
    }
    #gnb_mo .swiper-slide {
        text-align: center;
        background: #fff;
        display: flex;
        line-height: 3;
    }
    #gnb_mo .swiper-slide a {
        font-size: 2.2vw;
        width: 100%;
        display: block;
    }
    #gnb_mo .swiper-button-prev {
        left: var(--swiper-navigation-sides-offset, 10px);
        right: auto;
    }
    #gnb_mo .swiper-button-next {
        right: var(--swiper-navigation-sides-offset, 10px);
        left: auto;
    }
    #gnb_mo .swiper-button-next:after,
    #gnb_mo .swiper-button-prev:after {
        font-size: 3vw;
    }

    /* Footer */
    .footer_wrap {
        box-sizing: border-box;
    }
    .footer_wrap > section {
        flex-direction: column;
        align-items: center;
    }
    .logo_f {
        width: 180px;
        max-width: 70%;
        padding-top: 0;
        margin-bottom: 20px;
    }
    .foot-inner {
        position: static;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 8px 12px;
        margin-bottom: 20px;
    }
    .foot-inner li {
        display: block;
        width: auto;
        flex: 0 0 auto;
    }
    .foot-inner li a {
        padding: 6px 0;
        font-size: 14px;
        white-space: nowrap;
    }
    .address {
        width: 100%;
        margin-top: 0;
        font-size: 13px;
        line-height: 1.6;
        word-break: keep-all;
        margin-bottom: 10px;
    }

    /* 하단 간편상담 */
    #bottom_consult {
        background: none;
    }
    #bottom_consult .counsling {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0 1rem 1rem 1rem;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        background: #5c5f6c;
        box-sizing: border-box;
        max-height: none;
    }
    #bottom_consult .txt-wrap {
        width: 100%;
        max-width: 420px;
        padding: 10px 0;
        margin: 0 auto;
        box-sizing: border-box;
    }
    #bottom_consult .txt-wrap p {
        text-align: center;
        font-size: 18px;
    }
    #bottom_consult .counsling_privacy {
        display: flex;
        justify-content: center;
        padding: 4px 0 0 0;
        flex-wrap: wrap;
        gap: 6px;
    }
    #bottom_consult .counsling_privacy div {
        display: flex;
        align-items: center;
    }
    #bottom_consult .counsling-form {
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin: 0 auto;
        padding: 0;
        box-sizing: border-box;
    }
    #bottom_consult .counsling-form li {
        width: 100%;
        box-sizing: border-box;
    }
    #bottom_consult .counsling-form input,
    #bottom_consult .counsling-form select {
        width: 100%;
        box-sizing: border-box;
        padding: 0.4em;
    }
    .top_btn {
        right: 12px;
        bottom: var(--bottom-consult-panel-offset);
        transition: bottom 0.2s ease-in-out;
    }
    body.bottom-consult-closed .top_btn {
        bottom: 0;
    }
}

/* ── Mobile: max-width: 768px ─────────────────────────── */

@media (max-width: 768px) {
    /* 로고 */
    .logo {
        width: 50%;
    }
    .logo a {
        display: block;
    }
    .logo a img {
        width: 100%;
    }

    /* 모바일 GNB 슬라이드 */
    #gnb_mo {
        height: 9vw;
    }
    #gnb_mo .swiper-slide a {
        font-size: 3vw;
    }
    #gnb_mo .swiper-button-next:after,
    #gnb_mo .swiper-button-prev:after {
        font-size: 4vw;
    }
    #gnb_mo .swiper-button-next,
    #gnb_mo .swiper-button-prev {
        top: var(--swiper-navigation-sides-offset, 50%);
    }

    /* LNB */
    .lnb_inner {
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        min-height: auto;
    }
    .lnb_inner > p {
        font-size: 1rem;
        padding: 10px 0;
    }
    .lnb_inner > ul {
        width: 100%;
        flex-wrap: nowrap;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .lnb_inner > ul::-webkit-scrollbar {
        display: none;
    }
    .lnb_inner > ul > li {
        flex: 0 0 auto;
    }
    .lnb_inner > ul > li > a {
        padding: 8px;
        white-space: nowrap;
    }

    /* Footer */
    .foot-inner {
        width: 90%;
    }
}

/* ── Mobile small: max-width: 660px ───────────────────── */

@media (max-width: 660px) {
    body {
        font-size: 15px;
    }
    .top h4 {
        font-size: 1.3rem !important;
    }
    .m_gnb ul li a {
        font-size: 0.9rem;
    }
}
