/* Cart Button - Fixed Position (Right Top Corner) */
.cart-btn {
    position: fixed;
    top: 30px;
    right: 30px;
    width: 45px;
    height: 45px;
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(128, 128, 128, 0.5);
    border-left: 5px solid var(--fenogram-yellow);
    border-radius: 3px;
    cursor: pointer;
    z-index: 999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--transition-smooth);
}

.cart-btn:hover {
    background-color: rgba(255, 255, 138, 0.08);
}

.cart-count {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--fenogram-white);
    font-family: 'Poppins', sans-serif;
}

/* Hide on watch page */
body.watch-page .cart-btn {
    display: none;
}

/* Cart Close Button */
.cart-close-btn {
    position: fixed;
    top: 33px;
    right: 48px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    background: none;
    border: none;
    font-size: 0;
    transition: all 0.2s var(--transition-smooth);
    z-index: 2001;
}

.cart-close-btn:hover {
    opacity: 0.7;
    transform: rotate(90deg);
}

.cart-close-btn svg {
    width: 16px;
    height: 16px;
}

/* Cart Sidebar - Same style as Side Menu */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    bottom: 0;
    width: 450px;
    height: 100vh;
    background: rgba(0, 0, 0, 0.35);
    backdrop-filter: blur(20px);
    z-index: 2000;
    display: flex;
    flex-direction: column;
    padding: 30px 40px;
    border-left: 1px solid rgba(255, 255, 255, 0.15);
    transition: right 0.35s var(--transition-smooth);
    overflow-y: auto;
    overflow-x: hidden;
}

.cart-sidebar.active {
    right: 0;
    animation: slideInFromRight 0.35s var(--transition-smooth) forwards;
}

.cart-sidebar.closing {
    animation: slideOutToRight 0.3s var(--transition-smooth) forwards;
}

@keyframes slideInFromRight {
    from {
        right: -100%;
    }
    to {
        right: 0;
    }
}

@keyframes slideOutToRight {
    from {
        right: 0;
    }
    to {
        right: -100%;
    }
}

/* Cart Header */
.cart-header {
    margin-bottom: 32px;
    margin-top: 0;
    padding-top: 13px;
    flex-shrink: 0;
}

.cart-title {
    font-size: 2rem;
    font-weight: 900;
    margin-bottom: 4px;
    color: var(--fenogram-white);
    line-height: 1.2;
}

.cart-subtitle {
    font-size: 0.95rem;
    font-weight: 200;
    color: var(--fenogram-text-gray);
    margin-top: 4px;
}

/* Cart Content */
.cart-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
    overflow-y: auto;
    max-height: calc(100vh - 300px);
    padding-right: 0px;
}

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

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

.cart-content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
}

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

/* Cart Item */
.cart-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background-color: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    transition: all 0.2s var(--transition-smooth);
}

.cart-item:hover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
}

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

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

.cart-item-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--fenogram-white);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--fenogram-text-gray);
    font-weight: 200;
}

.cart-item-meta .maturity img {
    height: 16px;
    width: auto;
    filter: brightness(0) invert(1);
}

.cart-item-meta span:not(:last-child):not(.maturity)::after {
    content: '•';
    margin-left: 8px;
    color: var(--fenogram-yellow);
}

.cart-item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--fenogram-yellow);
    margin-top: 8px;
}

.cart-item-remove {
    width: 36px;
    height: 36px;
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    cursor: pointer;
    color: var(--fenogram-white);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s var(--transition-smooth);
    flex-shrink: 0;
}

.cart-item-remove:hover {
    background-color: rgba(255, 0, 0, 0.2);
    border-color: rgba(255, 0, 0, 0.5);
}

/* Cart Empty State */
.cart-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    text-align: center;
}

.cart-empty svg {
    stroke: var(--fenogram-text-gray);
    margin-bottom: 24px;
    opacity: 0.5;
}

.cart-empty-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--fenogram-white);
    margin-bottom: 8px;
}

.cart-empty-subtext {
    font-size: 0.9rem;
    font-weight: 200;
    color: var(--fenogram-text-gray);
}

/* Cart Footer */
.cart-footer {
    flex-shrink: 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.cart-checkout-btn {
    width: 100%;
    padding: 14px 24px;
    background-color: rgba(255, 255, 138, 0.08);
    border: none;
    border-left: 5px solid var(--fenogram-yellow);
    border-radius: 0;
    color: var(--fenogram-white);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s var(--transition-smooth);
    font-family: 'Poppins', sans-serif;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.cart-checkout-btn:hover {
    background-color: rgba(255, 255, 138, 0.15);
}

.cart-checkout-btn svg {
    flex-shrink: 0;
}

/* Mobile Cart Icon in Header - Hidden on Desktop */
.mobile-cart-icon {
    display: none !important;
    position: relative;
}

@media (max-width: 768px) {
    .mobile-cart-icon {
        display: flex !important;
    }
}

.mobile-cart-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: var(--fenogram-yellow);
    color: var(--fenogram-black);
    font-size: 0.65rem;
    font-weight: 700;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: 'Poppins', sans-serif;
}

/* Mobile Styles */
@media (max-width: 768px) {
    /* Hide desktop cart button on mobile */
    .cart-btn {
        display: none !important;
    }
    
    /* Show mobile cart icon in header */
    .mobile-cart-icon {
        display: flex;
    }
    
    .cart-count {
        font-size: 1.1rem;
    }
    
    .cart-sidebar {
        width: 100%;
        padding: 20px;
        max-height: 100vh;
        max-height: 100dvh;
        height: 100vh;
        height: 100dvh;
    }
    
    .cart-title {
        font-size: 1.6rem;
    }
    
    .cart-subtitle {
        font-size: 0.85rem;
    }
    
    .cart-close-btn {
        right: 20px;
    }
    
    .cart-item-img {
        width: 60px;
        height: 90px;
    }
    
    .cart-item-title {
        font-size: 0.95rem;
    }
    
    .cart-item-meta {
        font-size: 0.75rem;
    }
}

/* Extra Small Mobile */
@media (max-width: 480px) {
    .cart-btn {
        width: 40px;
        height: 40px;
    }
    
    .cart-count {
        font-size: 1rem;
    }
    
    .cart-item {
        padding: 10px;
        gap: 12px;
    }
    
    .cart-item-img {
        width: 50px;
        height: 75px;
    }
    
    .cart-item-title {
        font-size: 0.9rem;
    }
}
