/* ========================================
   SHOPPING CART MODAL
   ======================================== */

.cart-modal {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 450px;
    max-width: 90vw;
    background: linear-gradient(135deg, rgba(20, 27, 61, 0.98) 0%, rgba(10, 14, 39, 0.98) 100%);
    backdrop-filter: blur(20px);
    border-left: 1px solid rgba(255, 215, 0, 0.2);
    box-shadow: -10px 0 50px rgba(0, 0, 0, 0.5);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    display: flex;
    flex-direction: column;
}

.cart-modal.active {
    transform: translateX(0);
}

.cart-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 9998;
}

.cart-backdrop.active {
    opacity: 1;
    visibility: visible;
}

/* Cart Header */
.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid rgba(255, 215, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: white;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.cart-title-count {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: #0a0e27;
    padding: 0.2rem 0.6rem;
    border-radius: 12px;
    font-size: 0.9rem;
}

.cart-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    transition: all 0.3s ease;
}

.cart-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

/* Cart Items */
.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #a0a8c1;
}

.cart-empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.cart-empty-text {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.cart-empty-subtext {
    font-size: 0.9rem;
    color: #6b7280;
}

.cart-item {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    transition: all 0.3s ease;
}

.cart-item:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 215, 0, 0.2);
}

.cart-item-image {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(168, 85, 247, 0.1) 100%);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
}

.cart-item-image img[src=""],
.cart-item-image img:not([src]) {
    display: none;
}

.cart-item-image::before {
    content: '📦';
    font-size: 2rem;
    position: absolute;
}

.cart-item-image img+.cart-item-image::before {
    display: none;
}

.cart-item-details {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cart-item-brand {
    font-size: 0.75rem;
    color: #a0a8c1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.cart-item-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: white;
    line-height: 1.3;
}

.cart-item-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: #ffd700;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: auto;
}

.quantity-control {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    padding: 0.3rem;
}

.quantity-btn {
    background: rgba(255, 215, 0, 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ffd700;
    font-weight: 700;
    transition: all 0.2s ease;
}

.quantity-btn:hover {
    background: rgba(255, 215, 0, 0.2);
}

.quantity-value {
    min-width: 30px;
    text-align: center;
    color: white;
    font-weight: 600;
}

.cart-item-remove {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ef4444;
    transition: all 0.2s ease;
    margin-left: auto;
}

.cart-item-remove:hover {
    background: rgba(239, 68, 68, 0.2);
}

/* Coupon Section */
.cart-coupon {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
}

.coupon-input-group {
    display: flex;
    gap: 0.5rem;
}

.coupon-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    color: white;
    font-size: 0.95rem;
    font-weight: 500;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.coupon-input::placeholder {
    color: #6b7280;
    text-transform: none;
}

.coupon-input:focus {
    outline: none;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 215, 0, 0.4);
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.btn-apply-coupon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.8) 0%, rgba(168, 85, 247, 0.8) 100%);
    border: none;
    padding: 0.9rem 1.5rem;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-apply-coupon:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(139, 92, 246, 0.5);
}

.coupon-applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    animation: slideInDown 0.4s ease;
}

.coupon-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: #10b981;
}

.coupon-info svg {
    flex-shrink: 0;
}

.coupon-text {
    font-size: 0.85rem;
    font-weight: 600;
}

.btn-remove-coupon {
    background: rgba(239, 68, 68, 0.1);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #ef4444;
    transition: all 0.2s ease;
}

.btn-remove-coupon:hover {
    background: rgba(239, 68, 68, 0.2);
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.cart-discount {
    color: #10b981 !important;
}

/* Cart Summary */
.cart-summary {
    padding: 1.5rem;
    border-top: 1px solid rgba(255, 215, 0, 0.1);
    background: rgba(0, 0, 0, 0.2);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 0.8rem;
    color: #a0a8c1;
}

.cart-summary-label {
    font-size: 0.95rem;
}

.cart-summary-value {
    font-weight: 600;
    color: white;
}

.cart-summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 1rem;
    margin-top: 1rem;
    border-top: 1px solid rgba(255, 215, 0, 0.2);
}

.cart-summary-total .cart-summary-label {
    font-size: 1.1rem;
    font-weight: 700;
    color: white;
}

.cart-summary-total .cart-summary-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffd700;
}

.cart-shipping-note {
    font-size: 0.85rem;
    color: #10b981;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.3rem;
}

/* Shipping Progress */
.cart-shipping-progress {
    margin: 15px 0;
    padding: 10px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 8px;
    border: 1px dashed rgba(255, 255, 255, 0.1);
}

.progress-text {
    font-size: 0.9rem;
    text-align: center;
    margin-bottom: 8px;
    color: #a0a8c1;
}

.progress-text strong {
    color: #ffd700;
}

.progress-bar-bg {
    height: 8px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 4px;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background: #f39c12;
    transition: width 0.5s ease-out, background-color 0.3s ease;
}

/* Cart Actions */
.cart-actions {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.btn-cart-primary {
    background: linear-gradient(135deg, #ffd700 0%, #ffb800 100%);
    color: #0a0e27;
    border: none;
    padding: 1rem;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-cart-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-cart-secondary {
    background: transparent;
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 1rem;
    border-radius: 12px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cart-secondary:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 215, 0, 0.3);
}

/* Scrollbar Styling */
.cart-items::-webkit-scrollbar {
    width: 6px;
}

.cart-items::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.cart-items::-webkit-scrollbar-thumb {
    background: rgba(255, 215, 0, 0.3);
    border-radius: 10px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 215, 0, 0.5);
}

/* ========================================
   CART ICON BADGE ANIMATION
   ======================================== */

.cart-count {
    position: absolute;
    top: -8px;
    right: -8px;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 0.4rem;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
    animation: cartBadgePop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes cartBadgePop {
    0% {
        transform: scale(0);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
    .cart-modal {
        width: 100%;
        max-width: 100%;
    }

    .cart-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .cart-item-controls {
        width: 100%;
        justify-content: center;
    }

    .cart-item-remove {
        margin-left: 0;
    }
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideInRight {
    from {
        transform: translateX(100%);
    }

    to {
        transform: translateX(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* ========================================
   USER BUTTON STYLES
   ======================================== */

.user-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: white;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.3s ease;
    text-decoration: none;
}

.user-btn:hover {
    color: #ffd700;
}

.user-btn.logged-in {
    color: #ffd700;
}