/* WooCommerce Blocks Cart Style */
.wp-block-woocommerce-cart {
    max-width: 100%;
    margin: 0 auto;
}
.woocommerce .cart-collaterals .cart_totals, .woocommerce-page .cart-collaterals .cart_totals,
.woocommerce-cart-form__contents{ width: 100%;}
.wc-block-components-sidebar-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.wc-block-components-main {
    flex: 1;
    min-width: 0;
}

.wc-block-components-sidebar {
    width: 100%;
    max-width: 400px;
}

.wc-block-cart-items {
    width: 100%;
    border-collapse: collapse;
}

.wc-block-cart-items__header th {
    text-align: left;
    padding: 1rem;
    border-bottom: 1px solid #e5e5e5;
    font-weight: 600;
    color: #333;
}

.wc-block-cart-items__header-product {
    width: 50%;
}

.wc-block-cart-items__header-image {
    width: 100px;
}

.wc-block-cart-items__header-total {
    text-align: right;
    width: 120px;
}

.wc-block-cart-items__row {
    border-bottom: 1px solid #e5e5e5;
}

.wc-block-cart-items__row td {
    padding: 1rem;
    vertical-align: top;
}

.wc-block-cart-item__image {
    width: 100px;
}

.wc-block-cart-item__image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.wc-block-cart-item__product {
    padding-right: 1rem;
}

.wc-block-cart-item__wrap {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.wc-block-components-product-name {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
}

.wc-block-components-product-name:hover {
    color: var(--primary-color);
}

.wc-block-cart-item__prices {
    font-size: 0.95rem;
    color: #666;
}

.wc-block-components-product-metadata {
    font-size: 0.85rem;
    color: #888;
}

.wc-block-cart-item__quantity {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.wc-block-components-quantity-selector {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.wc-block-components-quantity-selector__input {
    width: 50px;
    height: 36px;
    border: none;
    text-align: center;
    font-size: 1rem;
    background: #fff;
}

.wc-block-components-quantity-selector__button {
    width: 32px;
    height: 36px;
    border: none;
    background: #f5f5f5;
    cursor: pointer;
    font-size: 1.2rem;
    color: #333;
    transition: background 0.2s;
}

.wc-block-components-quantity-selector__button:hover:not(:disabled) {
    background: var(--primary-color);
    color: #fff;
}

.wc-block-components-quantity-selector__button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.wc-block-cart-item__remove-link {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #999;
    transition: color 0.2s;
}

.wc-block-cart-item__remove-link:hover {
    color: #dc3545;
}

.wc-block-cart-item__remove-link svg {
    width: 20px;
    height: 20px;
}

.wc-block-cart-item__total {
    text-align: right;
    vertical-align: top;
}

.wc-block-cart-item__total-price-and-sale-badge-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.wc-block-components-sale-badge {
    background: #ed1c24;
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
}

/* Cart Sidebar / Totals */
.wc-block-cart__sidebar {
    background: #f9f9f9;
    padding: 1.5rem;
    border-radius: 8px;
    height: fit-content;
}

.wc-block-cart__totals-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: #333;
}

.wc-block-components-totals-wrapper {
    padding: 0.75rem 0;
    border-bottom: 1px solid #e5e5e5;
}

.wc-block-components-totals-wrapper:last-child {
    border-bottom: none;
}

.wc-block-components-totals-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.wc-block-components-totals-item__label {
    color: #666;
    font-size: 0.95rem;
}

.wc-block-components-totals-item__value {
    font-weight: 500;
    color: #333;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

/* Coupon */
.wc-block-components-totals-coupon .wc-block-components-panel__button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    cursor: pointer;
    color: #666;
    font-size: 0.95rem;
}

.wc-block-components-totals-coupon__input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
}

/* Checkout Button */
.wc-block-cart__submit {
    margin-top: 1.5rem;
}

.wc-block-cart__submit-button {
    width: 100%;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: 600;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    text-decoration: none;
    display: block;
}

.wc-block-cart__submit-button:hover {
    background: var(--primary-dark, #0d6efd);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Update Cart Button */
.wc-block-cart__update {
    margin-top: 1rem;
    text-align: center;
}

.update-cart-button {
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 500;
    background: #6c757d;
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.update-cart-button:hover {
    background: #5a6268;
}

.update-cart-button:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading state */
.wc-block-cart__sidebar.updating .wc-block-components-totals-item__value {
    opacity: 0.5;
}

.wc-block-cart__sidebar.updating::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.7);
    z-index: 10;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-block-components-sidebar-layout {
        flex-direction: column;
    }
    
    .wc-block-components-sidebar {
        max-width: 100%;
        order: -1;
    }
    
    .wc-block-cart-items__header-product,
    .wc-block-cart-items__header-total {
        display: none;
    }
    
    .wc-block-cart-item__product,
    .wc-block-cart-item__total {
        display: block;
    }
    
    .wc-block-cart-item__total {
        text-align: left;
        margin-top: 0.5rem;
    }
    
    .wc-block-cart-item__total-price-and-sale-badge-wrapper {
        align-items: flex-start;
    }
}
