/* gacha-drawer.css - 상단 픽업/셀렉션 선택 서랍 스타일 (레이어 분리형) */

.gacha-drawer {
    position: fixed;
    top: 0; left: 0;
    width: 100%;
    height: 35vh; 
    background: rgba(10, 10, 10, 0.15);
    backdrop-filter: blur(25px);
    z-index: 20001;
    transform: translateY(-100%);
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
}

.gacha-drawer.active {
    transform: translateY(0);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.8);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.drawer-header { display: none; }

/* 공통 스크롤 컨테이너 */
.drawer-content-scroll {
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    position: relative;
    scroll-snap-type: x mandatory;
    padding: 0 50vw; /* 양옆 여백 */
}

.drawer-content-scroll::-webkit-scrollbar { height: 0; background: transparent; }

/* 1. 인디케이터 레이어 (가로선 + 마름모) */
.drawer-indicator-layer {
    position: absolute;
    bottom: 0; 
    left: 50vw;
    height: 100px;
    display: flex;
    gap: 40px;
    align-items: flex-end;
    pointer-events: none;
    z-index: 10;
}

.drawer-indicator-line {
    position: absolute;
    bottom: 30px; /* 라인 위치 고정 (마름모 중앙) */
    left: 0;
    width: 100%;
    height: 1px;
    background: rgba(255, 255, 255, 0.15);
    z-index: 1;
    pointer-events: none;
}

.drawer-diamond-wrapper {
    width: 160px;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding-bottom: 23px; /* 크기 확대에 따른 위치 재보정 (아래로) */
    scroll-snap-align: center;
}

.drawer-diamond-wrapper.selection-diamond {
    width: 280px; /* 셀렉션용 너비 보정 */
}

.drawer-item-date { 
    color: #fff; 
    font-size: 0.7rem; 
    opacity: 0.8; 
    margin-bottom: 12px;
}

/* 2. 아이템 레이어 (이미지 + 텍스트) */
.drawer-items-layer {
    display: flex;
    gap: 40px;
    padding-top: 40px;
    position: relative;
    z-index: 2;
}

.drawer-item {
    width: 160px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: transform 0.3s, opacity 0.3s;
    scroll-snap-align: center;
    position: relative; /* 자식 요소 absolute 배치를 위함 */
}

/* 중앙 강조 효과 */
.drawer-item { transform: scale(0.85); opacity: 0.5; }
.drawer-item.active-item { transform: scale(1.05); opacity: 1; }

.drawer-card-img {
    width: 100%;
    aspect-ratio: 1 / 1.25;
    background-size: cover;
    background-position: top;
    border-radius: 0 50px 0 50px; /* 우상단과 좌하단 라운딩 */
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);
    margin-bottom: 12px;
    z-index: 5;
}

.drawer-item.selection-type { width: 280px; }
.drawer-item.selection-type .drawer-card-img { 
    aspect-ratio: 16 / 9; 
    border-radius: 0 50px 0 50px; /* 우상단과 좌하단 라운딩 */
}

.drawer-item-name {
    color: #fff; font-size: 0.85rem; font-weight: bold;
    height: 2.4rem; display: flex; align-items: center; justify-content: center; text-align: center;
    margin-bottom: 4px;
}



.drawer-diamond {
    font-size: 16px;
    color: rgba(255, 255, 255, 0.4);
    transform-origin: center center;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.active-diamond .drawer-diamond {
    font-size: 16px;
    color: #ff4081;
    transform: scale(1.8); /* 배율을 1.8로 하향 조정 */
    text-shadow: 0 0 8px #ff4081;
    opacity: 1;
}

/* 오버레이 */
.drawer-overlay {
    position: fixed; top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.3); z-index: 20000;
    visibility: hidden; opacity: 0; transition: opacity 0.3s, visibility 0.3s;
}
.drawer-overlay.active { visibility: visible; opacity: 1; }

@media (max-width: 768px) {
    .gacha-drawer { height: 38vh; } /* 기본 높이 38vh 복구 */
    .gacha-drawer.drawer-horizontal-mode { height: 34vh; } /* 32vh에서 34vh로 조정 */
    
    .drawer-card-img { 
        width: 100%; 
        margin-bottom: 10px; 
        border-radius: 0 30px 0 30px; /* 모바일 우상단/좌하단 라운딩 */
    } 
    .drawer-item { width: 130px; }
    .drawer-item.selection-type { width: 180px; } /* 200px에서 180px로 최종 축소 */
    .drawer-item.selection-type .drawer-card-img {
        border-radius: 0 30px 0 30px; /* 모바일 우상단/좌하단 라운딩 */
    }
    .drawer-content-scroll { padding: 15px 50vw 0; }
    .drawer-item-name { font-size: 0.8rem; width: 100%; height: 2.2rem; } 
    .drawer-item.selection-type .drawer-item-name { width: 100%; }
    
    /* 레이어 간격 확대 */
    .drawer-items-layer { gap: 50px; padding-top: 35px; }
    .drawer-indicator-layer { gap: 50px; bottom: 0; }
    
    .drawer-diamond-wrapper { 
        width: 130px; 
        padding-bottom: 15px !important; /* 16px에서 1px 내려서 15px로 조정 */
    }
    .drawer-diamond-wrapper.selection-diamond {
        width: 180px; /* 아이템 너비와 동일하게 180px로 축소 */
    }
    .drawer-indicator-line { 
        bottom: 20px; 
    }
    .drawer-diamond {
        font-size: 12px !important;
    }
}

/* 서랍 내 픽업/선택 아이템용 플랜 아이콘 */
.drawer-plan-icon {
    position: absolute;
    top: 6px;
    left: 6px;
    width: 24px;
    z-index: 10;
}

@media (max-width: 768px) {
    .drawer-plan-icon {
        width: 18px;
        top: 4px;
        left: 4px;
    }
}
