/* PRバッジのスタイル - Text Ad Managerから動的に色を取得 */
.akp-pr-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #fff; /* デフォルト色(インラインスタイルで上書きされる) */
    color: #fff; /* テキストは白 */
    font-size: 12px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 3px;
    z-index: 10;
    letter-spacing: 0.5px;
}

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

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

/* カスタムHTMLテキストのスタイル */
.akp-custom-html {
    position: absolute;
    top: 8px;
    left: 50px; /* PRバッジとの間隔 */
    background-color: #fff;
    color: #333;
    font-size: 12px;
    font-weight: normal;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 10;
    max-width: calc(100% - 58px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

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

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

/* タブレットサイズ対応 */
@media (max-width: 1024px) {
    .akp-pr-badge {
        font-size: 11px;
        padding: 3px 7px;
    }
    
    .akp-custom-html {
        font-size: 11px;
        padding: 2px 5px;
        left: 48px;
    }
}

/* スマホサイズ対応 */
@media (max-width: 768px) {
    .akp-pr-badge {
        top: 10px;
        left: 10px;
        font-size: 11px;
        padding: 3px 7px;
    }
    
    .akp-custom-html {
        font-size: 10px;
        padding: 2px 5px;
        top: 10px;
        left: 55px;
        max-width: calc(100% - 65px);
    }
}

/* 小さいスマホサイズ対応 - 縦並びにする */
@media (max-width: 480px) {
    .akp-pr-badge {
        position: absolute;
        top: 10px;
        left: 10px;
    }
    
    .akp-custom-html {
        font-size: 9px;
        padding: 2px 4px;
        position: relative;
        top: auto;
        left: auto;
        margin-top: 40px;
        margin-left: 10px;
        margin-right: 10px;
        max-width: calc(100% - 20px);
    }
}

/* 超小型スマホ (320px以下) */
@media (max-width: 320px) {
    .akp-pr-badge {
        font-size: 10px;
        padding: 2px 6px;
    }
    
    .akp-custom-html {
        font-size: 8px;
        padding: 1px 3px;
    }
}

/* Amazon商品表示の基本スタイル */
.amazon-products {
    margin-top: 20px;
    margin-bottom: 20px;
}

.akp-product {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.akp-image {
    flex-shrink: 0;
    margin-right: 15px;
    padding-top: 60px;
}

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

.akp-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.akp-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    padding-top: 30px;
}

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

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

.akp-release-date {
    color: #666;
    font-size: 14px;
    margin-bottom: 15px;
}

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

.akp-buttons {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}

.akp-btn {
    display: inline-block;
    padding: 8px 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: 100px;
}

.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);
}

/* Container Queries対応 */
.amazon-products {
    container-type: inline-size;
}

@container (max-width: 400px) {
    .akp-product {
        flex-direction: column;
        text-align: center;
        gap: 15px;
        padding: 12px;
    }
    
    .akp-image {
        align-self: center;
        margin-right: 0;
        margin-bottom: 10px;
        padding-top: 0;
    }
    
    .akp-image img {
        width: 120px;
        max-width: 120px;
    }
    
    .akp-info {
        text-align: left;
    }
    
    .akp-title {
        text-align: center;
        font-size: 14px;
        line-height: 1.4;
        margin-bottom: 15px;
        padding-top: 0;
    }
    
    .akp-release-date {
        text-align: center;
        margin-bottom: 15px;
        font-size: 13px;
    }
    
    .akp-buttons {
        flex-direction: column;
        gap: 6px;
        margin-top: 15px;
    }
    
    .akp-btn {
        width: 100%;
        padding: 8px 14px;
        font-size: 13px;
        min-width: auto;
    }
}

/* スマホサイズ対応 */
@media (max-width: 768px) {
    .akp-product {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
        text-align: center;
    }
    
    .akp-image {
        align-self: center;
        margin-right: 0;
        margin-bottom: 10px;
        padding-top: 0;
    }
    
    .akp-image img {
        width: 150px;
        max-width: 150px;
    }
    
    .akp-info {
        text-align: left;
    }
    
    .akp-title {
        font-size: 15px;
        line-height: 1.4;
        text-align: center;
        margin-bottom: 15px;
        padding-top: 0;
    }
    
    .akp-release-date {
        text-align: center;
        margin-bottom: 20px;
    }
    
    .akp-buttons {
        flex-direction: column;
        gap: 8px;
        margin-top: 20px;
    }
    
    .akp-btn {
        width: 100%;
        padding: 10px 16px;
        font-size: 14px;
        min-width: auto;
    }
}

/* 小さいスマホサイズ対応 */
@media (max-width: 480px) {
    .amazon-products {
        margin-top: 15px;
        margin-bottom: 15px;
    }
    
    .akp-product {
        padding: 12px;
        gap: 12px;
        margin-bottom: 15px;
    }
    
    .akp-image img {
        width: 120px;
        max-width: 120px;
    }
    
    .akp-title {
        font-size: 14px;
        margin-bottom: 12px;
    }
    
    .akp-release-date {
        font-size: 13px;
        margin-bottom: 15px;
    }
    
    .akp-btn {
        padding: 10px 15px;
        font-size: 14px;
    }
    
    .akp-buttons {
        gap: 6px;
        margin-top: 15px;
    }
}