@import url('legal.css');
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;700&display=swap');

/* ===== フッター ===== */
footer {
    background-color: #343a40;
    /* ダークグレーの背景 */
    color: #fff;
    padding: 30px 0;
    text-align: center;
    /* 中央寄せ */
    margin-top: 50px;
}

footer p {
    margin: 0;
    font-size: 0.85rem;
    color: #adb5bd;
}

footer p .operated {
    color: #adb5bd;
    text-decoration: none;
}

footer .footer-links {
    margin-bottom: 15px;
}

footer .footer-links a {
    color: #f8f9fa;
    text-decoration: none;
    margin: 0 10px;
    transition: color 0.2s;
}

footer .footer-links a:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

:root {
    /* ロゴ「おさまる」に合わせた配色（緑・オレンジ・イエロー） */
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --accent-color: #FF9800;
    --accent-dark: #F57C00;
    --accent-yellow: #FFC107;
    --text-color: #4a4a4a;
    --text-muted: #7f8c8d;
    --bg-color: #f8faf6;
    --card-bg: #ffffff;
    --border-color: #e0e8dc;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(76, 175, 80, 0.12);
    --shadow-lg: 0 8px 24px rgba(76, 175, 80, 0.15);
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 20px;
}

body {
    font-family: 'Noto Sans JP', "Helvetica Neue", Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
}

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

main.container {
    padding-top: 50px;
}

@media (max-width: 768px) {
    main.container {
        padding-top: 0px;
    }
}

/* ===== ヘッダー ===== */
header {
    background: linear-gradient(to bottom, #ffffff, #f8faf6);
    box-shadow: none;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 160px;
    display: flex;
    align-items: center;
    transition: min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled {
    min-height: 64px;
    padding: 10px 0;
    border-bottom-color: var(--primary-color);
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.2);
}

.header-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 112px;
    transition: min-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled .header-logo {
    min-height: 44px;
}

.header-logo img {
    height: 112px;
    width: auto;
    max-width: min(400px, 92vw);
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.08));
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1), max-width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

header.scrolled .header-logo img {
    height: 80px;
    max-width: min(200px, 70vw);
}

/* 元あった h1 スタイルは画像ロゴ化のため削除想定 */

/* ===== 検索パネル ===== */
.search-panel {
    background: var(--card-bg);
    padding: 30px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 30px;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
    overflow-x: hidden;
    /* 子要素のはみ出し対策 */
}

@media (max-width: 768px) {
    /* SP: ヘッダーをコンパクトにし、追従なし。ロゴの拡大縮小は行わない */
    header {
        position: relative;
        min-height: 100px;
        height: auto;
        padding: 0;
    }

    header.scrolled {
        min-height: 100px;
        padding: 0;
        border-bottom-color: transparent;
        box-shadow: none;
    }

    .header-logo {
        min-height: 68px;
    }

    header.scrolled .header-logo {
        min-height: 68px;
    }

    .header-logo img {
        height: 68px;
        max-width: min(300px, 90vw);
    }

    header.scrolled .header-logo img {
        height: 68px;
        max-width: min(300px, 90vw);
    }

    /* SP: フッターをコンパクトに */
    footer {
        padding: 16px 0;
        margin-top: 30px;
    }

    footer .footer-links {
        margin-bottom: 8px;
    }

    footer .footer-links a {
        margin: 0 6px;
        font-size: 0.8rem;
    }

    footer p {
        font-size: 0.75rem;
    }

    .search-panel {
        padding: 20px 15px;
        overflow-y: visible;
        /* SPではパディングを狭める。プレビュー見切れ防止で縦ははみ出し許可 */
    }

    /* スペースプレビューが見切れないように */
    #space-search-content,
    .space-search-flex,
    .space-preview-col {
        overflow: visible;
    }

    .space-preview-col .visual-preview {
        overflow: visible;
        padding-bottom: 130px;
        margin-bottom: 20px;
    }

    .space-preview-col .shelf-outline {
        margin-bottom: 70px;
        max-width: 100%;
    }

    .space-preview-col .shelf-outline::before {
        bottom: -52px;
        left: 0;
        right: 0;
    }

    .space-preview-col .visual-legend {
        margin-top: 8px;
    }
}

.search-panel-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.search-icon {
    font-size: 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 0;
    line-height: 1;
    min-height: 1.4em;
    color: var(--primary-color);
}
.search-icon .fa {
    margin-right: 0;
    vertical-align: middle;
    display: block;
}
.section-title .fa {
    margin-right: 0.35em;
    color: var(--primary-color);
    opacity: 0.95;
}
#search-btn .fa {
    margin-right: 0.35em;
}
.disclaimer-message .fa {
    margin-right: 0.35em;
}

/* font awesome アイコンの色を変更 */
.fa-solid {
    color: var(--primary-color);
}
.fa-solid.fa-triangle-exclamation {
    color: #f00;
}
.fa-solid.fa-chevron-up {
    color: #fff;
}
.fa-solid.fa-circle-arrow-left {
    color: #0000008b;
}
.fa-solid.fa-magnifying-glass {
    color: #fff;
}

/* ビジュアルプレビュー */
.visual-preview {
    margin-top: 25px;
    padding: 24px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.shelf-outline {
    position: relative;
    margin: 30px auto 80px;
    /* 下のマージンをさらに拡大 */
    background: #f8fafc;
    width: 100%;
    max-width: 450px;
    height: 200px;
    display: flex;
    padding: 4px;
    /* ボックスと枠線の隙間 */
    box-sizing: border-box;
    align-items: stretch;
    justify-content: center;
    transition: all 0.2s ease;
}

.shelf-outline::before {
    content: attr(data-width);
    position: absolute;
    bottom: -55px;
    /* 正面ラベルよりさらに下に配置 */
    left: -50px;
    /* 横幅が極端に狭い場合の折り返しスペース確保 */
    right: -50px;
    font-size: 11px;
    line-height: 1.3;
    color: #64748b;
    text-align: center;
    white-space: pre-wrap;
    /* 改行を有効にする */
}

.shelf-outline::after {
    content: attr(data-front);
    position: absolute;
    font-size: 10px;
    font-weight: bold;
    color: var(--accent-color);
    background: white;
    padding: 1px 6px;
    border: 1px solid var(--accent-color);
    border-radius: 4px;
    z-index: 10;
    display: none;
    white-space: nowrap;
}

/* ビューごとのラベル位置 */
.shelf-outline.view-side::after {
    display: block;
    left: -35px;
    /* 左側に十分なスペースを確保 */
    top: 50%;
    transform: translateY(-50%) rotate(-90deg);
}

.shelf-outline.view-top::after {
    display: block;
    bottom: -18px;
    /* 枠線のすぐ下に配置 */
    left: 50%;
    transform: translateX(-50%);
}

.shelf-boxes {
    display: flex;
    width: 100%;
    height: 90%;
    gap: 4px;
}

.shelf-box {
    flex: 1;
    background: rgba(76, 175, 80, 0.1);
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: var(--primary-color);
    font-weight: 700;
    box-shadow: 2px 2px 0 rgba(56, 142, 60, 0.12);
}

.shelf-box .box-label {
    font-size: 8px;
    font-weight: 400;
    color: #94a3b8;
    margin-bottom: 2px;
}

/* ビュー切替ボタン */
.view-selector {
    display: flex;
    justify-content: center;
    gap: 4px;
    margin-bottom: 15px;
    background: #f1f5f9;
    padding: 3px;
    border-radius: 8px;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.view-btn {
    padding: 6px 12px;
    font-size: 11px;
    font-weight: 600;
    border: none;
    background: none;
    color: #64748b;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
}

.view-btn.active {
    background: var(--accent-color);
    color: white;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.2);
}

.view-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
}

.visual-legend {
    font-size: 10px;
    color: var(--text-muted);
}

/* フォームセクションの調整 */
.form-section {
    margin-bottom: 20px;
    padding-bottom: 18px;
    border-bottom: 1px solid #f0f0f0;
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 12px;
    padding-bottom: 0;
}

.section-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 10px;
}

.section-subtitle {
    font-size: 12px;
    color: #334155;
    margin: 8px 0 16px;
    padding: 8px 15px;
    background: linear-gradient(to right, rgba(231, 76, 60, 0.05), transparent);
    border-left: 4px solid var(--primary-color);
    line-height: 1.5;
    font-weight: 500;
}

.section-notice {
    font-size: 11.5px;
    color: #475569;
    background: #f1f5f9;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    margin: 0 0 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.section-notice::before {
    font-family: "Font Awesome 6 Free";
    font-weight: 900;
    content: "\f0eb";
    font-size: 14px;
}

.form-controls-row {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    align-items: center;
    margin: 8px 0 16px;
}

/* 改良版タブデザイン (セグメンタルコントロール風) */
.search-tabs {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 25px;
    gap: 4px;
}

.tab-btn {
    flex: 1;
    padding: 10px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    text-align: center;
}

.tab-btn:hover:not(.active) {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text-color);
}

/* スペース検索レイアウト */
.space-search-flex {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

.space-inputs-col {
    flex: 0 0 350px;
    /* 入力欄は固定幅気味に */
    min-width: 0;
}

.space-preview-col {
    flex: 1;
    /* プレビュー側を広くとる */
    min-width: 0;
}

/* 計算結果カード */
.calc-card {
    background: #f0f7ff;
    border: 1px solid #cce3ff;
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0, 102, 255, 0.05);
}

.calc-icon {
    font-size: 24px;
}

.calc-icon .fa-lightbulb {
    color: #F5C518;
}

.calc-header {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 4px;
}

.calc-dims {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-color);
}

.calc-val {
    color: #f12e5a;
    font-size: 18px;
}

@media (max-width: 900px) {
    .space-search-flex {
        flex-direction: column;
        gap: 20px;
    }

    .space-inputs-col,
    .space-preview-col {
        width: 100%;
        flex: none;
    }

    /* SPでカードをさらにコンパクトに */
    .calc-card {
        padding: 8px 12px;
        gap: 8px;
        margin-bottom: 10px !important;
    }

    .calc-icon {
        font-size: 14px;
    }

    .calc-header {
        font-size: 10px;
        margin-bottom: 2px;
    }

    .calc-dims {
        font-size: 12px;
        line-height: 1.3;
    }

    .calc-val {
        font-size: 14px;
    }
}

.visual-preview {
    padding: 24px;
    background: #fff;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    text-align: center;
}

.tab-btn.active {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.toggle-range,
.toggle-exact {
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    font-weight: 500;
    transition: color 0.2s;
}

.toggle-range:hover,
.toggle-exact:hover {
    color: var(--primary-color);
}

.btn-swap {
    background: #f0f4f8;
    border: 1px solid #d1d9e6;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 11px;
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-swap:hover {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.section-title .hint {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-muted);
}

/* ===== サイト選択 ===== */
.site-selector {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.site-chip {
    position: relative;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 16px;
    border: 2px solid var(--border-color);
    border-radius: 24px;
    transition: all 0.2s ease;
    background: var(--card-bg);
}

/* チェックボックスは視覚的に隠すがクリック可能に（display:none だとラベルクリックで外れない環境があるため） */
.site-chip input[type="checkbox"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    opacity: 0;
}

.site-chip.active,
.site-chip:has(input:checked) {
    border-color: var(--primary-color);
    background: #e8f5e9;
    color: var(--primary-color);
}

.site-chip:hover:not(.disabled) {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.site-chip.disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.coming-soon {
    font-size: 10px;
    color: #999;
    font-weight: 400;
    background: #f0f0f0;
    padding: 2px 6px;
    border-radius: 4px;
}

/* ===== サイズ入力 ===== */
/* 個数入力の拡張 */
.count-inputs {
    gap: 12px !important;
}

.count-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.count-unit {
    font-size: 10px;
    color: var(--text-muted);
    font-weight: 700;
}

.count-field input {
    width: 45px !important;
    padding: 6px 4px !important;
}

.size-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.size-row,
.price-row {
    display: flex;
    align-items: center;
    gap: 8px;
}

.size-label {
    font-weight: 700;
    min-width: 36px;
    text-align: right;
    font-size: 14px;
}

.range-group {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.range-sep {
    color: var(--text-muted);
    font-size: 14px;
}

/* ===== スクロールトップボタン ===== */
.scroll-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 24px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s, visibility 0.3s, transform 0.2s, background-color 0.2s;
    pointer-events: none;
    /* 非表示時はクリック不可 */
}

.scroll-to-top.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.scroll-to-top:hover {
    background-color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.3);
}

.scroll-to-top:active {
    transform: translateY(0);
}

@media (max-width: 768px) {
    .scroll-to-top {
        bottom: 100px;
        right: 20px;
        width: 44px;
        height: 44px;
        font-size: 20px;
    }
}

.unit {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 500;
}

.range-group input,
.price-row input {
    padding: 10px 8px;
    font-size: 14px;
    width: 70px;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #fafafa;
}

@media (max-width: 768px) {
    .range-group input,
    .price-row input {
        font-size: 16px;
    }
}

.price-row input {
    width: 100px;
}

.range-group input:focus,
.price-row input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.2);
    background: #fff;
}

@media (max-width: 768px) {
    .range-group input,
    .price-row input {
        width: 70px;
    }
}

.terms-agreement a {
    font-weight: 500;
}

/* ===== 検索ボタン ===== */
#search-btn {
    display: block;
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform 0.15s, box-shadow 0.15s;
    margin-top: 8px;
    letter-spacing: 1px;
}

#search-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.35);
}

#search-btn:active {
    transform: translateY(0);
}

/* ===== ローディング ===== */
.loading-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 20px;
    font-size: 14px;
    color: var(--text-muted);
}

.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* メインローディング表示 */
.loading-indicator {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 20px 40px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.loading-indicator .spinner {
    width: 40px;
    height: 40px;
}

.loading-indicator span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-color);
}

/* 検索ボタンのローディング状態 */
#search-btn.is-searching {
    background: #95a5a6 !important;
    cursor: not-allowed;
    opacity: 0.8;
}

#search-btn.is-searching:hover {
    transform: none;
    box-shadow: none;
}

/* ===== 統計情報 ===== */
.result-stats {
    margin-bottom: 20px;
    font-size: 15px;
    color: var(--text-color);
    font-weight: 500;
    background: var(--card-bg);
    padding: 12px 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: none;
    /* 初期状態は非表示 */
}

.result-stats b {
    color: var(--primary-color);
    font-size: 18px;
    margin: 0 4px;
}

/* ===== 検索結果 (サイト別スライダー) ===== */
.site-section {
    margin-bottom: 40px;
    background: var(--card-bg);
    padding: 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}

.site-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.site-section-title {
    font-weight: 600;
    font-size: 1rem;
}

.site-logo-badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
}

.site-logo-badge.rakuten {
    background: #bf0000;
}

.site-logo-badge.yahoo {
    background: #ff0033;
}

.site-logo-badge.amazon {
    background: #ff9900;
}

/* 検索結果: 縦グリッド（4行5列→スクロールで20件ずつ追加） */
.results-section .results-grid-wrapper {
    position: relative;
    min-height: 120px;
}
.results-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 20px;
    padding: 4px 0;
}
@media (max-width: 1100px) {
    .results-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}
@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
@media (max-width: 600px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
.results-grid .item-card {
    min-width: 0;
}
.results-grid-wrapper.is-loading {
    pointer-events: none;
    opacity: 0.85;
}
.results-loading-overlay {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
}
.load-more-sentinel {
    height: 1px;
    width: 100%;
    pointer-events: none;
    visibility: hidden;
}

/* 追加読み込み時のメッセージ（結果エリアの下で表示） */
.load-more-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px;
    color: var(--text-muted, #64748b);
    font-size: 0.95rem;
}
.load-more-indicator .spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* カード共通 */
.item-card {
    min-width: 180px;
    background: var(--card-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s;
}

.item-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.item-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.item-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.item-info {
    padding: 12px;
}

/* カード内のECサイト表示バッジ */
.item-card-site {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-bottom: 6px;
    color: #fff;
}
.item-card-site.rakuten { background: #bf0000; }
.item-card-site.yahoo { background: #ff0033; }
.item-card-site.amazon { background: #ff9900; }

.item-title {
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 6px;
    height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    color: var(--text-color);
    line-height: 1.4;
}

.item-price {
    font-size: 15px;
    font-weight: 700;
    color: #bf0000;
    margin: 0 0 4px;
}

.shop-name {
    font-size: 10px;
    color: var(--text-muted);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== エラー ===== */
.error {
    color: #e74c3c;
    text-align: center;
    font-size: 14px;
}

#validation-error {
    background: #fef0ef;
    border: 1px solid #f5c6cb;
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    margin-bottom: 12px;
    text-align: left;
}

/* ===== ページネーション ===== */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin-top: 2rem;
    padding: 20px 0;
}

.page-btn {
    padding: 8px 14px;
    font-size: 14px;
    font-weight: 500;
    border: 2px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
    color: var(--text-color);
    cursor: pointer;
    transition: all 0.2s;
}

.page-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    box-shadow: var(--shadow-sm);
}

.page-btn.active {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
}

.page-ellipsis {
    padding: 8px 4px;
    color: var(--text-muted);
    font-size: 14px;
}