body {
    font-family: sans-serif;
    background-color: #fff;
    margin: 0;
    padding: 20px;
}
.container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    background: transparent;
    padding: 10px 0;
    box-sizing: border-box;
}
.review-card {
    border-bottom: 1px solid #ccc;
    padding: 15px 0;
}
.rating {
    color: #ffa41c;
    font-size: 18px;
    margin-bottom: 5px;
}
.review-title {
    font-weight: bold;
    font-size: 14px;
    margin-bottom: 5px;
}
.review-comment {
    font-size: 12px;
    margin-bottom: 10px;
}
.review-footer {
    font-size: 12px;
    color: #555;
    text-align: right;
}
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.media-preview {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 12px;
    padding: 10px 0;
    white-space: nowrap;
    max-width: 100%;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.media-preview::-webkit-scrollbar {
    height: 8px;
}
.media-preview::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 4px;
}
.media-thumb {
    width: 200px;
    height: 150px;
    object-fit: contain;
    flex-shrink: 0;
    border-radius: 6px;
    background-color: #f9f9f9;
    scroll-snap-align: start;
}
.media-preview img,
.media-preview video {
    scroll-snap-align: start;
    width: 240px;
    height: 180px;
    object-fit: contain;
    /* cover → contain に変更 */
    border-radius: 6px;
    flex-shrink: 0;
    cursor: pointer;
    background-color: #f9f9f9;
    /* 背景が空のときのために白っぽい色を追加 */
}
.rating-summary {
    margin-bottom: 20px;
    border: 1px solid #ddd;
    padding: 16px;
    border-radius: 8px;
    background: #f9f9f9;
}
.rating-summary h4 {
    margin: 0 0 10px;
    font-size: 18px;
}
.rating-distribution {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.rating-label {
    width: 60px;
    font-size: 14px;
}
.rating-bar {
    flex-grow: 1;
    height: 12px;
    background: #e0e0e0;
    margin: 0 10px;
    border-radius: 6px;
    overflow: hidden;
}
.rating-bar-inner {
    height: 100%;
    background: #ffa41c;
    border-radius: 6px;
}
.rating-count {
    width: 30px;
    font-size: 13px;
    text-align: right;
    color: #555;
}
.review-toolbar {
    margin: 20px 0;
    display: flex;
    gap: 10px;
}
.review-toolbar input[type="text"] {
    flex: 1;
    padding: 6px;
    font-size: 14px;
}
.review-toolbar select {
    padding: 6px;
    font-size: 14px;
}
.review-summary-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 30px;
    padding: 20px 0;
    border-bottom: 1px solid #ddd;
}
.left-summary {
    width: 250px;
}
.left-summary h2 {
    font-size: 20px;
    margin-bottom: 8px;
}
.rating-score span {
    font-size: 20px;
    color: #ff9900;
    font-weight: bold;
}
/* 1. 評価件数を横並びに（折り返さない） */
.rating-count {
    font-size: 13px;
    margin-bottom: 12px;
    color: #555;
    white-space: nowrap;
    /* ←これが重要！ */
}
/* 2. 商品名を大きく・パターン名を非表示にする */
.product-details h3 {
    font-size: 18px;
    margin: 0;
    color: #0066c0;
    font-weight: bold;
}
.rating-distribution {
    display: flex;
    align-items: center;
    margin-bottom: 6px;
}
.rating-label {
    width: 35px;
    font-size: 13px;
}
.rating-bar {
    flex-grow: 1;
    height: 12px;
    background: #eee;
    margin: 0 8px;
    border-radius: 6px;
    overflow: hidden;
}
.rating-bar-inner {
    height: 100%;
    background: #ff9900;
    border-radius: 6px;
}
.rating-count-percent {
    width: 30px;
    font-size: 13px;
    text-align: right;
    color: #333;
}
.right-product-info {
    flex-grow: 1;
    display: flex;
    gap: 15px;
    align-items: flex-start;
    justify-content: flex-start;
}
.product-image {
    width: 60px;
    height: auto;
    object-fit: contain;
}
.product-details {
    flex-grow: 1;
}
.product-details h3 {
    font-size: 16px;
    margin: 0;
    color: #0066c0;
    font-weight: normal;
}
.product-details small {
    font-size: 13px;
    color: #555;
}
.review-button {
    display: inline-block;
    margin-top: 8px;
    padding: 6px 12px;
    background-color: #f0f2f2;
    border: 1px solid #ccc;
    font-size: 13px;
    cursor: pointer;
    border-radius: 4px;
}
.media-thumb {
    width: 240px;
    height: 160px;
    object-fit: cover;
    border-radius: 4px;
    margin: 5px;
    cursor: pointer;
}
/* Lightbox */
#lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    justify-content: center;
    align-items: center;
    z-index: 9999;
}
#lightbox-overlay img,
#lightbox-overlay video {
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 8px;
}
#lightbox-overlay span {
    position: absolute;
    top: 20px;
    right: 30px;
    font-size: 30px;
    color: white;
    cursor: pointer;
}

/* ========================================
   モバイル対応のレスポンシブスタイル
   ======================================== */

/* スマートフォン対応 (768px以下) */
@media screen and (max-width: 768px) {
    body {
        padding: 0 !important;
    }
    
    .container {
        width: 100% !important;
        max-width: 100% !important;
        padding: 10px !important;
        box-sizing: border-box !important;
        margin: 0 !important;
    }
    
    /* レビューサマリーラッパーをモバイルで縦並びに */
    .review-summary-wrapper {
        flex-direction: column;
        gap: 20px;
        padding: 15px 0;
    }
    
    .left-summary {
        width: 100%;
    }
    
    .left-summary h2 {
        font-size: 18px;
    }
    
    .rating-score span {
        font-size: 24px;
    }
    
    .rating-distribution {
        margin-bottom: 8px;
    }
    
    .rating-label {
        width: 40px;
        font-size: 12px;
    }
    
    .rating-bar {
        margin: 0 6px;
    }
    
    .rating-count-percent {
        width: 35px;
        font-size: 12px;
    }
    
    /* 商品情報セクション */
    .right-product-info {
        width: 100%;
        gap: 12px;
    }
    
    .product-details h3 {
        font-size: 16px;
        line-height: 1.4;
    }
    
    .review-button {
        width: 100%;
        padding: 10px 12px;
        font-size: 14px;
        box-sizing: border-box;
    }
    
    /* 検索ツールバー */
    .review-toolbar {
        flex-direction: column;
        gap: 10px;
        margin: 15px 0;
    }
    
    .review-toolbar input[type="text"] {
        width: 100%;
        padding: 10px;
        font-size: 16px; /* iOSのズーム防止 */
        box-sizing: border-box;
    }
    
    .review-toolbar select {
        width: 100%;
        padding: 10px;
        font-size: 16px;
        box-sizing: border-box;
    }
    
    .review-toolbar button {
        width: 100%;
        padding: 12px;
        font-size: 16px;
        background-color: #f0f2f2;
        border: 1px solid #ccc;
        border-radius: 4px;
        cursor: pointer;
    }
    
    /* レビューカード */
    .review-card {
        padding: 12px 0;
    }
    
    .rating {
        font-size: 16px;
    }
    
    .review-title {
        font-size: 14px;
        line-height: 1.4;
    }
    
    .review-comment {
        font-size: 13px;
        line-height: 1.6;
    }
    
    .review-footer {
        font-size: 11px;
        text-align: left;
        margin-top: 8px;
    }
    
    /* メディアプレビュー */
    .media-preview {
        gap: 8px;
        padding: 8px 0;
    }
    
    .media-preview img,
    .media-preview video {
        width: 120px;
        height: 90px;
    }
    
    .media-thumb {
        width: 120px;
        height: 90px;
        margin: 3px;
    }
    
    /* Lightbox */
    #lightbox-overlay {
        padding: 10px;
    }
    
    #lightbox-overlay img,
    #lightbox-overlay video {
        max-width: 95vw;
        max-height: 80vh;
    }
    
    #lightbox-overlay span {
        top: 10px;
        right: 15px;
        font-size: 28px;
    }
}

/* タブレット対応 (769px〜1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .container {
        width: 100%;
        max-width: 768px;
        padding: 15px;
        box-sizing: border-box;
    }
    
    .review-summary-wrapper {
        gap: 25px;
    }
    
    .left-summary {
        width: 220px;
    }
    
    .review-toolbar {
        flex-wrap: wrap;
    }
    
    .review-toolbar input[type="text"] {
        flex: 1;
        min-width: 200px;
    }
    
    .review-toolbar select {
        min-width: 150px;
    }
    
    .review-toolbar button {
        padding: 8px 16px;
    }
    
    .media-preview img,
    .media-preview video {
        width: 180px;
        height: 135px;
    }
    
    .media-thumb {
        width: 180px;
        height: 135px;
    }
}

/* 横向きスマートフォン対応 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .media-preview img,
    .media-preview video {
        width: 160px;
        height: 120px;
    }
    
    .media-thumb {
        width: 160px;
        height: 120px;
    }
    
    #lightbox-overlay img,
    #lightbox-overlay video {
        max-height: 90vh;
    }
}

/* タッチデバイス向けの調整 */
@media (hover: none) and (pointer: coarse) {
    .review-button:active {
        opacity: 0.8;
        background-color: #e0e2e2;
    }
    
    .review-toolbar button:active {
        opacity: 0.8;
        background-color: #e0e2e2;
    }
    
    .media-thumb {
        border: 1px solid #e0e0e0;
    }
}

/* 印刷時の調整 */
@media print {
    body {
        padding: 0;
    }
    
    .container {
        width: 100%;
    }
    
    .review-toolbar {
        display: none;
    }
    
    .review-button {
        display: none;
    }
    
    #lightbox-overlay {
        display: none !important;
    }
    
    .media-preview {
        overflow: visible;
    }
}