/**
 * Lazy Loading スタイル
 * Issue #40 ステップ6: 画像遅延読み込み用CSS
 */

/* 基本スタイル */
.lazy-loading {
    opacity: 0.7;
    transition: opacity 0.3s ease-in-out;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading-shimmer 1.5s infinite;
}

.lazy-loaded {
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
}

.lazy-error {
    opacity: 0.5;
    filter: grayscale(1);
    background-color: #f5f5f5;
    border: 1px dashed #ddd;
}

/* ローディングアニメーション */
@keyframes loading-shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* 商品画像用スタイル */
.product-image {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease-in-out, opacity 0.3s ease-in-out;
}

.product-image:hover {
    transform: scale(1.05);
}

.product-image.lazy-loading {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image.lazy-error {
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .product-image {
        max-width: 100%;
        margin: 0 auto;
    }
    
    .product-image.lazy-loading {
        min-height: 150px;
    }
    
    .product-image.lazy-error {
        min-height: 150px;
        font-size: 12px;
    }
}

/* ダークモード対応 */
@media (prefers-color-scheme: dark) {
    .lazy-loading {
        background: linear-gradient(90deg, #2a2a2a 25%, #3a3a3a 50%, #2a2a2a 75%);
    }
    
    .lazy-error {
        background-color: #2a2a2a;
        border-color: #444;
        color: #666;
    }
}

/* パフォーマンス最適化 */
.product-image {
    will-change: transform, opacity;
}

/* GPU加速有効化 */
.lazy-loading,
.lazy-loaded {
    transform: translateZ(0);
    backface-visibility: hidden;
}

/* プリント用スタイル */
@media print {
    .lazy-loading {
        animation: none;
        background: white;
        opacity: 1;
    }
    
    .lazy-error {
        filter: none;
        opacity: 1;
    }
}