/* search.css */
.search-container,
.product-detail-container {
    position: relative;          /* 必須 */
    max-width: 1400px;
    width: 100%;
    margin: 0 auto 40px auto;    /* 底部40px间距 */
    padding: 20px;
    box-sizing: border-box;
    overflow: visible;           /* はみ出し許可 */
}

.search-container::before,
.product-detail-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);  /* 白色背景比卡片稍微多一点 */
    max-width: 1368px;              /* 白色背景比卡片稍微多一点 */
    height: 100%;                /* コンテナの高さに追従 */
    min-height: 100%;            /* コンテンツが少ないときも最低限 */
    background: #fff;
    border-radius: 8px;
    -box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    z-index: -1;
    pointer-events: none;        /* クリックを透過 */
}
.search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    align-items: center;
}
.search-input {
    flex: 1;
    min-width: 200px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}
.search-btn {
    background: #ff5000;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
}
.search-btn:hover {
    background: #e64500;
}
.filter-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 15px;
}
.filter-input {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    width: 80px;
}
.sort-select {
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.results-summary {
    margin: 15px 0;
    color: #666;
    font-size: 14px;
}
.results-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px;
    width: 100%;
    margin: 0 auto;
}

.results-grid .product-card {
    width: 100%;
    min-width: 0;
}

@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: repeat(4, 1fr) !important;
    }
}

@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}

@media (max-width: 600px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
.product-card {
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow 0.3s;
}
.product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}
.product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
}
.product-info {
    padding: 12px;
}
.product-title {
    font-size: 14px;
    color: #333;
    margin: 0 0 8px;
    line-height: 1.4;
    height: 40px;
    overflow: hidden;
}
.product-price {
    color: #ff5000;
    font-weight: bold;
    font-size: 16px;
}
.product-sold {
    font-size: 12px;
    color: #999;
    margin: 4px 0;
}
.product-badges {
    margin: 8px 0;
}
.badge {
    display: inline-block;
    padding: 2px 6px;
    font-size: 11px;
    border-radius: 3px;
    margin-right: 4px;
}
.badge-select {
    background: #ff5000;
    color: white;
}
.badge-onepiece {
    background: #07c160;
    color: white;
}
.badge-patent {
    background: #1890ff;
    color: white;
}

/* 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なら先頭に強制配置（念のため） */
}


.detail-btn {
    display: block;
    text-align: center;
    background: #f5f5f5;
    color: #333;
    padding: 8px;
    font-size: 13px;
    text-decoration: none;
    border-top: 1px solid #eee;
}
.detail-btn:hover {
    background: #eee;
}
.pagination {
    text-align: center;
    margin: 30px 0;
}
.pagination a {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
}
.pagination a.active, .pagination a:hover {
    background: #ff5000;
    color: white;
    border-color: #ff5000;
}
.error-message {
    background: #ffebee;
    color: #c62828;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    font-weight: bold;
}
.no-results {
    text-align: center;
    color: #999;
    padding: 40px;
    font-size: 16px;
}
.debug-container {
    margin: 40px 0;
    padding: 20px;
    background: #f7f7f7;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: monospace;
}
.debug-header {
    font-weight: bold;
    color: #333;
    cursor: pointer;
    user-select: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}
.debug-content {
    background: #fff;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* search.css に以下の2行を追加 */
.pagination { text-align: left !important; }
.pagination-container { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    margin: 20px 0; 
}
.summary-and-buttons { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
}
.csv-download-btn {
    background: #28a745;
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
}
.csv-download-btn:hover {
    background: #218838;
}

/* 価格フィルター - インライン版 */
.filter-inline {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 15px;
    flex-wrap: wrap;
}
.filter-inline label {
    font-size: 13px;
    color: #666;
}
.filter-inline input {
    width: 80px;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}
.filter-inline select {
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 13px;
}
.filter-inline button {
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}
.filter-apply-btn {
    background: #ff5000;
    color: white;
}
.filter-apply-btn:hover {
    background: #e64500;
}
.filter-reset-btn {
    background: #f5f5f5;
    color: #666;
}
.filter-reset-btn:hover {
    background: #e0e0e0;
}

/* ──────────────────────────────────────────────
   商品カード ホバーモーダル（グローバルJS方式）
   モーダル本体は #seller-global-modal（body直下・position:fixed）
   overflow:hidden の影響を受けないためCSSホバーは使わない
────────────────────────────────────────────── */
.product-card-hoverable {
    /* position:relative 不要（モーダルはfixed） */
}

/* 2列行 */
.shm-row2 {
    display: flex;
    gap: 4px;
    margin-bottom: 3px;
}
.shm-cell {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 3px;
    min-width: 0;
}
.shm-lbl {
    font-size: 10px;
    color: rgba(0,0,0,0.4);
    white-space: nowrap;
    flex-shrink: 0;
}
.shm-val {
    font-size: 12px;
    font-weight: bold;
    color: #222;
    white-space: nowrap;
}
.shm-date {
    font-size: 11px;
    font-weight: normal;
    color: #444;
}
.shm-divider {
    border-top: 1px dashed rgba(0,0,0,0.12);
    margin: 5px 0;
}
.shm-medal {
    font-size: 11px;
    color: #555;
    margin-bottom: 3px;
}
/* スコア 1列リスト（全項目確実に表示） */
.shm-scores {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.shm-score-cell {
    display: flex;
    align-items: center;
    gap: 4px;
}
.shm-score-cell .shm-lbl {
    width: 30px;
    flex-shrink: 0;
}