body { 
    font-family: 'Noto Sans JP', sans-serif; 
}

/* 2015年風の少し立体的なボタンなどの補助スタイル */
.btn-gradient {
    background-image: linear-gradient(to bottom, #fb923c, #f97316);
}

.btn-gradient:hover {
    background-image: linear-gradient(to bottom, #f97316, #ea580c);
}

/* テーブルの縞模様 */
.table-stripe tr:nth-child(even) {
    background-color: #f9fafb;
}

/* 商品リスト - テーブル形式レイアウト */
.product-list {
    width: 100%;
}

.product-list .cf::after {
    content: "";
    display: table;
    clear: both;
}

.product-list ul#product-list {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    border: 1px solid #ddd;
    border-right: none;
    border-bottom: none;
}

.product-list ul#product-list li.search-item {
    box-sizing: border-box;
    border-right: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    margin: 0;
    padding: 0.8rem;
    background-color: #fff;
    height: auto;
}

/* レスポンシブ対応 */
/* スマホ: 2列 (50%) */
@media (max-width: 767px) {
    .product-list ul#product-list li.search-item {
        width: 50%;
    }
}

/* タブレット: 3列 (33.333%) */
@media (min-width: 768px) and (max-width: 1023px) {
    .product-list ul#product-list li.search-item {
        width: 33.333%;
    }
}

/* PC: 4列 (25%) */
@media (min-width: 1024px) {
    .product-list ul#product-list li.search-item {
        width: 25%;
    }
}

/* ホバー効果 */
.product-list ul#product-list li.search-item:hover {
    background-color: #fffcee;
    outline: 1px solid #fac600;
    outline-offset: -1px;
    z-index: 1;
    position: relative;
}

/* ========================================
   ガイドページ用スタイル
   ----------------------------------------
   責任: ご利用ガイド、会社概要、プライバシーポリシー、
         特定商取引法に基づく表記ページの共通スタイル
   依存: なし（独立したスタイル定義）
   ======================================== */

/* ガイドセクション - 各セクション間のマージン */
.guide-section {
    margin-bottom: 3rem;
}

/* ガイドセクション見出し - 青い下線付きの見出しスタイル */
.guide-section h3 {
    border-bottom: 2px solid #2563eb;
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    color: #1e3a8a;
    font-weight: bold;
    font-size: 1.125rem;
}

/* ガイドボックス - コンテンツを囲むボックススタイル */
.guide-box {
    background-color: #fff;
    border: 1px solid #e5e7eb;
    padding: 1.5rem;
    border-radius: 4px;
}

/* ========================================
   決済フロー進捗表示スタイル
   ----------------------------------------
   責任: カート、情報入力、確認、完了の各ステップを
         視覚的に表示するためのスタイル
   依存: なし（独立したスタイル定義）
   ======================================== */

/* 決済フローコンテナ - ステップを横並びに配置 */
.checkout-flow {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    position: relative;
    flex-wrap: wrap;
    gap: 1rem;
}

/* 決済フローの背景線（ステップ間を結ぶ線） */
.checkout-flow::after {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e7eb;
    z-index: 0;
}

/* 各ステップ - ステップ番号とラベルを表示 */
.flow-step {
    position: relative;
    z-index: 1;
    background: #f5f5f5;
    padding: 0 10px;
    text-align: center;
    color: #9ca3af;
    flex: 1;
    min-width: 100px;
}

/* アクティブなステップ - 現在のステップを強調表示 */
.flow-step.active {
    color: #2563eb;
    font-weight: bold;
}

/* ステップ番号の円 - 各ステップの番号を表示する円形の要素 */
.flow-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e5e7eb;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 5px;
    font-weight: bold;
    font-size: 0.875rem;
}

/* アクティブなステップの円 - 現在のステップの円を強調表示 */
.flow-step.active .flow-circle {
    background: #2563eb;
    color: #fff;
}

/* レスポンシブ対応 - スマホでは縦並びに変更 */
@media (max-width: 767px) {
    .checkout-flow {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .checkout-flow::after {
        display: none;
    }
    
    .flow-step {
        width: 100%;
        text-align: left;
        padding: 0.5rem;
        display: flex;
        align-items: center;
        gap: 0.5rem;
    }
    
    .flow-circle {
        margin: 0;
        flex-shrink: 0;
    }
}

/* ========================================
   検索バー・リアルタイム検索ドロップダウン
   ----------------------------------------
   責任: ヘッダー検索バーの下に表示する検索結果ドロップダウンの
         レイアウト・見た目・ホバー・スクロール
   依存: なし（既存の .search-item とは別の .search-result-item を使用）
   ======================================== */

/* 検索バーを包むラッパー（ドロップダウンを position: absolute で配置するため） */
.search-bar-wrapper {
    position: relative;
    width: 100%;
}

/* 検索結果ドロップダウン - 検索バーの直下に表示 */
.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 2px;
    max-height: 360px;
    overflow-y: auto;
    background: #fff;
    border: 2px solid #2563eb;
    border-top: none;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
    z-index: 1000;
    list-style: none;
    margin-left: 0;
    margin-right: 0;
    padding: 0;
}

/* 検索結果が0件のときのメッセージ */
.search-dropdown-empty {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

/* 各検索結果アイテム - クリック可能な1行 */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    text-decoration: none;
    color: inherit;
    cursor: pointer;
    transition: background-color 0.15s ease;
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item:hover {
    background-color: #eff6ff;
}

/* 検索結果内の商品画像 */
.search-result-item img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    flex-shrink: 0;
    border: 1px solid #e5e7eb;
}

/* 検索結果内のテキストブロック（商品名・価格） */
.search-result-item-content {
    flex: 1;
    min-width: 0;
}

.search-result-item-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #1e3a8a;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-item-price {
    font-size: 0.75rem;
    color: #dc2626;
    font-weight: bold;
    margin-top: 2px;
}

/* ========================================
   カード入力UI（fillin ページ・クレジット選択時）
   ----------------------------------------
   責任: カードプレビュー＋フォームのレイアウト、高級感（余白・タイポ・
         フォーカス・エラー・ボタン）。Card.js / Cleave.js と併用。
   依存: #stripe-card-wrapper, .card-input-section, .card-wrapper, .card-form-fields
   ======================================== */

/* レイアウト: スマホは縦並び（カード→フォーム）、PC は横並び（カード左・フォーム右） */
.card-input-section {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 0.5rem;
}

/* スマホ: カードと入力欄の GAP は 0。カード上下の余白を同じにする */
@media (max-width: 767px) {
    .card-input-section {
        gap: 0;
        margin-top: 0;
    }
}

@media (min-width: 768px) {
    .card-input-section {
        flex-direction: row;
        align-items: center;
        gap: 2rem;
    }
}

/* カードプレビュー用コンテナ（Card.js がここにカードを描画）。固定幅・角丸・薄い影 */
.card-wrapper {
    flex-shrink: 0;
    width: 100%;
    max-width: 320px;
    min-height: 200px;
}

/* スマホ: カードがはみ出さないよう縮小。右側・右上・右下の見切れを防ぎ、下の余白を負の margin でつぶす */
@media (max-width: 767px) {
    .card-wrapper {
        max-width: 100%;
        overflow: hidden;
        margin-left: 0;
        margin-right: 0;
    }
    .card-wrapper .jp-card-container {
        margin-left: auto;
        margin-right: auto;
        transform: scale(min(1, calc((100vw - 2rem) / 350)));
        transform-origin: center top;
        /* レイアウト上は 350px のままなので、負の margin-right で占有幅を縮め右側が切れないようにする */
        margin-right: calc(-350px * (1 - min(1, calc((100vw - 2rem) / 350))));
        /* レイアウト上は 200px のままなので、見た目より下に空く分を負の margin でつぶす */
        margin-bottom: calc(-200px * (1 - min(1, calc((100vw - 2rem) / 350))));
    }
}

@media (min-width: 768px) {
    .card-wrapper {
        width: 320px;
    }
}

/* Card.js が生成するカード要素の見た目を上書き（角丸 8〜12px、薄い影、フォーカス時わずかに強調） */
.card-wrapper .jp-card {
    border-radius: 12px !important;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08) !important;
    transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.card-wrapper .jp-card.jp-card-focused {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1) !important;
}

/* フォーム欄は可変幅・余白を広め */
.card-form-fields {
    flex: 1;
    min-width: 0;
    padding: 0;
}

/* ラベル: 小さめ・薄め */
.card-form-fields label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #6b7280;
}

/* 入力欄: 枠は薄く、フォーカス時は1色で強調。影は薄く（プロダクト感） */
.card-form-fields .card-input {
    border-radius: 8px;
    border-color: #e5e7eb;
    box-shadow: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-form-fields .card-input:hover {
    border-color: #d1d5db;
}

.card-form-fields .card-input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

.card-form-fields .card-input::placeholder {
    color: #9ca3af;
}

/* エラー表示: 控えめな赤＋短文（直下に表示） */
.card-form-fields .card-errors {
    font-size: 0.875rem;
    color: #b91c1c;
    line-height: 1.4;
    margin-bottom: 0.75rem;
}

/* スマホのみ: 空の .card-errors / .fake-card-brand の謎の距離を消す（min-height・margin を 0 に） */
@media (max-width: 767px) {
    .card-form-fields .card-errors:empty {
        min-height: 0;
        margin-bottom: 0;
    }
    .card-form-fields .fake-card-brand:empty {
        min-height: 0;
        margin-bottom: 0;
    }
}

/* 行間は詰めない（詰めると安いフォームに見える） */
.card-form-fields .mb-4 {
    line-height: 1.5;
}
