/**
 * Shop-Bedding Theme - Cart Page Styles
 * @package shop-bedding
 */

/* Page Title */
.sb-page-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Loading */
.sb-cart-loading {
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
    font-size: 1rem;
}

/* Empty State */
.sb-cart-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: #999;
}
.sb-cart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    display: block;
    color: #ddd;
}
.sb-cart-empty p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Cart Header */
.sb-cart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 2px solid #333;
    margin-bottom: 0;
}
.sb-cart-check-all {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
}
.sb-cart-check-all input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #5671c0;
}

/* Cart Item */
.sb-cart-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
    position: relative;
}
.sb-cart-item-inactive {
    opacity: 0.5;
}
.sb-cart-item-check {
    display: flex;
    align-items: center;
    padding-top: 0.5rem;
}
.sb-cart-item-cb {
    width: 18px;
    height: 18px;
    accent-color: #5671c0;
}
.sb-cart-item-image {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}
.sb-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.sb-cart-item-info {
    flex: 1;
    min-width: 0;
}
.sb-cart-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    display: block;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.sb-cart-item-name:hover {
    color: #5671c0;
}
.sb-cart-item-category {
    font-size: 0.75rem;
    color: #999;
    display: block;
    margin-bottom: 0.25rem;
}
.sb-cart-item-options {
    font-size: 0.8rem;
    color: #666;
    margin-bottom: 0.25rem;
}
.sb-cart-item-soldout {
    font-size: 0.75rem;
    color: #e74c3c;
    font-weight: 600;
}
.sb-cart-item-price {
    font-size: 0.95rem;
    font-weight: 700;
    color: #333;
    margin-top: 0.25rem;
}

/* Quantity Control */
.sb-cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0;
    flex-shrink: 0;
}
.sb-cart-item-qty .sb-quantity-btn {
    width: 28px;
    height: 28px;
    font-size: 0.7rem;
}
.sb-cart-item-qty .sb-quantity-input {
    width: 40px;
    height: 28px;
    font-size: 0.85rem;
    text-align: center;
    padding: 0;
}

/* Subtotal */
.sb-cart-item-subtotal {
    text-align: right;
    flex-shrink: 0;
    min-width: 90px;
}
.sb-cart-item-subtotal-value {
    font-size: 1rem;
    font-weight: 700;
    color: #333;
    display: block;
}
.sb-cart-item-ship {
    font-size: 0.75rem;
    color: #999;
    display: block;
    margin-top: 0.25rem;
}

/* Remove Button */
.sb-cart-item-remove {
    position: absolute;
    top: 0.75rem;
    right: 0;
    background: none;
    border: none;
    color: #ccc;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1rem;
    line-height: 1;
}
.sb-cart-item-remove:hover {
    color: #e74c3c;
}

/* Cart Summary */
.sb-cart-summary {
    background: #f9f9f9;
    border-radius: 12px;
    padding: 1.25rem;
    margin: 1.5rem 0;
}
.sb-cart-summary-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    font-size: 0.95rem;
    color: #555;
}
.sb-cart-summary-total {
    border-top: 1px solid #ddd;
    margin-top: 0.5rem;
    padding-top: 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: #333;
}

/* Order Form */
.sb-cart-order-form {
    margin: 1.5rem 0;
    padding: 1.5rem;
    background: #fff;
    border: 1px solid #eee;
    border-radius: 12px;
}
.sb-cart-order-form .sb-order-form-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #eee;
}

/* Actions */
.sb-cart-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
}
.sb-cart-actions .sb-btn {
    flex: 1;
    text-align: center;
    justify-content: center;
}

/* ==========================================
   Mobile Responsive
   ========================================== */

@media (max-width: 768px) {
    .sb-cart-item {
        flex-wrap: wrap;
        padding: 0.75rem 0;
    }
    .sb-cart-item-check {
        padding-top: 0;
    }
    .sb-cart-item-image {
        width: 64px;
        height: 64px;
    }
    .sb-cart-item-info {
        flex: 1;
        min-width: 0;
    }
    .sb-cart-item-name {
        font-size: 0.85rem;
        white-space: normal;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }
    .sb-cart-item-qty {
        margin-left: auto;
    }
    .sb-cart-item-subtotal {
        width: 100%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px dashed #eee;
        margin-left: calc(18px + 0.75rem + 64px + 0.75rem);
        min-width: unset;
    }
    .sb-cart-item-subtotal-value {
        font-size: 0.95rem;
    }
    .sb-cart-item-remove {
        top: 0.5rem;
    }

    .sb-cart-actions {
        flex-direction: column;
    }

    .sb-cart-order-form {
        padding: 1rem;
    }
}
