/* Skeleton Loading Styles for Product Cards */

/* 骨架屏容器 */
.skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
    padding-bottom: 24px;
}

/* 骨架屏卡片 */
.skeleton-card {
    background: var(--bg-card);
    border: 1px solid var(--border-primary);
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    width: 100%;
}

/* 骨架屏元素基础样式 */
.skeleton {
    background: linear-gradient(
        90deg,
        var(--bg-card3) 0%,
        var(--bg-hover) 50%,
        var(--bg-card3) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* 骨架屏图片区域 */
.skeleton-card__image {
    width: 100%;
    height: 264px;
    background: linear-gradient(
        90deg,
        rgba(0, 0, 0, 0.05) 0%,
        rgba(0, 0, 0, 0.02) 50%,
        rgba(0, 0, 0, 0.05) 100%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
}

[data-theme="dark"] .skeleton-card__image {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.08) 0%,
        rgba(255, 255, 255, 0.03) 50%,
        rgba(255, 255, 255, 0.08) 100%
    );
    background-size: 200% 100%;
}

/* 骨架屏内容区域 */
.skeleton-card__content {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 骨架屏标题 */
.skeleton-card__title {
    height: 16px;
    width: 80%;
}

/* 骨架屏副标题 */
.skeleton-card__subtitle {
    height: 16px;
    width: 60%;
}

/* 骨架屏价格容器 */
.skeleton-card__price-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}

/* 骨架屏价格 */
.skeleton-card__price {
    height: 16px;
    width: 80px;
}

/* 骨架屏原价 */
.skeleton-card__original-price {
    height: 16px;
    width: 60px;
}

/* 骨架屏按钮组 */
.skeleton-card__actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
}

/* 骨架屏按钮 */
.skeleton-card__button {
    flex: 1;
    height: 40px;
    border-radius: 10px;
}

/* 隐藏骨架屏的辅助类 */
.skeleton-hidden {
    display: none !important;
}

/* 渐入动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.15s ease-out;
}

/* 响应式布局 */
@media (max-width: 768px) {
    .skeleton-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .skeleton-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .skeleton-card__image {
        height: 200px;
    }
}
