/*
==============================================
## カスタマーレビューページのスタイル
==============================================
*/

/* ベースコンテナ */
.customer-reviews-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 150px 20px 40px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* ページタイトル */
.page-title {
    color: #333;
    font-size: 2.0rem;
    text-align: center;
    margin-bottom: 40px;
}

/* ==============================================
フィルターセクション
============================================== */
.reviews-filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    background-color: #f9f9f9;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-item label {
    color: #666;
    font-size: 0.9rem;
    font-weight: 600;
}

.filter-item select {
    min-width: 150px;
    padding: 8px 12px;
    font-size: 0.9rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.filter-button {
    background-color: #4285f4;
    color: white;
    padding: 10px 20px;
    margin-top: 20px;
    font-weight: 600;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.filter-button:hover {
    background-color: #3367d6;
}

/* ==============================================
フィルターチップ
============================================== */
.filter-chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 10px;
    font-size: 0.9rem;
    background: #F0F0F1;
    border-radius: 20px;
    cursor: pointer;
    user-select: none;
}

.chip input {
    display: none;
}

.chip input:checked + span,
.chip input:checked {
    color: #fff;
    font-weight: 600;
    background: #2563eb;
}

/* ==============================================
レビューセクション (最終レイアウト修正版)
============================================== */

/* 親がGridレイアウトの場合、この要素が幅全体を使うように指定 */
.ol-article__content .customer-reviews-container {
    grid-column: 1 / -1;
    width: 100%;
}

/* FlexboxからCSS Gridレイアウトに変更し、テーマの干渉を完全に回避 */
.reviews-grid {
    display: grid; /* ここを grid に変更 */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); /* これが魔法のコードです */
    gap: 30px;
    width: 100%;
}

/* レビューカード (flexプロパティは不要になります) */
.review-card {
    position: relative;
    /* flexプロパティは不要なので削除 */
    min-height: 250px;
    padding: 25px;
    background: linear-gradient(135deg, rgba(255,255,255,0.95), rgba(240,240,255,0.95));
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
}

.review-card::before {
    content: "";
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: -1;
    background: linear-gradient(135deg, rgba(200,210,255,0.1), rgba(220,230,255,0.2));
    border-radius: 12px;
}

.review-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

/* 星評価 */
.review-stars {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 5px;
}

.star {
    font-size: 1.5rem;
    color: #ccc;
}

.star.filled {
    color: #fbbc05;
}

/* レビューワーメタ情報 */
.reviewer-info {
    display: flex;
    align-items: center;
    margin-top: 5px;
}

.reviewer-details {
    display: flex;
    flex-direction: column;
}

.reviewer-name {
    color: #333;
    font-size: 0.95rem;
    font-weight: 600;
}

.review-date {
    color: #888;
    font-size: 0.85rem;
    margin-top: 2px;
}

/* ラベル */
.review-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 8px 0;
}

.review-label {
    padding: 4px 8px;
    font-size: 0.6rem;
    background: #f1f5f9;
    border-radius: 12px;
    white-space: nowrap;
}

/* レビュータイトル */
.review-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 5px 0 0;
    color: #333;
    line-height: 1.5;
}

/* レビュー本文ラッパー */
.review-content-wrapper {
    position: relative;
    margin-bottom: 5px;
}

.review-content-wrapper.expandable {
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.review-content-wrapper.expandable:hover {
    background-color: rgba(66, 133, 244, 0.05);
}

/* 本文 */
.review-content {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.review-content .more-text {
    display: none;
}

.review-card.review-expanded .review-content .more-text {
    display: inline;
}

/* 展開インジケーター */
.expand-indicator {
    display: none;
    font-size: 0.8rem;
    color: #2563eb;
    margin-top: 4px;
    font-weight: 500;
}

.review-content-wrapper.expandable .expand-indicator {
    display: block;
}

/* ==============================================
返信セクション
============================================== */
.review-reply {
    margin-top: 15px;
    padding: 15px;
    background: linear-gradient(135deg, rgba(240,248,255,0.8), rgba(230,245,255,0.9));
    border-left: 4px solid #4285f4;
    border-radius: 8px;
    overflow: hidden;
}

.reply-author {
    color: #4285f4;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.reply-author::before {
    content: "↳";
    font-size: 1rem;
}

/* 返信本文ラッパー */
.reply-content-wrapper {
    position: relative;
}

.reply-content-wrapper.expandable {
    cursor: pointer;
    padding: 8px;
    margin: -8px;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.reply-content-wrapper.expandable:hover {
    background-color: rgba(66, 133, 244, 0.1);
}

/* 返信本文 */
.reply-content {
    color: #555;
    font-size: 0.9rem;
    line-height: 1.6;
    margin: 0;
}

.reply-content .more-text {
    display: none;
}

.review-card.reply-expanded .reply-content .more-text {
    display: inline;
}

/* 返信展開インジケーター */
.reply-expand-indicator {
    display: none;
    font-size: 0.8rem;
    color: #2563eb;
    margin-top: 4px;
    font-weight: 500;
}

.reply-content-wrapper.expandable .reply-expand-indicator {
    display: block;
}

/* ==============================================
レスポンシブ対応
============================================== */
@media (max-width: 768px) {
    .customer-reviews-container {
        padding: 100px 20px 40px;
    }

    .reviews-filter-section {
        flex-direction: column;
    }

    .filter-controls {
        width: 100%;
        flex-direction: column;
    }

    .filter-button {
        width: 100%;
        margin-top: 20px;
    }

    .reviews-grid {
        gap: 20px;
    }

    .review-card {
        flex: 1 1 100%;
        min-width: 250px;
    }
}

@media (max-width: 480px) {
    .review-card {
        padding: 20px;
    }

    .review-reply {
        padding: 12px;
    }
}

/* ================================================================
   テーマ「OLTANA-002」の強力なレイアウトを上書きするための最終手段
================================================================ */

/* テーマのコンテナが持つレイアウト指定をリセット */
.ol-article__content .customer-reviews-container {
    display: block !important;
    width: 80% !important;
    max-width: none !important;
    margin: 0 auto !important;  /* 中央寄せ */
    padding: 150px 0 40px !important;  /* 左右のパディングは0 */
    box-sizing: border-box !important;  /* ボックスサイズの計算方法を明確に */
}

/* レビューグリッドを3列のグリッドレイアウトに変更 + フルワイド化 */
.ol-article__content .reviews-grid {
    display: grid !important;  /* flexからgridに変更 */
    grid-template-columns: repeat(3, 1fr) !important;  /* 3列均等幅 */
    gap: 30px !important;
    
    /* フルワイド化の設定 */
    width: 100vw !important;
    position: relative !important;
    left: 50% !important;
    right: 50% !important;
    margin-left: -50vw !important;
    margin-right: -50vw !important;
    padding: 0 40px !important;  /* 左右に適度な余白 */
}

/* レビューカードの幅指定を削除（グリッドに任せる） */
.ol-article__content .review-card {
    /* flexプロパティを削除 */
    width: 100% !important;  /* グリッドセル内で100%幅 */
    max-width: none !important;
}

/* レスポンシブ対応 */
@media (max-width: 1200px) {
    .ol-article__content .reviews-grid {
        grid-template-columns: repeat(2, 1fr) !important;  /* タブレット: 2列 */
        padding: 0 30px !important;
    }
}

@media (max-width: 768px) {
    .ol-article__content .customer-reviews-container {
        padding: 100px 20px 40px !important;
    }
    
    .ol-article__content .reviews-grid {
        grid-template-columns: 1fr !important;  /* モバイル: 1列 */
        width: 100% !important;  /* モバイルでは通常幅に戻す */
        position: static !important;
        left: auto !important;
        right: auto !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding: 0 !important;
    }
}