/* Sidebar Cart Styles */
.wp-checkout-sidebar-cart {
    position: fixed !important;
    top: 0 !important;
    right: -100% !important;
    width: 100% !important;
    max-width: 400px !important;
    height: 100vh !important;
    z-index: 99999 !important;
    transition: right 0.3s ease-in-out !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    display: block !important;
    visibility: visible !important;
}

.wp-checkout-sidebar-cart.open {
    right: 0 !important;
    transform: translateX(0) !important;
}

.sidebar-cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: -1;
}

.wp-checkout-sidebar-cart.open .sidebar-cart-overlay {
    opacity: 1;
    visibility: visible;
}

.sidebar-cart-content {
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
}

/* Light Theme */
.wp-checkout-sidebar-cart[data-theme="light"] .sidebar-cart-content {
    background: #ffffff;
    color: #333333;
}

.wp-checkout-sidebar-cart[data-theme="light"] .sidebar-cart-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
}

.wp-checkout-sidebar-cart[data-theme="light"] .cart-item {
    background: #ffffff;
    border-bottom: 1px solid #f0f0f0;
}

.wp-checkout-sidebar-cart[data-theme="light"] .cart-item:hover {
    background: #f9f9f9;
}

/* Dark Theme */
.wp-checkout-sidebar-cart[data-theme="dark"] .sidebar-cart-content {
    background: #1a1a1a;
    color: #ffffff;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .sidebar-cart-header {
    background: #1a1a1a;
    border-bottom: 1px solid #333333;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .cart-item {
    background: #1a1a1a;
    border-bottom: 1px solid #2a2a2a;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .cart-item:hover {
    background: #2a2a2a;
}

/* Header */
.sidebar-cart-header {
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.sidebar-cart-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
}

.sidebar-cart-controls {
    display: flex;
    gap: 8px;
    align-items: center;
}

.clear-cart-btn-small {
    background: none;
    border: 1px solid #ddd;
    font-size: 14px;
    cursor: pointer;
    padding: 4px 6px;
    border-radius: 4px;
    transition: all 0.2s;
    color: inherit;
    min-width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.clear-cart-btn-small:hover {
    background: rgba(255, 0, 0, 0.1);
    border-color: #ff4757;
    color: #ff4757;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .clear-cart-btn-small {
    border-color: #555;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .clear-cart-btn-small:hover {
    background: rgba(255, 71, 87, 0.1);
    border-color: #ff4757;
    color: #ff4757;
}

.theme-toggle {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.2s;
}

.theme-toggle:hover {
    background: rgba(0, 0, 0, 0.1);
}

.wp-checkout-sidebar-cart[data-theme="dark"] .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.1);
}

.theme-icon {
    display: none;
}

.wp-checkout-sidebar-cart[data-theme="light"] .light-icon {
    display: inline;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .dark-icon {
    display: inline;
}

.close-cart {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 4px;
    transition: background 0.2s;
    color: inherit;
}

.close-cart:hover {
    background: rgba(255, 0, 0, 0.1);
}

/* Cart Items */
.sidebar-cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 0;
}

.cart-item {
    display: flex;
    padding: 16px 20px;
    gap: 12px;
    transition: background 0.2s;
}

.item-image {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .item-image {
    background: #333333;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.item-details {
    flex: 1;
    min-width: 0;
}

.item-name {
    font-size: 16px;
    font-weight: 500;
    margin: 0 0 4px 0;
    line-height: 1.3;
}

.item-price {
    font-size: 14px;
    margin: 0 0 12px 0;
    opacity: 0.7;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid #ddd;
    background: #ffffff;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .qty-btn {
    border-color: #555;
    background: #2a2a2a;
    color: #ffffff;
}

.qty-btn:hover {
    background: #f0f0f0;
    border-color: #ccc;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .qty-btn:hover {
    background: #3a3a3a;
    border-color: #666;
}

.qty-input {
    width: 40px;
    height: 28px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #ffffff;
    font-size: 14px;
    font-weight: 500;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .qty-input {
    border-color: #555;
    background: #2a2a2a;
    color: #ffffff;
}

.item-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 8px;
}

.delete-item {
    background: none;
    border: none;
    color: #ff4757;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background 0.2s;
}

.delete-item:hover {
    background: rgba(255, 71, 87, 0.1);
}

.item-total {
    font-size: 16px;
    font-weight: 600;
    color: inherit;
}

/* Footer */
.sidebar-cart-footer {
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .sidebar-cart-footer {
    border-top-color: #333333;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    font-size: 18px;
    font-weight: 600;
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.clear-cart-btn {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    background: transparent;
    color: inherit;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.wp-checkout-sidebar-cart[data-theme="dark"] .clear-cart-btn {
    border-color: #555;
}

.clear-cart-btn:hover {
    background: rgba(0, 0, 0, 0.05);
}

.wp-checkout-sidebar-cart[data-theme="dark"] .clear-cart-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: #007cba;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.checkout-btn:hover {
    background: #005a87;
}

/* Empty Cart State */
.empty-cart {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 200px;
    opacity: 0.6;
}

.empty-cart-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.empty-cart-text {
    font-size: 16px;
    text-align: center;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .wp-checkout-sidebar-cart {
        max-width: 100%;
        width: 100%;
    }
    
    .sidebar-cart-header {
        padding: 16px;
    }
    
    .cart-item {
        padding: 12px 16px;
    }
    
    .sidebar-cart-footer {
        padding: 16px;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.wp-checkout-sidebar-cart.open .sidebar-cart-content {
    animation: slideIn 0.3s ease-out;
}

.cart-item {
    animation: fadeIn 0.2s ease-out;
}
