/* Cart Sidebar Styles */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -450px;
    width: 450px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 20px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
}

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

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

.cart-sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Header */
.cart-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 2px solid #f0f0f0;
    background: #fafafa;
}

.cart-sidebar-header h3 {
    margin: 0;
    font-size: 22px;
    color: #333;
    font-weight: 600;
}

.close-cart-sidebar {
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s;
}

.close-cart-sidebar:hover {
    transform: rotate(90deg);
}

.close-cart-sidebar svg {
    stroke: #666;
}

/* Cart Content */
.cart-sidebar-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.cart-sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.cart-sidebar-content::-webkit-scrollbar-thumb {
    background: #c0596A;
    border-radius: 3px;
}

.cart-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #a04858;
}

/* Empty Cart */
.empty-cart-sidebar {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 40px 20px;
}

.empty-cart-icon {
    font-size: 80px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-cart-sidebar h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 20px;
}

.empty-cart-sidebar p {
    color: #666;
    font-size: 14px;
}

/* Cart Item */
.cart-sidebar-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: #fafafa;
    border-radius: 10px;
    margin-bottom: 15px;
    position: relative;
    transition: all 0.3s;
}

.cart-sidebar-item:hover {
    background: #f5f5f5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

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

.cart-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 5px 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-category {
    font-size: 12px;
    color: #888;
    margin: 0 0 3px 0;
}

.cart-item-size,
.cart-item-color {
    font-size: 11px;
    color: #666;
    margin: 0 0 3px 0;
}

.cart-item-price {
    font-size: 14px;
    color: #c0596A;
    font-weight: 600;
    margin: 5px 0;
}

.cart-item-total {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 16px;
    font-weight: 700;
    color: #c0596A;
}

/* Cart Item Actions */
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    padding: 4px 8px;
}

.qty-btn {
    background: none;
    border: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 16px;
    color: #666;
    transition: all 0.2s;
}

.qty-btn:hover {
    color: #c0596A;
    transform: scale(1.2);
}

.qty-value {
    min-width: 30px;
    text-align: center;
    font-weight: 600;
    font-size: 14px;
    color: #333;
}

.remove-item-btn {
    background: none;
    border: none;
    color: #ff4444;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: all 0.2s;
}

.remove-item-btn:hover {
    background: #fff0f0;
}

.remove-item-btn svg {
    stroke: #ff4444;
}

/* Cart Footer */
.cart-sidebar-footer {
    padding: 20px 25px;
    border-top: 2px solid #f0f0f0;
    background: #fafafa;
}

.cart-summary {
    margin-bottom: 20px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: 14px;
    color: #666;
}

.summary-row.total-row {
    font-size: 18px;
    color: #333;
    padding-top: 10px;
    border-top: 2px solid #e0e0e0;
    margin-top: 10px;
}

.summary-row.total-row strong {
    color: #c0596A;
}

.cart-checkout-btn {
    width: 100%;
    padding: 15px;
    background: #c0596A;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    transition: all 0.3s;
}

.cart-checkout-btn:hover {
    background: #a04858;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(192, 89, 106, 0.3);
}

.cart-continue-btn {
    width: 100%;
    padding: 12px;
    background: white;
    color: #666;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
}

.cart-continue-btn:hover {
    background: #f5f5f5;
    border-color: #c0596A;
    color: #c0596A;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #c0596A;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid white;
    animation: badgePop 0.3s ease;
}

@keyframes badgePop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

/* Cart Notification */
.cart-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 25px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    z-index: 10002;
    opacity: 0;
    transform: translateX(100px);
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.cart-notification.show {
    opacity: 1;
    transform: translateX(0);
}

.cart-notification.success {
    background: #4CAF50;
}

.cart-notification.error {
    background: #f44336;
}

.cart-notification.info {
    background: #2196F3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-sidebar.active {
        right: 0;
    }
    
    .cart-sidebar-header {
        padding: 15px 20px;
    }
    
    .cart-sidebar-header h3 {
        font-size: 18px;
    }
    
    .cart-sidebar-content {
        padding: 15px;
    }
    
    .cart-sidebar-item {
        padding: 12px;
    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
    }
    
    .cart-item-name {
        font-size: 14px;
    }
    
    .cart-item-total {
        font-size: 14px;
    }
    
    .cart-sidebar-footer {
        padding: 15px 20px;
    }
}

@media (max-width: 480px) {
    .cart-sidebar-item {
        flex-direction: row;
        align-items: start;
        text-align: center;

    }
    
    .cart-item-image {
        width: 70px;
        height: 70px;
        flex-shrink: 0;
    }

    .cart-item-name {
        font-size: 14px;
    }
    
    .cart-item-total {
        font-size: 14px;
    }
    
    .cart-sidebar-footer {
        padding: 14px 20px;
    }

    .cart-item-details {
        display: flex;
        flex-direction: column;
        justify-content: start;
        align-items: start;
    }
    
    .cart-item-total {
        position: static;
        margin-top: 10px;
    }

    .cart-item-price {
        font-size: 14px;
        color: #c0596A;
        font-weight: 600;
        margin: 2px 0;
    }

    .cart-item-actions {
        justify-content: start;
        width: 100%;
    }

    .cart-checkout-btn {
        width: 100%;
        background: #c0596A;
        color: white;
        border: none;
        border-radius: 8px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        padding: 0px;
        margin: 0px;
        transition: all 0.3s;
    }

    .cart-continue-btn{
        padding: 0px;
        margin: 0px;
    }
}

/* Animation for cart items */
@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-sidebar-item {
    animation: slideInRight 0.3s ease;
}

/* Loading state */
.cart-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
}

.cart-loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #c0596A;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Free shipping progress bar (optional) */
.shipping-progress {
    margin: 15px 0;
    padding: 15px;
    background: #fff8f0;
    border-radius: 8px;
    border-left: 4px solid #c0596A;
}

.shipping-progress-text {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.shipping-progress-bar {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.shipping-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #c0596A, #ff8fa3);
    transition: width 0.3s ease;
}
