body.woocommerce-cart {
    background: #f5f5f5;
}


/* Cart 타이틀 */

.cart-main-title {
    font-size: 43px;
    font-weight: 700;
    color: #333;
    margin: 0 0 20px 0;
    padding: 0;
}


/* 알림 메시지 스타일 */

.woocommerce-notices-wrapper {
    margin: 0 0 20px 0;
}

.woocommerce-notices-wrapper .woocommerce-message,
.woocommerce-notices-wrapper .woocommerce-error,
.woocommerce-notices-wrapper .woocommerce-info {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 8px;
}

.woocommerce-notices-wrapper .woocommerce-message {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.woocommerce-notices-wrapper .woocommerce-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.woocommerce-notices-wrapper .woocommerce-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}


/* 장바구니 2열 레이아웃: 왼쪽 상품목록, 오른쪽 결제금액 */

.woocommerce-cart .cart-container {
    display: flex;
    gap: 30px;
    align-items: flex-start;
}

.woocommerce-cart .woocommerce-cart-form {
    flex: 1;
    margin-bottom: 0;
}

.woocommerce-cart .cart-collaterals {
    flex: 0 0 400px;
    display: block;
}


/* 선택상품 헤더 */

.cart-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: #fff;
    /* border: 1px solid #e0e0e0; */
    margin-bottom: 10px;
    border-radius: 5px;
}

.cart-select-header label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
    cursor: pointer;
}

.cart-select-header input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.delete-selected-btn {
    padding: 6px 16px;
    background: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

button#delete-selected {
    color: #606060;
    background: #f1f1f1;
    border-radius: 3px;
    padding: 6px 11px;
    font-weight: 500;
}

.delete-selected-btn:hover {
    background: #f5f5f5;
}


/* 장바구니 테이블 */

.shop_table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 0;
    background: #fff;
    border-radius: 6px;
}

.shop_table thead {
    display: none;
}

.shop_table thead th.product-checkbox {
    width: 50px;
    text-align: center;
    padding: 15px;
}

.shop_table tbody tr {
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
}

.shop_table tbody tr:last-child {
    border-bottom: none;
}

.shop_table td {
    padding: 20px 15px;
    vertical-align: middle;
    border: none;
}


/* 테이블 열 순서 변경: 체크박스, 썸네일, 상품명, 가격, 수량, 소계, 삭제 */


/* 체크박스 열 (맨 앞) */

.product-checkbox {
    order: 0;
    width: 50px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 15px !important;
    vertical-align: middle;
}

.product-checkbox .cart-item-select {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
}

.product-thumbnail {
    order: 1;
    width: 120px;
    flex-shrink: 0;
}

.product-name {
    order: 2;
    flex: 1;
    min-width: 200px;
}

.product-price {
    order: 3;
    width: 120px;
    flex-shrink: 0;
}

.product-quantity {
    order: 4;
    width: 140px;
    flex-shrink: 0;
}

.product-subtotal {
    order: 5;
    width: 120px;
    flex-shrink: 0;
}


/* 삭제 버튼 열 (맨 뒤) */

.product-remove {
    order: 7;
    width: 60px;
    flex-shrink: 0;
    text-align: center;
}

.remove-item-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.remove-item-btn:hover {
    color: #e74c3c;
}


/* 상품 썸네일 */

.product-thumbnail img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
}


/* 상품명 */

.product-name a {
    color: #333;
    text-decoration: none;
}

.product-name a:hover {
    color: #532b83;
}


/* 가격 */

.product-price .woocommerce-Price-amount {
    color: #532b83;
}


/* 수량 조절 */

.cart-quantity-controls {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
}

.cart-quantity-controls .qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.cart-quantity-controls .qty-btn:hover {
    background: #f5f5f5;
}

.cart-quantity-controls .qty-input,
.cart-quantity-controls input[type="number"].qty-input {
    width: 50px !important;
    height: 32px !important;
    border: none !important;
    border-left: 1px solid #ddd !important;
    border-right: 1px solid #ddd !important;
    text-align: center !important;
    font-size: 14px !important;
    padding: 0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    min-height: unset !important;
    background: #fff !important;
    appearance: textfield !important;
    -moz-appearance: textfield !important;
}

.cart-quantity-controls .qty-input:focus {
    outline: none !important;
    box-shadow: none !important;
}

.cart-quantity-controls .qty-input::-webkit-outer-spin-button,
.cart-quantity-controls .qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    appearance: none !important;
    margin: 0 !important;
}


/* quantity-selector 스타일 */

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    width: fit-content;
}

.quantity-selector .qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    background: white;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    padding: 0;
}

.quantity-selector .qty-btn:hover {
    background: #f5f5f5;
}

.quantity-selector .qty-btn:active {
    background: #e0e0e0;
}

.quantity-selector .qty-input {
    width: 50px;
    height: 32px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    appearance: textfield;
    -moz-appearance: textfield;
    outline: none;
}

.quantity-selector .qty-input:focus {
    border-color: #532b83;
}

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


/* 소계 */


/* Actions 행 숨김 */

.shop_table .actions {
    display: none;
}


/* 장바구니 합계 영역 */

.custom-cart-summary {
    width: 100%;
    position: sticky;
    top: 20px;
}

.summary-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: #333;
}


/* 금액 행 */

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.summary-row:last-of-type {
    border-bottom: none;
}

.summary-label {
    font-size: 14px;
    color: #666;
}

.summary-value {
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.summary-value.discount {
    color: #e74c3c;
}


/* 최종 결제 금액 */

.summary-row.total-row {
    margin: 8px 0px 15px;
    padding: 0px;
    border-bottom: none;
}

.summary-row.total-row .summary-label {
    font-size: 16px;
    font-weight: 700;
}

.summary-row.total-row .summary-value {
    color: #532b83;
    font-size: 20px;
    font-weight: 700;
}

.summary-cart-wrapper {
    background: #fff;
    padding: 20px;
    border-radius: 6px;
}


/* 주문하기 버튼 */

.custom-checkout-button {
    display: block;
    width: 100%;
    padding: 16px;
    background: #532b83;
    color: white;
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

.custom-checkout-button:hover {
    background: #532b83;
    color: white;
}


/* 반응형 */

@media (max-width: 1024px) {
    .woocommerce-cart .woocommerce {
        flex-direction: column;
    }
    .woocommerce-cart .cart-collaterals {
        flex: 1;
        width: 100%;
    }
    .custom-cart-summary {
        position: static;
    }
}

@media (max-width: 768px) {
    .woocommerce-cart {
        padding: 10px;
    }
    .cart-main-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    .shop_table tbody tr {
        flex-wrap: wrap;
    }
    .product-thumbnail {
        width: 80px;
    }
    .product-thumbnail img {
        width: 70px;
        height: 70px;
    }
    .product-name {
        min-width: auto;
    }
    .product-price,
    .product-quantity,
    .product-subtotal {
        width: auto;
    }
    .shop_table td {
        padding: 10px;
    }
}


/* 기본 WooCommerce 스타일 오버라이드 */

.woocommerce .cart-collaterals .cart_totals,
.woocommerce-page .cart-collaterals .cart_totals {
    display: none !important;
}

.woocommerce table.shop_table_responsive tr td::before {
    display: none;
}


/* 포인트 관련 행 숨기기 (JavaScript로 처리) */


/* 쿠폰 정보 행 스타일 */

.summary-cart-wrapper .coupon-info-row {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #e0e0e0;
    border-bottom: 0;
    padding-bottom: 5px;
}

.summary-cart-wrapper .coupon-info-row .summary-label {
    color: #666;
    font-size: 14px;
}

.summary-cart-wrapper .coupon-info-row .coupon-count {
    color: #e74c3c;
    font-weight: 600;
    font-size: 15px;
}

.summary-cart-wrapper .coupon-notice {
    margin-top: 8px;
    padding: 8px 12px;
    background-color: #f8f9fa;
    border-radius: 4px;
    text-align: center;
}

.summary-cart-wrapper .coupon-notice small {
    color: #666;
    font-size: 14px;
    line-height: 1.4;
}