/* 팝업 오버레이 */
#popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    z-index: 9998;
    display: none;
}

/* 팝업 전체 Wrapper */
#popup.hd_pop_wr {
    position: fixed; /* 화면에 고정 */
    top: 50%; /* 화면의 세로 50% 위치 */
    left: 50%; /* 화면의 가로 50% 위치 */
    transform: translate(-50%, -50%); /* 정확히 중앙에 배치 */
    z-index: 9999; /* 다른 요소 위로 표시 */
    width: 95%;
    max-width: 500px; /* 원래 크기로 복원 */
    background: #ffffff; /* 팝업 배경색 */
    box-shadow: 0 0 20px rgba(0,0,0,0.2);
    overflow: hidden; /* 추가: 내용이 넘치지 않도록 */
    max-height: 90vh; /* 화면 높이의 90%로 제한 */
    border-radius: 30px; /* 추가 */
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    transition: opacity 0.3s ease;
}

/* 팝업이 준비되면 표시 */
#popup.hd_pop_wr.popup-ready {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* 팝업 내용 영역 */
.popup-slk-wr {
    width: 100%;
    overflow: hidden;
    margin: 0;
    padding: 0;
    position: relative;
    opacity: 0 !important;
    visibility: hidden !important;
    max-height: 0 !important;
    overflow: hidden !important;
}

/* 슬라이더 초기화 완료 후 표시 */
.popup-slk-wr.slick-ready {
    opacity: 1 !important;
    visibility: visible !important;
    max-height: none !important;
    overflow: visible !important;
    transition: opacity 0.3s ease;
}

/* 메인 슬라이더 */
.pop-slk {
    width: 100%;
    font-size: 0; /* 이미지 간격 제거는 여기서만 적용 */
    line-height: 0;
    background: #000000; /* 동영상 배경 검정색 */
    aspect-ratio: 1 / 1; /* 1:1 비율 유지 */
}

.pop-slk .slick-slide > div {
    width: 100%;
    height: 100%;
    position: relative;
}

.pop-slk .slick-slide > div > a {
    width: 100%;
    height: 100%;
    display: block;
    position: relative;
}

/* 동영상이 있는 슬라이드만 flex로 중앙 정렬 */
.pop-slk .slick-slide.has-video {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    height: 100% !important;
}

.pop-slk .slick-slide.has-video > div {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

.pop-slk .slick-slide.has-video > div > a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    height: 100% !important;
    position: relative !important;
}

.pop-slk img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.pop-slk video {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    position: relative;
    z-index: 1;
}

.pop-slk video {
    /* 동영상 컨트롤러 숨기기 */
    pointer-events: none;
}

.pop-slk video::-webkit-media-controls {
    display: none !important;
}

.pop-slk video::-webkit-media-controls-enclosure {
    display: none !important;
}

.pop-slk video::-webkit-media-controls-panel {
    display: none !important;
}

.pop-slk video::-webkit-media-controls-play-button {
    display: none !important;
}

.pop-slk video::-webkit-media-controls-start-playback-button {
    display: none !important;
}

/* 모든 브라우저에서 동영상 컨트롤러 숨기기 */
.pop-slk video[controls] {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.pop-slk video {
    /* controls 속성 제거를 위한 스타일 */
    outline: none;
}
/* 정사각형 팝업 안에서 가로형 비디오를 강제로 정중앙 배치 */
.pop-slk .slick-slide.has-video {
    position: relative !important;
}

.pop-slk .slick-slide.has-video video {
    position: relative !important;
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain !important;
}
/* 네비게이션 탭 */
.nav-slk {
    width: 100%;
    background: #333 !important;
    min-height: 60px !important;
    height: auto !important;
    overflow: visible;
    font-size: 14px; /* 탭 글자 크기 복원 */
    line-height: 1.2; /* 탭 줄간격 복원 */
    visibility: visible !important;
    opacity: 1 !important;
    display: block !important;
}

.nav-slk .slick-list {
    background: #333 !important;
}

.nav-slk .slick-track {
    background: #333 !important;
}

.nav-slk .slick-track {
    width: 100% !important;
    display: flex !important;
    transform: translate3d(0, 0, 0) !important;
    height: auto !important;
    min-height: 60px !important;
    background-color: #333;  /* 트랙 배경색 */
}

.nav-slk .slick-slide {
    width: calc(100% / 5) !important; /* PC/태블릿에서 5개씩 */
    min-width: calc(100% / 5) !important;
    flex: 0 0 calc(100% / 5) !important;
    height: 60px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #c3c5c7;            /* 기본 탭 글자색 */
    padding: 10px;
    cursor: pointer;
    text-align: center;
    border-right: 1px solid rgba(255,255,255,0.1);
    border-bottom: 1px solid rgba(255,255,255,0.1);
    box-sizing: border-box;
    transition: background-color 0.3s ease;
    background-color: #333;  /* 기본 탭 배경색 */
}

.nav-slk .slick-slide:hover {
    background-color: #6E8066;
}


.nav-slk .slick-slide.active {
    background-color: #6E8066;  /* 활성화된 탭 배경색 */
    color: #fff;               /* 활성화된 탭 글자색 */
}

.nav-slk .slick-slide div {
    white-space: normal;
    line-height: 1.2;
    word-break: keep-all;
    width: 100%;
    text-align: center;
}

/* 하단 버튼 영역 */
.hd_pops_footer {
    padding: 10px;
    background: #333;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: none;
}

.hd_pops_footer button {
    padding: 8px 15px;
    background: #333;
    border-radius: 3px;
    cursor: pointer;
    border: none;
    color: #fff;
}

.hd_pops_footer button:hover {
    background: #333 !important;
    color: #fff !important;
}

/* 화살표 버튼 */
.popup-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    background: rgba(0, 0, 0, 0.6);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease, opacity 0.3s ease;
    opacity: 0.8;
}

.popup-arrow:hover {
    background: rgba(0, 0, 0, 0.8);
    opacity: 1;
}

.popup-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.popup-arrow svg {
    width: 20px;
    height: 20px;
}

.popup-arrow-prev {
    left: 10px;
}

.popup-arrow-next {
    right: 10px;
}

.popup-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 반응형 설정 */
@media screen and (max-width: 768px) {
    #popup.hd_pop_wr {
        width: 90%;
    }

    .nav-slk,
    .nav-slk .slick-track {
        height: 50px !important;
    }

    .nav-slk .slick-slide {
        width: 50% !important; /* 모바일에서 2개씩 */
        min-width: 50% !important;
        flex: 0 0 50% !important;
        height: 50px !important;
    }

    .popup-arrow {
        width: 35px;
        height: 35px;
    }

    .popup-arrow svg {
        width: 18px;
        height: 18px;
    }

    .popup-arrow-prev {
        left: 5px;
    }

    .popup-arrow-next {
        right: 5px;
    }
}