/* =============================================
   商品比較テーブル - フロントエンドCSS
   ============================================= */

.ptb-wrapper {
    max-width: 960px;
    margin: 2em auto;
    font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
}

.ptb-wrapper * {
    box-sizing: border-box;
}

/* テーブルレイアウト */
.ptb-table {
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 0;
}

.ptb-cols-2 .ptb-table { max-width: 640px; margin: 0 auto; }
.ptb-cols-4 .ptb-table { max-width: 1200px; }

/* モバイル横スクロール */
.ptb-mobile-scroll .ptb-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    padding-bottom: 8px;
}

.ptb-mobile-scroll .ptb-card {
    scroll-snap-align: start;
    flex-shrink: 0;
}

/* カード共通 */
.ptb-card {
    flex: 1;
    min-width: 180px;
    max-width: 320px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: visible;
    position: relative;
    z-index: 1;
    transition: box-shadow 0.2s;
}

.ptb-card:not(:last-child) {
    border-right: none;
    border-radius: 8px 0 0 8px;
}

.ptb-card:not(:first-child):not(:last-child) {
    border-radius: 0;
}

.ptb-card:last-child {
    border-radius: 0 8px 8px 0;
}

.ptb-card:only-child {
    border-radius: 8px;
    border-right: 1px solid #e0e0e0;
}

/* おすすめカード */
.ptb-card.ptb-recommended {
    z-index: 2;
    border: 2px solid #1a56db;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(26, 86, 219, 0.15);
    transform: scaleY(1.02);
    transform-origin: bottom;
}

/* 王冠 */
.ptb-crown {
    text-align: center;
    padding: 0;
    margin-top: -28px;
    margin-bottom: 0;
    color: #1a56db;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
}

.ptb-crown svg {
    display: block;
    margin: 0 auto 2px;
}

.ptb-crown span {
    font-size: 12px;
    letter-spacing: 0.5px;
}

/* ヘッダー */
.ptb-card-header {
    padding: 16px 12px 12px;
    text-align: center;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.ptb-card-header.ptb-header-rec {
    background: #1a56db;
    color: #fff;
    border-bottom-color: #1a56db;
}

.ptb-product-name {
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}

.ptb-product-subtitle {
    font-size: 12px;
    margin-top: 4px;
    opacity: 0.8;
}

/* 価格 */
.ptb-price {
    text-align: center;
    padding: 20px 12px;
    border-bottom: 1px solid #f0f0f0;
}

.ptb-price.ptb-price-rec {
    background: #eef2ff;
}

.ptb-price-amount {
    font-size: 32px;
    font-weight: 800;
    color: #222;
    letter-spacing: -0.5px;
}

.ptb-price-rec .ptb-price-amount {
    font-size: 36px;
    color: #1a56db;
}

.ptb-price-unit {
    font-size: 14px;
    color: #666;
    margin-left: 2px;
}

.ptb-price-rec .ptb-price-unit {
    color: #444;
}

/* 特徴行 */
.ptb-feature {
    text-align: center;
    padding: 14px 12px;
    border-bottom: 1px solid #f0f0f0;
    min-height: 52px;
}

.ptb-feature:last-of-type {
    border-bottom: none;
}

.ptb-feature-label {
    font-size: 15px;
    font-weight: 700;
    color: #333;
}

.ptb-feature-sublabel {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
}

/* ボタンエリア */
.ptb-buttons {
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ptb-btn {
    display: block;
    text-align: center;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    color: #fff;
    transition: opacity 0.2s, transform 0.1s;
    line-height: 1.3;
}

.ptb-btn:hover {
    opacity: 0.88;
    transform: translateY(-1px);
    color: #fff;
    text-decoration: none;
}

.ptb-btn:active {
    transform: translateY(0);
}

/* ボタンカラー */
.ptb-btn-black  { background: #333; }
.ptb-btn-blue   { background: #1a56db; }
.ptb-btn-orange { background: #e88a1a; }
.ptb-btn-red    { background: #bf2c2c; }
.ptb-btn-purple { background: #5b5ea6; }
.ptb-btn-green  { background: #28a745; }

/* =============================================
   レスポンシブ
   ============================================= */

@media (max-width: 768px) {
    .ptb-table {
        flex-direction: column;
        align-items: center;
    }

    .ptb-mobile-scroll .ptb-table {
        flex-direction: row;
        align-items: flex-end;
    }

    .ptb-card {
        max-width: 100%;
        width: 100%;
        border-radius: 8px !important;
        border-right: 1px solid #e0e0e0 !important;
        margin-bottom: 16px;
    }

    .ptb-card.ptb-recommended {
        border: 2px solid #1a56db !important;
        transform: none;
        order: -1;
    }

    .ptb-mobile-scroll .ptb-card {
        min-width: 260px;
        max-width: 280px;
        width: auto;
        margin-bottom: 0;
    }

    .ptb-mobile-scroll .ptb-card.ptb-recommended {
        order: unset;
    }

    .ptb-price-amount {
        font-size: 28px;
    }

    .ptb-price-rec .ptb-price-amount {
        font-size: 32px;
    }
}

@media (max-width: 480px) {
    .ptb-mobile-scroll .ptb-card {
        min-width: 230px;
    }
}
