/* ========================================
   재사용 가능한 상품 목록 표 CSS (v3 2025‑07‑13)
   옵션 및 수량 열 추가, 가격 구조 개선
   ======================================== */

/* 상품 테이블 컨테이너 ---------------------------------------------- */
.product-table-container {
    margin: 15px 0;
    border-top: 1px solid var(--table-border);
    border-bottom: 1px solid var(--table-border);
    border-radius: 0;
    overflow: hidden;
}

/* 상품 테이블 --------------------------------------------------------- */
.product-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}

/* 헤더 --------------------------------------------------------------- */
.table-header {
    height: 50px;
    background: transparent;
    border-bottom: 1px solid var(--table-border);
}

.table-header th {
    text-align: center;
    vertical-align: middle;
    font-weight: 400;
    color: var(--font-primary);
    font-size: 14px;
    padding: 0 16px;
}

/* 열 너비 (주문 페이지 스타일로 변경) */
.col-image {
    width: 120px;
}

@media (max-width: 1024px) {
    .col-image {
        width: 100px;
    }
}

@media (max-width: 768px) {
    .col-image {
        width: 80px;
    }
}

.col-checkbox {
    width: 60px;
}

.col-product {
    width: auto;
    min-width: 300px;
}

.col-quantity {
    width: 100px;
}

.col-price {
    width: 120px;
}

.col-shipping {
    width: 100px;
}

.col-action {
    width: 80px;
}

/* 행 --------------------------------------------------------------- */
.product-row {
    height: 190px;
    border-bottom: 1px solid var(--table-border);
}

@media (max-width: 1024px) {
    .product-row {
        height: 170px;
    }
}

@media (max-width: 768px) {
    .product-row {
        height: 150px;
    }
}

.product-row:last-child {
    border-bottom: none;
}

/* 셀 */
.product-row td {
    text-align: center;
    vertical-align: middle;
    padding: 20px 12px;
    box-sizing: border-box;
}

/* 이미지 ------------------------------------------------------------ */
.product-image {
    width: 96px;
    height: 96px;
    object-fit: cover;
    border-radius: 6px;
    border: 1px solid #eee;
    display: block;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .product-image {
        width: 80px;
        height: 80px;
    }
}

@media (max-width: 768px) {
    .product-image {
        width: 60px;
        height: 60px;
    }
}

/* 상품 정보 --------------------------------------------------------- */
.col-product {
    text-align: left !important;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 100%;
}

.product-name {
    font: 500 16px/1.4 var(--font-family, "Noto Sans KR", sans-serif);
    color: var(--font-primary);
    margin: 0 0 6px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-option, .product-code {
    font-size: 13px;
    color: var(--font-light);
    margin: 0;
}

.product-base-price {
    font-size: 12px;
    color: var(--font-light);
    margin: 4px 0 0 0;
}

.product-original-price {
    font-size: 13px;
    color: var(--font-original-price);
    text-decoration: line-through;
    margin: 0;
}

/* 옵션 및 수량 정보 스타일 ------------------------------------------- */
.option-detail {
    font-size: 13px;
    line-height: 1.4;
}

.base-option {
    color: #333;
    font-weight: 400;
    margin-bottom: 4px;
}

.add-ons {
    margin-top: 6px;
}

.addon-item {
    color: #666;
    margin-bottom: 2px;
    padding-left: 12px;
    position: relative;
}

.addon-item::before {
    content: "∟";
    position: absolute;
    left: 0;
    color: #999;
}

/* 기존 수량 조절 (옵션별 표시용) ------------------------------------ */
.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--input-border);
    border-radius: 6px;
    width: 100px;
    margin: 0 auto;
    background: #fff;
}

.quantity-btn {
    width: 30px;
    height: 32px;
    border: none;
    background: var(--quantity-control-bg);
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .2s;
}

.quantity-btn:hover {
    background: #e8e8e8;
}

.quantity-btn.minus {
    border-radius: 4px 0 0 4px;
}

.quantity-btn.plus {
    border-radius: 0 4px 4px 0;
}

.quantity-input {
    width: 40px;
    height: 32px;
    border: none;
    text-align: center;
    font-size: 14px;
    background: #fff;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: textfield;
}

/* Chrome, Safari, Edge에서 스피너 숨기기 */
.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 수량 표시 (장바구니용) */
.quantity-display {
    font-weight: 400;
    color: var(--font-primary);
    font-size: 16px;
}

/* 가격 ------------------------------------------------------------- */
.col-price {
    text-align: center;
    position: relative;
}

.price-container {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100%;
    gap: 4px;
}

.product-original-price-inline {
    font-size: 12px;
    color: var(--font-original-price);
    text-decoration: line-through;
    margin: 0;
    white-space: nowrap;
}

.product-price {
    font-size: 16px;
    font-weight: 700;
    color: var(--font-primary);
}

.price-breakdown {
    font-size: 11px;
    color: #999;
    margin: 2px 0 0 0;
}

/* 배송비 */
.shipping-fee {
    font-size: 14px;
    color: var(--font-primary);
}

/* 삭제 버튼 --------------------------------------------------------- */
.delete-btn {
    padding: 6px 12px;
    border: 1px solid var(--table-border);
    border-radius: 6px;
    background: #fff;
    color: var(--font-light);
    font-size: 14px;
    cursor: pointer;
    transition: background .2s, border-color .2s;
    min-width: 50px;
    white-space: nowrap;
}

.delete-btn:hover {
    background: #f8f8f8;
    border-color: #ccc;
}

/* 체크박스 스타일 */
.table-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

/* 빈 장바구니 스타일 */
.loading {
    text-align: center;
    padding: 40px;
    color: #666;
}

.empty-cart {
    text-align: center;
    padding: 60px 20px;
}

.empty-message {
    color: #666;
}

.empty-message i {
    font-size: 48px;
    margin-bottom: 16px;
    color: #ddd;
}

.empty-message p {
    margin: 16px 0;
    font-size: 16px;
}

/* 반응형 ----------------------------------------------------------- */
@media (max-width: 1024px) {
    .col-product {
        min-width: 250px;
    }

    .col-quantity {
        width: 80px;
    }

    .quantity-control {
        width: 90px;
    }

    .quantity-btn {
        width: 28px;
        height: 30px;
    }

    .quantity-input {
        width: 34px;
        height: 30px;
    }
}

@media (max-width: 768px) {
    .product-table-container {
        overflow-x: auto;
    }

    .product-table {
        min-width: 800px;
    }

    .product-row td {
        padding: 16px 10px;
    }

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

    .col-product {
        min-width: 200px;
    }

    .col-quantity {
        width: 70px;
    }

    .quantity-control {
        width: 80px;
    }

    .quantity-btn {
        width: 24px;
        height: 28px;
        font-size: 14px;
    }

    .quantity-input {
        width: 32px;
        height: 28px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .product-table {
        min-width: 700px;
    }

    .table-header th {
        font-size: 13px;
        padding: 0 8px;
    }

    .product-row td {
        padding: 12px 8px;
    }

    .col-quantity {
        width: 60px;
    }

    .col-price, .col-shipping {
        width: 90px;
    }

    .col-action {
        width: 60px;
    }
}