/* ============================================================
   Amazon Keyword Products - style.css
   ============================================================ */


/* ------------------------------------------------------------
   商品カード全体
   ------------------------------------------------------------ */

.amazon-products {
    margin-top: 20px;
    margin-bottom: 20px;
}

.akp-product {
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow: hidden; /* 角丸に合わせてはみ出し防止 */
}


/* ------------------------------------------------------------
   ヘッダーエリア（PRバッジ・テキスト広告・セールバッジ）
   通常フローで配置するため絶対配置なし
   ------------------------------------------------------------ */

.akp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px;
    background-color: #f7f7f7;
    border-bottom: 1px solid #e0e0e0;
    min-height: 32px;
    flex-wrap: wrap;
}

/* 左側：PRバッジ ＋ テキスト広告 */
.akp-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0; /* テキスト折り返しのため */
}

/* 右側：不要になったため削除済み */

/* セールバッジ（商品情報エリア内・タイトルの上） */
.akp-sale-badge {
    display: inline-block;
    background: linear-gradient(135deg, #e60012, #ff4500);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    line-height: 1.4;
    margin-bottom: 6px;
    white-space: nowrap;
}
.akp-pr-badge {
    display: inline-block;
    flex-shrink: 0;
    background-color: #9e9e9e; /* インラインスタイルで上書きされる */
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 7px;
    border-radius: 3px;
    letter-spacing: 0.5px;
    line-height: 1.3;
    white-space: nowrap;
}

.akp-pr-badge a {
    color: #fff;
    text-decoration: none;
}

.akp-pr-badge a:hover {
    text-decoration: underline;
}

/* テキスト広告（カスタムHTML） */
.akp-custom-html {
    display: inline-block;
    color: #555;
    font-size: 12px;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}

.akp-custom-html a {
    color: #0066c0;
    text-decoration: none;
}

.akp-custom-html a:hover {
    color: #c45500;
    text-decoration: underline;
}

/* セールバッジ */
.akp-sale-badge {
    display: inline-block;
    background: linear-gradient(135deg, #e60012, #ff4500);
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    line-height: 1.4;
    white-space: nowrap;
}


/* ------------------------------------------------------------
   ボディエリア（画像 ＋ 商品情報 横並び）
   ------------------------------------------------------------ */

.akp-body {
    display: flex;
    flex-direction: row;
    gap: 16px;
    padding: 14px;
}

/* 商品画像 */
.akp-image {
    flex-shrink: 0;
    align-self: flex-start;
}

.akp-image img {
    width: 120px;
    height: auto;
    object-fit: contain;
    border-radius: 4px;
    display: block;
}

/* 商品情報 */
.akp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.akp-title {
    font-weight: bold;
    font-size: 15px;
    margin: 0 0 8px 0;
    line-height: 1.5;
}

.akp-title a {
    color: #232f3e;
    text-decoration: none;
}

.akp-title a:hover {
    text-decoration: underline;
}

/* catchcopy（セールメッセージ） */
.akp-catchcopy {
    color: #c45500;
    font-size: 13px;
    margin: 0 0 8px 0;
    line-height: 1.5;
    word-break: break-all;
}

/* ショップ名 */
.akp-shop-name {
    color: #555;
    font-size: 13px;
    margin: 0 0 6px 0;
}

.akp-shop-name a {
    color: #555;
    text-decoration: none;
}

.akp-shop-name a:hover {
    color: #BF0000;
    text-decoration: underline;
}

/* 価格 */
.akp-price {
    color: #666;
    font-size: 14px;
    margin: 0 0 6px 0;
}

.akp-price span {
    font-weight: bold;
    color: #BF0000;
    font-size: 16px;
}

/* 発売日 */
.akp-release-date {
    color: #666;
    font-size: 14px;
    margin: 0 0 6px 0;
}

.akp-release-date span {
    font-weight: bold;
    color: #232f3e;
}


/* ------------------------------------------------------------
   ボタンエリア
   ------------------------------------------------------------ */

.akp-buttons {
    display: flex;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    flex-wrap: wrap;
}

.akp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 16px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid;
    min-width: 90px;
    min-height: 40px;
    line-height: 1.4;
    box-sizing: border-box;
}

.akp-btn-external {
    color: #fff;
}

.akp-btn-external:hover {
    opacity: 0.85;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

/* Amazon 詳細ボタン */
.akp-btn-amazon-detail {
    position: relative;
    overflow: hidden;
    font-size: 14px;
    padding: 10px 20px;
    min-height: 42px;
}

.akp-btn-amazon-detail::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%,-50%);
    transition: width 0.6s, height 0.6s;
}

.akp-btn-amazon-detail:hover::before { width: 300px; height: 300px; }
.akp-btn-amazon-detail:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(255,153,0,0.4);
}

/* 楽天 詳細ボタン */
.akp-btn-rakuten-detail {
    position: relative;
    overflow: hidden;
    font-size: 14px;
    padding: 10px 20px;
    min-height: 42px;
}

.akp-btn-rakuten-detail::before {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    width: 0; height: 0;
    border-radius: 50%;
    background: rgba(255,255,255,0.3);
    transform: translate(-50%,-50%);
    transition: width 0.6s, height 0.6s;
}

.akp-btn-rakuten-detail:hover::before { width: 300px; height: 300px; }
.akp-btn-rakuten-detail:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(191,0,0,0.4);
}


/* ------------------------------------------------------------
   楽天クレジット
   ------------------------------------------------------------ */

.akp-rakuten-credit {
    text-align: right;
    padding: 6px 14px;
    border-top: 1px solid #e0e0e0;
    font-size: 10px;
}

.akp-rakuten-credit a {
    color: #999;
    text-decoration: none;
}

.akp-rakuten-credit a:hover {
    color: #BF0000;
    text-decoration: underline;
}


/* ============================================================
   スマホ対応 (max-width: 768px)
   ============================================================ */

@media (max-width: 768px) {

    /* ヘッダーは縦並びでもそのまま flex で機能する */
    .akp-header {
        padding: 6px 10px;
        gap: 6px;
    }

    .akp-custom-html {
        font-size: 11px;
        /* スマホでは折り返し許可 */
        white-space: normal;
        text-overflow: clip;
    }

    .akp-sale-badge {
        font-size: 10px;
        padding: 3px 7px;
        display: block;
        text-align: center;
        white-space: normal;
    }

    /* ボディを縦並びに */
    .akp-body {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        padding: 12px;
    }

    .akp-image {
        align-self: center; /* flex-start を上書きしてセンターに */
    }

    .akp-image img {
        width: 140px;
    }

    .akp-info {
        width: 100%;
        text-align: center;
    }

    .akp-title {
        font-size: 14px;
        text-align: center;
    }

    .akp-catchcopy,
    .akp-shop-name,
    .akp-price,
    .akp-release-date {
        text-align: center;
        font-size: 13px;
    }

    .akp-buttons {
        flex-direction: column;
        gap: 7px;
        padding-top: 10px;
    }

    .akp-btn,
    .akp-btn-amazon-detail,
    .akp-btn-rakuten-detail {
        width: 100%;
        min-width: auto;
        font-size: 14px;
        min-height: 42px;
    }
}


/* ============================================================
   小さいスマホ (max-width: 480px)
   ============================================================ */

@media (max-width: 480px) {

    .akp-header {
        padding: 5px 8px;
    }

    .akp-body {
        padding: 10px;
        gap: 10px;
    }

    .akp-image {
        align-self: center;
    }

    .akp-image img {
        width: 120px;
    }

    .akp-title {
        font-size: 13px;
    }

    .akp-catchcopy,
    .akp-shop-name,
    .akp-price,
    .akp-release-date {
        font-size: 12px;
    }

    .akp-price span {
        font-size: 15px;
    }

    .akp-rakuten-credit {
        font-size: 9px;
        padding: 5px 10px;
    }
}


/* ============================================================
   カルーセル
   ============================================================ */

.akp-carousel-wrap {
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* スライド可視領域 */
.akp-carousel-viewport {
    overflow: hidden;
    width: 100%;
}

/* スライドを横一列に並べるトラック */
.akp-carousel-track {
    display: flex;
    transition: transform 0.35s ease;
    will-change: transform;
}

/* 各スライド（既存の .akp-product スタイルを継承） */
.akp-carousel-item {
    flex: 0 0 100%;   /* 常に1枚ずつ表示 */
    min-width: 0;
    box-sizing: border-box;
    /* カルーセル内なので外枠のborder/shadow/marginはwrapに任せる */
    border: none;
    box-shadow: none;
    border-radius: 0;
    margin-bottom: 0;
}

/* 矢印ボタン：viewport の中央に配置 */
.akp-carousel-btn {
    position: absolute;
    top: calc(var(--akp-header-h, 34px) + (var(--akp-viewport-h, 200px) / 2));
    transform: translateY(-50%);
    background: rgba(255,255,255,0.92);
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 14px;
    line-height: 1;
    cursor: pointer;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transition: background 0.2s;
    padding: 0;
    color: #333;
}

.akp-carousel-btn:hover {
    background: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.akp-carousel-prev { left: 6px; }
.akp-carousel-next { right: 6px; }

/* ドット（インジケーター） */
.akp-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    padding: 10px 0 12px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.akp-carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    display: inline-block;
}

.akp-carousel-dot.active {
    background: #BF0000;
    transform: scale(1.25);
}

/* スマホ：矢印を少し小さく */
@media (max-width: 768px) {
    .akp-carousel-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    .akp-carousel-prev { left: 4px; }
    .akp-carousel-next { right: 4px; }
}
