/* ========================================
   基本
======================================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        "Noto Sans JP",
        sans-serif;
    color: #222;
    background: #f5f6f8;
    line-height: 1.7;
}

a {
    color: inherit;
}

img {
    max-width: 100%;
}


/* ========================================
   ヘッダー
======================================== */

.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
}

.header-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 18px 20px;
}

.site-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.site-title a {
    text-decoration: none;
}


/* ========================================
   メイン
======================================== */

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 35px 20px 60px;
}


/* ========================================
   ランキングヘッダー
======================================== */

.ranking-header {
    margin-bottom: 25px;
}

.ranking-header h1 {
    margin: 0 0 8px;
    font-size: 28px;
    line-height: 1.4;
}

.ranking-description {
    margin: 0 0 5px;
    color: #666;
}

.updated-at {
    margin: 0;
    color: #888;
    font-size: 14px;
}


/* ========================================
   ランキング一覧
======================================== */

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}


/* ========================================
   商品カード
======================================== */

.ranking-card {
    position: relative;
    display: grid;
    grid-template-columns: 80px 150px 1fr;
    gap: 22px;
    align-items: center;

    background: #ffffff;
    border: 1px solid #e4e6e8;
    border-radius: 10px;

    padding: 22px;
}


/* ========================================
   順位
======================================== */

.rank {
    text-align: center;
}

.rank-number {
    font-size: 18px;
    font-weight: 700;
    color: #555;
}

.rank-number strong {
    display: block;
    font-size: 32px;
    line-height: 1.1;
}


/* 1〜3位 */

.rank-1 {
    border-left: 6px solid #d4a017;
}

.rank-2 {
    border-left: 6px solid #a8adb3;
}

.rank-3 {
    border-left: 6px solid #a66a3f;
}

.rank-1 .rank-number {
    color: #b48700;
}

.rank-2 .rank-number {
    color: #777d84;
}

.rank-3 .rank-number {
    color: #966039;
}


/* ========================================
   商品画像
======================================== */

.product-image {
    display: flex;
    align-items: center;
    justify-content: center;

    height: 140px;
}

.product-image img {
    max-width: 140px;
    max-height: 140px;
    object-fit: contain;
}


/* ========================================
   商品情報
======================================== */

.product-info {
    min-width: 0;
}

.product-title {
    margin: 0 0 12px;
    font-size: 17px;
    line-height: 1.55;
    font-weight: 600;

    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
}

/* ========================================
   レビュー数
======================================== */

.review-area {
    display: flex;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 8px 16px;

    margin: 10px 0 8px;
}

.review-main {
    display: flex;
    align-items: baseline;
    gap: 5px;
}

.review-label {
    margin-right: 4px;

    color: #777;
    font-size: 13px;
    font-weight: 600;
}

.review-number {
    font-size: 29px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.review-unit {
    font-size: 14px;
    font-weight: 700;
}

.rating {
    margin-bottom: 2px;

    color: #666;
    font-size: 14px;
}

/* ========================================
   価格
======================================== */

.price {
    margin: 8px 0 12px;

    font-size: 18px;
    font-weight: 700;
}

/* ========================================
   Amazonボタン
======================================== */

.amazon-button {
    display: inline-block;

    padding: 9px 18px;

    background: #ff9900;
    color: #111;

    border-radius: 6px;

    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
}

.amazon-button:hover {
    opacity: 0.85;
}


/* ========================================
   トップページ
======================================== */

.page-title {
    margin-top: 0;
    margin-bottom: 8px;
}

.page-description {
    color: #666;
    margin-bottom: 30px;
}

.category-group {
    margin-bottom: 30px;
}

.category-group h2 {
    font-size: 20px;
    margin-bottom: 12px;
}

.category-list {
    display: grid;
    grid-template-columns:
        repeat(auto-fill, minmax(220px, 1fr));

    gap: 12px;

    padding: 0;
    margin: 0;

    list-style: none;
}

.category-list a {
    display: block;

    background: #ffffff;
    border: 1px solid #e3e5e8;
    border-radius: 8px;

    padding: 16px 18px;

    text-decoration: none;
    font-weight: 600;
}

.category-list a:hover {
    background: #fafafa;
    border-color: #bbb;
}


/* ========================================
   フッター
======================================== */

.site-footer {
    border-top: 1px solid #e0e0e0;
    background: #ffffff;

    color: #777;
    font-size: 13px;
}

.footer-inner {
    max-width: 1000px;
    margin: 0 auto;
    padding: 25px 20px;
}


/* ========================================
   スマートフォン
======================================== */

@media (max-width: 700px) {

    .container {
        padding: 25px 14px 45px;
    }

    .ranking-header h1 {
        font-size: 23px;
    }

    .ranking-card {
        grid-template-columns: 55px 100px 1fr;
        gap: 12px;

        padding: 16px 12px;
    }

    .rank-number {
        font-size: 14px;
    }

    .rank-number strong {
        font-size: 25px;
    }

    .product-image {
        height: 100px;
    }

    .product-image img {
        max-width: 95px;
        max-height: 95px;
    }

    .product-title {
        font-size: 14px;
    }

    .review-count {
        font-size: 16px;
    }

    .price {
        font-size: 18px;
    }

    .amazon-button {
        padding: 8px 13px;
        font-size: 13px;
    }
}


@media (max-width: 500px) {

    .ranking-card {
        grid-template-columns: 45px 85px 1fr;
        gap: 9px;
    }

    .product-image {
        height: 85px;
    }

    .product-image img {
        max-width: 80px;
        max-height: 80px;
    }

}

.rank-1 .review-number {
    font-size: 34px;
}

.rank-2 .review-number {
    font-size: 32px;
}

.rank-3 .review-number {
    font-size: 31px;
}

.ranking-card {
    min-height: 210px;
}
/* ========================================
   商品ランキング：施設ランキング型サイドバー
======================================== */
.product-ranking-container { max-width: 1200px; }
.product-category-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}
.product-category-main { min-width: 0; }
.product-category-sidebar {
    background: #fff;
    border: 1px solid #dfe3e9;
    border-radius: 12px;
    padding: 20px;
}
.product-sidebar-title {
    margin: 0 0 18px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e2e6ec;
    font-size: 16px;
    font-weight: 700;
}
.product-sidebar-section h3 {
    margin: 0 0 12px;
    color: #64748b;
    font-size: 13px;
    font-weight: 500;
}
.product-sidebar-group { margin: 2px 0; }
.product-sidebar-summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding: 10px 9px;
    font-size: 14px;
    font-weight: 600;
    list-style: none;
}
.product-sidebar-summary::-webkit-details-marker { display: none; }
.product-sidebar-summary:hover { background: #f5f7fa; border-radius: 6px; }
.product-sidebar-chevron {
    width: 8px;
    height: 8px;
    border-right: 2px solid #64748b;
    border-bottom: 2px solid #64748b;
    transform: rotate(-45deg);
    transition: transform .15s;
    margin-right: 4px;
}
.product-sidebar-group[open] > .product-sidebar-summary .product-sidebar-chevron {
    transform: rotate(45deg);
}
.product-sidebar-children {
    margin: 2px 0 10px 12px;
    padding-left: 10px;
    border-left: 1px solid #dfe5ed;
}
.product-sidebar-link {
    display: block;
    padding: 9px 10px;
    margin: 2px 0;
    border-radius: 6px;
    color: #52627b;
    text-decoration: none;
    font-size: 13px;
    line-height: 1.5;
}
.product-sidebar-link:hover { background: #f3f6fa; color: #2355c5; }
.product-sidebar-link.selected {
    background: #fff1d6;
    color: #815000;
    border-left: 3px solid #f59e0b;
    padding-left: 7px;
    font-weight: 700;
}
.product-sidebar-mobile { display: none; }
@media (max-width: 800px) {
    .product-category-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
    .product-category-sidebar { padding: 0; background: transparent; border: 0; }
    .product-sidebar-desktop { display: none; }
    .product-sidebar-mobile { display: block; }
    .product-sidebar-mobile > summary {
        cursor: pointer;
        background: #fff;
        border: 1px solid #dfe3e9;
        border-radius: 8px;
        padding: 12px 16px;
        font-weight: 600;
        color: #245bd7;
    }
    .product-sidebar-mobile-content {
        margin-top: 10px;
        padding: 18px;
        background: #fff;
        border: 1px solid #dfe3e9;
        border-radius: 10px;
    }
}

/* ランキング見出しはデスクトップで可能な限り1行に */
.product-category-main .ranking-header h1 { font-size: 25px; line-height: 1.35; }
@media (max-width: 700px) { .product-category-main .ranking-header h1 { font-size: 23px; } }

/* ========================================
   商品ランキング：施設ランキングに合わせた外枠
   カード内の順位・画像・情報の列幅は変更しない
======================================== */
.product-ranking-container {
    max-width: 1040px;
    padding-top: 24px;
}
.product-category-layout {
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 24px;
}
.site-header .header-inner {
    max-width: 1040px;
}
.site-description {
    margin: 3px 0 0;
    color: #666;
    font-size: 13px;
}
.product-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 20px;
    color: #777;
    font-size: 13px;
}
.product-breadcrumb a {
    color: #4267b2;
    text-decoration: none;
}
.product-breadcrumb a:hover { text-decoration: underline; }
@media (max-width: 800px) {
    .product-category-layout { grid-template-columns: minmax(0, 1fr); }
}

/* =========================================================
   施設ランキングとの外枠寸法統一（商品カード内部は変更しない）
   施設側: container 1100px/92%, sidebar 260px, gap 28px
   ========================================================= */
.site-header {
    background: #ffffff;
    border-bottom: 1px solid #e5e5e5;
}
.site-header .header-inner {
    width: min(1100px, 92%);
    max-width: none;
    margin: 0 auto;
    padding: 28px 0;
}
.site-header .site-title {
    margin: 0;
    font-size: 25px;
    line-height: 1.6;
}
.site-header .site-description {
    margin: 6px 0 0;
    color: #666;
    font-size: 14px;
    line-height: 1.6;
}
.container.product-ranking-container {
    width: min(1100px, 92%);
    max-width: none;
    margin: 0 auto;
    padding: 32px 0 70px;
}
.product-ranking-container .product-breadcrumb {
    display: block;
    margin: 0 0 22px;
    color: #64748b;
    font-size: 14px;
    line-height: 1.6;
}
.product-ranking-container .product-breadcrumb a { color: #2563eb; }
.product-ranking-container .product-category-layout {
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 28px;
}
@media (max-width: 850px) {
    .product-ranking-container .product-category-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 22px;
    }
}
@media (max-width: 600px) {
    .site-header .site-title { font-size: 20px; }
}

.review-number {
    color: #d97706;
}

.site-header {
    background: #c65d12;
    border-bottom: none;
}

.site-header .site-title,
.site-header .site-title a {
    color: #ffffff;
}

.site-header {
    background: #c65d12;
    border-bottom: none;
}

.site-header .header-inner p,
.site-header .header-inner .header-description {
    color: #fff0df !important;
}