/* ======================================================
   product-detail-new.css
   ① 갤러리: 세로 썸네일 왼쪽 + 메인 이미지 오른쪽 (무신사 스타일)
   ② 컬러 칩: select 숨기고 시각적 칩 표시
   ③ 구매 영역 개선 (Humi 무드 유지)
   ※ 기존 product-detail.css 를 덮어씌우는 override 파일
   ====================================================== */

/* ── ① 갤러리 레이아웃 ──────────────────────────────── */

/* 기존: flex-direction:column → 썸네일 아래
   변경: flex-direction:row → 썸네일 왼쪽, 메인 오른쪽 */
.product-gallery {
    flex-direction: row !important;
    align-items: flex-start;
    gap: 14px !important;
    position: relative;
}

/* 썸네일 세로 스크롤 컬럼 */
.product-gallery__thumbs {
    display: flex !important;
    flex-direction: column !important;
    flex-wrap: nowrap !important;
    gap: 10px !important;
    width: 88px;
    min-width: 88px;
    max-height: 560px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #d5b8c8 transparent;
    order: -1; /* 썸네일을 메인 앞(왼쪽)으로 */
    padding-right: 4px;
}

.product-gallery__thumbs::-webkit-scrollbar {
    width: 4px;
}
.product-gallery__thumbs::-webkit-scrollbar-thumb {
    background: #d5b8c8;
    border-radius: 4px;
}

/* 썸네일 버튼 */
.thumb-btn {
    width: 80px !important;
    height: 80px !important;
    min-height: 80px;
    border-radius: 12px !important;
    border: 1.5px solid #e8e8e8 !important;
    flex-shrink: 0;
    transition: border-color 0.15s;
}

.thumb-btn--active {
    border-color: #111 !important;
    box-shadow: 0 0 0 1px #111;
}

/* 메인 이미지 영역 */
.product-gallery__main {
    flex: 1;
    min-width: 0;
    position: relative;
    border-radius: 20px !important;
    overflow: hidden;
}

/* 이미지 카운터 */
.gallery-counter {
    position: absolute;
    bottom: 14px;
    right: 14px;
    background: rgba(0,0,0,0.45);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 5px 12px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    pointer-events: none;
    z-index: 2;
}

/* 이전/다음 네비 버튼 */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.88);
    border: none;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
    box-shadow: 0 2px 12px rgba(0,0,0,0.14);
    transition: background 0.15s, opacity 0.15s;
    backdrop-filter: blur(4px);
}

.gallery-nav--prev {
    left: 12px;
}

.gallery-nav--next {
    right: 12px;
}

.gallery-nav:hover {
    background: rgba(255,255,255,1);
}

.gallery-nav:disabled {
    opacity: 0.3;
    cursor: default;
}

/* ── ② 컬러 이미지 칩 ────────────────────────────────── */

/* 기존 select는 패널용으로만 남기고 화면에서 숨김 */
#colorOption {
    display: none !important;
}

/* 컬러 칩 컨테이너 */
.color-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 6px;
}

/* 이미지형 컬러 칩 컨테이너 */
.color-chip-group--image {
    gap: 10px;
}

/* 이미지 칩 */
.color-chip--img {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 0;
    border: 2px solid #e8e8e8;
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.18s ease, transform 0.15s ease;
    overflow: hidden;
    width: 76px;
}

.color-chip--img img {
    width: 76px;
    height: 76px;
    object-fit: cover;
    display: block;
    border-radius: 10px 10px 0 0;
    background: #f5f5f5;
}

.color-chip__name {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    padding: 0 4px 7px;
    white-space: nowrap;
    transition: color 0.15s;
}

.color-chip--img:hover {
    border-color: #aaa;
    transform: translateY(-2px);
}

.color-chip--img.is-active {
    border-color: #111;
    box-shadow: 0 0 0 1px #111;
}

.color-chip--img.is-active .color-chip__name {
    color: #111;
    font-weight: 800;
}

/* 텍스트 칩 (fallback) */
.color-chip:not(.color-chip--img) {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 14px;
    border: 1.5px solid #e0e0e0;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    color: #333;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
}

.color-chip:not(.color-chip--img):hover { border-color: #888; }
.color-chip:not(.color-chip--img).is-active {
    border-color: #111;
    background: #111;
    color: #fff;
}

/* ── ③ 사이즈 select 스타일 개선 ────────────────────── */
#sizeOption.product-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 7L11 1' stroke='%23555' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

/* ── ④ 총 금액 영역 스타일 개선 ──────────────────────── */
.product-total-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
    margin: 16px 0 !important;
}

.product-total-box span {
    font-size: 13px;
    color: #888;
    font-weight: 600;
}

.product-total-box strong {
    font-size: 22px;
    font-weight: 800;
    color: #111;
    letter-spacing: -0.03em;
}

/* ── ⑤ 구매 버튼 행 개선 ──────────────────────────────
   찜하기 | 장바구니 | 바로구매  구성 유지하되
   찜하기 버튼을 아이콘 형태로 압축
──────────────────────────────────────────────────── */
.product-action-row {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-top: 20px !important;
}

/* 찜하기: 한 줄에 맞는 크기로 고정 */
.action-btn--light {
    width: auto !important;
    min-width: 80px !important;
    height: 52px !important;
    padding: 0 16px !important;
    border-radius: 14px !important;
    border: 1.5px solid #e8e8e8 !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    white-space: nowrap !important;
    word-break: keep-all !important;
}

/* 장바구니 */
.action-btn--line {
    flex: 1;
    height: 52px !important;
    border-radius: 14px !important;
    border: 1.5px solid #111 !important;
    font-size: 14px !important;
    font-weight: 800;
}

/* 바로구매 */
.action-btn--dark {
    flex: 1.4;
    height: 52px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    font-weight: 800;
    background: #111 !important;
}

/* ── 반응형 ────────────────────────────────────────── */
@media (max-width: 768px) {
    .product-gallery {
        flex-direction: column !important;
    }

    .product-gallery__thumbs {
        flex-direction: row !important;
        width: 100% !important;
        max-height: none;
        overflow-x: auto;
        overflow-y: hidden;
        order: 1; /* 모바일에서는 아래로 */
    }

    .thumb-btn {
        width: 68px !important;
        height: 68px !important;
    }
}