/**
 * WooCommerce Cart Block Custom Styling
 * Tailwind CSS-inspired styling for cart blocks
 */

/* Cart Container */
.wp-block-woocommerce-cart {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Cart Items Table */
.wc-block-cart-items {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.wc-block-cart-items__row {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    transition: background-color 0.2s;
}

.wc-block-cart-items__row:last-child {
    border-bottom: none;
}

.wc-block-cart-items__row:hover {
    background-color: #f9fafb;
}

/* Product Image */
.wc-block-cart-item__image {
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
    overflow: hidden;
}

.wc-block-cart-item__image img {
    max-width: 100px;
}

/* Product Name */
.wc-block-cart-item__product a {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    text-decoration: none;
    transition: color 0.2s;
}

.wc-block-cart-item__product a:hover {
    color: #2563eb;
}

/* Product Metadata - Compact Pill Style */
.wc-block-components-product-metadata {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
    margin-bottom: 0.75rem;
}

.wc-block-components-product-details {
    display: contents;
}

.wc-block-components-product-details > div,
.wc-block-components-product-details > ul,
.wc-block-components-product-details > li {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.625rem;
    background-color: #f3f4f6;
    border-radius: 0.375rem;
    font-size: 0.75rem;
    list-style: none;
    margin: 0;
}

.wc-block-components-product-details__name {
    font-weight: 500;
    color: #374151;
}

.wc-block-components-product-details__value {
    color: #111827;
}

.wc-block-components-product-details ul {
    display: contents;
}

/* Price Styling */
.wc-block-cart-item__prices {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

/* Sale Price - Red */
.wc-block-cart-item__prices ins {
    text-decoration: none;
    font-size: 1.25rem;
    font-weight: 700;
    color: #dc2626 !important;
}

/* Regular Price - Gray Strikethrough */
.wc-block-cart-item__prices del {
    font-size: 0.875rem;
    color: #9ca3af;
}

/* Sale Badge - Red with Savings */
.wc-block-cart-item__prices .wc-block-components-product-price__value--on-sale::after {
    content: 'Save';
    display: inline-block;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background-color: #fee2e2;
    color: #dc2626;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 0.25rem;
}

/* Quantity Selector */
.wc-block-components-quantity-selector {
    display: inline-flex;
    align-items: center;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    overflow: hidden;
    background: white;
}

.wc-block-components-quantity-selector__button {
    padding: 0.5rem 0.75rem;
    background: white;
    border: none;
    color: #4b5563;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wc-block-components-quantity-selector__button:hover {
    background-color: #f3f4f6;
}

.wc-block-components-quantity-selector__input {
    width: 60px;
    text-align: center;
    border: none;
    padding: 0.5rem 0.25rem;
    font-weight: 600;
    font-size: 0.875rem;
}

/* Remove Button - Red Trash Icon */
.wc-block-cart-item__remove-link {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #dc2626 !important;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
    margin-top: 0.5rem;
}

.wc-block-cart-item__remove-link:hover {
    color: #b91c1c !important;
}

.wc-block-cart-item__remove-link::before {
    content: '';
    display: inline-block;
    width: 1rem;
    height: 1rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23dc2626'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16'/%3E%3C/svg%3E");
    background-size: contain;
    background-repeat: no-repeat;
}

/* Cart Totals Sidebar */
.wp-block-woocommerce-cart-order-summary-block {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1);
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
}

.wc-block-components-totals-wrapper {
    margin-bottom: 1.5rem;
}

.wc-block-components-totals-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem 0;
    color: #374151;
}

.wc-block-components-totals-footer-item {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
.wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
}

/* Proceed to Checkout Button - Big Green */
.wc-block-cart__submit-container .wc-block-components-button,
.wc-block-components-checkout-place-order-button {
    width: 100%;
    background: linear-gradient(to right, #16a34a, #059669) !important;
    color: white !important;
    font-weight: 700 !important;
    padding: 1rem 1.5rem !important;
    border-radius: 0.75rem !important;
    font-size: 1.125rem !important;
    border: none !important;
    text-decoration: none !important;
    box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1) !important;
    transition: all 0.2s !important;
    cursor: pointer;
}

.wc-block-cart__submit-container .wc-block-components-button:hover,
.wc-block-components-checkout-place-order-button:hover {
    background: linear-gradient(to right, #15803d, #047857) !important;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1) !important;
    transform: translateY(-2px);
    text-decoration: none !important;
}

/* Update Cart Button */
.wc-block-cart__submit-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background-color: #f3f4f6;
    color: #111827;
    font-weight: 500;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s;
}

.wc-block-cart__submit-button:hover {
    background-color: #e5e7eb;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-block-cart-items__row {
        padding: 1rem;
    }
    
    .wc-block-cart-item__image img {
        max-width: 80px;
    }
    
    .wc-block-cart-item__product a {
        font-size: 1rem;
    }
}

/* Empty Cart */
.wc-block-cart__empty-cart {
    text-align: center;
    padding: 3rem 1.5rem;
}

.wc-block-cart__empty-cart__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 1rem;
}

/* Loading State */
.wc-block-components-spinner {
    border-color: #16a34a !important;
}
