/* ==========================================================================
   1. 変数定義 & 基本設定
   ========================================================================== */
:root {
    --primary-color: #007bff;   /* 信頼のブルー */
    --accent-color: #ff9800;    /* 査定ボタン等のオレンジ */
    --price-color: #d32f2f;     /* 価格強調用レッド */
    --line-color: #06C755;      /* LINEグリーン */
    --text-main: #333;
    --text-muted: #666;
    --bg-light: #f8f9fa;
    --white: #ffffff;
}

* {
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans JP', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    margin: 0;
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 15px;
}

img {
    max-width: 100%;
    height: auto;
    vertical-align: bottom;
}

/* ==========================================================================
   2. ヘッダー & ナビゲーション（ハンバーガーメニュー含む）
   ========================================================================== */
.main-header {
    background: var(--white);
    padding: 3px 0;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo img {
    max-height: 60px;
    height: auto;
}

/* ナビゲーション共通 */
.main-nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.main-nav li {
    margin-left: 20px;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-main);
    font-weight: bold;
    font-size: 15px;
    transition: color 0.3s;
}

.main-nav a:hover {
    color: var(--primary-color);
}

.nav-btn {
    background: var(--primary-color);
    color: var(--white) !important;
    padding: 8px 18px;
    border-radius: 25px;
}

/* ハンバーガーアイコン（スマホ用） */
.menu-checkbox { display: none; }
.hamburger-icon {
    display: none;
    cursor: pointer;
    width: 30px;
    height: 24px;
    position: relative;
    z-index: 1100;
}

.hamburger-icon span {
    display: block;
    width: 100%;
    height: 3px;
    background: var(--text-main);
    position: absolute;
    transition: 0.3s;
}

.hamburger-icon span:nth-child(1) { top: 0; }
.hamburger-icon span:nth-child(2) { top: 10px; }
.hamburger-icon span:nth-child(3) { top: 20px; }

/* ==========================================================================
   3. 検索バー（コンパクト版）
   ========================================================================== */
.search-bar-compact {
    background: #0056b3;
    padding: 15px 0;
    margin-bottom: 20px;
}

.compact-form {
    display: flex;
    max-width: 800px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.select-wrapper select {
    height: 50px;
    padding: 0 15px;
    border: none;
    background-color: #f1f3f5;
    border-right: 1px solid #ddd;
    font-size: 14px;
    outline: none;
}

.input-wrapper {
    flex: 1;
    display: flex;
}

.input-wrapper input {
    flex: 1;
    border: none;
    padding: 0 15px;
    font-size: 16px;
    outline: none;
}

.btn-search-icon {
    background: #ffcc00;
    border: none;
    padding: 0 25px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.3s;
}

.btn-search-icon:hover {
    background: #e6b800;
}

.search-title {
  color: white;
  font-weight: bold;
  text-align: center;
}

/* ==========================================================================
   4. 検索結果・商品カード
   ========================================================================== */
.result-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.product-card {
    background: var(--white);
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.2s;
}

.product-card:hover {
    transform: translateY(-5px);
}

.product-info {
    padding: 15px;
    flex-grow: 1;
}

.price-label {
    margin: 3px;
}
.label-cd {
    background: var(--primary-color);
    color: var(--white);
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.jan-code {
    font-size: 11px;
    color: var(--text-muted);
    margin: 8px 0 4px;
}

.product-name {
    font-size: 14px;
    font-weight: bold;
    line-height: 1.4;
    margin-bottom: 12px;
    height: 2.8em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.price-box {
    background: #fff5f5;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
}

.price {
    font-size: 20px;
    color: var(--price-color);
    font-weight: bold;
    margin: 0;
}

.update-date {
    font-size: 11px;
    color: #999;
    text-align: right;
    margin: 0px;
}

.btn-sell {
    display: block;
    background: #444;
    color: var(--white);
    text-align: center;
    padding: 12px;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
}

/* ==========================================================================
   5. 査定フォーム専用
   ========================================================================== */
.assess-form-section { max-width: 900px; margin: 0 auto; }
.form-group-card {
    background: var(--white);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 25px;
}

.input-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field label { display: block; font-weight: bold; font-size: 0.9rem; margin-bottom: 8px; }
.field input, .field select, .field textarea {
    width: 100%; padding: 12px; border: 1px solid #ddd; border-radius: 6px; font-size: 1rem;
}

.btn-submit {
    background: var(--accent-color);
    color: var(--white);
    border: none;
    padding: 18px 50px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 50px;
    cursor: pointer;
    width: 100%;
}

/* ==========================================================================
   6. フッター
   ========================================================================== */
.main-footer {
    background: #333;
    color: #ccc;
    padding: 40px 0 20px;
    margin-top: 50px;
}

.footer-links ul {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    list-style: none;
    padding: 0;
    margin-bottom: 20px;
}

.footer-links li { margin: 0 15px 10px; }
.footer-links a { color: #ccc; text-decoration: none; font-size: 14px; }
.footer-links a:hover { color: var(--white); }
.footer-copy { text-align: center; font-size: 11px; border-top: 1px solid #444; padding-top: 20px; }

/* ==========================================================================
   7. レスポンシブ対応 (Mobile)
   ========================================================================== */
@media (max-width: 768px) {
    /* ヘッダー・メニュー */
    .hamburger-icon { display: block; margin-left: auto; }
    .menu-checkbox:checked + .hamburger-icon span:nth-child(1) { transform: translateY(10px) rotate(45deg); }
    .menu-checkbox:checked + .hamburger-icon span:nth-child(2) { opacity: 0; }
    .menu-checkbox:checked + .hamburger-icon span:nth-child(3) { transform: translateY(-10px) rotate(-45deg); }

    .main-nav {
        position: fixed; top: 0; right: -100%; width: 80%; height: 100%;
        background: var(--white); box-shadow: -5px 0 15px rgba(0,0,0,0.1);
        transition: 0.4s; padding-top: 80px;
    }
    .menu-checkbox:checked ~ .main-nav { right: 0; }
    .main-nav ul { flex-direction: column; }
    .main-nav li { margin: 15px 0; width: 100%; text-align: center; }

    /* 検索バー */
    .compact-form { flex-direction: column; background: transparent; box-shadow: none; gap: 10px; }
    .select-wrapper select, .input-wrapper input, .btn-search-icon { 
        width: 100%; border-radius: 4px; border: 1px solid #ddd; height: 46px;
    }

    /* グリッド */
    .result-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
    .input-grid { grid-template-columns: 1fr; }
}

/* ==========================================================================
   追加・修正：スマホ用固定CTA & 検索窓レイアウト
   ========================================================================== */

/* --- 共通設定 (メディアクエリの外に記述) --- */
.sp-fixed-cta {
    display: none; /* 基本は非表示（PC版） */
}

@media (max-width: 768px) {
    /* 1. スマホ固定フッターメニュー (復活) */
    .sp-fixed-cta {
        display: flex;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 70px;
        z-index: 2000; /* 最前面に */
        box-shadow: 0 -2px 10px rgba(0,0,0,0.15);
    }
    
    .cta-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #fff;
        font-size: 0.75rem;
        font-weight: bold;
    }
    
    .cta-tel { background: var(--accent-color); }
    .cta-line { background: var(--line-color); }
    .cta-mail { background: #444; }
    
    .cta-item i { font-size: 1.4rem; margin-bottom: 4px; }
    
    /* 固定メニュー分、bodyの下に余白を作る */
    body { padding-bottom: 70px !important; }

    /* 2. 検索窓のレイアウト修正（要素が重ならないように） */
    .search-bar-compact {
        padding: 10px 0;
    }

    .compact-form {
        display: flex;
        flex-direction: column; /* 縦に並べる */
        background: transparent !important; /* 背景を透明にして個別に枠線を持たせる */
        box-shadow: none !important;
        gap: 8px;
    }

    .select-wrapper, .input-wrapper {
        width: 100%;
    }

    .select-wrapper select {
        width: 100%;
        height: 48px;
        border-radius: 4px !important;
        border: 1px solid #ddd !important;
        background-color: #fff;
    }

    .input-wrapper {
        display: flex; /* 入力欄と虫眼鏡ボタンは横に並べる */
        background: #fff;
        border-radius: 4px;
        border: 1px solid #ddd;
        overflow: hidden;
    }

    .input-wrapper input {
        height: 48px;
        padding: 0 12px;
        font-size: 16px; /* ズーム防止 */
    }

    .btn-search-icon {
        height: 48px;
        width: 60px; /* スマホではアイコンのみにしてスッキリさせる */
        min-width: 60px;
        padding: 0;
    }
    
    .btn-search-icon span {
        display: none; /* 「検索」の文字を消してアイコンだけに */
    }
}

/* コンテンツページ用：情報テーブル */
.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 10px 0;
}

.info-table th {
    width: 30%;
    background: #f8f9fa;
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    vertical-align: top;
}

.info-table td {
    padding: 15px;
    border-bottom: 1px solid #eee;
    font-size: 0.95rem;
    line-height: 1.6;
}

/* スマホでは縦並びにする */
@media (max-width: 600px) {
    .info-table th, .info-table td {
        display: block;
        width: 100%;
        border-bottom: none;
    }
    .info-table th {
        background: transparent;
        color: var(--primary-color);
        padding-bottom: 5px;
        font-size: 0.85rem;
    }
    .info-table td {
        padding-top: 5px;
        padding-bottom: 15px;
        border-bottom: 1px solid #f0f0f0;
    }
}

/* ==========================================================================
   SNSリンク用スタイル
   ========================================================================== */
.footer-social {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 25px;
}

.social-icon {
    font-size: 24px;
    color: #ccc;
    transition: transform 0.3s, color 0.3s;
    text-decoration: none;
}

.social-icon:hover {
    transform: translateY(-3px);
}

/* X (Twitter) ブランドカラー */
.x-twitter:hover {
    color: #000000; /* PCでのホバー時 */
}

/* Instagram ブランドカラー */
.instagram:hover {
    color: #E1306C;
}

/* レイアウト補助 */
.border-top-primary { border-top: 5px solid #007bff !important; }
.border-top-success { border-top: 5px solid #28a745 !important; }
.gap-2 { gap: 0.5rem; }

/* 買取ステップのデザイン */
.step-list {
    margin-top: 20px;
}
.step-item {
    display: flex;
    margin-bottom: 15px;
    align-items: flex-start;
}
.step-num {
    background: #007bff;
    color: #fff;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
    margin-right: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}
.step-content strong {
    display: block;
    font-size: 1.05rem;
    color: #333;
}
.step-content p {
    font-size: 0.9rem;
    color: #666;
    margin-bottom: 0;
    line-height: 1.4;
}

/* テーブルの装飾 */
.custom-table th {
    background-color: #f8f9fa;
    width: 30%;
    white-space: nowrap;
}

/* Q&Aの装飾 */
.qa-container {
    padding: 10px 0;
}
.qa-item {
    margin-bottom: 25px;
}
.qa-q {
    font-weight: bold;
    color: #d32f2f;
    font-size: 1.1rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
}
.q-icon {
    background: #d32f2f;
    color: #fff;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 14px;
}
.qa-a {
    padding-left: 34px;
    position: relative;
    color: #444;
    line-height: 1.6;
}
.qa-a::before {
    content: "A.";
    position: absolute;
    left: 0;
    font-weight: bold;
    color: #333;
}

/* ボタン（Bootstrap風の基本設定がない場合用） */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: 0.3s;
}
.btn-primary { background: #007bff; color: #fff; border: 1px solid #007bff; }
.btn-success { background: #28a745; color: #fff; border: 1px solid #28a745; }
.btn-outline-dark { background: transparent; color: #333; border: 1px solid #333; }
.btn:hover { opacity: 0.8; color: #fff; }


/* アイコンサークル */
.icon-circle {
    width: 70px;
    height: 70px;
    margin: 0 auto;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 各種背景色 */
.bg-primary-light { background-color: #e7f3ff; }
.bg-success-light { background-color: #e9f7ef; }
.bg-warning-light { background-color: #fff8e6; }

/* ジャンルアイコン */
.genre-section i {
    font-size: 1.5rem;
}

/* 影の微調整 */
.shadow-xs {
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

/* タイトル装飾 */
.display-title {
    font-weight: 700;
    position: relative;
    padding-bottom: 15px;
}
.display-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: #007bff;
}


/* バーコードボタンの配置（input-wrapper内） */
.input-wrapper {
    display: flex;
    align-items: center;
}

.btn-barcode {
    position: absolute;
    right: 80px; /* 検索ボタンの左側に配置 */
    background: transparent;
    border: none;
    color: #666;
    font-size: 1.4rem;
    padding: 5px;
    cursor: pointer;
    z-index: 5;
}

.btn-barcode:hover {
    color: #007bff;
}

/* スマホでの入力欄の余白調整 */
#search-input {
    padding-right: 45px; /* アイコンと重ならないように */
}

/* 検索フォーム全体を1行にする */
.search-flex-row {
    display: flex;
    max-width: 600px; /* PCでの最大幅 */
    margin: 0 auto;
    border: 2px solid #007bff; /* 全体の枠線 */
    border-radius: 30px; /* 角丸でモダンに */
    overflow: hidden; /* 子要素のはみ出しをカット */
    background: #fff;
}

/* 左側のセレクト部分 */
.select-part {
    width: 100px; /* スマホならこれくらいが適当 */
    flex-shrink: 0;
    border-right: 1px solid #ddd;
    background: #f8f9fa;
}

.select-part select {
    width: 100%;
    height: 45px;
    border: none;
    background: transparent;
    padding: 0 5px 0 15px;
    font-size: 0.85rem;
    outline: none;
    cursor: pointer;
}

/* 右側の入力・ボタン部分 */
.input-part {
    flex-grow: 1;
    display: flex;
    align-items: center;
    position: relative;
}

.input-part input {
    flex-grow: 1;
    height: 45px;
    border: none;
    padding: 0 80px 0 10px; /* 右側のボタン2つ分の余白 */
    font-size: 1rem;
    outline: none;
}

/* バーコードボタン */
.btn-scan {
    position: absolute;
    right: 45px; /* 検索ボタンの隣 */
    background: none;
    border: none;
    color: #666;
    font-size: 1.2rem;
    padding: 10px;
    cursor: pointer;
}

/* 検索実行ボタン */
.btn-submit-search {
    width: 45px;
    height: 45px;
    background: #007bff;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: 0.2s;
}

.btn-submit-search:hover {
    background: #0056b3;
}

/* スマホ向けの微調整 */
@media (max-width: 480px) {
    .select-part {
        width: 85px; /* スマホではジャンル欄を少し狭く */
    }
    .select-part select {
        padding-left: 10px;
        font-size: 0.8rem;
    }
}
