/* ===================================================
   배너 슬라이더 스타일 - 플랫 캐러셀
   - 반응형: 960px 기준으로 1:2.7 → 1:1 비율 변경
   - 좌우 슬라이드가 같은 레이어에 나란히 배치
   - 자동 슬라이드, 스와이프, 컨트롤 버튼
   =================================================== */

/* 배너 컨테이너 */
.top-banner-slider {
    width: 100%;
    padding: 40px 0;
    background: #f8f9fa;
    overflow: hidden; /* 좌우 넘치는 슬라이드 숨김 - 최상위에서 처리 */
}

.banner-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: flex-start; /* JavaScript가 transform으로 중앙 배치 처리 */
    /* 컨테이너 높이를 배너 슬라이드 높이와 동일하게 설정 */
    min-height: calc(var(--vw, 1vw) * 85 / 2.7); /* 데스크톱: 2.7:1 비율 */
}

/* 배너 래퍼 - 슬라이드들을 가로로 배치 */
.banner-wrapper {
    display: flex;
    gap: 24px; /* 슬라이드 간격 */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform; /* GPU 가속 최적화 */
}

/* 개별 배너 슬라이드 */
.banner-slide {
    position: relative;
    flex: 0 0 calc(var(--vw, 1vw) * 85); /* 스크롤바 제외한 윈도우 너비의 85% */
    aspect-ratio: 2.7 / 1; /* 1:2.7 비율 */
    border-radius: 20px;
    overflow: hidden;
    transition: opacity 0.3s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* 배너 슬라이드 컨테이너 */
.banner-slide > div {
    position: relative;
    width: 100%;
    height: 100%;
}

/* 배너 콘텐츠 - 이미지 위에 텍스트 오버레이 */
.banner-content {
    position: relative;
    padding: 2.4rem;
    width: 100%;
    height: -moz-fit-content;
    height: fit-content;
    margin: 0 auto;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 0.4rem;
    z-index: 2;
    font-family: "Pretendard Variable", pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
}

/* 배너 텍스트 */
.banner-text {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    color: rgb(255, 255, 255);
    max-width: 98rem;
    font-family: "Pretendard Variable", pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, "Helvetica Neue", "Segoe UI", "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    white-space-collapse: preserve;
    text-wrap-mode: wrap;
    overflow-wrap: break-word;
    word-break: keep-all;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    -webkit-font-smoothing: antialiased;
}

.banner-text h2 {
    font-size: 4rem;
    font-weight: 700;
    line-height: 1.2;
    max-width: 43rem;
    word-break: keep-all;
    text-align: center;
}

.banner-text p {
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.5;
    max-width: 43rem;
    word-break: keep-all;
    text-align: center;
}

.banner-btn {
    display: inline-block;
    padding: 14px 32px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid #fff;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border-radius: 50px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.banner-btn:hover {
    background: #fff;
    color: #333;
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
}

/* 배너 배경 이미지 래퍼 */
.banner-slide > div > div:last-child:not(.banner-text) {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* 컨트롤 UI - 배너 내부에 배치 */
.banner-controls {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(var(--vw, 1vw) * 85); /* 데스크톱: 배너와 동일한 너비 */
    max-width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    z-index: 10;
    pointer-events: none;
    padding: 0 20px;
    box-sizing: border-box;
}

.banner-pagination,
.banner-buttons {
    pointer-events: auto;
}

/* 페이지네이션 (좌하단) */
.banner-pagination {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #fff !important; /* 모든 텍스트 흰색 */
    font-size: 11px !important; /* 모든 폰트 크기 11px 통일 */
    font-weight: 300 !important; /* 얇은 폰트로 통일 */
    padding: 4px 10px;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 16px;
    backdrop-filter: blur(10px);
}

.banner-pagination * {
    color: #fff !important; /* 슬래쉬 포함 모든 요소 흰색 */
    font-size: 12px !important; /* 모든 폰트 크기 11px 통일 */
    font-weight: 300 !important; /* 모든 텍스트 얇은 폰트로 통일 */
}

.banner-pagination .current-slide {
    font-size: 12px !important; /* 현재 페이지도 11px */
    font-weight: 300 !important; /* 현재 페이지도 얇은 폰트 */
    color: #fff !important; /* 현재 페이지 흰색 */
}

.banner-pagination .total-slides {
    color: #fff !important; /* 총 페이지 흰색 */
    font-size: 12px !important; /* 총 페이지도 11px */
    font-weight: 300 !important; /* 총 페이지도 얇은 폰트 */
}

/* 버튼 그룹 (우하단) */
.banner-buttons {
    display: flex;
    gap: 6px;
}

.banner-control-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(0, 0, 0, 0.5); /* 페이지네이션과 동일한 어두운 배경 */
    color: #fff !important; /* 흰색 아이콘 */
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    font-size: 14px !important; /* 유니코드 문자 크기 */
    line-height: 1;
    font-family: Arial, sans-serif; /* 유니코드 문자가 잘 보이는 폰트 */
}

.banner-control-btn:hover {
    background: rgba(0, 0, 0, 0.7); /* 호버 시 더 진한 배경 */
    transform: scale(1.05);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.3);
}

/* 재생/일시정지 버튼 토글 */
.pause-btn {
    display: flex;
}

.play-btn {
    display: none;
}

.pause-btn.hidden {
    display: none;
}

.play-btn.active {
    display: flex;
}

/* 반응형: 태블릿 (960px 이하) */
@media (max-width: 960px) {
    .banner-slide {
        flex: 0 1 calc(var(--vw, 1vw) * 90); /* 스크롤바 제외한 화면 중앙 90% 차지, 필요시 축소 가능 */
        width: calc(var(--vw, 1vw) * 90); /* 스크롤바 제외한 너비를 90%로 명시적 설정 */
        max-width: 420px; /* 정사각형 최대 너비 제한 */
        min-width: 288px; /* 정사각형 최소 너비 제한 */
        aspect-ratio: 1 / 1; /* 정사각형 */
    }

    /* 모바일에서는 슬라이드 간격 축소 */
    .banner-wrapper {
        gap: 16px;
    }

    .banner-content {
        padding: 2.4rem;
        width: 100%;
        height: fit-content;
        margin: 0 auto;
        align-items: center;
        gap: .4rem;
        justify-content: flex-start;
    }

    .banner-text {
        text-align: center;
        max-width: 100%;
    }

    .banner-text h2 {
        font-size: 2.4rem !important;
        font-weight: 700;
        line-height: 150%;
        text-align: center;
    }

    .banner-text p {
        font-size: 1.4rem !important;
        font-weight: 400;
        line-height: 150%;
        text-align: center;
    }

    .banner-btn {
        padding: 12px 28px;
        font-size: 15px;
    }

    .banner-container {
        padding: 0 40px;
        /* 정사각형 배너 높이에 맞춤 (1:1 비율) */
        min-height: min(calc(var(--vw, 1vw) * 90), 420px);
    }

    .banner-controls {
        width: calc(var(--vw, 1vw) * 90); /* 모바일: 배너와 동일한 너비 */
        max-width: 420px; /* 배너 최대 너비와 동일 */
        bottom: 15px;
        padding: 0 15px;
    }
}

/* 반응형: 모바일 (600px 이하) */
@media (max-width: 600px) {
    .top-banner-slider {
        padding: 20px 0;
    }

    .banner-container {
        padding: 0 20px;
        /* 정사각형 배너 높이에 맞춤 (1:1 비율) */
        min-height: min(calc(var(--vw, 1vw) * 90), 420px);
    }

    .banner-slide {
        flex: 0 1 calc(var(--vw, 1vw) * 90); /* 스크롤바 제외한 화면 중앙 90% 차지, 필요시 축소 가능 */
        width: calc(var(--vw, 1vw) * 90); /* 스크롤바 제외한 너비를 90%로 명시적 설정 */
        max-width: 420px; /* 정사각형 최대 너비 제한 */
        min-width: 288px; /* 정사각형 최소 너비 제한 */
        border-radius: 15px;
    }

    .banner-wrapper {
        gap: 16px; /* 간격 줄임 */
    }

    .banner-content {
        padding: 2.4rem;
    }

    .banner-text h2 {
        font-size: 2.4rem;
        font-weight: 700;
        line-height: 150%;
        text-align: center;
    }

    .banner-text p {
        font-size: 1.4rem;
        font-weight: 400;
        line-height: 150%;
        text-align: center;
    }

    .banner-btn {
        padding: 10px 24px;
        font-size: 14px;
    }

    .banner-controls {
        width: calc(var(--vw, 1vw) * 90); /* 모바일: 배너와 동일한 너비 */
        max-width: 420px; /* 배너 최대 너비와 동일 */
        bottom: 12px;
        padding: 0 12px;
    }

    .banner-pagination {
        font-size: 10px;
        padding: 3px 8px;
        gap: 4px;
        font-weight: 300 !important; /* 얇은 폰트 유지 */
    }

    .banner-pagination .current-slide {
        font-size: 12px;
        font-weight: 300 !important; /* 얇은 폰트 유지 */
    }

    .banner-control-btn {
        width: 28px;
        height: 28px;
        font-size: 12px !important; /* 모바일에서 유니코드 문자 크기 */
    }
}

/* 반응형: 데스크톱 (961px 이상) */
@media (min-width: 961px) {
    .banner-content {
        padding: 0 4rem 3rem;
        height: 100%;
        justify-content: center;
        align-items: flex-start;
        gap: 1.2rem;
    }

    .banner-text {
        align-items: flex-start;
        text-align: left;
    }

    .banner-text h2,
    .banner-text p {
        text-align: left;
    }
}

/* 터치 디바이스 최적화 */
@media (hover: none) and (pointer: coarse) {
    .banner-wrapper {
        cursor: grab;
    }

    .banner-wrapper:active {
        cursor: grabbing;
    }

    .banner-control-btn:hover {
        transform: none;
    }

    .banner-control-btn:active {
        transform: scale(0.9);
    }
}

/* 접근성 개선 */
.banner-control-btn:focus {
    outline: 3px solid rgba(66, 153, 225, 0.6);
    outline-offset: 2px;
}

/* 애니메이션 감소 모션 선호 */
@media (prefers-reduced-motion: reduce) {
    .banner-wrapper,
    .banner-control-btn,
    .banner-btn {
        transition: none;
    }
}

/* 로딩 상태 */
.banner-wrapper.loading .banner-slide {
    opacity: 0.5;
}

/* 모든 슬라이드 동일한 opacity 유지 (흐려짐 방지) */
.banner-slide:not(.active) {
    opacity: 1;
}

.banner-slide.active {
    opacity: 1;
}
