/* RFZ Ecom Cart Menu Styles */
.rfz-ecom-cart-menu-wrapper {
    display: inline-block;
    position: relative;
}

.rfz-ecom-cart-trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    cursor: pointer;
    border: none;
    background: transparent;
    transition: all 0.3s ease;
}

.rfz-ecom-cart-trigger:hover {
    transform: translateY(-1px);
}

.rfz-ecom-cart-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: inherit;
}

.rfz-ecom-cart-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #d30c5c;
    color: #fff;
    border-radius: 50%;
    font-size: 10px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 16px;
    height: 16px;
}

.rfz-ecom-cart-subtotal {
    font-weight: 600;
    margin-left: 8px;
}

/* Cart Sidebar */
.rfz-ecom-cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 100%;
    max-width: 380px;
    height: 100vh;
    z-index: 9999; /* keep this higher */
    transition: right 0.3s ease;
}

.rfz-ecom-cart-sidebar.active {
    right: 0;
}

.rfz-ecom-cart-sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 9998; /* ensure this is BELOW sidebar */
}

/* When sidebar is active */
.rfz-ecom-cart-sidebar-open .rfz-ecom-cart-sidebar-overlay {
    opacity: 1;
    visibility: visible;
}


.rfz-ecom-cart-sidebar-content {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    background: #fff;
    box-shadow: -2px 0 20px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    z-index: 9999;
}

.rfz-ecom-cart-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid #e5e5e5;
    background: #f9f9f9;
}

.rfz-ecom-cart-sidebar-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
}

.rfz-ecom-cart-sidebar-close {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
    transition: color 0.3s ease;
}

.rfz-ecom-cart-sidebar-close:hover {
    color: #333;
}

.rfz-ecom-cart-sidebar-close svg {
    width: 20px;
    height: 20px;
}

.rfz-ecom-cart-sidebar-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.rfz-ecom-cart-items {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
}

.rfz-ecom-cart-item {
    display: flex;
    align-items: flex-start;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.rfz-ecom-cart-item:last-child {
    border-bottom: none;
}

.rfz-ecom-cart-item-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
}

.rfz-ecom-cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

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

.rfz-ecom-cart-item-name {
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 0.9rem;
    line-height: 1.3;
    color: #333;
}

.rfz-ecom-cart-item-name a {
    text-decoration: none;
    color: inherit;
}

.rfz-ecom-cart-item-name a:hover {
    color: #d30c5c;
}

.rfz-ecom-cart-item-price {
    color: #d30c5c;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.rfz-ecom-cart-item-quantity {
    display: flex;
    align-items: center;
    margin-top: 5px;
    font-size: 0.8rem;
    color: #666;
}

.rfz-ecom-cart-item-quantity label {
    margin-right: 5px;
    font-weight: 500;
}

.rfz-ecom-cart-item-quantity .quantity-value {
    font-weight: 600;
    color: #333;
}

.rfz-ecom-cart-item-remove {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    margin-left: 10px;
    transition: color 0.3s ease;
    position: absolute;
    top: 15px;
    right: 0;
}

.rfz-ecom-cart-item-remove:hover {
    color: #d30c5c;
}

.rfz-ecom-cart-empty {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 1rem;
}

.rfz-ecom-cart-sidebar-footer {
    padding: 20px;
    border-top: 1px solid #e5e5e5;
    background: #f9f9f9;
}

.rfz-ecom-cart-totals {
    margin-bottom: 20px;
}

.rfz-ecom-cart-subtotal-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    font-size: 1.1rem;
}

.rfz-ecom-cart-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.rfz-ecom-cart-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    text-decoration: none;
    font-weight: 600;
    border-radius: 4px;
    transition: all 0.3s ease;
    text-align: center;
    border: 2px solid transparent;
    font-size: 0.9rem;
}

.rfz-ecom-view-cart-button {
    background: #fff;
    color: #333;
    border-color: #333;
}

.rfz-ecom-view-cart-button:hover {
    background: #333;
    color: #fff;
}

.rfz-ecom-checkout-button {
    background: #d30c5c;
    color: #fff;
    border-color: #d30c5c;
}

.rfz-ecom-checkout-button:hover {
    background: #b00a4d;
    border-color: #b00a4d;
}

/* Loading States */
.rfz-ecom-cart-loading {
    opacity: 0.7;
    pointer-events: none;
}

.rfz-ecom-cart-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: rfz-ecom-spin 0.8s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes rfz-ecom-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Responsive */
@media (max-width: 480px) {
    .rfz-ecom-cart-sidebar {
        max-width: 100%;
    }
    
    .rfz-ecom-cart-buttons {
        grid-template-columns: 1fr;
    }
    
    .rfz-ecom-cart-item {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .rfz-ecom-cart-item-image {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .rfz-ecom-cart-item-remove {
        position: static;
        align-self: flex-end;
        margin-top: 10px;
    }
}







