/* =========================================================
   CTA Product Cards — フロントCSS
   プレフィックス: cta-pd-
   CSS変数: --cta-pd-amazon / --cta-pd-rakuten / --cta-pd-custom
   （インラインCSSで設定画面の色値に置換）
   ========================================================= */

/* --- 共通ラッパー --- */
.cta-pd-wrap {
    position: relative;
    max-width: 680px;
    margin: 2em auto;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,.06);
    font-size: 15px;
    line-height: 1.6;
    box-sizing: border-box;
}

.cta-pd-wrap *,
.cta-pd-wrap *::before,
.cta-pd-wrap *::after {
    box-sizing: border-box;
}

/* --- Simple モード --- */
.cta-pd-mode-simple .cta-pd-main {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.cta-pd-mode-simple .cta-pd-image {
    flex-shrink: 0;
    width: 120px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}

.cta-pd-mode-simple .cta-pd-image img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.cta-pd-mode-simple .cta-pd-info {
    flex: 1;
    min-width: 0;
}

.cta-pd-mode-simple .cta-pd-name {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #1a1a1a;
}

.cta-pd-mode-simple .cta-pd-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 12px;
    font-size: 13px;
    color: #6b7280;
}

.cta-pd-mode-simple .cta-pd-price {
    font-weight: 700;
    color: #dc2626;
    font-size: 15px;
}

/* --- Rich モード --- */
.cta-pd-mode-rich {
    text-align: center;
}

.cta-pd-mode-rich .cta-pd-name--rich {
    margin: 0 0 4px;
    font-size: 19px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1.4;
}

.cta-pd-mode-rich .cta-pd-maker {
    margin: 0 0 12px;
    font-size: 13px;
    color: #9ca3af;
}

.cta-pd-mode-rich .cta-pd-image--rich {
    max-width: 280px;
    margin: 0 auto 16px;
    border-radius: 8px;
    overflow: hidden;
    background: #f3f4f6;
}

.cta-pd-mode-rich .cta-pd-image--rich img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: contain;
}

.cta-pd-mode-rich .cta-pd-rating--rich {
    margin: 0 0 12px;
    font-size: 15px;
    color: #f59e0b;
    font-weight: 600;
}

.cta-pd-mode-rich .cta-pd-specs {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 16px;
}

.cta-pd-mode-rich .cta-pd-spec-tag {
    display: inline-block;
    padding: 4px 10px;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    font-size: 13px;
    color: #374151;
    background: #f9fafb;
}

.cta-pd-mode-rich .cta-pd-price--rich {
    margin: 0 0 16px;
    font-size: 22px;
    font-weight: 700;
    color: #dc2626;
}

/* --- 画像フォールバック --- */
.cta-pd-image--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 80px;
    background: repeating-linear-gradient(
        -45deg,
        #f3f4f6, #f3f4f6 8px,
        #e5e7eb 8px, #e5e7eb 16px
    );
}

/* --- ボタン共通 --- */
.cta-pd-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}

.cta-pd-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 calc(50% - 4px);
    min-width: 140px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    text-align: center;
    line-height: 1.3;
    transition: opacity .2s, transform .15s;
    cursor: pointer;
}

.cta-pd-btn:hover {
    opacity: .85;
    transform: translateY(-1px);
}

.cta-pd-btn-amazon {
    background: var(--cta-pd-amazon, #ff9900);
}

.cta-pd-btn-rakuten {
    background: var(--cta-pd-rakuten, #bf0000);
}

.cta-pd-btn-manufacturer {
    background: var(--cta-pd-manufacturer, #01b902);
    flex: 1 1 100%;
}

.cta-pd-btn-custom {
    background: var(--cta-pd-custom, #01b902);
    flex: 1 1 100%;
}

/* 注意書き */
.cta-pd-note {
    margin: 10px 0 0;
    font-size: 11px;
    color: #9ca3af;
    text-align: center;
}

/* Pending state */
.cta-pd-pending {
    padding: 16px;
    text-align: center;
    color: #9ca3af;
    font-size: 13px;
}

/* =========================================================
   v1.8.7 cta_search: 軽量検索カード（楽天CTA拡張のフェイルセーフ用）
   商品名 + Amazon/楽天ボタンのみ。画像・価格・レビューなし。
   ========================================================= */

.cta-pd-search {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid var(--cta-pd-border, #e5e7eb);
    border-radius: 12px;
    background: var(--cta-pd-bg, #ffffff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cta-pd-search-name {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--cta-pd-text, #111827);
    text-align: left;
}

.cta-pd-search-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.cta-pd-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 calc(50% - 4px);
    min-width: 140px;
    padding: 12px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    text-align: center;
    line-height: 1.3;
    transition: opacity .2s, transform .15s;
    cursor: pointer;
}

.cta-pd-search-btn:hover {
    opacity: .85;
    transform: translateY(-1px);
}

.cta-pd-search-btn-amazon {
    background: var(--cta-pd-amazon, #ff9900);
}

.cta-pd-search-btn-rakuten {
    background: var(--cta-pd-rakuten, #bf0000);
}

@media (max-width: 480px) {
    .cta-pd-search {
        padding: 16px;
    }
    .cta-pd-search-name {
        font-size: 15px;
    }
    .cta-pd-search-btn {
        flex: 1 1 100%;
        padding: 11px 14px;
        font-size: 13px;
    }
}

/* =========================================================
   v1.9.0 cta_hotel_search: ホテル検索カード（楽天トラベルCTA拡張のフェイルセーフ用）
   ホテル名/エリア名 + 楽天トラベル/じゃらん/JTB/一休 の4ボタン横並び
   ========================================================= */

.cta-pd-hotel-search {
    margin: 20px 0;
    padding: 20px;
    border: 1px solid var(--cta-pd-border, #e5e7eb);
    border-radius: 12px;
    background: var(--cta-pd-bg, #ffffff);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.cta-pd-hotel-search-name {
    margin: 0 0 14px;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--cta-pd-text, #111827);
    text-align: left;
}

.cta-pd-hotel-search-btns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.cta-pd-hotel-search-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: #fff !important;
    text-decoration: none !important;
    text-align: center;
    line-height: 1.3;
    transition: opacity .2s, transform .15s;
    cursor: pointer;
}

.cta-pd-hotel-search-btn:hover {
    opacity: .85;
    transform: translateY(-1px);
}

.cta-pd-hotel-search-btn-rakuten { background: var(--cta-pd-rakuten-travel, #BF0000); }
.cta-pd-hotel-search-btn-jalan   { background: var(--cta-pd-jalan, #FF6600); }
.cta-pd-hotel-search-btn-jtb     { background: var(--cta-pd-jtb, #CC0000); }
.cta-pd-hotel-search-btn-ikyu    { background: var(--cta-pd-ikyu, #C8A84E); }

@media (max-width: 480px) {
    .cta-pd-hotel-search {
        padding: 16px;
    }
    .cta-pd-hotel-search-name {
        font-size: 15px;
    }
    .cta-pd-hotel-search-btns {
        grid-template-columns: 1fr;
    }
    .cta-pd-hotel-search-btn {
        padding: 11px 14px;
        font-size: 13px;
    }
}

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

/* モバイル (< 480px) */
@media (max-width: 480px) {
    .cta-pd-wrap {
        padding: 14px;
        border-radius: 8px;
    }

    .cta-pd-mode-simple .cta-pd-main {
        flex-direction: column;
        gap: 12px;
    }

    .cta-pd-mode-simple .cta-pd-image {
        width: 100%;
        max-width: 200px;
        margin: 0 auto;
    }

    .cta-pd-mode-simple .cta-pd-name {
        font-size: 15px;
    }

    .cta-pd-btn {
        flex: 1 1 100%;
        font-size: 13px;
        padding: 10px 12px;
    }

    .cta-pd-mode-rich .cta-pd-name--rich {
        font-size: 16px;
    }

    .cta-pd-mode-rich .cta-pd-price--rich {
        font-size: 19px;
    }
}

/* PC (≥ 768px) */
@media (min-width: 768px) {
    .cta-pd-mode-simple .cta-pd-image {
        width: 140px;
    }

    .cta-pd-mode-rich .cta-pd-image--rich {
        max-width: 320px;
    }

    .cta-pd-btn {
        flex: 1 1 auto;
        min-width: 160px;
    }

    .cta-pd-btn-custom {
        flex: 0 1 auto;
    }
}
