/* ===================================================
   product.css - 製品ページ専用スタイル
   =================================================== */

/* ---------------------------------------------------
   カテゴリーバッジ
   --------------------------------------------------- */
.product-category-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-primary);
    background-color: rgba(53, 178, 28, 0.1);
    border: 1px solid rgba(53, 178, 28, 0.3);
    border-radius: 3px;
    text-decoration: none;
    transition: background-color 0.15s, color 0.15s;
}

a.product-category-badge:hover {
    background-color: var(--color-primary);
    color: var(--color-white);
}

/* ---------------------------------------------------
   カテゴリーフィルター
   --------------------------------------------------- */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 32px;
}

.category-filter__btn {
    display: inline-block;
    padding: 6px 18px;
    font-size: 1.3rem;
    font-weight: 500;
    color: var(--color-text);
    background-color: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.category-filter__btn:hover,
.category-filter__btn.is-active {
    color: var(--color-white);
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

/* ---------------------------------------------------
   製品グリッド（アーカイブ）
   --------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 28px;
}

/* ---------------------------------------------------
   製品カード
   --------------------------------------------------- */
.product-card {
    background-color: var(--color-white);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--color-border);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.product-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: var(--color-text);
}

.product-card__image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    flex-shrink: 0;
    background-color: var(--color-bg-sub);
}

.product-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.product-card:hover .product-card__image img {
    transform: scale(1.04);
}

.product-card__no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card__no-image span {
    font-size: 1.3rem;
    color: var(--color-text-muted);
}

.product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 16px 18px 20px;
    gap: 6px;
}

.product-card__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.product-card__title {
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.5;
    color: var(--color-text);
    transition: color 0.15s;
}

.product-card:hover .product-card__title {
    color: var(--color-primary);
}

.product-card__subtitle {
    font-size: 1.3rem;
    color: var(--color-text-muted);
    margin: 0;
}

.product-card__desc {
    font-size: 1.3rem;
    color: var(--color-text-light);
    line-height: 1.65;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ---------------------------------------------------
   製品詳細：メインエリア 2カラム
   --------------------------------------------------- */
.product-main {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    margin-bottom: 56px;
    align-items: start;
}

/* ---------------------------------------------------
   画像ギャラリー
   --------------------------------------------------- */
.product-gallery__main {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    background-color: var(--color-bg-sub);
    margin-bottom: 12px;
}

.product-gallery__main img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    transition: opacity 0.2s;
}

.product-gallery__main--empty {
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-gallery__main--empty span {
    font-size: 1.4rem;
    color: var(--color-text-muted);
}

.product-gallery__thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-gallery__thumb-btn {
    width: 72px;
    height: 72px;
    overflow: hidden;
    border-radius: var(--radius);
    border: 2px solid transparent;
    padding: 0;
    background: none;
    cursor: pointer;
    transition: border-color 0.15s, opacity 0.15s;
    opacity: 0.7;
}

.product-gallery__thumb-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-gallery__thumb-btn:hover,
.product-gallery__thumb-btn.is-active {
    border-color: var(--color-primary);
    opacity: 1;
}

/* ---------------------------------------------------
   製品情報（右カラム）
   --------------------------------------------------- */
.product-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-info__cats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.product-info__title {
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--color-text);
    margin: 0;
    line-height: 1.4;
}

.product-info__subtitle {
    font-size: 1.6rem;
    color: var(--color-text-muted);
    margin: 0;
}

.product-info__desc {
    font-size: 1.5rem;
    color: var(--color-text-light);
    line-height: 1.85;
    margin: 4px 0 0;
}

/* ---------------------------------------------------
   ダウンロードボタン（サイドバー）
   --------------------------------------------------- */
.download-buttons--side {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

/* ---------------------------------------------------
   製品エディタ本文
   --------------------------------------------------- */
.product-editor-content {
    margin-bottom: 48px;
    padding-bottom: 48px;
    border-bottom: 1px solid var(--color-border);
}

/* ---------------------------------------------------
   特徴セクション
   --------------------------------------------------- */
.product-features__catch {
    text-align: center;
    font-size: 2.0rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.product-features__list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin: 0;
}

.product-features__item {
    background-color: var(--color-bg-sub);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--color-primary);
    padding: 20px 22px;
}

.product-features__heading {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 8px;
}

.product-features__desc {
    font-size: 1.4rem;
    color: var(--color-text-light);
    line-height: 1.8;
    margin: 0;
}

/* ---------------------------------------------------
   スペック表
   --------------------------------------------------- */
.product-specs__block {
    margin-bottom: 32px;
}

.product-specs__block:last-child {
    margin-bottom: 0;
}

.product-specs__name {
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 12px;
    padding-left: 12px;
    border-left: 4px solid var(--color-primary);
}

.product-specs__table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1.5rem;
}

.product-specs__table th,
.product-specs__table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: left;
    vertical-align: top;
}

.product-specs__table th {
    width: 200px;
    font-weight: 700;
    background-color: var(--color-bg-sub);
    color: var(--color-text);
    white-space: nowrap;
}

.product-specs__table tr:first-child th,
.product-specs__table tr:first-child td {
    border-top: 2px solid var(--color-primary);
}

/* ---------------------------------------------------
   ダウンロードセクション（全幅）
   --------------------------------------------------- */
.download-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-white);
    background-color: var(--color-primary);
    border-radius: var(--radius);
    text-decoration: none;
    transition: background-color 0.2s, transform 0.15s;
    flex-shrink: 0;
}

.download-btn:hover {
    background-color: var(--color-primary-dark);
    transform: translateY(-1px);
}

.download-btn__icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.download-btn--large {
    padding: 16px 28px;
    font-size: 1.6rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 200px;
}

.download-btn--large .download-btn__icon {
    width: 22px;
    height: 22px;
    align-self: flex-start;
}

.download-btn__sub {
    font-size: 1.2rem;
    font-weight: 400;
    opacity: 0.85;
}

/* ---------------------------------------------------
   一覧へ戻るボタン
   --------------------------------------------------- */
.single-back {
    text-align: center;
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--color-border);
}

.btn {
    display: inline-block;
    padding: 12px 32px;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
    border-radius: var(--radius);
    transition: background-color 0.2s, color 0.2s;
}

.btn--outline {
    color: var(--color-primary);
    background-color: var(--color-white);
    border: 2px solid var(--color-primary);
}

.btn--outline:hover {
    color: var(--color-white);
    background-color: var(--color-primary);
}

.no-posts {
    text-align: center;
    color: var(--color-text-muted);
    font-size: 1.5rem;
    padding: 48px 0;
}

/* ---------------------------------------------------
   レスポンシブ
   --------------------------------------------------- */
@media (max-width: 1100px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 24px;
    }
}

@media (max-width: 900px) {
    .product-main {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .product-gallery__main {
        max-width: 520px;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .product-info__title {
        font-size: 2.0rem;
    }

    .product-features__list {
        grid-template-columns: 1fr;
    }

    .product-specs__table th {
        width: 130px;
        padding: 10px 12px;
    }

    .product-specs__table td {
        padding: 10px 12px;
    }

    .download-buttons {
        flex-direction: column;
    }

    .download-btn--large {
        min-width: unset;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }

    /* スペック表を縦積み */
    .product-specs__table,
    .product-specs__table tbody,
    .product-specs__table tr,
    .product-specs__table th,
    .product-specs__table td {
        display: block;
        width: 100%;
    }

    .product-specs__table th {
        border-bottom: none;
        padding-bottom: 4px;
        font-size: 1.2rem;
        color: var(--color-text-muted);
        background: none;
    }

    .product-specs__table td {
        padding-top: 4px;
        padding-bottom: 14px;
    }
}
