/* ===== ARKDIO - POPUP Frontend Styles ===== */

/* Popup Overlay */
.ap-popup-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}
.ap-popup-wrap.ap-visible {
    opacity: 1;
}

/* Background overlay */
.ap-popup-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
}

/* Popup Container - max-width set dynamically via JS */
.ap-popup-container {
    position: relative;
    z-index: 2;
    width: 85%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Slider */
.ap-popup-slider {
    width: 100%;
    overflow: hidden;
}
.ap-popup-slider .swiper-wrapper {
    display: flex;
    align-items: flex-start;
}

/* Slide */
.ap-slide {
    flex-shrink: 0;
}
.ap-slide-inner {
    position: relative;
    width: 100%;
    height: 0;
    overflow: hidden;
    background: #fff;
    isolation: isolate; /* 명확한 스택 컨텍스트 생성 → iframe/poster z-index 정상 동작 */
    /* border-radius set via inline style from settings */
}
/* PC: hover - entire slide lifts up (distance set by JS) */
@media (min-width: 769px) {
    .ap-hover-enabled .ap-slide {
        transition: transform 0.25s ease;
    }
}
.ap-slide-inner img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.ap-slide-inner a {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}
.ap-slide-inner a img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Bottom bar */
.ap-popup-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 5px;
    box-sizing: border-box;
}

/* Checkbox - 13px */
.ap-popup-check {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff !important;
    font-size: 13px;
    cursor: pointer;
    user-select: none;
}
.ap-popup-check span {
    color: #fff !important;
}
.ap-popup-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #fff;
    cursor: pointer;
}

/* Close button - SAME 13px as checkbox */
.ap-popup-close {
    color: #fff;
    font-size: 13px;
    text-decoration: none;
    padding: 5px 10px;
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 4px;
    transition: all 0.2s;
}
.ap-popup-close:hover {
    color: #fff;
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.6);
    text-decoration: none;
}

/* ===== Navigation Arrows ===== */
.ap-nav-prev,
.ap-nav-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    cursor: pointer;
    z-index: 10;
    color: rgba(255,255,255,0.8);
    transition: color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ap-nav-prev:hover,
.ap-nav-next:hover {
    color: #fff;
}
.ap-nav-prev svg,
.ap-nav-next svg {
    width: 100%;
    height: 100%;
}
.ap-nav-prev.swiper-button-disabled,
.ap-nav-next.swiper-button-disabled {
    opacity: 0.2;
    cursor: default;
}
/* PC: arrows outside slider area, inside container */
.ap-nav-prev {
    left: -44px;
}
.ap-nav-next {
    right: -44px;
}

/* ===== Mobile - Centered + Symmetric Peek ===== */
@media (max-width: 768px) {
    .ap-popup-container {
        width: 100%;
        padding: 0 4%;
        box-sizing: border-box;
    }
    .ap-popup-bottom {
        padding: 10px 0;
    }
    .ap-popup-check {
        font-size: 12px;
    }
    .ap-popup-close {
        font-size: 12px;
    }
    /* Overflow visible to show symmetric peek on both sides */
    .ap-popup-slider {
        overflow: visible;
    }
    /* Inactive slides dimmed for peek effect */
    .ap-popup-slider .swiper-slide {
        opacity: 0.35;
        transition: opacity 0.3s ease;
    }
    .ap-popup-slider .swiper-slide-active {
        opacity: 1;
    }
    /* Mobile: arrows on peek area, slightly inset from edge */
    .ap-nav-prev,
    .ap-nav-next {
        width: 28px;
        height: 28px;
        top: 50%;
    }
    .ap-nav-prev {
        left: 10px;
    }
    .ap-nav-next {
        right: 10px;
    }
}

/* Mobile hidden (controlled by JS) */
.ap-popup-wrap.ap-hide-mobile {
    display: none !important;
}

/* ===== 동영상 슬라이드 공통 ===== */
.ap-slide-media {
    background: #000;
}

/* mp4 video 요소 */
.ap-video-element {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: none;
    display: block;
}

/* YouTube iframe */
.ap-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
    z-index: 1; /* isolation 컨텍스트 내에서 포스터(100) 보다 낮게 */
}

/* YouTube 비율 커버 래퍼:
   padding-bottom 부모에서 자식 높이 상속이 불가능하므로
   left/top/width/height 는 JS(setupYtScalers)가 px 단위로 명시 설정. */
.ap-yt-scaler {
    position: absolute;
    overflow: hidden;
    z-index: 1; /* 포스터(100) 보다 낮게 */
}
.ap-yt-scaler .ap-video-iframe {
    position: absolute;
    top: 0;
    left: 0;
    border: none;
    display: block;
    transform-origin: 50% 50%;
    z-index: auto;
}

/* 포스터 오버레이 (YouTube 로딩 대기) */
.ap-video-poster {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100;
    transform: translateZ(0); /* iframe GPU 레이어 위로 강제 승격 */
    transition: opacity 0.5s ease;
    pointer-events: none;
}
.ap-video-poster img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ap-video-poster.ap-poster-fade {
    opacity: 0;
}

/* ===== 문의 폼 바 ===== */
.ap-inquiry-bar {
    width: 100%;
    background: #111111; /* 기본값: 다크. PHP inline style로 덮어씀 */
    border-radius: 0 0 10px 10px;
    padding: 14px 16px;
    box-sizing: border-box;
    box-shadow: 0 6px 24px rgba(0,0,0,0.4);
}
.ap-inquiry-form {
    width: 100%;
}
.ap-inquiry-fields {
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}
.ap-inq-input,
.ap-inq-select {
    flex: 1;
    min-width: 90px;
    height: 40px;
    padding: 0 12px !important;
    border: none !important;
    border-radius: 6px !important;
    font-size: 14px !important;
    color: #111 !important;
    background: #ffffff !important;
    outline: none !important;
    transition: box-shadow 0.2s;
    box-sizing: border-box !important;
    box-shadow: none !important;
    font-family: inherit !important;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}
.ap-inq-input:focus,
.ap-inq-select:focus {
    box-shadow: 0 0 0 2px rgba(255,255,255,0.6);
}
.ap-inq-input::placeholder {
    color: #aaa !important;
}
.ap-inq-select {
    background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23999' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center !important;
    padding-right: 30px !important;
    cursor: pointer;
    color: #aaa !important;
}
.ap-inq-select.ap-has-value {
    color: #111 !important;
}
.ap-inq-select option {
    background: #fff;
    color: #111;
}
.ap-inq-btn {
    flex-shrink: 0;
    height: 40px;
    padding: 0 22px;
    background: #FFD700; /* 기본값: 노랑. PHP inline style로 덮어씀 */
    color: #000;         /* 대비용 기본 검정 텍스트. PHP inline style로 덮어씀 */
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.2s;
    white-space: nowrap;
    letter-spacing: 0.3px;
}
.ap-inq-btn:hover {
    filter: brightness(0.88);
}
.ap-inq-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    filter: none;
}
.ap-inq-msg {
    margin-top: 8px;
    font-size: 13px;
    text-align: center;
    padding: 7px 14px;
    border-radius: 6px;
}
.ap-inq-msg.success {
    background: rgba(5,150,105,0.18);
    color: #34d399;
    border: 1px solid rgba(52,211,153,0.3);
}
.ap-inq-msg.error {
    background: rgba(220,38,38,0.18);
    color: #f87171;
    border: 1px solid rgba(248,113,113,0.3);
}

@media (max-width: 768px) {
    .ap-inquiry-bar {
        padding: 12px 10px;
        border-radius: 0 0 8px 8px;
    }
    .ap-inquiry-fields {
        gap: 6px;
    }
    .ap-inq-input,
    .ap-inq-select {
        font-size: 13px;
        height: 38px;
    }
    .ap-inq-btn {
        width: 100%;
        height: 38px;
        font-size: 13px;
    }
}
