/**
 * Product Skeleton Loading
 * Placeholder animation for product listing during AJAX loads
 */

/* Skeleton shimmer animation */
@keyframes skeleton-shimmer {
    0% {
        background-position: -468px 0;
    }
    100% {
        background-position: 468px 0;
    }
}

/* Product placeholder container */
.stm-product-skeleton {
    opacity: 0.7;
    pointer-events: none;
}

/* Skeleton loading elements */
.skeleton-box {
    background: #e0e0e0;
    background-image: linear-gradient(
        90deg,
        #e0e0e0 0px,
        #f0f0f0 40px,
        #e0e0e0 80px
    );
    background-size: 600px;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 4px;
}

/* Image placeholder */
.skeleton-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
}

.skeleton-image img {
    width: 70%;
    height: 70%;
    opacity: 0.3;
    object-fit: contain;
}

/* Title skeleton */
.skeleton-title {
    height: 24px;
    width: 70%;
    margin-bottom: 12px;
}

/* Category skeleton */
.skeleton-category {
    height: 16px;
    width: 50%;
    margin-bottom: 16px;
}

/* Spec row skeleton */
.skeleton-spec-row {
    height: 20px;
    margin-bottom: 8px;
}

.skeleton-spec-row:nth-child(odd) {
    width: 90%;
}

.skeleton-spec-row:nth-child(even) {
    width: 75%;
}

/* Button skeleton */
.skeleton-button {
    height: 40px;
    width: 100%;
    margin-top: 12px;
    margin-bottom: 8px;
}

/* Loading overlay - positioned over first placeholder */
.product-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 10;
    pointer-events: none;
}

/* Loading message */
.product-loading-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    font-size: 18px;
    color: #666;
    font-weight: 500;
}

/* Modern spinner */
.loading-spinner {
    display: inline-block;
    width: 48px;
    height: 48px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #bb2018;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* First skeleton item needs relative positioning for overlay */
.stm-product-skeleton:first-child {
    position: relative;
}
