.amz-ranking {
    font-family: 'Meiryo', 'Yu Gothic', 'Hiragino Kaku Gothic ProN', sans-serif;
    max-width: 100%;
    margin: 1.2rem 0 1.5rem;
}

.amz-ranking-title {
    font-size: 1.05rem;
    font-weight: bold;
    margin: 0 0 0.6rem;
    padding: 0 0 0.3rem;
    color: #111;
    border-bottom: 1px solid #ccc;
}

.amz-slider-wrap {
    position: relative;
}

.amz-ranking-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.amz-ranking-list::-webkit-scrollbar {
    display: none;
}

.amz-ranking-item {
    flex: 0 0 calc((100% - 8px * 4) / 5);
    max-width: calc((100% - 8px * 4) / 5);
    scroll-snap-align: start;
    margin: 0;
    padding: 0;
    background: #fff;
    position: relative;
    overflow: hidden;
}

.amz-ranking-item > a {
    display: block;
    padding: 0;
    text-decoration: none;
    color: inherit;
}

.amz-ranking-item > a:hover {
    text-decoration: none;
    color: inherit;
}

.amz-ranking-item:hover .amz-img {
    opacity: 0.85;
}

.amz-rank {
    position: absolute;
    top: 0;
    left: 0;
    background: #c0392b;
    color: #fff;
    font-size: 0.95rem;
    font-weight: bold;
    min-width: 26px;
    text-align: center;
    padding: 2px 6px 3px;
    z-index: 2;
    line-height: 1.1;
}

.amz-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: contain;
    display: block;
    background: #fff;
    transition: opacity 0.15s;
}

.amz-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.82rem;
    line-height: 1.35;
    color: #222;
    margin: 6px 2px 4px;
    min-height: calc(0.82rem * 1.35 * 2);
}

.amz-price {
    display: block;
    color: #c0392b;
    font-weight: bold;
    font-size: 1rem;
    margin: 0 2px 6px;
    letter-spacing: 0.02em;
}

.amz-arrow {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    width: 36px;
    height: 56px;
    background: rgba(192, 57, 43, 0.9);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 1.6rem;
    font-weight: bold;
    line-height: 1;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 4px;
    transition: opacity 0.15s, background 0.15s;
}

.amz-arrow:hover {
    background: #c0392b;
}

.amz-arrow-left {
    left: 0;
}

.amz-arrow-right {
    right: 0;
}

.amz-ranking-empty {
    color: #888;
    font-size: 0.9rem;
    padding: 1rem;
    text-align: center;
    border: 1px dashed #ccc;
    border-radius: 4px;
}

@media (max-width: 1100px) {
    .amz-ranking-item {
        flex: 0 0 calc((100% - 8px * 3) / 4);
        max-width: calc((100% - 8px * 3) / 4);
    }
}

@media (max-width: 820px) {
    .amz-ranking-item {
        flex: 0 0 calc((100% - 8px * 2) / 3);
        max-width: calc((100% - 8px * 2) / 3);
    }
}

@media (max-width: 640px) {
    .amz-ranking-list {
        gap: 6px;
    }
    .amz-ranking-item {
        flex: 0 0 calc((100% - 6px) / 2);
        max-width: calc((100% - 6px) / 2);
    }
    .amz-title {
        font-size: 0.85rem;
    }
    .amz-price {
        font-size: 1rem;
    }
    .amz-rank {
        font-size: 0.95rem;
        min-width: 24px;
        padding: 2px 6px;
    }
    .amz-arrow {
        width: 32px;
        height: 48px;
        font-size: 1.4rem;
    }
}
