/* =================================================
   css/product-single.css
   商品（post）個別ページ専用スタイル
   ================================================= */

.product-single {
    padding: 40px 0;
    background: var(--color-white, #fff);
}

.product-single-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.product-single-container {
    display: flex;
    flex-direction: column;
    gap: 60px;
}


/* =========================================
   メインエリア
   ========================================= */
.product-main {
    display: grid;
    grid-template-columns: 480px 1fr;
    gap: 48px;
    align-items: start;
}


/* =========================================
   ギャラリー
   ========================================= */
.product-image-col {
    position: sticky;
    top: 90px;
}

.product-gallery-main {
    position: relative;
    background: #f8f8f8;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 1;
}

.gallery-main-inner {
    width: 100%;
    height: 100%;
}

.gallery-slide {
    display: none;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
}

.gallery-slide.active {
    display: flex;
}

.gallery-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 24px;
}

.product-no-image {
    color: #ccc;
    font-size: 14px;
}

/* ◀▶ ナビ */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 50%;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, box-shadow 0.2s;
}

.gallery-nav:hover {
    background: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gallery-prev { left: 10px; }
.gallery-next { right: 10px; }

/* サムネイル列 */
.product-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

.gallery-thumb {
    width: 72px;
    height: 72px;
    border: 2px solid #eee;
    border-radius: 4px;
    overflow: hidden;
    background: #f8f8f8;
    cursor: pointer;
    padding: 0;
    transition: border-color 0.2s;
}

.gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.gallery-thumb.active,
.gallery-thumb:hover {
    border-color: var(--color-main, #219cd8);
}


/* =========================================
   右カラム：商品情報
   ========================================= */
.product-info-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding-top: 4px;
}

.product-title {
    font-size: 22px;
    font-weight: 700;
    color: #222;
    line-height: 1.5;
}

.product-sku {
    font-size: 12px;
    color: #aaa;
}

/* 価格・在庫・カートを右寄せにまとめるブロック */
.product-purchase-block {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
    padding: 20px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #eee;
}

.product-price-block {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.product-price {
    font-size: 32px;
    font-weight: 700;
    color: var(--color-main, #219cd8);
}

.product-price-tax {
    font-size: 13px;
    color: #888;
}

.product-stock {
    font-size: 13px;
    font-weight: 600;
    padding: 5px 14px;
    border-radius: 4px;
}

/* 在庫 + 数量を横並び */
.product-stock-quantity-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    width: 100%;
}

.product-stock.in-stock {
    background: #e8f5e9;
    color: #2e7d32;
}

.product-stock.out-of-stock {
    background: #ffebee;
    color: #c62828;
}

/* カートフォーム */
.product-cart-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-quantity-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
}

.quantity-label {
    font-size: 14px;
    color: #555;
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.qty-btn {
    width: 36px;
    height: 36px;
    background: #f0f0f0;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #555;
    transition: background 0.2s;
}

.qty-btn:hover { background: #e0e0e0; }

.qty-input {
    width: 52px;
    height: 36px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 15px;
    font-family: 'Shippori Mincho', serif;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.qty-input:focus { outline: none; }

.product-add-to-cart-btn {
    width: 100%;
    padding: 14px 20px;
    background: var(--color-main, #219cd8);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 700;
    font-family: 'Shippori Mincho', serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: background 0.2s, transform 0.1s, box-shadow 0.2s;
}

.product-add-to-cart-btn:hover {
    background: #1a7fa8;
    box-shadow: 0 4px 16px rgba(33, 156, 216, 0.35);
    transform: translateY(-2px);
}

.product-add-to-cart-btn:active { transform: translateY(0); }

.product-add-to-cart-btn.btn-disabled {
    background: #e0e0e0;
    color: #999;
    cursor: not-allowed;
}

.product-add-to-cart-btn.btn-disabled:hover {
    background: #e0e0e0;
    box-shadow: none;
    transform: none;
}


/* =========================================
   カートボタン下：説明・対応機種
   PC版は右カラム内、SP版はメインエリア下
   ========================================= */
.product-below-cart {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* PC版（右カラム内） */
.product-below-cart--pc { display: flex; }
/* SP版（メインエリア下） */
.product-below-cart--sp { display: none; }


/* =========================================
   セクション共通タイトル
   ========================================= */
.product-section-title {
    font-size: 20px;
    font-weight: 700;
    color: #222;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-main, #219cd8);
}

.product-section-title-sm {
    font-size: 15px;
    font-weight: 700;
    color: #222;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid #eee;
}

.product-description {
    background: #f8f8f8;
    padding: 20px;
    border-radius: 8px;
    line-height: 1.8;
    color: #555;
    font-size: 14px;
}

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


/* =========================================
   同シリーズの他商品
   ========================================= */
.product-related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

.related-card {
    text-decoration: none;
    color: inherit;
}


/* =========================================
   取り付け動画
   ========================================= */
.product-video-section {}

.product-video-wrap {
    background: #000;
    border-radius: 8px;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-video-wrap video {
    width: 100%;
    height: 100%;
    object-fit: contain;
}


/* =========================================
   FAQ
   ========================================= */
.product-faq-section .faq-container {
    background: var(--color-white, #fff);
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 28px;
}


/* =========================================
   レスポンシブ：タブレット（〜1023px）
   ========================================= */
@media (max-width: 1023px) {
    .product-main {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .product-image-col {
        position: static;
        max-width: 480px;
        margin: 0 auto;
        width: 100%;
    }

    /* PC版を非表示にしてSP版を表示 */
    .product-below-cart--pc { display: none; }
    .product-below-cart--sp { display: flex; }

    .product-related-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
}


/* =========================================
   レスポンシブ：スマホ（〜767px）
   ========================================= */
@media (max-width: 767px) {
    .product-single-container { gap: 40px; }
    .product-title { font-size: 18px; }
    .product-price { font-size: 26px; }
    .gallery-thumb { width: 56px; height: 56px; }

    .product-purchase-block { padding: 16px; }

    .product-add-to-cart-btn {
        padding: 12px 16px;
        font-size: 15px;
    }

    .product-description { padding: 14px; }

    .product-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
}