/* ===== Shopping Cart Styles ===== */

/* Cart Toggle Button */
.cart-toggle {
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    position: relative;
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 1em;
}

.cart-toggle:hover {
    color: var(--bs-primary);
    transform: scale(1.1);
}

.cart-toggle i {
    font-size: 1.3rem;
}

.cart-count {
    position: absolute;
    top: -0.2rem;
    right: -0.2rem;
    background: var(--bs-primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 1.2rem;
    height: 1.2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    font-family: 'Josefin Sans', serif;
    animation: pulse 0.3s ease;
}

.cart-count.hidden {
    display: none;
}

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

/* Cart Sidebar */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: linear-gradient(135deg, rgba(0, 0, 0, 0.95) 0%, rgba(30, 30, 30, 0.95) 100%);
    backdrop-filter: blur(10px);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    z-index: 1060;
    transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: flex;
    flex-direction: column;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.3);
}

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

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

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

/* Cart Header */
.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
}

.cart-title {
    font-family: 'Josefin Sans', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: #fff;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.cart-close {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0.25rem;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-close:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

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

.cart-content::-webkit-scrollbar {
    width: 0.5rem;
}

.cart-content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
}

.cart-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0.25rem;
}

.cart-content::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

/* Cart Items */
.cart-items {
    padding: 1rem 0;
}

.cart-item {
    display: flex;
    align-items: center;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
    animation: slideInRight 0.3s ease;
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

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

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 0.5rem;
    overflow: hidden;
    margin-right: 1rem;
    flex-shrink: 0;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

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

.cart-item-name {
    font-family: 'Josefin Sans', serif;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin: 0 0 0.25rem 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.cart-item-brand {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0 0 0.5rem 0;
}

.cart-item-price {
    font-family: 'Josefin Sans', serif;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--bs-primary);
    margin: 0;
}

.cart-item-controls {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-left: 1rem;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    padding: 0.25rem;
    margin-bottom: 0.5rem;
}

.quantity-btn {
    background: transparent;
    border: none;
    color: #fff;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--bs-primary);
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-display {
    color: #fff;
    font-weight: 600;
    min-width: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

.remove-item {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 50%;
    width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.remove-item:hover {
    color: #dc3545;
    background: rgba(220, 53, 69, 0.1);
}

/* Empty Cart */
.cart-empty {
    text-align: center;
    padding: 3rem 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.cart-empty i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.cart-empty h4 {
    font-family: 'Josefin Sans', serif;
    font-size: 1.3rem;
    color: #fff;
    margin-bottom: 0.5rem;
}

.cart-empty p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.continue-shopping {
    background: var(--bs-primary);
    color: #fff;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 0.5rem;
    font-family: 'Josefin Sans', serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.continue-shopping:hover {
    background: var(--bs-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--bs-primary-rgb), 0.4);
    color: #fff;
}

/* Cart Footer */
.cart-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.05);
    padding: 1.5rem;
}

.cart-summary {
    margin-bottom: 1.5rem;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.cart-total-label {
    font-family: 'Josefin Sans', serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.cart-total-amount {
    font-family: 'Josefin Sans', serif;
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--bs-primary);
}

.cart-subtotal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
}

.cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.cart-btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-family: 'Josefin Sans', serif;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    display: block;
}

.cart-btn-primary {
    background: var(--bs-primary);
    color: #fff;
}

.cart-btn-primary:hover {
    background: var(--bs-primary);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(var(--bs-primary-rgb), 0.4);
    color: #fff;
}

.cart-btn-secondary {
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cart-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

/* Success Animation */
.cart-item.removing {
    animation: slideOutRight 0.3s ease forwards;
}

@keyframes slideOutRight {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Mobile Responsive */
@media (max-width: 767.98px) {
    .cart-sidebar {
        width: 100%;
        right: -100%;
    }
    
    .cart-sidebar.open {
        right: 0;
    }
    
    .cart-header {
        padding: 1rem;
    }
    
    .cart-title {
        font-size: 1.2rem;
    }
    
    .cart-item {
        padding: 0.75rem 1rem;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
        margin-right: 0.75rem;
    }
    
    .cart-item-name {
        font-size: 0.9rem;
    }
    
    .cart-footer {
        padding: 1rem;
    }
    
    .cart-total-label {
        font-size: 1rem;
    }
    
    .cart-total-amount {
        font-size: 1.2rem;
    }
}

@media (max-width: 575.98px) {
    .cart-item-controls {
        margin-left: 0.5rem;
    }
    
    .cart-item-quantity {
        margin-bottom: 0.25rem;
    }
    
    .quantity-btn {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.7rem;
    }
    
    .quantity-display {
        min-width: 1.5rem;
        font-size: 0.8rem;
    }
}

/* Cart Badge Animation */
.cart-count.updated {
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 20%, 53%, 80%, 100% {
        transform: translate3d(0, 0, 0);
    }
    40%, 43% {
        transform: translate3d(0, -8px, 0);
    }
    70% {
        transform: translate3d(0, -4px, 0);
    }
    90% {
        transform: translate3d(0, -2px, 0);
    }
}

/* Loading State */
.cart-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    color: rgba(255, 255, 255, 0.6);
}

.cart-loading i {
    font-size: 2rem;
    animation: spin 1s linear infinite;
}

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