/* Page transition */
.page-transition {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--background);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.page-transition.fade-out {
    opacity: 0;
    visibility: hidden;
}

.transition-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: var(--secondary);
    font-size: 2rem;
    font-weight: bold;
}

.transition-logo i {
    font-size: 4rem;
    animation: pulse 1.5s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Glitch effect */
.glitch {
    position: relative;
    animation: glitch-effect 3s infinite;
}

@keyframes glitch-effect {
    0% { transform: translate(0); }
    20% { transform: translate(-3px, 3px); }
    40% { transform: translate(-3px, -3px); }
    60% { transform: translate(3px, 3px); }
    80% { transform: translate(3px, -3px); }
    100% { transform: translate(0); }
}

/* Floating icons animation */
.floating-icon {
    position: absolute;
    color: rgba(157, 78, 221, 0.3);
    font-size: 2rem;
    animation: float 6s ease-in-out infinite;
    animation-delay: var(--delay);
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) rotate(0deg); }
    25% { transform: translate(20px, 20px) rotate(5deg); }
    50% { transform: translate(10px, 30px) rotate(0deg); }
    75% { transform: translate(-10px, 20px) rotate(-5deg); }
}

/* Scroll animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
    transition-delay: var(--delay, 0);
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Add to cart animation */
@keyframes cart-bounce {
    0%, 100% { transform: scale(1); }
    25% { transform: scale(1.2); }
    50% { transform: scale(0.9); }
    75% { transform: scale(1.1); }
}

.cart-bounce {
    animation: cart-bounce 0.5s ease;
}

.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background: var(--surface);
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.3);
    z-index: 1001;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
    border-left: 1px solid rgba(157, 78, 221, 0.3);
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(157, 78, 221, 0.3);
}

.cart-header h3 {
    color: var(--secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.close-cart {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close-cart:hover {
    color: var(--secondary);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(157, 78, 221, 0.1);
}

.cart-item:last-child {
    border-bottom: none;
}

.cart-item-info h4 {
    margin: 0 0 0.5rem;
    color: var(--text);
}

.cart-item-price {
    color: var(--accent);
    font-weight: bold;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-item-controls button {
    background: rgba(157, 78, 221, 0.2);
    border: none;
    color: var(--text);
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cart-item-controls button:hover {
    background: var(--secondary);
    color: white;
}

.cart-item-controls span {
    min-width: 20px;
    text-align: center;
}

.empty-cart {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem 0;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid rgba(157, 78, 221, 0.3);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: bold;
}

.cart-total span:last-child {
    color: var(--accent);
}

.checkout-btn {
    width: 100%;
    padding: 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 5px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkout-btn:hover {
    background: var(--secondary);
    transform: translateY(-2px);
}

.checkout-btn:disabled {
    background: var(--text-secondary);
    cursor: not-allowed;
    transform: none;
}

/* Overlay when cart is open */
.cart-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.cart-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* Fade in up */
.fade-in-up {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 1s ease forwards;
    animation-delay: 0.5s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}