/* ============================================
   SKELETON LOADING ANIMATIONS
   ============================================ */

/* Base skeleton animation */
@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

/* Skeleton card wrapper */
.skeleton-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    border: 1px solid rgba(0,0,0,0.04);
}

/* Skeleton item layout - flex for alignment */
.skeleton-item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    position: relative;
}

/* Image skeleton */
.skeleton-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        #e8e8e8 25%,
        #d5d5d5 50%,
        #e8e8e8 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* Content skeletons */
.skeleton-content {
    flex: 1;
    min-width: 0;
}

.skeleton-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        #e8e8e8 25%,
        #d5d5d5 50%,
        #e8e8e8 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-subtitle {
    height: 16px;
    width: 40%;
    margin-bottom: 10px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-price-row {
    display: flex;
    gap: 20px;
    margin-top: 8px;
}

.skeleton-price {
    height: 20px;
    width: 80px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        #e8e8e8 25%,
        #d5d5d5 50%,
        #e8e8e8 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-quantity {
    height: 38px;
    width: 120px;
    border-radius: 20px;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

.skeleton-remove {
    height: 36px;
    width: 36px;
    border-radius: 50%;
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e0e0e0 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    flex-shrink: 0;
}

/* ============================================
   SKELETON WITH SHIMMER EFFECT (Premium)
   ============================================ */

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton-shimmer {
    background: linear-gradient(
        90deg,
        #f6f7f8 0%,
        #edeef1 20%,
        #f6f7f8 40%,
        #f6f7f8 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
    border-radius: 4px;
}

/* Shimmer variants */
.skeleton-shimmer-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    border-radius: 8px;
    background: linear-gradient(
        90deg,
        #f6f7f8 0%,
        #edeef1 20%,
        #f6f7f8 40%,
        #f6f7f8 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

.skeleton-shimmer-title {
    height: 24px;
    width: 60%;
    margin-bottom: 12px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        #f6f7f8 0%,
        #edeef1 20%,
        #f6f7f8 40%,
        #f6f7f8 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

.skeleton-shimmer-price {
    height: 20px;
    width: 80px;
    border-radius: 4px;
    background: linear-gradient(
        90deg,
        #f6f7f8 0%,
        #edeef1 20%,
        #f6f7f8 40%,
        #f6f7f8 100%
    );
    background-size: 200% 100%;
    animation: shimmer 2s ease-in-out infinite;
}

/* ============================================
   SKELETON WITH BORDER ANIMATION (Modern)
   ============================================ */

@keyframes border-pulse {
    0% {
        border-color: rgba(0,0,0,0.06);
    }
    50% {
        border-color: rgba(0,0,0,0.12);
    }
    100% {
        border-color: rgba(0,0,0,0.06);
    }
}

.skeleton-border-pulse {
    border: 1px solid rgba(0,0,0,0.06);
    animation: border-pulse 2s ease-in-out infinite;
}

.skeleton-border-pulse .skeleton-image,
.skeleton-border-pulse .skeleton-title,
.skeleton-border-pulse .skeleton-price {
    background: linear-gradient(
        90deg,
        #f0f0f0 25%,
        #e8e8e8 50%,
        #f0f0f0 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

/* ============================================
   RESPONSIVE SKELETON
   ============================================ */

@media (max-width: 768px) {
    .skeleton-item {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }
    
    .skeleton-image,
    .skeleton-shimmer-image {
        width: 80px;
        height: 80px;
    }
    
    .skeleton-title,
    .skeleton-shimmer-title {
        width: 80%;
        margin: 0 auto 10px;
    }
    
    .skeleton-subtitle {
        width: 60%;
        margin: 0 auto 10px;
    }
    
    .skeleton-price-row {
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .skeleton-quantity {
        width: 100px;
        margin: 0 auto;
    }
    
    .skeleton-remove {
        margin: 0 auto;
    }
}

/* ============================================
   SMOOTH ENTRANCE ANIMATION
   ============================================ */

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

.skeleton-card {
    animation: fadeSlideUp 0.4s ease-out forwards;
}

.skeleton-card:nth-child(1) { animation-delay: 0.05s; }
.skeleton-card:nth-child(2) { animation-delay: 0.1s; }
.skeleton-card:nth-child(3) { animation-delay: 0.15s; }
.skeleton-card:nth-child(4) { animation-delay: 0.2s; }
.skeleton-card:nth-child(5) { animation-delay: 0.25s; }
.skeleton-card:nth-child(6) { animation-delay: 0.3s; }

/* ============================================
   LOADING OVERLAY (Optional)
   ============================================ */

.loading-overlay {
    position: relative;
}

.loading-overlay::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255,255,255,0.4);
    backdrop-filter: blur(2px);
    border-radius: 8px;
    animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================
   STATUS INDICATOR (Small dot animation)
   ============================================ */

@keyframes dot-pulse {
    0%, 100% {
        transform: scale(1);
        opacity: 1;
    }
    50% {
        transform: scale(0.8);
        opacity: 0.5;
    }
}

.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #007bff;
    margin-right: 8px;
    animation: dot-pulse 1.5s ease-in-out infinite;
}