/* リセットと基本スタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Hiragino Kaku Gothic ProN', 'ヒラギノ角ゴ ProN W3', 'Meiryo', メイリオ, sans-serif;
    background-color: #ffffff;
    color: #333333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* ヘッダー */
header {
    text-align: center;
    padding: 20px 20px 10px;
    margin-bottom: 15px;
}

header h1 {
    font-size: 2rem;
    color: #2c3e50;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.title-icon {
    display: flex;
    align-items: center;
}

.title-icon svg {
    display: block;
}

header .subtitle {
    color: #6c757d;
    font-size: 0.95rem;
}

/* ローディング状態 */
.loading-status {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    margin-bottom: 25px;
    border: 1px solid #e9ecef;
}

.loading-status.hidden {
    display: none;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loading-status p {
    color: #6c757d;
    font-size: 1rem;
}

.loading-status.error {
    background: #fff5f5;
    border-color: #feb2b2;
}

.loading-status.error p {
    color: #c53030;
}

/* セクション共通 */
section {
    background: #ffffff;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e9ecef;
}

section h2 {
    font-size: 1.3rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

/* 検索フォーム */
.search-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.search-hint {
    font-size: 0.9rem;
    color: #6c757d;
    margin-bottom: 5px;
}

.search-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.search-field label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-clear {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    font-size: 1.3rem;
    color: #ccc;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    z-index: 2;
    display: none;
}

.input-clear.visible {
    display: block;
}

.input-clear:hover {
    color: #495057;
}

.search-field input {
    padding: 12px 36px 12px 16px;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    outline: none;
    transition: border-color 0.2s ease;
    width: 100%;
}

.search-field input:focus {
    border-color: #3498db;
}

.search-field input::placeholder {
    color: #adb5bd;
}

.search-actions {
    display: flex;
    gap: 16px;
}

.search-button {
    flex: 1;
    padding: 14px 32px;
    font-size: 1rem;
    font-weight: 600;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.search-button:hover {
    background: #2980b9;
}

.clear-search-button {
    flex: 1;
    padding: 14px 24px;
    font-size: 1rem;
    font-weight: 500;
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-search-button:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

/* カテゴリセレクター */
.category-selector {
    margin-top: 0;
    margin-bottom: 10px;
}

.category-selector label {
    font-weight: 600;
    color: #495057;
    margin-right: 12px;
}

.category-select {
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    outline: none;
    min-width: 250px;
    cursor: pointer;
}

.category-select:focus {
    border-color: #3498db;
}

/* 絞り込みセレクター群 */
.filter-selectors {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 10px;
}

.filter-selector {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filter-selector label {
    font-weight: 600;
    color: #495057;
    font-size: 0.95rem;
}

.filter-select {
    padding: 12px 16px;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    outline: none;
    cursor: pointer;
    background-color: #fff;
}

.filter-select:focus {
    border-color: #3498db;
}

.filter-input {
    padding: 12px 36px 12px 16px;
    font-size: 1rem;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    outline: none;
    background-color: #fff;
    width: 100%;
}

.filter-input:focus {
    border-color: #3498db;
}

.filter-input::placeholder {
    color: #adb5bd;
}

/* 販売状況フィルター */
.status-filter {
    margin-top: 10px;
}

.status-filter > label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.status-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.status-btn {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.status-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.status-btn.active {
    background: #e8f4fc;
    color: #3498db;
    border-color: #3498db;
}

/* 並び替えフィルター */
.sort-filter {
    margin-top: 10px;
}

.sort-filter > label {
    display: block;
    font-weight: 600;
    color: #495057;
    margin-bottom: 10px;
}

.sort-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sort-btn {
    padding: 10px 18px;
    font-size: 0.95rem;
    font-weight: 500;
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sort-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.sort-btn.active {
    background: #e8f4fc;
    color: #3498db;
    border-color: #3498db;
}

.hidden {
    display: none !important;
}

/* 検索履歴 */
.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 12px;
    border-bottom: 2px solid #e9ecef;
}

.history-header h2 {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.clear-history-btn {
    padding: 8px 16px;
    font-size: 0.85rem;
    background: #dc3545;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.clear-history-btn:hover {
    background: #c82333;
}

.history-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: #f1f3f4;
    border-radius: 20px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.history-item:hover {
    background: #e2e6ea;
}

.history-item .type-badge {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: #3498db;
    color: #ffffff;
    border-radius: 10px;
}

.history-item .keyword {
    color: #495057;
}

.history-item .delete-btn {
    background: none;
    border: none;
    color: #adb5bd;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 4px;
    line-height: 1;
}

.history-item .delete-btn:hover {
    color: #dc3545;
}

.no-history {
    color: #6c757d;
    font-style: italic;
}

/* 検索結果 */
#resultCount {
    font-size: 0.9rem;
    font-weight: normal;
    color: #6c757d;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 20px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.2s ease;
    cursor: pointer;
}

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

.product-card .product-id {
    font-size: 0.8rem;
    color: #6c757d;
    margin-bottom: 8px;
}

.product-card .product-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-card .google-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 500;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 10px;
    text-decoration: none;
}

.product-card .google-search-btn:hover {
    background: #2980b9;
}

.product-card .google-search-btn svg {
    width: 14px;
    height: 14px;
}

.product-card .product-info {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-card .info-row {
    display: flex;
    font-size: 0.9rem;
}

.product-card .info-label {
    flex-shrink: 0;
    width: 80px;
    color: #6c757d;
    font-weight: 500;
}

.product-card .info-value {
    color: #495057;
    flex: 1;
}

/* 分類アイコン */
.category-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    margin-right: 6px;
    flex-shrink: 0;
    font-size: 14px;
}

.category-icon.pill {
    color: #3498db;
}

.category-icon.food {
    color: #f1c40f;
}

.category-icon.fresh {
    color: #27ae60;
}

.category-value-wrapper {
    display: flex;
    align-items: center;
}

.product-card .health-claim {
    margin-top: 12px;
    padding: 12px;
    background: #f8f9fa;
    border-radius: 6px;
    font-size: 0.85rem;
    line-height: 1.5;
    color: #495057;
    max-height: 100px;
    overflow: hidden;
    position: relative;
}

.product-card .health-claim::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(transparent, #f8f9fa);
}

.product-card .health-claim-title {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 6px;
}

.product-card .status-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.75rem;
    border-radius: 12px;
    margin-top: 10px;
}

.product-card .status-badge.販売中 {
    background: #d4edda;
    color: #155724;
}

.product-card .status-badge.販売休止中 {
    background: #fff3cd;
    color: #856404;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
    grid-column: 1 / -1;
}

.no-results p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.no-results .hint {
    font-size: 0.9rem;
}

/* 初期状態（検索前） */
.initial-state {
    text-align: center;
    padding: 80px 20px;
    color: #6c757d;
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    border: 1px dashed #dee2e6;
}

.initial-state p {
    font-size: 1.1rem;
    margin-bottom: 10px;
}

.initial-state .hint {
    font-size: 0.9rem;
    color: #adb5bd;
    margin-bottom: 0;
}

.initial-state .hint + .hint {
    margin-top: 0;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.page-btn {
    padding: 10px 20px;
    font-size: 0.95rem;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.page-btn:hover:not(:disabled) {
    background: #2980b9;
}

.page-btn:disabled {
    background: #dee2e6;
    color: #6c757d;
    cursor: not-allowed;
}

.page-info {
    color: #495057;
    font-size: 0.95rem;
}

/* モーダル */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    padding: 20px;
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: #ffffff;
    border-radius: 12px;
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    padding: 30px;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.5rem;
    background: none;
    border: none;
    cursor: pointer;
    color: #6c757d;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close:hover {
    background: #f1f3f4;
    color: #333;
}

.modal-body h2 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 20px;
    padding-right: 40px;
}

.modal-body .detail-row {
    display: flex;
    padding: 12px 0;
    border-bottom: 1px solid #e9ecef;
}

.modal-body .detail-row:last-child {
    border-bottom: none;
}

.modal-body .detail-label {
    flex-shrink: 0;
    width: 180px;
    font-weight: 600;
    color: #495057;
}

.modal-body .detail-value {
    color: #333;
    flex: 1;
    line-height: 1.6;
}

.modal-body .detail-value.health-claim-full {
    white-space: pre-wrap;
}

/* モーダル内のGoogle検索ボタン */
.modal-google-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    font-size: 0.95rem;
    font-weight: 500;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-bottom: 20px;
    text-decoration: none;
}

.modal-google-search-btn:hover {
    background: #2980b9;
}

.modal-google-search-btn svg {
    width: 18px;
    height: 18px;
}

/* ハイライト */
mark {
    background: #fff3cd;
    padding: 1px 2px;
    border-radius: 2px;
}

/* 商品画像コンテナ */
.product-image-container {
    width: 100%;
    max-width: 300px;
    margin: 0 auto 20px;
    text-align: center;
}

.product-image {
    max-width: 100%;
    max-height: 250px;
    object-fit: contain;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.image-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
}

.image-not-found {
    padding: 40px;
    background: #f8f9fa;
    border-radius: 8px;
    color: #6c757d;
    font-size: 0.9rem;
}

/* 小さいスピナー */
.spinner-small {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top-color: #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* AI要約セクション */
.ai-summary-section {
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fc 100%);
    border-radius: 10px;
    border: 1px solid #c5dff8;
}

.ai-summary-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.ai-icon {
    font-size: 1.2rem;
}

.ai-summary-content {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #495057;
}

.ai-summary-text {
    font-size: 0.95rem;
    line-height: 1.6;
    color: #333;
}

.ai-summary-error {
    color: #6c757d;
    font-style: italic;
}

/* 関連情報セクション */
.related-info-section {
    margin-top: 20px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 10px;
    border: 1px solid #e9ecef;
}

.related-info-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 10px;
}

.info-icon {
    font-size: 1.1rem;
}

.load-related-btn {
    margin-left: auto;
    padding: 6px 14px;
    font-size: 0.85rem;
    background: #3498db;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.load-related-btn:hover:not(:disabled) {
    background: #2980b9;
}

.load-related-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
}

.related-info-content {
    min-height: 20px;
}

.related-info-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.related-info-item {
    padding: 10px;
    background: #fff;
    border-radius: 6px;
    border: 1px solid #e9ecef;
}

.related-info-item a {
    color: #3498db;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
}

.related-info-item a:hover {
    text-decoration: underline;
}

.related-snippet {
    font-size: 0.85rem;
    color: #6c757d;
    margin-top: 5px;
    line-height: 1.5;
}

.no-related-info {
    color: #6c757d;
    font-style: italic;
    font-size: 0.9rem;
}

/* ==============================
   検索リンクボタンのスタイル
   ============================== */

.search-links-section {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
}

.search-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.search-link-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.search-link-btn.google {
    background: #4285f4;
    color: #fff;
}

.search-link-btn.google:hover {
    background: #3367d6;
}

.search-link-btn.google-image {
    background: #34a853;
    color: #fff;
}

.search-link-btn.google-image:hover {
    background: #2d8f47;
}

.search-link-btn.amazon {
    background: #ff9900;
    color: #111;
}

.search-link-btn.amazon:hover {
    background: #e88a00;
}

.search-link-btn.rakuten {
    background: #bf0000;
    color: #fff;
}

.search-link-btn.rakuten:hover {
    background: #a00000;
}

.search-link-btn.yahoo {
    background: #ff0033;
    color: #fff;
}

.search-link-btn.yahoo:hover {
    background: #e0002e;
}

/* ==============================
   AI分析結果のスタイル
   ============================== */

/* 分析セクション全体 */
.analysis-section {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.analysis-section h3 {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.15rem;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e9ecef;
}

/* 分析ボタン */
.analyze-btn {
    padding: 12px 24px;
    font-size: 0.95rem;
    font-weight: 600;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.analyze-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.analyze-btn:disabled {
    background: #adb5bd;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* ローディングインジケーター */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fc 100%);
    border-radius: 10px;
    color: #495057;
    font-size: 0.95rem;
}

/* 分析グリッド */
.analysis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 15px;
}

/* 分析カード */
.analysis-card {
    background: #ffffff;
    border-radius: 10px;
    border: 1px solid #e9ecef;
    overflow: hidden;
    transition: all 0.2s ease;
}

.analysis-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.card-header {
    padding: 12px 16px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    font-weight: 600;
    color: #2c3e50;
    font-size: 0.95rem;
    border-bottom: 1px solid #e9ecef;
}

.card-content {
    padding: 16px;
}

/* 分析アイテム */
.analysis-item {
    margin-bottom: 12px;
}

.analysis-item:last-child {
    margin-bottom: 0;
}

.analysis-item strong {
    display: block;
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.analysis-item span {
    display: block;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* サマリーカード（全幅） */
.summary-card {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
}

.summary-card .card-header {
    background: rgba(255, 255, 255, 0.15);
    color: #ffffff;
    border-bottom-color: rgba(255, 255, 255, 0.2);
}

.summary-card .card-content {
    color: rgba(255, 255, 255, 0.95);
    font-size: 1rem;
    line-height: 1.7;
}

/* 検索結果リスト */
.search-results-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.search-result-item {
    padding: 12px 15px;
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.search-result-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.search-result-item a {
    color: #3498db;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    display: block;
    margin-bottom: 5px;
}

.search-result-item a:hover {
    text-decoration: underline;
}

.search-result-item .snippet {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.5;
}

/* データなし表示 */
.no-data {
    text-align: center;
    padding: 30px;
    color: #6c757d;
    font-style: italic;
}

/* 分析エラー表示 */
.analysis-error {
    padding: 20px;
    background: #fff5f5;
    border: 1px solid #feb2b2;
    border-radius: 10px;
    color: #c53030;
    text-align: center;
}

/* モーダル内の2カラムレイアウト */
.modal-two-column {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

.modal-left-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.modal-right-column {
    display: flex;
    flex-direction: column;
}

/* モーダル内の基本情報テーブル */
.basic-info-table {
    width: 100%;
    border-collapse: collapse;
}

.basic-info-table tr {
    border-bottom: 1px solid #e9ecef;
}

.basic-info-table tr:last-child {
    border-bottom: none;
}

.basic-info-table th {
    text-align: left;
    padding: 10px 12px 10px 0;
    font-weight: 600;
    color: #6c757d;
    font-size: 0.85rem;
    width: 100px;
    vertical-align: top;
}

.basic-info-table td {
    padding: 10px 0;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* 商品タイトルエリア */
.product-title-area {
    margin-bottom: 20px;
}

.product-title-area h2 {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 8px;
    padding-right: 40px;
    line-height: 1.4;
}

.product-title-area .product-id-badge {
    display: inline-block;
    padding: 4px 12px;
    background: #e8f4fc;
    color: #3498db;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

/* ヘルスクレーム表示エリア */
.health-claim-area {
    margin: 15px 0;
    padding: 15px;
    background: linear-gradient(135deg, #e8f5e9 0%, #c8e6c9 100%);
    border-radius: 10px;
    border: 1px solid #a5d6a7;
}

.health-claim-area h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #2e7d32;
    margin-bottom: 8px;
}

.health-claim-area p {
    color: #1b5e20;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .modal-two-column {
        grid-template-columns: 1fr;
    }

    .modal-left-column {
        order: 1;
    }

    .modal-right-column {
        order: 2;
    }

    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .summary-card {
        grid-column: 1;
    }
}

/* ==============================
   検索ボタンセクション
   ============================== */

.search-button-section {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.search-link-section {
    margin-bottom: 16px;
}

.search-link-section .google-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    font-size: 0.9rem;
    font-weight: 500;
    background: #3498db;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease;
    text-decoration: none;
}

.search-link-section .google-search-btn:hover {
    background: #2980b9;
}

.search-link-section .google-search-btn svg {
    width: 16px;
    height: 16px;
}

.search-link-section .google-direct-link {
    color: #3498db;
    text-decoration: none;
    font-size: 0.95rem;
}

.search-link-section .google-direct-link:hover {
    text-decoration: underline;
}

.search-product-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    font-size: 1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: #ffffff;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
    text-decoration: none;
}

.search-product-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
    color: #ffffff;
}

/* 検索結果セクション */
.search-results-section {
    margin-bottom: 20px;
}

/* ==============================
   検索上位3件セクション（シンプル版）
   ============================== */

.search-top3-section {
    margin-bottom: 28px;
}

.simple-search-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.simple-search-list li {
    padding: 6px 0;
    border-bottom: 1px dotted #e9ecef;
}

.simple-search-list li:last-child {
    border-bottom: none;
}

.simple-search-list li::before {
    content: "・";
    color: #3498db;
}

.simple-search-list a {
    color: #3498db;
    text-decoration: none;
    font-size: 0.95rem;
}

.simple-search-list a:hover {
    text-decoration: underline;
}

/* ==============================
   AI商品分析セクション（シンプル版）
   ============================== */

.ai-analysis-section {
    margin-bottom: 28px;
}

.simple-analysis-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.simple-analysis-list li {
    padding: 8px 0;
    border-bottom: 1px dotted #e9ecef;
}

.simple-analysis-list li:last-child {
    border-bottom: none;
}

.analysis-item-label {
    font-weight: 600;
    color: #495057;
    display: block;
    margin-bottom: 2px;
}

.analysis-item-value {
    color: #333;
    font-size: 0.95rem;
    display: block;
    padding-left: 12px;
}

/* ローディングスピナー（検索・分析用） */
.loading-spinner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 30px;
    background: linear-gradient(135deg, #f0f7ff 0%, #e8f4fc 100%);
    border-radius: 10px;
    color: #495057;
    font-size: 0.95rem;
}

.loading-spinner .spinner {
    width: 24px;
    height: 24px;
    border-width: 3px;
    margin: 0;
}

/* エラー・情報なしメッセージ */
.no-results-message,
.error-message {
    padding: 30px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    color: #6c757d;
}

.error-message {
    background: #fff5f5;
    border: 1px solid #feb2b2;
    color: #c53030;
}

.no-results-message .hint,
.error-message .hint {
    font-size: 0.85rem;
    margin-top: 8px;
    opacity: 0.8;
}

/* セクションタイトル */
.section-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 28px 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #a8e6cf;
    display: flex;
    align-items: center;
    gap: 8px;
}

.section-title:first-of-type {
    margin-top: 16px;
}

/* 検索結果セクション */
.search-results-section {
    margin-top: 28px;
}

.search-results-section .section-title:first-of-type {
    margin-top: 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .analysis-grid {
        grid-template-columns: 1fr;
    }

    .analysis-card.full-width {
        grid-column: 1;
    }

    .search-result-item {
        flex-direction: column;
        gap: 8px;
    }

    .result-number {
        align-self: flex-start;
    }
}

/* フッター */
footer {
    text-align: center;
    padding: 30px 20px;
    color: #6c757d;
    font-size: 0.85rem;
    border-top: 1px solid #e9ecef;
}

footer p {
    margin-bottom: 8px;
}

footer a {
    color: #3498db;
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

.brave-usage {
    font-size: 0.75rem;
    color: #adb5bd;
    margin-top: 4px;
    margin-bottom: 0 !important;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .search-fields {
        grid-template-columns: 1fr;
    }

    .search-actions {
        flex-direction: column;
        gap: 12px;
    }

    .search-button,
    .clear-search-button {
        width: 100%;
        flex: none;
    }

    .results-grid {
        grid-template-columns: 1fr;
    }

    .history-header {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .modal-content {
        padding: 20px;
    }

    .modal-body .detail-row {
        flex-direction: column;
        gap: 5px;
    }

    .modal-body .detail-label {
        width: 100%;
    }

    .category-select {
        width: 100%;
    }

    .status-buttons,
    .sort-buttons {
        flex-direction: column;
    }

    .status-btn,
    .sort-btn {
        width: 100%;
        text-align: center;
    }
}

/* 商品画像セクション */
.product-image-section {
    margin-bottom: 20px;
    text-align: center;
}

.product-image-container {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 15px;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.product-main-image {
    max-width: 200px;
    max-height: 200px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    object-fit: contain;
}

.image-source {
    font-size: 0.75rem;
    color: #888;
    margin-top: 8px;
}

.image-loading {
    color: #666;
    font-size: 0.9rem;
}

.no-image {
    color: #999;
    font-size: 0.9rem;
    padding: 20px;
}

/* 商品カードヘッダー（画像+商品名） */
.product-card-header {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}

.product-list-image {
    flex-shrink: 0;
    width: 70px;
    height: 70px;
    background: #f8f9fa;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.product-list-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.product-list-image .image-placeholder {
    color: #999;
    font-size: 0.7rem;
    text-align: center;
}

.product-list-image .no-img {
    color: #ccc;
    font-size: 1.2rem;
    text-align: center;
    font-weight: bold;
}

/* ポップアップ内の画像なしアイコン */
.no-image .no-img-icon {
    color: #ccc;
    font-size: 2rem;
    font-weight: bold;
}

.product-header-info {
    flex: 1;
    min-width: 0;
}

.product-header-info .product-id {
    font-size: 0.75rem;
    color: #999;
    margin-bottom: 4px;
}

.product-header-info .product-name {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    line-height: 1.3;
}

@media (max-width: 600px) {
    .product-card-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .product-list-image {
        width: 60px;
        height: 60px;
    }
}
