/* WooCommerce Cart Table Styling */
.woocommerce-cart-form {
    margin-bottom: 2rem;
}

.woocommerce-cart-form__contents {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 1.5rem;
}

/* Table Header */
.woocommerce-cart-form__contents thead {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
}

.woocommerce-cart-form__contents th {
    padding: 0.5rem 0.75rem;
    text-align: left;
    font-weight: 500;
    color: #64748b;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #e2e8f0;
}

.woocommerce-cart-form__contents th.product-remove {
    width: 50px;
    text-align: center;
}

.woocommerce-cart-form__contents th.product-thumbnail {
    width: 80px;
    text-align: center;
}

.woocommerce-cart-form__contents th.product-name {
    width: 35%;
}

.woocommerce-cart-form__contents th.product-price {
    width: 15%;
    text-align: center;
}

.woocommerce-cart-form__contents th.product-quantity {
    width: 15%;
    text-align: center;
}

.woocommerce-cart-form__contents th.product-subtotal {
    width: 15%;
    text-align: center;
}

/* Table Body */
.woocommerce-cart-form__contents tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: background-color 0.15s ease;
    background-color: #f8fafc;
}

.woocommerce-cart-form__contents tbody tr:hover {
    background-color: #f1f5f9;
}

.woocommerce-cart-form__contents tbody td {
    padding: 0.75rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    background-color: #f8fafc !important;
}

.woocommerce-cart-form__contents tbody th {
    padding: 0.75rem 0.75rem;
    vertical-align: middle;
    border-bottom: 1px solid #f1f5f9;
    background-color: #f8fafc !important;
}

/* Remove Button */
.product-remove a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f1f5f9;
    color: #64748b;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1;
    transition: all 0.15s ease;
    border: 1px solid #e2e8f0;
}

.product-remove a:hover {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
    transform: none;
}

/* Product Thumbnail */
.product-thumbnail img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border-radius: 4px;
    border: 1px solid #e2e8f0;
    transition: border-color 0.15s ease;
}

.product-thumbnail img:hover {
    border-color: #cbd5e1;
}

/* Product Name - Remove hyperlinks */
.product-name a {
    color: #1e293b;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.3;
    pointer-events: none;
    cursor: default;
}

.product-name a:hover {
    color: #1e293b;
    text-decoration: none;
}

/* Price and Subtotal */
.product-price,
.product-subtotal {
    text-align: center;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.875rem;
}

.woocommerce-Price-amount {
    font-weight: 600;
}

/* Quantity Controls */
.quantity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.125rem;
    max-width: 100px;
    margin: 0 auto;
}

.quantity input[type="button"] {
    width: 24px;
    height: 24px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    color: #64748b;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

.quantity input[type="button"]:hover {
    background: #f1f5f9;
    border-color: #94a3b8;
    color: #475569;
}

.quantity input[type="button"]:active {
    background: #e2e8f0;
    color: #475569;
}

.quantity input[type="number"] {
    width: 40px;
    height: 24px;
    text-align: center;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    color: #1e293b;
    background: white;
}

.quantity input[type="number"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Actions Row */
.woocommerce-cart-form__contents .actions {
    background: #f8fafc;
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
}

.woocommerce-cart-form__contents .actions .coupon {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.woocommerce-cart-form__contents .actions .coupon input[type="text"] {
    flex: 1;
    max-width: 180px;
    padding: 0.5rem 0.75rem;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    font-size: 0.875rem;
    background: white;
}

.woocommerce-cart-form__contents .actions .coupon input[type="text"]:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.woocommerce-cart-form__contents .actions .coupon button {
    padding: 0.375rem 1.5rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
}

.woocommerce-cart-form__contents .actions .coupon button:hover {
    background: #059669;
    transform: none;
}

.woocommerce-cart-form__contents .actions button[name="update_cart"] {
    padding: 0.375rem 1.5rem;
    background: #64748b;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    float: right;
    margin-right: 17px;
}

.woocommerce-cart-form__contents .actions button[name="update_cart"]:not([disabled]):hover {
    background: #475569;
    transform: none;
}

.woocommerce-cart-form__contents .actions button[name="update_cart"][disabled] {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Additional WooCommerce cart styling */
.woocommerce-page table.cart td.actions .coupon {
    min-width: 50%;
    text-align: left;
    margin-left: 17px;
}

/* WooCommerce Checkout Terms Override */
.wc-block-checkout__terms {
    background: transparent;
    border: none;
    padding: 16px 0;
    margin: 20px 0;
    position: relative;
    transition: all 0.3s ease;
}

.wc-block-checkout__terms .wc-block-components-checkbox__label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    margin: 0;
    padding: 0;
    font-weight: 400;
    position: relative;
}

.wc-block-checkout__terms .wc-block-components-checkbox__label::before {
    content: '';
    width: 20px;
    height: 20px;
    border: 1px solid #8c8f94;
    border-radius: 2px;
    background: white;
    flex-shrink: 0;
    margin-top: 1px;
    position: relative;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.wc-block-checkout__terms .wc-block-components-checkbox__label::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wc-block-checkout__terms input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.wc-block-checkout__terms input[type="checkbox"]:checked + .wc-block-components-checkbox__label::before {
    background: #007cba;
    border-color: #007cba;
}

.wc-block-checkout__terms input[type="checkbox"]:checked + .wc-block-components-checkbox__label::after {
    opacity: 1;
}

/* Hover state */
.wc-block-checkout__terms .wc-block-components-checkbox__label:hover::before {
    border-color: #007cba;
}

/* Focus state */
.wc-block-checkout__terms .wc-block-components-checkbox__label:focus-within::before {
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

/* Error state when form is submitted without checking */
.wc-block-checkout__terms.error {
    animation: shake 0.6s ease-in-out;
}

.wc-block-checkout__terms.error .wc-block-components-checkbox__label {
    color: #d63638 !important;
}

.wc-block-checkout__terms.error .wc-block-components-checkbox__label::before {
    border-color: #d63638;
    background: #fef2f2;
}

.wc-block-checkout__terms.error .wc-block-components-checkbox__label::after {
    content: '✕';
    color: #d63638;
    opacity: 1;
    background: white;
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: bold;
    border: none;
    transform: none;
}

/* Keep links blue even in error state */
.wc-block-checkout__terms.error .wc-block-components-checkbox__label a {
    color: #007cba !important;
}

.wc-block-checkout__terms.error .wc-block-components-checkbox__label a:hover {
    color: #005a87 !important;
}

/* Default unchecked state - no error styling */
.wc-block-checkout__terms:not(.error) .wc-block-components-checkbox__label::before {
    border-color: #8c8f94;
    background: white;
}

.wc-block-checkout__terms:not(.error) .wc-block-components-checkbox__label::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.wc-block-checkout__terms .wc-block-components-checkbox__label a {
    color: #007cba;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.wc-block-checkout__terms .wc-block-components-checkbox__label a:hover {
    color: #005a87;
    text-decoration: underline;
}

/* Required asterisk styling */
.wc-block-checkout__terms .wc-block-components-checkbox__label .required-asterisk {
    color: #d63638;
    font-weight: bold;
    font-size: 14px;
    margin-left: 2px;
}

/* Also style asterisk for classic WooCommerce terms */
.woocommerce-terms-and-conditions .wc-block-components-checkbox__label .required-asterisk {
    color: #d63638;
    font-weight: bold;
    font-size: 14px;
    margin-left: 2px;
}

/* JavaScript will inject the checkbox */
.wc-block-checkout__terms {
    position: relative;
}

.wc-block-checkout__terms .spm-terms-checkbox {
    position: absolute;
    left: 0;
    top: 16px;
    width: 20px;
    height: 20px;
    z-index: 1;
    opacity: 1;
    pointer-events: auto;
}

/* Error message styling */
.terms-error-message {
    color: #dc2626;
    font-size: 13px;
    margin-top: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 1px solid #fca5a5;
    border-radius: 6px;
    display: none;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(220, 38, 38, 0.1);
}

.terms-error-message.show {
    display: block;
    animation: fadeIn 0.4s ease-in-out;
}

/* Disabled place order button styling */
#place_order.disabled,
.woocommerce-checkout-payment button[type="submit"].disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #ccc !important;
    color: #666 !important;
}

#place_order:disabled,
.woocommerce-checkout-payment button[type="submit"]:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #ccc !important;
    color: #666 !important;
}

/* WooCommerce Block Checkout Place Order Button - Disabled State */
.wc-block-components-checkout-place-order-button.disabled,
.wc-block-components-checkout-place-order-button:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    background-color: #ccc !important;
    color: #666 !important;
    border-color: #ccc !important;
    box-shadow: none !important;
}

.wc-block-components-checkout-place-order-button.disabled:hover,
.wc-block-components-checkout-place-order-button:disabled:hover {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background-color: #ccc !important;
    color: #666 !important;
    transform: none !important;
    box-shadow: none !important;
}

.wc-block-components-checkout-place-order-button.disabled:active,
.wc-block-components-checkout-place-order-button:disabled:active {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
    background-color: #ccc !important;
    color: #666 !important;
    transform: none !important;
    box-shadow: none !important;
}

/* Disable the button text as well */
.wc-block-components-checkout-place-order-button.disabled .wc-block-components-button__text,
.wc-block-components-checkout-place-order-button:disabled .wc-block-components-button__text,
.wc-block-components-checkout-place-order-button.disabled .wc-block-components-checkout-place-order-button__text,
.wc-block-components-checkout-place-order-button:disabled .wc-block-components-checkout-place-order-button__text {
    color: #666 !important;
    cursor: not-allowed !important;
}

/* Animations */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(-8px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* Mobile responsiveness for terms */
@media (max-width: 768px) {
    .wc-block-checkout__terms {
        padding: 14px 0;
        margin: 16px 0;
    }
    
    .wc-block-checkout__terms .wc-block-components-checkbox__label {
        font-size: 13px;
        line-height: 1.4;
        gap: 10px;
    }
    
    .wc-block-checkout__terms .wc-block-components-checkbox__label::before {
        width: 18px;
        height: 18px;
    }
    
    .wc-block-checkout__terms .spm-terms-checkbox {
        width: 18px;
        height: 18px;
        top: 14px;
    }
}

@media (max-width: 480px) {
    .wc-block-checkout__terms {
        padding: 12px 0;
        margin: 14px 0;
    }
    
    .wc-block-checkout__terms .wc-block-components-checkbox__label {
        font-size: 12px;
        line-height: 1.3;
        gap: 8px;
    }
    
    .wc-block-checkout__terms .wc-block-components-checkbox__label::before {
        width: 16px;
        height: 16px;
    }
    
    .wc-block-checkout__terms .spm-terms-checkbox {
        width: 16px;
        height: 16px;
        top: 12px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .woocommerce-cart-form__contents {
        font-size: 0.875rem;
    }
    
    .woocommerce-cart-form__contents th,
    .woocommerce-cart-form__contents td {
        padding: 0.75rem 0.5rem;
    }
    
    .product-thumbnail img {
        width: 50px;
        height: 50px;
    }
    
    .quantity {
        max-width: 100px;
    }
    
    .quantity input[type="button"] {
        width: 28px;
        height: 28px;
    }
    
    .quantity input[type="number"] {
        width: 40px;
        height: 28px;
    }
    
    .woocommerce-cart-form__contents .actions {
        padding: 1rem;
    }
    
    .woocommerce-cart-form__contents .actions .coupon {
        flex-direction: column;
        align-items: stretch;
        gap: 0.5rem;
    }
    
    .woocommerce-cart-form__contents .actions .coupon input[type="text"] {
        max-width: none;
    }
    
    .woocommerce-cart-form__contents .actions button[name="update_cart"] {
        float: none;
        width: 100%;
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .woocommerce-cart-form__contents th.product-thumbnail,
    .woocommerce-cart-form__contents td.product-thumbnail {
        display: none;
    }
    
    .woocommerce-cart-form__contents th.product-price,
    .woocommerce-cart-form__contents td.product-price {
        display: none;
    }
    
    .woocommerce-cart-form__contents th.product-name {
        width: 50%;
    }
    
    .woocommerce-cart-form__contents th.product-quantity {
        width: 25%;
    }
    
    .woocommerce-cart-form__contents th.product-subtotal {
        width: 25%;
    }
} 