@charset "UTF-8";

/* 1. 이미지 슬라이더 및 기본 스타일 */
.main-img-container {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 4/3;
    overflow: hidden;
    border-radius: 12px;
}

#mainView {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.3);
    color: white;
    border: none;
    padding: 8px 15px;
    cursor: pointer;
    z-index: 10;
    font-weight: bold;
    transition: 0.3s;
    line-height: 1;
    font-size: 1.2rem;
}

.nav-btn:hover { background: rgba(0, 0, 0, 0.7); }
.prev-btn { left: 0; border-radius: 0 5px 5px 0; }
.next-btn { right: 0; border-radius: 5px 0 0 5px; }

/* 2. 썸네일 영역 */
.thumb-scroll-container {
    display: flex;
    overflow-x: auto;
    gap: 10px;
    scrollbar-width: none;
    justify-content: safe center;
}
.thumb-scroll-container::-webkit-scrollbar { display: none; }
.thumb-item { flex: 0 0 85px; }
.thumb-btn {
    width: 100%;
    opacity: 0.5;
    transition: 0.3s;
    cursor: pointer;
    border: 2px solid transparent !important;
    padding: 0;
    background: none;
}
.thumb-btn.active { opacity: 1; border-color: #198754 !important; }

/* [상단 요약 카드 스타일] */
.product-summary-card {
    background: #fff;
    padding: 25px;
    border-radius: 15px;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    border: 1px solid #f0f0f0;
}

.unit-price-row {
    font-size: 1.6rem;
    color: #dc3545 !important;
    font-weight: 800;
    margin-bottom: 25px;
}

.purchase-config-area {
    display: flex;
    align-items: stretch;
    justify-content: center;
    margin-bottom: 25px;
    padding: 20px 0;
    background-color: #f8f9fa;
    border-radius: 10px;
}

.qty-selector-wrapper, .total-price-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.qty-title, .total-title {
    font-size: 1.1rem; 
    font-weight: 800;
    color: #333;
    margin-bottom: 10px;
}

.total-price-wrapper {
    border-left: 1px solid #ddd;
}

.totalPriceText-large {
    font-size: 2.0rem; 
    font-weight: 800;
    color: #198754;
}

.input-group-fixed {
    width: 150px !important;
    flex-wrap: nowrap !important;
    position: relative; 
}

/* 3. 상단 Sticky 탭 메뉴 */
.sticky-nav {
    position: sticky;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(5px);
    z-index: 1000;
    border-top: 1px solid #eee;
    border-bottom: 2px solid #198754;
    margin-bottom: 50px;
}
.nav-tabs-custom { display: flex; list-style: none; padding: 0; margin: 0 auto; max-width: 1100px; }
.nav-tabs-custom li { flex: 1; text-align: center; }
.nav-tabs-custom a { display: block; padding: 15px 0; color: #888; text-decoration: none; font-weight: bold; transition: 0.3s; }
.nav-tabs-custom a.active { color: #198754; border-bottom: 3px solid #198754; }

/* 4. 본문 상세 정보 */
.section-detail { scroll-margin-top: 80px; max-width: 850px; margin: 0 auto 60px auto; }
.btn-buy-group { display: flex; gap: 50px; width: 100%; justify-content: center; }
.btn-buy-group .btn { flex: 0 1 auto; padding: 8px 25px; font-size: 1.1rem; font-weight: bold; }

/* 5. 하단 고정 스티키 바 (애니메이션 개선) */
.bottom-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 -8px 25px rgba(0, 0, 0, 0.15);
    z-index: 1100;
    padding: 15px 0;
    /* 초기 상태: 아래로 숨김 */
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.4s;
    pointer-events: none; /* 숨겨져 있을 때 클릭 방지 */
}

/* 활성화 상태 */
.bottom-sticky-bar.show {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
}

.sticky-container {
    max-width: 1200px; margin: 0 auto; display: flex; align-items: center; justify-content: center; gap: 70px; padding: 0 30px;
}
.sticky-info-wrapper { display: contents; }
.sticky-product-info { flex: 0 1 auto; text-align: center; }
.sticky-product-info .sticky-name { font-size: 1.2rem; font-weight: 800; color: #212529; margin: 0; margin-bottom: 2px; }
.sticky-product-info .sticky-price { font-size: 1.3rem; color: #dc3545 !important; font-weight: 700; margin: 0; }

.sticky-total-area {
    flex: 0 1 auto; text-align: center; padding: 0 50px; border-left: 1px solid #eee; border-right: 1px solid #eee;
}
.sticky-total-label { font-size: 1.0rem; color: #888; margin-bottom: 2px; }
.totalPriceText { font-size: 1.6rem; font-weight: 800; color: #198754; }
.sticky-action-area { flex: 0 1 auto; display: flex; align-items: center; gap: 20px; }

.sticky-qty-label {
    font-size: 0.85rem;
    color: #666;
    margin-right: 8px;
    font-weight: bold;
}

.sticky-action-area .input-group {
    position: relative;
}

.qty-msg-box {
    position: absolute;
    bottom: 120%;
    left: 50%;
    transform: translateX(-50%);
    background-color: rgba(51, 51, 51, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
.qty-msg-box::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: rgba(51, 51, 51, 0.9) transparent transparent transparent;
}

/* 6. Top 버튼 (아이콘형 둥근 스타일 - 스티키 바와 연동) */
#back-to-top {
    position: fixed;
    bottom: 100px;
    right: 30px;
    z-index: 1200;
    
    /* 레이아웃 제어 */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    
    /* 디자인 */
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    cursor: pointer;
    padding: 0;
    
    /* 초기 상태: 아래로 숨김 */
    opacity: 0;
    transform: translateY(150%);
    transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), 
                opacity 0.4s, 
                background-color 0.3s, 
                border-color 0.3s;
    pointer-events: none;
}

/* 활성화 상태 (스티키 바와 함께 클래스 제어) */
#back-to-top.show {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* 위로 꺽쇠 아이콘 (CSS Drawing) */
#back-to-top .up-arrow {
    width: 10px;
    height: 10px;
    border-top: 2px solid #333;
    border-left: 2px solid #333;
    transform: rotate(45deg);
    margin-bottom: -2px;
    margin-top: 4px;
    transition: border-color 0.3s;
}

/* TOP 글자 스타일 */
#back-to-top .top-text {
    font-size: 11px;
    font-weight: bold;
    color: #333;
    transition: color 0.3s;
}

/* 호버 효과 */
#back-to-top:hover {
    background-color: #f8f9fa;
    border-color: #198754;
}

#back-to-top:hover .up-arrow {
    border-color: #198754;
}

#back-to-top:hover .top-text {
    color: #198754;
}

/* 7. 모바일 대응 */
@media (max-width: 992px) {
    .bottom-sticky-bar {
        padding: 15px 0;
        display: block; 
    }

    .sticky-container {
        display: flex;
        flex-direction: column-reverse;
        gap: 10px;
        padding: 0;
    }

    .sticky-info-wrapper {
        display: flex;
        width: 100%;
        flex-direction: row; 
        align-items: center;
    }

    .sticky-product-info, .sticky-total-area {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center; 
        flex: 1;
        width: 50%;
        margin: 0;
        padding: 5px 0;
    }

    .sticky-product-info {
        border-right: 1px solid #eee;
    }

    .sticky-product-info .sticky-name {
        font-size: 1.1rem;
        margin-bottom: 2px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 90%; 
    }

    .sticky-product-info .sticky-price {
        font-size: 1.2rem;
        margin: 0;
    }

    .sticky-total-area .sticky-total-label {
        font-size: 1.0rem;
        margin-bottom: 0;
    }
    
    .unit-price-row {
    	font-size: 1.5rem;
    }

    .totalPriceText {
        font-size: 1.4rem;
    }

    .sticky-action-area {
        width: 100%;
        justify-content: center;
        padding: 0 15px;
        gap: 20px;
    }

    /* 모바일 전용 Top 버튼 위치 조정 및 크기 축소 */
    #back-to-top {
        bottom: 160px; /* 모바일 하단바 높이 고려 */
        right: 20px;
        width: 48px;
        height: 48px;
    }
    
    #back-to-top .up-arrow {
        width: 8px;
        height: 8px;
    }
    
    #back-to-top .top-text {
        font-size: 10px;
    }
}