/* サイドバー用 Amazon商品表示の縦型スタイル */
.amazon-products {
    margin-top: 20px;
    margin-bottom: 20px;
    max-width: 300px; /* サイドバー幅に合わせて調整 */
}

.amazon-products h5 {
    font-size: 1em;
    margin: 10px 0;
    color: #333;
    border-bottom: 1px solid #ddd;
    padding-bottom: 5px;
    text-align: center;
}

/* 縦型レイアウトのメイン設定 */
.akp-product {
    display: flex;
    flex-direction: column; /* 縦型に変更 */
    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);
    text-align: center; /* 中央揃え */
}

/* 画像を上部に配置 */
.akp-image {
    align-self: center;
    margin-bottom: 15px;
    margin-right: 0; /* 横方向のマージンを削除 */
}

.akp-image img {
    width: 100%;
    max-width: 150px; /* サイドバー用に最大幅を設定 */
    height: auto;
    object-fit: contain;
    border-radius: 4px;
}

/* 情報部分を縦型に最適化 */
.akp-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.akp-title {
    font-weight: bold;
    font-size: 14px; /* サイドバー用にサイズを調整 */
    margin-bottom: 10px;
    line-height: 1.4;
}

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

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

/* レビュー評価のスタイル（縦型用） */
.akp-review-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    margin-bottom: 10px;
}

.akp-stars {
    display: flex;
    align-items: center;
    justify-content: center;
}

.akp-star {
    color: #ffa41c;
    font-size: 14px;
    line-height: 1;
}

.akp-star-full {
    color: #ffa41c;
}

.akp-star-half {
    color: #ffa41c;
}

.akp-star-empty {
    color: #ddd;
}

.akp-rating-text {
    color: #565959;
    font-size: 12px;
    font-weight: normal;
}

.akp-release-date {
    color: #666;
    font-size: 12px;
    margin-bottom: 15px;
    text-align: center;
}

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

/* ボタンを縦型に最適化 */
.akp-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 15px;
    width: 100%;
}

.akp-btn {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: bold;
    font-size: 12px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    width: 100%;
    box-sizing: border-box;
}

/* Amazonで見るボタン */
.akp-btn-amazon {
    background-color: #ff9900;
    color: #fff;
    border: 2px solid #ff9900;
}

.akp-btn-amazon:hover {
    background-color: #e68900;
    border-color: #e68900;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(255, 153, 0, 0.3);
}

/* 類似商品を探すボタン */
.akp-btn-similar {
    background-color: #fff;
    color: #0066c0;
    border: 2px solid #0066c0;
}

.akp-btn-similar:hover {
    background-color: #0066c0;
    color: #fff;
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 102, 192, 0.3);
}

/* サイドバー用のコンパクトなスタイル */
.widget .amazon-products {
    margin: 15px 0;
}

.widget .akp-product {
    padding: 12px;
    margin-bottom: 15px;
}

.widget .akp-title {
    font-size: 13px;
    margin-bottom: 8px;
}

.widget .akp-image {
    margin-bottom: 12px;
}

.widget .akp-btn {
    padding: 6px 10px;
    font-size: 11px;
}

/* 複数商品を表示する場合の区切り線 */
.akp-product + .akp-product {
    border-top: 2px solid #f0f0f0;
    margin-top: 20px;
    padding-top: 20px;
}

/* 価格表示の追加スタイル */
.akp-price {
    font-size: 16px;
    font-weight: bold;
    color: #b12704;
    margin-bottom: 10px;
}

/* 狭いサイドバー用の追加レスポンシブ対応 */
@media (max-width: 320px) {
    .amazon-products {
        max-width: 100%;
    }
    
    .akp-image img {
        max-width: 120px;
    }
    
    .akp-title {
        font-size: 12px;
    }
    
    .akp-btn {
        font-size: 10px;
        padding: 6px 8px;
    }
}

/* 通常のサイドバー幅（250px-300px）用の最適化 */
@media (min-width: 250px) and (max-width: 300px) {
    .akp-image img {
        max-width: 140px;
    }
    
    .akp-title {
        font-size: 13px;
    }
}

/* 管理画面用スタイル（既存のものを維持） */
.akp-columns::after {
    content: '';
    display: table;
    clear: both;
}

.akp-sortable-box {
    width: 100%;
    margin-bottom: 30px;
    padding: 10px;
    background: #f9f9f9;
    border: 2px solid #ccc;
    border-radius: 6px;
}

.akp-col-title {
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 10px;
    color: #0073aa;
}

.akp-sortable {
    list-style: none;
    margin: 0;
    padding: 0;
    min-height: 100px;
}

.akp-sortable li {
    background: #ffffff;
    border: 1px solid #ccc;
    padding: 8px 12px;
    margin-bottom: 6px;
    border-radius: 4px;
    cursor: move;
    box-shadow: 1px 1px 3px rgba(0,0,0,0.1);
}

.akp-sortable li::before {
    content: '\1F4E6'; /* 📦 */
    margin-right: 6px;
}

#akp-selected li::before {
    counter-increment: akp-num;
    content: counter(akp-num) '. ';
    font-weight: bold;
    margin-right: 6px;
    color: #0073aa;
}

#akp-selected {
    counter-reset: akp-num;
    background-color: #eaf7ff;
}

#akp-available {
    background-color: #fefefe;
}

.akp-highlight {
    background: #cce5ff !important;
    border: 2px dashed #0073aa;
    height: 40px;
    margin-bottom: 6px;
}