/* Cart Styles */

/* Floating Cart Button */
.cart-float-btn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 50%;
    color: white;
    font-size: 1.4rem;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.5);
    z-index: 1050;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-float-btn:hover {
    transform: scale(1.1) translateY(-4px);
    box-shadow: 0 12px 32px rgba(139, 92, 246, 0.7);
    color: white;
}

.cart-float-btn .cart-float-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.5);
    animation: pulse-badge 2s infinite;
}

@keyframes pulse-badge {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Cart Drawer (slide-in from right) */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -480px;
    width: 480px;
    max-width: 100vw;
    height: 100vh;
    background: linear-gradient(180deg, #1a1f3a 0%, #0f1629 100%);
    border-left: 2px solid rgba(139, 92, 246, 0.3);
    z-index: 1060;
    transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: -8px 0 40px rgba(0, 0, 0, 0.5);
}

.cart-drawer.open {
    right: 0;
}

.cart-drawer-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 1055;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s;
    backdrop-filter: blur(4px);
}

.cart-drawer-overlay.open {
    opacity: 1;
    pointer-events: all;
}

.cart-drawer-header {
    padding: 20px 24px;
    border-bottom: 2px solid rgba(139, 92, 246, 0.3);
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15) 0%, rgba(124, 58, 237, 0.15) 100%);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.cart-drawer-title {
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-drawer-close {
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 10px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: all 0.2s;
    cursor: pointer;
}

.cart-drawer-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #ef4444;
}

/* Free shipping progress */
.free-shipping-bar {
    padding: 12px 24px;
    background: rgba(16, 185, 129, 0.08);
    border-bottom: 1px solid rgba(16, 185, 129, 0.2);
    flex-shrink: 0;
}

.free-shipping-text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.82rem;
    margin-bottom: 6px;
}

.free-shipping-text span {
    color: #10b981;
    font-weight: 700;
}

.progress-track {
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #10b981, #059669);
    border-radius: 10px;
    transition: width 0.5s ease;
}

/* Cart Items */
.cart-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(139, 92, 246, 0.4) transparent;
}

.cart-drawer-body::-webkit-scrollbar { width: 4px; }
.cart-drawer-body::-webkit-scrollbar-track { background: transparent; }
.cart-drawer-body::-webkit-scrollbar-thumb { background: rgba(139, 92, 246, 0.4); border-radius: 4px; }

.cart-item {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: all 0.2s;
    animation: slideInItem 0.3s ease;
}

@keyframes slideInItem {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.cart-item:hover {
    border-color: rgba(139, 92, 246, 0.35);
    background: rgba(139, 92, 246, 0.06);
}

.cart-item-img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    object-fit: cover;
    flex-shrink: 0;
    background: rgba(0, 0, 0, 0.3);
}

.cart-item-img-placeholder {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    background: rgba(139, 92, 246, 0.1);
    border: 1px solid rgba(139, 92, 246, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(139, 92, 246, 0.5);
    font-size: 1.5rem;
    flex-shrink: 0;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-item-price {
    color: #a78bfa;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 10px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.qty-btn {
    width: 28px;
    height: 28px;
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.3);
    color: white;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.qty-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: #8b5cf6;
}

.qty-display {
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    min-width: 24px;
    text-align: center;
}

.cart-item-remove {
    background: none;
    border: none;
    color: rgba(239, 68, 68, 0.5);
    font-size: 1rem;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.cart-item-remove:hover {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.cart-item-subtotal {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.8rem;
    margin-top: 4px;
}

/* Empty cart */
.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: rgba(255, 255, 255, 0.5);
}

.cart-empty i {
    font-size: 4rem;
    color: rgba(139, 92, 246, 0.3);
    margin-bottom: 16px;
    display: block;
}

.cart-empty p {
    font-size: 1rem;
    margin-bottom: 20px;
}

/* Cart Footer */
.cart-drawer-footer {
    padding: 20px 24px;
    border-top: 2px solid rgba(139, 92, 246, 0.3);
    background: rgba(0, 0, 0, 0.2);
    flex-shrink: 0;
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.cart-summary-label { color: rgba(255, 255, 255, 0.6); }
.cart-summary-value { color: white; font-weight: 600; }
.cart-summary-value.free { color: #10b981; }

.cart-total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    margin-top: 8px;
    border-top: 1px solid rgba(139, 92, 246, 0.2);
    margin-bottom: 16px;
}

.cart-total-label {
    color: white;
    font-weight: 700;
    font-size: 1rem;
}

.cart-total-value {
    color: #a78bfa;
    font-weight: 800;
    font-size: 1.3rem;
}

.btn-checkout {
    width: 100%;
    background: linear-gradient(135deg, #8b5cf6 0%, #7c3aed 100%);
    border: none;
    border-radius: 14px;
    color: white;
    font-weight: 700;
    font-size: 1rem;
    padding: 14px;
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(139, 92, 246, 0.4);
    text-decoration: none;
    display: block;
    text-align: center;
    margin-bottom: 10px;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.6);
    color: white;
}

.btn-view-cart {
    width: 100%;
    background: transparent;
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 14px;
    color: rgba(255, 255, 255, 0.8);
    font-weight: 600;
    padding: 11px;
    transition: all 0.3s;
    text-decoration: none;
    display: block;
    text-align: center;
}

.btn-view-cart:hover {
    border-color: #8b5cf6;
    color: white;
    background: rgba(139, 92, 246, 0.1);
}

/* Toast notification */
.cart-toast {
    position: fixed;
    bottom: 100px;
    right: 30px;
    background: linear-gradient(135deg, #1a1f3a 0%, #252b4a 100%);
    border: 2px solid rgba(139, 92, 246, 0.4);
    border-radius: 14px;
    padding: 14px 20px;
    color: white;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1070;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 320px;
}

.cart-toast.show {
    transform: translateX(0);
}

.cart-toast.success { border-color: rgba(16, 185, 129, 0.5); }
.cart-toast.success i { color: #10b981; }
.cart-toast.error { border-color: rgba(239, 68, 68, 0.5); }
.cart-toast.error i { color: #ef4444; }

/* Nav cart badge */
.cart-nav-badge {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    border-radius: 12px;
    padding: 3px 8px;
    font-size: 0.7rem;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

/* Cart page styles */
.cart-page-item {
    background: linear-gradient(135deg, #1a1f3a 0%, #252b4a 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    display: flex;
    gap: 20px;
    align-items: center;
    transition: all 0.3s;
}

.cart-page-item:hover {
    border-color: rgba(139, 92, 246, 0.4);
    box-shadow: 0 4px 20px rgba(139, 92, 246, 0.15);
}

.cart-page-img {
    width: 100px;
    height: 100px;
    border-radius: 12px;
    object-fit: cover;
    flex-shrink: 0;
}

.cart-summary-card {
    background: linear-gradient(135deg, #1a1f3a 0%, #252b4a 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: 20px;
    padding: 28px;
    position: sticky;
    top: 20px;
}

@media (max-width: 576px) {
    .cart-drawer { width: 100vw; right: -100vw; }
    .cart-float-btn { bottom: 20px; right: 20px; }
}
