/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-primary);
    box-shadow: -4px 0 16px rgba(0, 0, 0, 0.1);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    transition: right 0.3s ease;
}

.cart-sidebar.active {
    right: 0;
}

.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-sidebar.active ~ .cart-overlay {
    opacity: 1;
    pointer-events: all;
}

#wishlistOverlay {
    display: none;
}

#wishlistSidebar.active ~ #wishlistOverlay,
#wishlistSidebar.active + #wishlistOverlay {
    display: block;
    opacity: 1;
    pointer-events: all;
}

.cart-sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
}

.cart-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: var(--transition);
}

.cart-close:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.cart-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-empty, .wishlist-empty {
    text-align: center;
    color: var(--text-secondary);
    padding: 3rem 1rem;
}

.wishlist-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.wishlist-item:last-child {
    border-bottom: none;
}

.wishlist-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-secondary);
}

.wishlist-item-info {
    flex: 1;
    min-width: 0;
}

.wishlist-item-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wishlist-item-price {
    color: var(--accent-primary);
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.wishlist-item-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

#wishlistSidebar.active ~ #wishlistOverlay {
    opacity: 1;
    pointer-events: all;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    background: var(--bg-secondary);
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-info h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-price {
    color: var(--accent-primary);
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.qty-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--bg-secondary);
    border-color: var(--accent-primary);
}

.cart-item-qty {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
}

.remove-btn {
    background: none;
    border: none;
    color: #ef4444;
    font-size: 0.85rem;
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.remove-btn:hover {
    background: rgba(239, 68, 68, 0.1);
}

.cart-total {
    padding: 1.5rem 0;
    border-top: 2px solid var(--border-color);
    margin-top: 1rem;
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.cart-limit {
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-align: right;
}

.cart-sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.btn-block {
    width: 100%;
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    z-index: 3000;
    transform: translateX(400px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

.notification-success {
    border-left: 4px solid #10b981;
    background: linear-gradient(90deg, rgba(16, 185, 129, 0.1) 0%, var(--bg-card) 4%);
}

.notification-error {
    border-left: 4px solid #ef4444;
    background: linear-gradient(90deg, rgba(239, 68, 68, 0.1) 0%, var(--bg-card) 4%);
}

.notification::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
}

.notification-success::before {
    content: '✓';
    width: 24px;
    height: 24px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.notification-error::before {
    content: '✕';
    width: 24px;
    height: 24px;
    background: #ef4444;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

/* Product Image Overlay */
.product-image {
    position: relative;
    overflow: hidden;
}

.product-image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition);
}

.product-card:hover .product-image-overlay {
    opacity: 1;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-overlay .btn {
    transform: translateY(20px);
    transition: var(--transition);
}

.product-card:hover .product-image-overlay .btn {
    transform: translateY(0);
}

@media (max-width: 968px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
}

@media (max-width: 640px) {
    .notification {
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}
