/* top_content.css */
.top-container {
    -max-width: 1200px;
    margin: 20px auto;
    padding: 0 30px;
    font-family: "Helvetica Neue", Arial, sans-serif;
}

.page-title {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
    font-size: 24px;
    font-weight: bold;
}

.category-section {
    margin-bottom: 40px;
}

.category-title {
    font-size: 20px;
    color: #ff5000;
    margin-bottom: 15px;
    padding-left: 5px;
    border-left: 4px solid #ff5000;
}

.carousel-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.carousel-wrapper {
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.carousel-wrapper::-webkit-scrollbar {
    display: none;
}

.carousel-track {
    display: flex;
    gap: 20px;
    padding: 15px;
}

.product-card {
    flex: 0 0 220px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

.product-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    background: #f8f8f8;
}

.no-image {
    width: 100%;
    height: 180px;
    background: #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
    font-size: 14px;
}

.product-info {
    padding: 12px;
}

.product-name {
    font-size: 14px;
    color: #333;
    margin: 0 0 8px 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price {
    font-weight: bold;
    color: #e64500;
    font-size: 16px;
    margin: 4px 0;
}

.sales {
    font-size: 12px;
    color: #666;
    margin: 4px 0 0 0;
}

.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 80, 0, 0.8);
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
    transition: all 0.2s;
}

.carousel-btn:hover {
    background: rgba(255, 80, 0, 1);
    transform: translateY(-50%) scale(1.1);
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

.error-msg, .no-data {
    color: #d00;
    font-size: 14px;
    text-align: center;
    padding: 20px;
    background: #fff8f8;
    border-radius: 6px;
    margin: 10px 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .product-card {
        flex: 0 0 180px;
    }
    .product-card img, .no-image {
        height: 150px;
    }
    .carousel-btn {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

.detail-btn {
    background: #ff5000;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
    margin-top: 6px;
    transition: background 0.2s;
}
.detail-btn:hover {
    background: #e64500;
}

.product-badges {
    margin: 8px 0;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}

.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 3px;
    color: white;
    font-weight: bold;
}

.badge-select {
    background: #9478e7;
}

.badge-onepiece {
    background: #07c160;
}

.badge-patent {
    background: #1890ff;
}

/* 1688専用バッジ（アリババオレンジ風） */
.badge-1688 {
    background-color: #ff5000;        /* アリババの代表的なオレンジ */
    color: white;
    font-weight: bold;
    font-size: 14px;
    padding: 2px 6px;
    border-radius: 3px;
    display: inline-block;
    line-height: 1.2;
}

/* 必要に応じて他のバッジより目立たせる調整例 */
.product-badges .badge-1688 {
    order: -1;           /* flexなら先頭に強制配置（念のため） */
}


/* top_content.css（追加分のみ） */

.sub-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0 20px;
    padding: 0 5px;
    border-bottom: 2px solid #eee;
}

.tab-btn {
    padding: 8px 16px;
    background: #f5f5f5;
    border: none;
    border-radius: 6px 6px 0 0;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
    color: #666;
    font-weight: 500;
}

.tab-btn.active {
    background: #ff5000;
    color: white;
}

.tab-btn:hover:not(.active) {
    background: #e0e0e0;
}

.tab-content {
    min-height: 300px;
}

/* top_content.css - 追加分（上書き用） */

.tab-content {
    min-height: 380px;           /* 高さ固定でチラつき防止 */
    position: relative;
    overflow: hidden;
    background: #fafafa;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.tab-content.loading-active {
    background: #fff;
}

/* カルーセルを絶対配置で重ねる */
.carousel-container {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s;
    pointer-events: none;
}

.carousel-container.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    z-index: 2;
}

/* ローディングは上に重ねる */
.tab-content > .loading {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255,255,255,0.9);
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10;
}

/* 空データも同じ */
.tab-content > .no-data,
.tab-content > .error-msg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    padding: 20px 40px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    z-index: 10;
}

/* 専用商品リンクボタン */
.exclusive-link-wrapper {
    text-align: center;
    margin: 20px auto;
    padding: 0 15px;
}
.exclusive-link-btn {
    display: inline-block;
    background: linear-gradient(135deg, #ff5000, #e64500);
    color: white;
    font-weight: bold;
    font-size: 18px;
    padding: 14px 40px;
    border-radius: 50px;
    text-decoration: none;
    box-shadow: 0 6px 15px rgba(255,80,0,0.3);
    transition: all 0.3s ease;
}
.exclusive-link-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255,80,0,0.4);
}
.exclusive-link-btn:active {
    transform: translateY(0);
}

/* 最上部バナー - 横幅100%、上300px表示、下部透明グラデーション */
.top-banner {
    width: 100%;
    height: 300px;
    position: relative;
    overflow: hidden;
    margin-bottom: 30px;
    border-radius: 0 0 0 0;
    -box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.top-banner img {
    width: 100%;
    height: auto;
    position: absolute;
    top: -300px; /* 上から300pxの位置から表示 */
    left: 0;
    object-fit: cover;
    transition: transform 0.8s ease;
}
.top-banner:hover img {
    -transform: scale(1.05);
}
.top-banner::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
	background: linear-gradient(to top,
        #F7FAFC 0%,        /* 背景と完全一致 */
        rgba(247,250,252,0.95) 15%,
        rgba(247,250,252,0.85) 35%,
        rgba(247,250,252,0.6)  60%,
        rgba(247,250,252,0.3)  85%,
        transparent 100%
    );
    z-index: 1;
}
.top-banner-text {
    position: absolute;
    bottom: 40px;
    left: 50px;
    color: white;
    z-index: 2;
    text-shadow: 0 3px 10px rgba(0,0,0,0.8);
}
.top-banner-text h1 {
    margin: 0 0 12px 0;
    font-size: 42px;
    font-weight: 900;
    letter-spacing: 2px;
}
.top-banner-text p {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    opacity: 0.95;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .top-banner {
        height: 300px;
    }
    .top-banner img {
        top: -180px;
    }
    .top-banner-text {
        left: 25px;
        bottom: 25px;
    }
    .top-banner-text h1 {
        font-size: 28px;
    }
    .top-banner-text p {
        font-size: 16px;
    }
}

/* お知らせエリア（高さ200px固定・スクロール） */
.top-info-container {
    -max-width: 1200px;
    margin: 0 auto 30px;
    padding: 0 15px;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
    overflow: hidden;
}

.top-info-title {
    background: #ff5000;
    color: white;
    margin: 0;
    padding: 14px 20px;
    font-size: 20px;
    font-weight: bold;
    text-align: center;
}

.top-info-list {
    height: 200px;                    /* 固定高さ */
    overflow-y: auto;                 /* 超えたら縦スクロール */
    padding: 16px 20px;
    background: #fcfcfc;
    border-top: 1px solid #eee;
}

.top-info-list::-webkit-scrollbar {
    width: 8px;
}
.top-info-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}
.top-info-list::-webkit-scrollbar-thumb {
    background: #ff5000;
    border-radius: 4px;
}

.top-info-item {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px dashed #ddd;
    gap: 16px;
    font-size: 14px;
}

.top-info-item:last-child {
    border-bottom: none;
}

.top-info-item.important {
    background: #fff2ed;
    border-left: 4px solid #ff5000;
    padding-left: 12px;
    margin: 4px 0;
    border-radius: 0 4px 4px 0;
}

.top-info-date {
    flex: 0 0 90px;
    color: #ff5000;
    font-weight: bold;
    text-align: center;
    line-height: 1.4;
    font-size: 13px;
}

.top-info-body {
    flex: 1;
}

.top-info-title-text {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
    font-size: 15px;
}

.top-info-content {
    color: #555;
    line-height: 1.5;
    font-size: 13.5px;
    margin-top: 4px;
}

/* 読み込み中・空・エラー */
.top-info-loading,
.top-info-empty,
.top-info-error {
    text-align: center;
    color: #888;
    padding: 50px 20px;
    font-size: 15px;
}

/* モバイル対応 */
@media (max-width: 768px) {
    .top-info-item {
        flex-direction: column;
        gap: 8px;
    }
    .top-info-date {
        flex: none;
        text-align: left;
    }
    .top-info-list {
        height: 220px;
        padding: 14px 16px;
    }
}

/* ===== バナースライドショー（左スクロール） ===== */
.banner-slideshow {
    position: relative;
    width: 100%;
    margin: 0 auto 30px;
    overflow: hidden;
    background: #f0f0f0;
}

/* トラック：全スライドを横一列に並べる */
.banner-slides {
    display: flex;
    /* width・transform は JS で動的にセット */
    transition: transform 0.6s ease;
    will-change: transform;
}

/* 各スライド：幅は JS でセット */
.banner-slide {
    flex-shrink: 0;
    /* width は JS で (100/total)% にセット */
}

.banner-slide img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* ドットインジケーター */
.banner-dots {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 5;
}

.banner-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.55);
    border: 2px solid rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: background 0.3s, transform 0.2s;
    display: inline-block;
}

.banner-dot.active {
    background: #ff5000;
    border-color: #ff5000;
    transform: scale(1.2);
}

/* 左右矢印ボタン */
.banner-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.35);
    color: white;
    border: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.2s;
    line-height: 1;
    padding: 0;
}

.banner-arrow:hover {
    background: rgba(255, 80, 0, 0.85);
    transform: translateY(-50%) scale(1.1);
}

.banner-arrow-prev { left: 12px; }
.banner-arrow-next { right: 12px; }

/* モバイル対応 */
@media (max-width: 768px) {
    .banner-arrow {
        width: 34px;
        height: 34px;
        font-size: 15px;
    }
    .banner-arrow-prev { left: 8px; }
    .banner-arrow-next { right: 8px; }
    .banner-dot {
        width: 8px;
        height: 8px;
    }
}