/**
 * 商品一覧ページ用CSS
 * フィルターUI、商品カード、買い時度表示、レスポンシブデザイン
 * トップページ・個別ページのデザインに統一（フラットデザイン）
 * 
 * <!-- 最終更新: 2025-01-18 22:00:00 -->
 */

/* フォント設定（トップページ・個別ページと統一） */
.products-list-header,
.products-filters,
.product-card {
    font-family: Meiryo, "メイリオ", sans-serif;
}

/* ========================================
   ヘッダー
   ======================================== */
.products-list-header {
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

.products-list-header h1 {
    font-size: 24px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0;
    padding: 8px 15px 8px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.products-list-header h1::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(135deg, #ff9900 0%, #ff8800 100%);
}

.products-list-header .desc {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.6;
    margin: 10px 0 0 0;
    padding: 0;
    background: none;
}

/* ========================================
   フィルター
   ======================================== */
.products-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    /* フラットデザイン: 角丸なし、シャドウなし */
    border-radius: 0;
    box-shadow: none;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 200px;
}

.filter-group label {
    font-weight: 600;
    color: #2c3e50;
    white-space: nowrap;
    min-width: 80px;
    font-size: 14px;
}

.filter-group select {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #e9ecef;
    /* フラットデザイン: 角丸なし */
    border-radius: 0;
    background: white;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    transition: border-color 0.3s ease;
    font-family: Meiryo, "メイリオ", sans-serif;
}

.filter-group select:focus {
    outline: none;
    border-color: #ff9900;
    /* フラットデザイン: シャドウなし */
    box-shadow: none;
}

.filter-group select:hover {
    border-color: #ff9900;
}

/* ========================================
   商品グリッド
   ======================================== */
.products-grid {
    display: grid;
    /* PC: 3列固定（トップページと統一） */
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    background: white;
    /* フラットデザイン: 角丸なし、シャドウなし */
    border-radius: 0;
    border: 1px solid #e9ecef;
    overflow: hidden;
    box-shadow: none;
    transition: border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    padding: 8px;
}

.product-card:hover {
    /* ホバー時: 外枠のみ橙色に変更 */
    border-color: #ff9900;
    transform: none;
    box-shadow: none;
}

/* ========================================
   商品画像
   ======================================== */
.product-image {
    width: 100% !important;
    height: 150px !important;
    overflow: hidden !important;
    background: #f8f9fa !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    margin-bottom: 8px;
}

.product-image a {
    width: 100% !important;
    height: 100% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.product-image img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important; /* トップページと統一: 画像全体が見える */
    /* フラットデザイン: ホバー時の変形なし */
    transition: none;
}

.product-card:hover .product-image img {
    transform: none;
}

.product-image .no-image {
    color: #999;
    font-size: 14px;
}

/* ========================================
   商品情報
   ======================================== */
.product-info {
    padding: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-title {
    font-size: 14px;
    font-weight: bold; /* トップページと統一: 太字 */
    margin: 0 0 4px 0;
    line-height: 1.4;
    color: #2c3e50;
    /* トップページの仕様: 2行固定 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8em;
    max-height: 2.8em;
}

.product-title a {
    color: #2c3e50;
    text-decoration: none;
    display: block;
}

.product-title a:hover {
    color: #2c3e50;
}

.product-meta {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 4px;
}

.product-brand {
    font-size: 12px;
    color: #7f8c8d;
    margin-bottom: 8px;
}

/* ========================================
   価格情報
   ======================================== */
.product-price-info,
.price-info {
    margin-bottom: 4px;
}

.current-price {
    font-size: 20px;
    font-weight: bold;
    /* トップページ・個別ページと統一: クリムゾンレッド */
    color: #DC143C;
    margin-bottom: 0;
}

.price-change {
    font-size: 12px;
    font-weight: normal;
}

/* トップページ・個別ページと統一: 値上がり/値下がり/変動なしの色 */
.price-change.price-increase {
    color: #e74c3c;
}

.price-change.price-decrease {
    color: #27ae60;
}

.price-change.price-neutral {
    color: #7f8c8d;
}

/* ========================================
   買い時度表示
   ======================================== */
.buy-timing-level,
.buy-recommendation {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
    padding: 0;
    background: none;
    /* フラットデザイン: 角丸なし */
    border-radius: 0;
}

.buy-timing-stars {
    font-size: 18px;
    font-weight: bold;
    /* トップページと統一: #2c3e50 */
    color: #2c3e50;
    line-height: 1;
}

.buy-timing-label {
    font-size: 14px;
    color: #7f8c8d;
    font-weight: normal;
}

/* ========================================
   商品アクション
   ======================================== */
.product-actions {
    display: flex;
    gap: 5px;
    margin-top: auto;
    padding-top: 0;
    border-top: none;
}

.product-actions .button {
    flex: 1;
    padding: 6px;
    /* トップページと統一: 角丸あり */
    border-radius: 4px;
    text-align: center;
    text-decoration: none;
    font-weight: bold; /* トップページと統一: 太字 */
    font-size: 12px;
    transition: all 0.3s ease;
    font-family: Meiryo, "メイリオ", sans-serif;
}

.product-actions .button.view-details {
    background: #f8f9fa;
    color: #2c3e50;
    border: 1px solid #e9ecef;
}

.product-actions .button.view-details:hover {
    background: #e9ecef;
    /* フラットデザイン: ホバー時の変形なし */
    transform: none;
}

.product-actions .button.buy-now {
    /* トップページと統一: オレンジグラデーション + シャドウ */
    background: linear-gradient(135deg, #ff9900 0%, #ff8800 100%);
    color: white;
    border: 1px solid #ff9900;
    box-shadow: 0 4px 12px rgba(255, 153, 0, 0.3);
}

.product-actions .button.buy-now:hover {
    /* トップページと統一: 濃いオレンジグラデーション + シャドウ拡大 */
    background: linear-gradient(135deg, #e68a00 0%, #d67a00 100%);
    box-shadow: 0 6px 16px rgba(255, 153, 0, 0.4);
    transform: translateY(-2px);
}

/* ========================================
   もっと見るボタン
   ======================================== */
#load-more-container {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
}

.load-more-btn {
    padding: 15px 40px;
    border: 1px solid #ff9900;
    /* フラットデザイン: 角丸なし */
    border-radius: 0;
    background: linear-gradient(135deg, #ff9900 0%, #ff8800 100%);
    color: white;
    font-weight: normal;
    font-size: 16px;
    cursor: pointer;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    font-family: Meiryo, "メイリオ", sans-serif;
}

.load-more-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #e68a00 0%, #d67a00 100%);
    border-color: #e68a00;
    /* フラットデザイン: ホバー時の変形なし */
    transform: none;
}

.load-more-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: linear-gradient(135deg, #ff9900 0%, #ff8800 100%);
}

/* ========================================
   ローディング・エラー
   ======================================== */
.loading-placeholder {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    /* トップページ・個別ページと統一: オレンジ系 */
    border-top: 4px solid #ff9900;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.no-products,
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.error-message {
    color: #dc3545;
}

/* ========================================
   エラーメッセージ・再読み込みボタン
   ======================================== */
.error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #dc3545;
}

.retry-button {
    padding: 10px 20px;
    border: 1px solid #ff9900;
    background: #ff9900;
    color: white;
    font-size: 14px;
    cursor: pointer;
    font-family: Meiryo, "メイリオ", sans-serif;
    border-radius: 0;
    transition: background-color 0.3s ease;
}

.retry-button:hover {
    background: #e68a00;
}

/* ========================================
   レスポンシブデザイン
   ======================================== */
@media (max-width: 768px) {
    .products-list-header h1 {
        font-size: 20px;
    }

    .products-filters {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
        min-width: auto;
    }

    .filter-group label {
        min-width: auto;
    }

    /* スマートフォン: 1列表示（トップページと統一） */
    .products-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .product-actions {
        flex-direction: column;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .products-list-header h1 {
        font-size: 18px;
    }
}

