/* 統合商品検索プラグイン - スタイル */

/* リセット */
.unified-search-container * {
    box-sizing: border-box;
}

.unified-search-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.5;
    color: #212529;
}

/* 検索フォーム */
.unified-search-form {
    background: #f8f9fa;
    padding: 1.5rem;
    border-radius: 0.5rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.search-input-group {
    display: grid;
    grid-template-columns: 2fr 1fr auto;
    gap: 0.75rem;
    align-items: center;
}

.search-input-group input[type="text"],
.search-input-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.375rem;
    font-size: 1rem;
    background: white;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.search-input-group input[type="text"]:focus,
.search-input-group select:focus {
    border-color: #007bff;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(0, 123, 255, 0.25);
}

.search-input-group select {
    cursor: pointer;
    appearance: none;
    background-image: url('data:image/svg+xml;charset=UTF-8,%3csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"%3e%3cpath fill="none" stroke="%23343a40" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M2 5l6 6 6-6"/%3e%3c/svg%3e');
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    padding-right: 2.5rem;
}

.search-input-group button {
    padding: 0.75rem 1.5rem;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 0.375rem;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.search-input-group button:hover {
    background: #0056b3;
}

.search-input-group button:active {
    background: #004085;
}

/* サイト選択チェックボックス */
.unified-site-selector {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1rem;
    padding: 1rem;
    background: white;
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
}

.unified-site-label {
    font-weight: 600;
    color: #495057;
    font-size: 0.875rem;
    margin-right: 0.5rem;
}

.unified-site-checkbox {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    transition: background 0.2s ease;
}

.unified-site-checkbox:hover {
    background: #f8f9fa;
}

.unified-site-checkbox input[type="checkbox"] {
    width: 1.125rem;
    height: 1.125rem;
    cursor: pointer;
}

.unified-site-checkbox .site-name {
    font-size: 0.875rem;
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.site-amazon {
    color: #FF9900;
    background: #fff3e0;
}

.site-rakuten {
    color: #BF0000;
    background: #ffebee;
}

.site-yahoo {
    color: #FF0033;
    background: #fce4ec;
}

.site-dmm {
    color: #0066CC;
    background: #e3f2fd;
}

/* デバッグメッセージ(管理者のみ) */
.unified-debug {
    background: #fff3cd;
    border: 1px solid #ffc107;
    color: #856404;
    padding: 1rem;
    border-radius: 0.375rem;
    margin-bottom: 1rem;
}

.unified-debug p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
}

/* 検索結果情報 */
.unified-results-info {
    background: #fff;
    border-left: 4px solid #007bff;
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    border-radius: 0.375rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.unified-results-info p {
    margin: 0.25rem 0;
    font-size: 0.95rem;
}

/* 検索結果なし */
.unified-no-results {
    text-align: center;
    padding: 3rem;
    color: #6c757d;
    font-size: 1rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
}

/* 商品リスト - 縦並び */
.unified-products-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* 商品カード - 横並びレイアウト */
.unified-product-card {
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    padding: 1.25rem;
    padding-top: 2.5rem; /* バッジ用のスペースを確保 */
    display: flex;
    gap: 1.5rem;
    transition: box-shadow 0.3s ease, transform 0.2s ease;
    position: relative;
}

.unified-product-card:hover {
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    transform: translateY(-2px);
}

/* サイトバッジ(カードの上部に表示) */
.unified-site-badge-top {
    position: absolute;
    top: 0.75rem;
    left: 0.75rem;
    padding: 0.35rem 0.65rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: white;
    z-index: 10;
}

/* 各サイトの背景色 */
.unified-site-badge-top.site-badge-amazon {
    background: #FF9900;
}

.unified-site-badge-top.site-badge-楽天市場 {
    background: #BF0000;
}

.unified-site-badge-top.site-badge-yahooショッピング {
    background: #FF0033;
}

.unified-site-badge-top.site-badge-dmmcom {
    background: #0066CC;
}

/* 左側: 商品画像 */
.unified-product-left {
    flex-shrink: 0;
    width: 200px;
    margin-top: 0.5rem; /* 画像を下げてバッジとの重なりを防ぐ */
}

.unified-product-left a {
    display: block;
    text-decoration: none;
}

.unified-product-image {
    width: 200px;
    height: 200px;
    object-fit: contain;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
    display: block;
}

.unified-no-image {
    width: 200px;
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e9ecef;
    color: #6c757d;
    font-size: 0.875rem;
    border: 1px solid #dee2e6;
    border-radius: 0.375rem;
}

/* 右側: 商品情報 */
.unified-product-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* 商品説明 */
.unified-description {
    font-size: 0.7rem;
    color: #dc3545;
    font-weight: 600;
    margin: 0;
    line-height: 1.3;
}

/* 商品名 */
.unified-name {
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
    font-weight: 700;
}

.unified-name a {
    color: #212529;
    text-decoration: none;
    transition: color 0.15s ease-in-out;
}

.unified-name a:hover {
    color: #007bff;
}

/* ショップ名 */
.unified-shop {
    font-size: 0.7rem;
    color: #6c757d;
    margin: 0;
}

/* 価格セクション */
.unified-details {
    margin-top: 0.25rem;
}

.unified-price-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-bottom: 0.5rem;
}

.unified-price {
    font-size: 1.125rem;
    font-weight: 700;
    color: #dc3545;
}

.unified-price-unknown {
    font-size: 0.875rem;
    color: #6c757d;
}

/* バッジ */
.unified-badge {
    background: #e9ecef;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    color: #495057;
    font-size: 0.7rem;
    font-weight: 500;
    display: inline-block;
}

/* レビューとポイント */
.unified-extra {
    display: flex;
    gap: 0.75rem;
    font-size: 0.8rem;
    align-items: center;
    flex-wrap: wrap;
}

.unified-review {
    color: #ffc107;
    font-weight: 600;
}

.unified-point {
    background: #fd7e14;
    color: white;
    padding: 0.2rem 0.4rem;
    border-radius: 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    display: inline-block;
}

/* 商品リンクボタン */
.unified-button {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: center;
    align-self: flex-start;
    transition: background 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.unified-button:hover {
    background: #0056b3;
    color: white;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
}

.unified-button:active {
    background: #004085;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .unified-search-container {
        padding: 0.75rem;
    }
    
    .unified-search-form {
        padding: 1rem;
    }
    
    .search-input-group {
        grid-template-columns: 1fr;
    }
    
    .unified-product-card {
        flex-direction: column;
        align-items: center;
        padding: 1rem;
        padding-top: 2.75rem; /* スマホでもバッジ用スペースを確保 */
    }
    
    .unified-product-left {
        width: 100%;
        max-width: 300px;
        margin-top: 0; /* スマホ表示では上マージン不要 */
    }
    
    .unified-product-image,
    .unified-no-image {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
        max-width: 300px;
    }
    
    .unified-product-right {
        width: 100%;
    }
    
    .unified-site-badge {
        position: static;
        display: inline-block;
        margin-bottom: 0.5rem;
    }
    
    .unified-description {
        padding-right: 0;
    }
    
    .unified-name {
        font-size: 0.95rem;
    }
    
    .unified-price {
        font-size: 1.25rem;
    }
    
    .unified-button {
        width: 100%;
    }
}

/* タブレット対応 */
@media (min-width: 769px) and (max-width: 1024px) {
    .search-input-group {
        grid-template-columns: 1fr 1fr;
    }
    
    .search-input-group button {
        grid-column: span 2;
    }
}

/* クレジット表示 */
.unified-credits {
    margin-top: 3rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 0.5rem;
    border-top: 2px solid #dee2e6;
}

.unified-credit-title {
    font-size: 0.875rem;
    color: #6c757d;
    margin: 0 0 0.75rem 0;
    font-weight: 600;
}

.unified-credit-links {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.unified-credit-item {
    color: #0066c0;
    text-decoration: none;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
}

.unified-credit-item:hover {
    text-decoration: underline;
}

.unified-credit-item img {
    display: block;
}

/* 人気の検索キーワード */
.unified-popular-keywords {
    margin-top: 3rem;
    padding: 2rem;
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
}

.unified-popular-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #212529;
    margin: 0 0 1rem 0;
}

.unified-keyword-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.unified-keyword-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.5rem 0.75rem;
    background: #e9ecef;
    color: #495057;
    text-decoration: none;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.unified-keyword-tag:hover {
    background: #007bff;
    color: white;
    border-color: #007bff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.2);
}

.unified-keyword-count {
    font-size: 0.75rem;
    opacity: 0.7;
}

.site-dmm {
    color: #0066CC;
    background: #e3f2fd;
}

.site-vc {
    color: #009900;
    background: #e8f5e9;
}

.site-dmm {
    color: #0066CC;
    background: #e3f2fd;
}

.site-vc {
    color: #009900;
    background: #e8f5e9;
}

.site-ls {
    color: #BF0000;
    background: #ffebee;
}

/* アクセストレード用スタイルを追加 */

/* サイト選択チェックボックス - アクセストレード */
.site-at {
    color: #0066cc;
    background: #e3f2fd;
}

/* サイトバッジ - アクセストレード */
.unified-site-badge-top.site-badge-アクセストレード {
    background: #0066cc;
}