/* ============================================================
   김치광장 - 장바구니 페이지 전용 CSS (basket.css)
   ============================================================ */


/* ============================================================
   본문 컨테이너
   ============================================================ */
.basket-wrap {
    padding: 30px 0 60px;
}


/* ============================================================
   주문 진행 단계 (장바구니 → 주문/결제 → 주문완료)
   ============================================================ */
.basket-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    list-style: none;
    margin: 0 0 36px;
    padding: 0;
}

.basket-steps li {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #b0b0b0;
    font-size: 14px;
    position: relative;
    padding-right: 32px;
}

.basket-steps li:last-child {
    padding-right: 0;
}

.basket-steps li:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 1px;
    background: #d0d0d0;
}

.basket-steps .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid #d0d0d0;
    background: #ffffff;
    font-size: 14px;
    font-weight: 600;
}

.basket-steps .step-label {
    font-weight: 500;
}

.basket-steps li.is-active {
    color: #292829;
}

.basket-steps li.is-active .step-num {
    background: #292829;
    border-color: #292829;
    color: #ffffff;
}


/* ============================================================
   빈 장바구니
   ============================================================ */
.basket-empty {
    text-align: center;
    padding: 80px 20px;
    color: #888888;
}

.basket-empty .material-icons {
    font-size: 80px;
    color: #d0d0d0;
    display: block;
    margin: 0 auto 18px;
}

.basket-empty .empty-title {
    font-size: 20px;
    font-weight: 700;
    color: #292829;
    margin: 0 0 8px;
}

.basket-empty .empty-text {
    font-size: 14px;
    color: #888888;
    margin: 0 0 24px;
}

.basket-empty .btn-go-list {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 28px;
    background: #292829;
    color: #ffffff;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s;
}

.basket-empty .btn-go-list:hover {
    background: #555555;
}

.basket-empty .btn-go-list .material-icons {
    font-size: 18px;
    color: #ffffff;
    margin: 0;
}


/* ============================================================
   2열 레이아웃 — 좌(목록) / 우(요약)
   ============================================================ */
.basket-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 30px;
    align-items: flex-start;
}


/* ============================================================
   좌측 — 목록 영역
   ============================================================ */
.basket-list-area {
    min-width: 0;
}

/* 상단 툴바 (전체선택 + 선택삭제/전체비우기) */
.basket-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-top: 2px solid #292829;
    border-bottom: 1px solid #ececec;
    background: #fafafa;
    flex-wrap: wrap;
    gap: 10px;
}

.basket-checkall {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: #292829;
    font-size: 14px;
    font-weight: 500;
}

.basket-checkall input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #292829;
    cursor: pointer;
}

.toolbar-actions {
    display: flex;
    gap: 6px;
}

.btn-tool {
    padding: 6px 12px;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    color: #555555;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    font-family: inherit;
}

.btn-tool:hover {
    background: #f5f5f5;
    border-color: #999999;
}

.btn-tool-danger:hover {
    color: #c0392b;
    border-color: #c0392b;
}


/* ============================================================
   상품 목록
   ============================================================ */
.basket-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.basket-item {
    display: grid;
    grid-template-columns: 32px 100px 1fr auto auto 32px;
    align-items: center;
    gap: 14px;
    padding: 18px 14px;
    border-bottom: 1px solid #ececec;
}

.basket-item.is-unavailable {
    background: #fafafa;
    opacity: 0.7;
}

/* 체크박스 */
.basket-item-check {
    display: flex;
    align-items: center;
    justify-content: center;
}

.chk-item {
    width: 16px;
    height: 16px;
    accent-color: #292829;
    cursor: pointer;
}

/* 썸네일 */
.basket-thumb {
    display: block;
    width: 100px;
    height: 100px;
    border: 1px solid #e8e8e8;
    border-radius: 4px;
    overflow: hidden;
    background: #fafafa;
}

.basket-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 상품 정보 */
.basket-info {
    min-width: 0;
}

.basket-name {
    display: block;
    font-size: 15px;
    font-weight: 500;
    color: #292829;
    line-height: 1.4;
    text-decoration: none;
    margin-bottom: 8px;
    word-break: keep-all;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.basket-name:hover {
    text-decoration: underline;
}

.basket-bad {
    display: inline-block;
    margin-bottom: 6px;
    padding: 2px 8px;
    background: #fdecea;
    color: #c0392b;
    font-size: 14px;
    border-radius: 3px;
}

.basket-price {
    font-size: 14px;
    color: #888888;
    display: flex;
    align-items: center;
    gap: 6px;
}

.basket-unit-price {
    color: #555555;
    font-weight: 500;
}

.basket-x {
    color: #c8c8c8;
}

/* 수량 조절 */
.basket-qty {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d0d0d0;
    border-radius: 3px;
    background: #ffffff;
    overflow: hidden;
}

.basket-qty button {
    width: 32px;
    height: 32px;
    background: #ffffff;
    border: 0;
    cursor: pointer;
    color: #555555;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.basket-qty button:hover {
    background: #f5f5f5;
    color: #292829;
}

.basket-qty button .material-icons {
    font-size: 16px;
}

.qty-num {
    width: 44px;
    height: 32px;
    border: none;
    border-left: 1px solid #d0d0d0;
    border-right: 1px solid #d0d0d0;
    text-align: center;
    font-size: 14px;
    color: #292829;
    outline: none;
    -moz-appearance: textfield;
    font-family: inherit;
}

.qty-num::-webkit-outer-spin-button,
.qty-num::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 소계 */
.basket-subtotal {
    text-align: right;
    color: #292829;
    font-size: 14px;
    min-width: 100px;
    white-space: nowrap;
}

.subtotal-num {
    font-size: 17px;
    font-weight: 700;
}

/* 행 삭제 버튼 */
.btn-item-remove {
    width: 32px;
    height: 32px;
    background: transparent;
    border: 0;
    color: #999999;
    cursor: pointer;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.btn-item-remove:hover {
    background: #fdecea;
    color: #c0392b;
}

.btn-item-remove .material-icons {
    font-size: 20px;
}

/* 안내 문구 */
.basket-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 18px 0 0;
    padding: 12px 16px;
    background: #fff8e7;
    border-left: 3px solid #f0a91e;
    color: #6a4c00;
    font-size: 14px;
    border-radius: 2px;
}

.basket-notice .material-icons {
    font-size: 18px;
    color: #f0a91e;
}


/* ============================================================
   우측 — 주문 요약 (스티키)
   ============================================================ */
.basket-summary {
    position: sticky;
    top: 120px;
    padding: 24px;
    background: #fafafa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
}

.summary-title {
    margin: 0 0 18px;
    font-size: 17px;
    font-weight: 700;
    color: #292829;
    padding-bottom: 12px;
    border-bottom: 1px solid #d8d8d8;
}

.summary-rows {
    margin: 0 0 4px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 8px 0;
    font-size: 14px;
}

.summary-row dt {
    color: #555555;
    font-weight: 400;
}

.summary-row dd {
    margin: 0;
    color: #292829;
    text-align: right;
    font-weight: 500;
}

.summary-row dd .ship-hint {
    display: block;
    margin-top: 4px;
    font-size: 14px;
    color: #888888;
    font-weight: 400;
}

.summary-divider {
    border: 0;
    border-top: 1px dashed #d0d0d0;
    margin: 12px 0 14px;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 18px;
}

.summary-total .total-label {
    font-size: 14px;
    color: #292829;
    font-weight: 600;
}

.summary-total .total-amount {
    font-size: 14px;
    color: #292829;
}

.summary-total .total-amount strong {
    font-size: 24px;
    font-weight: 800;
    color: #6b1210;
    margin-right: 2px;
    letter-spacing: -0.5px;
}

/* 주문하기 버튼 */
.btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 14px 0;
    background: #6b1210;
    color: #ffffff;
    border: 0;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
    font-family: inherit;
}

.btn-checkout:hover {
    background: #8a1a18;
}

.btn-checkout .material-icons {
    font-size: 20px;
}

/* 계속 쇼핑 버튼 */
.btn-keep-shop {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    margin-top: 8px;
    padding: 12px 0;
    background: #ffffff;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    color: #555555;
    font-size: 14px;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    box-sizing: border-box;
}

.btn-keep-shop:hover {
    background: #f5f5f5;
    color: #292829;
    border-color: #999999;
}

.btn-keep-shop .material-icons {
    font-size: 18px;
}


/* ============================================================
   태블릿 (1024px 이하)
   ============================================================ */
@media (max-width: 1024px) {
    .basket-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .basket-summary {
        position: static;
    }

    /* 행 레이아웃 — 한 줄 유지하되 소계 컬럼 약간 축소 */
    .basket-item {
        grid-template-columns: 28px 80px 1fr auto auto 28px;
        gap: 12px;
    }

    .basket-thumb {
        width: 80px;
        height: 80px;
    }
}


/* ============================================================
   모바일 (768px 이하) — 행을 2단으로 재배치
   상단: 체크 + 썸네일 + 상품정보 + 삭제
   하단: 수량 + 소계
   ============================================================ */
@media (max-width: 768px) {
    .basket-wrap {
        padding: 20px 0 40px;
    }

    .basket-steps {
        gap: 12px;
        margin-bottom: 24px;
    }

    .basket-steps li {
        padding-right: 20px;
        font-size: 14px;
    }

    .basket-steps .step-num {
        width: 24px;
        height: 24px;
        font-size: 14px;
    }

    /* 그리드 → 2단 (상단/하단) */
    .basket-item {
        grid-template-columns: 24px 80px 1fr 28px;
        grid-template-areas:
            "check thumb info  remove"
            "check thumb qty   sub";
        gap: 10px 12px;
        padding: 14px 8px;
    }

    .basket-item-check {
        grid-area: check;
        align-self: flex-start;
        padding-top: 30px;
    }

    .basket-thumb {
        grid-area: thumb;
        width: 80px;
        height: 80px;
    }

    .basket-info {
        grid-area: info;
    }

    .btn-item-remove {
        grid-area: remove;
        align-self: flex-start;
    }

    .basket-qty {
        grid-area: qty;
        justify-self: flex-start;
    }

    .basket-subtotal {
        grid-area: sub;
        align-self: center;
        min-width: 0;
    }

    .basket-name {
        font-size: 14px;
    }

    .subtotal-num {
        font-size: 15px;
    }

    .summary-total .total-amount strong {
        font-size: 20px;
    }
}


/* ============================================================
   작은 모바일 (480px 이하)
   ============================================================ */
@media (max-width: 480px) {
    .basket-toolbar {
        padding: 10px 12px;
    }

    .btn-tool {
        padding: 5px 10px;
        font-size: 14px;
    }

    .basket-item {
        grid-template-columns: 22px 70px 1fr 26px;
        gap: 8px 10px;
    }

    .basket-thumb {
        width: 70px;
        height: 70px;
    }

    .basket-qty button {
        width: 28px;
        height: 28px;
    }

    .qty-num {
        width: 36px;
        height: 28px;
    }

    .basket-summary {
        padding: 18px;
    }
}
