/**
 * 仮)会員機能：公開画面用CSS
 * 共通フォームスタイル（common-form.css）を使用
 */

/* === メッセージ表示 === */
.barom-member-message {
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.6;
    border-left: 4px solid;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 成功メッセージ */
.barom-member-message.is-success {
    background-color: #d4edda;
    border-color: #28a745;
    color: #155724;
}

/* エラーメッセージ */
.barom-member-message.is-error {
    background-color: #f8d7da;
    border-color: #dc3545;
    color: #721c24;
}

/* 情報メッセージ */
.barom-member-message.is-info {
    background-color: #d1ecf1;
    border-color: #17a2b8;
    color: #0c5460;
}

/* 警告メッセージ */
.barom-member-message.is-warning {
    background-color: #fff3cd;
    border-color: #ffc107;
    color: #856404;
}

/* === ページ全体の余白を削除 === */
.page-template-default.page .l-mainContent__inner {
    max-width: 100%;
    padding: 0;
}

body.page-id-member .l-article {
    padding: 2rem 1rem;
}

/* === マイページ === */
.barom-my-page {
    max-width: 800px;
    margin: 0 auto;
}

/* ヘッダー - ウェルカムメッセージとログアウト */
.my-page-header {
    margin-bottom: 1.5em;
}

.member-welcome {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
    padding: 1em 0;
}

.welcome-text {
    margin: 0;
    font-size: 1.2em;
    font-weight: 500;
}

.member-name {
    font-weight: bold;
    color: #667eea;
}

.logout-link {
    color: #666;
    text-decoration: none;
    font-size: 0.9em;
    padding: 0.5em 1em;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.logout-link:hover {
    color: #fff;
    background: #dc3545;
    border-color: #dc3545;
}

/* === マイページヘッダー行（名前 + ログアウト） === */
.mypage-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
}

.mypage-header-row .welcome-text {
    margin: 0;
    font-size: 1rem;
    color: #e0e0e0;
}

.mypage-header-row .member-name {
    font-size: 1.1rem;
    font-weight: bold;
    color: #fff;
}

.mypage-header-row .sama {
    font-size: 0.85rem;
    color: #999;
}

.mypage-header-row .logout-link {
    padding: 0.4rem 1rem;
    font-size: 0.85rem;
    color: #999;
    border: 1px solid #555;
    border-radius: 4px;
    text-decoration: none;
    transition: all 0.2s;
}

.mypage-header-row .logout-link:hover {
    color: #fff;
    border-color: #888;
    background: rgba(255,255,255,0.05);
}

/* === マイページメインエリア === */
.mypage-main-area {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 2em;
}

/* === ポイントカード === */
.points-card-section {
    display: flex;
    align-items: stretch;
}

.points-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

/* カードヘッダー（紫帯 + ロゴ） */
.points-card-header {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.points-card-logo {
    height: 28px;
    width: auto;
    filter: brightness(0) invert(1);
}

/* ロゴがない場合のテキスト表示 */
.points-card-site-name {
    color: #fff;
    font-size: 1.1rem;
    font-weight: bold;
    letter-spacing: 0.05em;
}

/* カードボディ（白背景 + 斜線エフェクト） */
.points-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: #f8f8f8;
    padding: 1rem 1.25rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* 右下の光の斜線エフェクト */
.points-card-shine {
    position: absolute;
    top: 0;
    right: -50%;
    bottom: 0;
    width: 100%;
    background: linear-gradient(
        135deg,
        transparent 40%,
        rgba(200, 200, 200, 0.15) 45%,
        rgba(200, 200, 200, 0.25) 50%,
        rgba(200, 200, 200, 0.15) 55%,
        transparent 60%
    );
    pointer-events: none;
}

.points-label {
    margin: 0 0 0.25rem;
    font-size: 0.85rem;
    color: #666;
    font-weight: 500;
    text-align: left;
}

.points-balance {
    margin-bottom: 0.25em;
}

.points-number {
    font-size: clamp(2.2em, 7vw, 3.5em);
    font-weight: bold;
    line-height: 1;
    color: #764ba2;
    word-break: keep-all;
    white-space: nowrap;
}

.points-unit {
    font-size: 1.1em;
    color: #764ba2;
    font-weight: 600;
}

.pending-points {
    margin: 0.25rem 0 0;
    color: #666;
    font-size: 0.8rem;
    text-align: right;
}

/* === QRスキャンセクション === */
.qr-scan-section {
    display: flex;
    align-items: stretch;
}

.qr-scan-section .qr-scan-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    background: transparent;
    padding: 0;
    margin: 0;
}


.qr-scan-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 200px;
    padding: 1.5rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.qr-scan-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

/* 旧スタイル（互換性） */
.member-info-section .logout-link:hover {
    color: #fff;
    border-color: #888;
    background: rgba(255,255,255,0.05);
}

/* 旧クラスの非表示（互換性のため残す） */
.my-page-header,
.points-summary,
.qr-scan-main {
    display: none;
}

/* タブナビゲーション - 会員ページ */
/* 基本スタイルは common-tabs.css から継承 */
/* 会員ページ専用のカスタマイズ */

/* タブコンテナをより暗く、境界を明確に */
.barom-my-page .hapb-tabs {
    background: #1e2022; /* さらに暗いグレー */
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.8), 0 2px 6px rgba(0, 0, 0, 0.6); /* 影を大幅に強調 */
}

/* タブコンテンツ部分も同じ暗さに */
.barom-my-page .hapb-tab-content {
    background: #1e2022;
}

/* アクティブなタブボタンも同じ背景色に合わせる */
.barom-my-page .hapb-tab-button.active {
    background: #1e2022;
}

/* タブ内セクション */
.hapb-tab-content .tab-section {
    background: transparent;
    padding: 0;
}

.section-subtitle {
    margin: 0 0 0.75em 0;
    font-size: 1.05em;
    font-weight: 700;
    color: #e0e0e0;
}

/* タブ内の見出し全般 */
.hapb-tab-content h4 {
    color: #e0e0e0 !important;
}

/* 来店履歴リスト */
.check-in-list {
    list-style: none;
    padding: 0 !important;
    padding-left: 0 !important;
    margin: 0;
}

.check-in-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75em 0;
    border-bottom: 1px solid #f0f0f0;
}

.check-in-date {
    color: #666;
    font-size: 0.9em;
}

.check-in-store {
    flex: 1;
    margin: 0 1em;
    font-weight: 500;
}

.check-in-points {
    color: #28a745;
    font-weight: bold;
}

/* ポイント履歴リスト */
.points-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.points-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75em 0;
    border-bottom: 1px solid #f0f0f0;
}

.history-info {
    flex: 1;
}

.history-date {
    display: block;
    color: #666;
    font-size: 0.85em;
    margin-bottom: 0.25em;
}

.history-desc {
    display: block;
    font-size: 0.95em;
}

.history-points {
    font-weight: bold;
    font-size: 1.1em;
}

.history-points.plus {
    color: #28a745;
}

.history-points.minus {
    color: #dc3545;
}

/* 空メッセージ */
.empty-message {
    color: #999;
    text-align: center;
    padding: 2em 0;
}

/* 設定セクション */
.section-description {
    color: #555;
    margin-bottom: 1em;
    font-size: 0.9em;
    line-height: 1.5;
}

.mail-opt-in-control {
    background: #f9f9f9;
    padding: 1em;
    border-radius: 8px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 0.6em;
    cursor: pointer;
    margin-bottom: 0.75em;
}

.mail-opt-in-checkbox {
    width: 18px;
    height: 18px;
}

.toggle-text {
    font-size: 0.95em;
    font-weight: 500;
    color: #333;
}

.setting-status {
    margin: 0;
    padding-top: 0.75em;
    border-top: 1px solid #e0e0e0;
    color: #555;
    font-size: 0.85em;
    line-height: 1.5;
}

/* 旧スタイルとの互換性 */
.member-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1em;
}

.my-page-section {
    margin-bottom: 3em;
    padding: 1.5em 0;
}

.my-page-section h3 {
    margin-top: 0;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #eee;
}

/* === ポイント残高表示 === */
.points-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
}

.points-section h3 {
    color: #fff;
    border-bottom-color: rgba(255,255,255,0.3);
}

.points-balance {
    text-align: center;
    padding: 2em 0;
}

.points-number {
    font-size: 3em;
    font-weight: bold;
    line-height: 1;
}

.points-unit {
    font-size: 1.2em;
    margin-left: 0.5em;
}

/* === QRスキャンセクション === */
.qr-scan-section p {
    margin-bottom: 1em;
    color: #666;
}

.qr-scan-container {
    max-width: 520px;
    margin: 0 auto;
}

.qr-scan-button {
    display: block;
    width: 100%;
    padding: 1em;
    font-size: 1.1em;
}

/* QRスキャナーUI - 全画面オーバーレイ */
.qr-ui {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    background: #000;
}

.qr-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    background: #000;
}

.qr-message {
    position: absolute;
    top: 20%;
    left: 50%;
    transform: translateX(-50%);
    margin: 0;
    padding: 1em 2em;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    font-size: 1.1em;
    text-align: center;
    border-radius: 8px;
    white-space: nowrap;
}

#qr-stop {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    padding: 1em 2.5em;
    font-size: 1.1em;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: bold;
    transition: background 0.3s ease;
}

#qr-stop:hover {
    background: #fff;
}

/* === 来店履歴テーブル === */
.check-in-history-table,
.points-history-table {
    width: 100%;
    border-collapse: collapse;
}

.check-in-history-table th,
.check-in-history-table td,
.points-history-table th,
.points-history-table td {
    padding: 0.75em;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.check-in-history-table th,
.points-history-table th {
    font-weight: bold;
}

.points-plus {
    color: #28a745;
    font-weight: bold;
}

.points-minus {
    color: #dc3545;
    font-weight: bold;
}

/* === 来店カレンダー === */
.check-in-calendar {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1em;
    table-layout: fixed; /* 横幅を均等7分割に固定 */
}

.check-in-calendar th {
    width: 14.28%; /* 100% / 7 */
    padding: 0.5em 0.25em;
    text-align: center;
    font-weight: bold;
    border-bottom: 2px solid #ddd;
}

.check-in-calendar td {
    width: 14.28%;
    padding: 2px 2px 4px;
    text-align: center;
    vertical-align: top;
    border: 1px solid #f0f0f0;
}

/* 日付の下に常にアイコン1つ分の高さを確保 */
.check-in-calendar td::after {
    content: '';
    display: block;
    min-height: 55px;
}

.check-in-calendar td.has-check-in::after {
    display: none;
}

.check-in-calendar td.calendar-empty::after {
    display: none;
}

.calendar-day.is-today {
    border: 2px solid #ffc107;
}

.day-number {
    font-size: 0.85em;
    line-height: 1.2;
    color: inherit;
}

.check-in-markers {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
    padding: 1px;
    min-height: 55px;
}

.check-in-marker {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

/* 店舗バナー画像 */
.check-in-marker.store-icon {
    background: #fff;
    border: 1px solid rgba(0,0,0,0.1);
}

.check-in-marker.store-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* バナー画像がない場合の頭文字表示 */
.check-in-marker.store-initial {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    font-size: 0.65em;
    font-weight: bold;
}

/* 3つ以上ある場合の重なりスタイル */
.check-in-markers.stacked {
    flex-wrap: nowrap;
    justify-content: center;
}

.check-in-markers.stacked .check-in-marker {
    margin-left: -8px;
    border: 2px solid #1e2022;
}

.check-in-markers.stacked .check-in-marker:first-child {
    margin-left: 0;
}

.check-in-markers.stacked .check-in-marker:nth-child(2) { z-index: 1; }
.check-in-markers.stacked .check-in-marker:nth-child(3) { z-index: 2; }
.check-in-markers.stacked .check-in-marker:nth-child(4) { z-index: 3; }

/* +N表示用 */
.check-in-marker.more-count {
    background: #444;
    color: #fff;
    font-size: 0.6em;
    font-weight: bold;
}

/* モバイル用+N表示はデスクトップでは非表示 */
.check-in-marker.mobile-more {
    display: none;
}

/* === 確認画面用スタイル === */
/* common-form.css のスタイルをそのまま使用 */

/* === レスポンシブ対応 === */
@media (max-width: 768px) {
    .barom-my-page {
        padding: 0 0.5em;
    }

    /* ウェルカムメッセージ - スマホで見やすく */
    .member-welcome {
        padding: 0.8em 0;
    }

    .welcome-text {
        font-size: 1em;
    }

    .logout-link {
        font-size: 0.85em;
        padding: 0.4em 0.8em;
    }

    /* ポイントカード - スマホ用調整 */
    .points-card {
        width: 100%;
        border-radius: 8px;
    }

    .points-number {
        font-size: 2.8em;
    }

    .points-unit {
        font-size: 1.2em;
    }

    .monthly-visits {
        font-size: 0.95em;
    }

    /* QRスキャンボタン - スマホでタップしやすく */
    .qr-scan-button {
        padding: 1.2em;
        font-size: 1.1em;
    }

    /* カレンダー - スマホでコンパクトに */
    .check-in-calendar td {
        padding: 2px 1px;
        font-size: 0.8em;
    }

    .check-in-calendar td::after {
        min-height: 24px;
    }

    /* モバイルでは縦並び、2つまで重ね表示 */
    .check-in-markers {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: auto;
        gap: 0;
        padding: 2px 0;
        position: relative;
    }

    .check-in-marker {
        width: 20px;
        height: 20px;
        border-radius: 3px;
        margin-left: 0;
        border: 1px solid rgba(0,0,0,0.1);
    }

    /* モバイルで2つ以上の場合は縦に重ねる */
    .check-in-markers.count-2 .check-in-marker,
    .check-in-markers.count-3 .check-in-marker,
    .check-in-markers.count-4 .check-in-marker {
        margin-top: -8px;
        border: 1px solid #1e2022;
    }

    .check-in-markers.count-2 .check-in-marker:first-child,
    .check-in-markers.count-3 .check-in-marker:first-child,
    .check-in-markers.count-4 .check-in-marker:first-child {
        margin-top: 0;
        z-index: 0;
    }

    .check-in-markers.count-2 .check-in-marker:nth-child(2),
    .check-in-markers.count-3 .check-in-marker:nth-child(2),
    .check-in-markers.count-4 .check-in-marker:nth-child(2) {
        z-index: 1;
    }

    /* モバイルでは3つ目以降を非表示（2つまで表示） */
    .check-in-markers.count-3 .check-in-marker:nth-child(3):not(.more-count),
    .check-in-markers.count-4 .check-in-marker:nth-child(3):not(.more-count) {
        display: none;
    }

    /* stacked クラスの上書き（モバイルでも縦重ね表示） */
    .check-in-markers.stacked {
        flex-direction: column;
        flex-wrap: nowrap;
    }

    .check-in-markers.stacked .check-in-marker {
        margin-left: 0;
        margin-top: -8px;
        border: 1px solid #1e2022;
    }

    .check-in-markers.stacked .check-in-marker:first-child {
        margin-top: 0;
    }

    .check-in-marker.store-initial {
        font-size: 0.5em;
    }

    .check-in-marker.more-count {
        font-size: 0.5em;
    }

    /* モバイル用+N表示を表示、PC用を非表示 */
    .check-in-marker.mobile-more {
        display: flex;
        z-index: 2;
        margin-top: -8px;
        margin-left: 0;
    }

    .check-in-marker.desktop-more {
        display: none;
    }

    .day-number {
        font-size: 0.8em;
        padding: 2px;
    }

    /* 確認画面のレスポンシブは共通フォームのスタイルを継承 */

    /* 設定セクション - モバイル最適化 */
    .section-subtitle {
        font-size: 1em;
        margin-bottom: 0.5em;
    }

    .section-description {
        font-size: 0.85em;
        margin-bottom: 0.75em;
    }

    .mail-opt-in-control {
        padding: 0.875em;
    }

    .toggle-text {
        font-size: 0.9em;
    }

    .setting-status {
        font-size: 0.8em;
        padding-top: 0.6em;
    }
}

/* 極小画面（iPhone SE等） */
@media (max-width: 375px) {
    .points-number {
        font-size: 2.3em;
    }

    .qr-scan-button {
        font-size: 1em;
        padding: 1em;
    }
}

/* === 履歴カレンダー：月切り替えコントロール === */
.history-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding: 0.5rem 0;
    background: transparent;
}

.history-nav-btn {
    background: transparent;
    border: none;
    padding: 0.3rem 0.5rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: normal;
    transition: opacity 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    color: inherit;
    min-width: auto;
}

.history-nav-btn:hover {
    opacity: 0.7;
}

.history-nav-btn:active {
    opacity: 0.5;
}

.current-month-display {
    font-size: 1rem;
    font-weight: bold;
    color: inherit;
    flex: 1;
    text-align: center;
}

.arrow-left, .arrow-right {
    font-size: 0.8rem;
}

/* 履歴件数バッジ */
.history-count-badge {
    display: inline-block;
    background: #667eea;
    color: #fff;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: bold;
    margin-left: 0.5rem;
}

/* ローディングスピナー */
.loading-spinner {
    text-align: center;
    padding: 2rem;
    color: #999;
    font-size: 0.95rem;
}

.loading-spinner::before {
    content: "⏳ ";
    display: inline-block;
}

/* エラーメッセージ */
.error-message {
    text-align: center;
    padding: 1.5rem;
    color: #d32f2f;
    background: #ffebee;
    border: 1px solid #ffcdd2;
    border-radius: 8px;
    margin: 1rem 0;
}

/* レスポンシブ対応 */
@media (max-width: 600px) {
    .history-controls {
        gap: 0.5rem;
        padding: 0.4rem 0;
    }

    .history-nav-btn {
        padding: 0.25rem 0.4rem;
        font-size: 0.85rem;
        gap: 0.3rem;
    }

    .current-month-display {
        font-size: 0.9rem;
        flex: 1;
    }

    .arrow-left, .arrow-right {
        font-size: 0.7rem;
    }
}

/* === 初回来店確認ポップアップ === */
#first-visit-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
}

.first-visit-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

.first-visit-content {
    background: white;
    border-radius: 20px;
    padding: 40px 30px;
    max-width: 90%;
    width: 400px;
    text-align: center;
    animation: scaleIn 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.first-visit-title {
    font-size: 28px;
    font-weight: bold;
    color: #2c3e50;
    margin: 0 0 15px 0;
}

.first-visit-store-name {
    font-size: 22px;
    color: #e74c3c;
    font-weight: bold;
    margin-bottom: 25px;
}

.first-visit-question {
    margin-bottom: 30px;
}

.first-visit-survey {
    font-size: 14px;
    color: #666;
    margin: 0 0 8px 0;
}

.first-visit-question p:nth-child(2) {
    font-size: 18px;
    color: #333;
    margin: 0 0 10px 0;
}

.first-visit-note {
    font-size: 14px;
    color: #888;
    margin: 0;
}

.first-visit-buttons {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.first-visit-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 18px 24px;
    font-size: 18px;
    font-weight: bold;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.first-visit-btn-first {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.first-visit-btn-first:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.first-visit-btn-repeat {
    background: linear-gradient(135deg, #27ae60 0%, #1e8449 100%);
    color: white;
}

.first-visit-btn-repeat:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(39, 174, 96, 0.4);
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .first-visit-content {
        padding: 30px 20px;
        margin: 0 15px;
    }

    .first-visit-title {
        font-size: 24px;
    }

    .first-visit-store-name {
        font-size: 18px;
    }

    .first-visit-btn {
        padding: 15px 20px;
        font-size: 16px;
    }
}

/* === 性別選択（登録フォーム用） === */
.gender-select-group {
    display: flex;
    gap: 20px;
    margin-top: 0.5em;
}

.gender-option {
    flex: 1;
    cursor: pointer;
}

.gender-option input[type="radio"] {
    display: none;
}

.gender-label {
    display: block;
    padding: 15px 20px;
    text-align: center;
    font-size: 1.1em;
    font-weight: bold;
    border: 3px solid #ddd;
    border-radius: 12px;
    transition: all 0.3s ease;
    background: #fff;
}

.gender-label.male {
    color: #3498db;
    border-color: #bee5fc;
}

.gender-label.female {
    color: #e91e63;
    border-color: #fce4ec;
}

.gender-option input[type="radio"]:checked + .gender-label.male {
    background: #e3f2fd;
    border-color: #3498db;
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.gender-option input[type="radio"]:checked + .gender-label.female {
    background: #fce4ec;
    border-color: #e91e63;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3);
}

.gender-option:hover .gender-label {
    transform: translateY(-2px);
}

/* 確認画面の性別表示 */
.confirm-gender-male {
    color: #3498db;
    font-weight: bold;
}

.confirm-gender-female {
    color: #e91e63;
    font-weight: bold;
}

/* === マイページ設定タブ：性別表示 === */
.gender-setting-section {
    margin-bottom: 1.5em;
}

.gender-display {
    display: flex;
    align-items: center;
    gap: 1em;
    padding: 1em;
    background: #f9f9f9;
    border-radius: 8px;
}

.gender-value {
    font-weight: bold;
    font-size: 1.1em;
}

.gender-value.male {
    color: #3498db;
}

.gender-value.female {
    color: #e91e63;
}

.gender-value.not-set {
    color: #e74c3c;
}

.gender-warning {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1em;
    margin-top: 0.75em;
    color: #856404;
    font-size: 0.9em;
}

.gender-warning-icon {
    margin-right: 0.5em;
}

.gender-locked-note {
    font-size: 0.85em;
    color: #666;
    margin-top: 0.5em;
}

/* レスポンシブ対応 */
@media (max-width: 480px) {
    .gender-select-group {
        gap: 10px;
    }

    .gender-label {
        padding: 12px 15px;
        font-size: 1em;
    }

    .gender-display {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5em;
    }
}

/* ========================================
   会員カード一覧スタイル
   ======================================== */

/* 検索バー */
.cards-search-bar {
    margin-bottom: 15px;
}

.cards-search-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid #ddd;
    border-radius: 0.5rem;
    font-size: 1rem;
    box-sizing: border-box;
}

.cards-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.1);
}

/* フィルタータブ */
.cards-filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.cards-filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    border-radius: 1.25rem;
    background: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cards-filter-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.cards-filter-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* カードグリッド - 4列 → 3列 → 2列 */
.member-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

/* 個別カード */
.member-card-item {
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.08);
    transition: transform 0.2s, box-shadow 0.2s;
}

.member-card-item:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 1rem rgba(0, 0, 0, 0.12);
}

/* 発行済み（取得済み）: 通常表示 + 緑の枠 */
.member-card-item.owned {
    border: 2px solid #4caf50;
}

/* 未取得: グレースケール + 暗め */
.member-card-item.not-owned .card-image {
    filter: grayscale(100%);
    opacity: 0.5;
}

/* 準備中: グレースケール + 暗め（未取得と同じ見た目） */
.member-card-item.preparing .card-image {
    filter: grayscale(100%);
    opacity: 0.5;
}

/* 期限切れ: セピア調 + 赤枠 */
.member-card-item.expired {
    border: 2px solid #d32f2f;
}
.member-card-item.expired .card-image {
    filter: grayscale(60%) sepia(30%);
    opacity: 0.6;
}

/* カード画像 - アスペクトレシオ指定 */
.card-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    overflow: hidden;
    background: #f5f5f5;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: filter 0.2s, opacity 0.2s;
}

/* ステータスバッジ */
.card-status-badge {
    position: absolute;
    top: 0.3rem;
    right: 0.3rem;
    padding: 0.2em 0.4em;
    border-radius: 0.2em;
    font-size: 0.6rem;
    font-weight: bold;
    color: #fff;
}

.card-status-badge.not-owned {
    background: rgba(118, 75, 162, 0.9);
}

.card-status-badge.expired {
    background: rgba(211, 47, 47, 0.9);
}

.card-status-badge.preparing {
    background: rgba(158, 158, 158, 0.9);
}

/* カード情報（店舗名のみ） */
.card-info {
    padding: 0.5rem;
}

.card-store-name {
    font-size: 0.75rem;
    font-weight: bold;
    color: #333;
    margin: 0;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* メッセージ */
.member-cards-grid .loading-message,
.member-cards-grid .empty-message,
.member-cards-grid .error-message {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.5rem 1.25rem;
    color: #666;
}

.member-cards-grid .error-message {
    color: #dc3545;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .member-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 480px) {
    .member-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }

    .card-info {
        padding: 0.4rem;
    }

    .card-store-name {
        font-size: 0.7rem;
    }

    .card-status-badge {
        font-size: 0.55rem;
    }
}

/* ページネーション */
.cards-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    margin-top: 1rem;
    padding: 0.5rem 0;
}

.cards-pagination-btn {
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    border: 1px solid #ddd;
    border-radius: 0.25rem;
    background: #fff;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.cards-pagination-btn:hover {
    border-color: #667eea;
    color: #667eea;
}

.cards-pagination-btn.active {
    background: #667eea;
    border-color: #667eea;
    color: #fff;
}

/* カード詳細モーダル */
.card-detail-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.card-detail-modal.show {
    display: flex;
}

.card-detail-content {
    background: #fff;
    border-radius: 0.75rem;
    max-width: 90%;
    width: 24rem;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 0.5rem 2rem rgba(0, 0, 0, 0.2);
}

.card-detail-header {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.card-detail-header h3 {
    margin: 0;
    font-size: 1rem;
    font-weight: bold;
}

.card-detail-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #999;
    line-height: 1;
}

.card-detail-close:hover {
    color: #333;
}

.card-detail-body {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
}

.card-detail-image {
    width: 100%;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.card-detail-status {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: bold;
    margin-bottom: 1rem;
}

.card-detail-status.owned {
    background: #e8f5e9;
    color: #2e7d32;
}

.card-detail-status.not-owned {
    background: #f5f5f5;
    color: #666;
}

.card-detail-status.expired {
    background: #ffebee;
    color: #c62828;
}

/* バーネーム表示 */
.card-detail-barname {
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    margin: 0.75rem 0 0.5rem;
    text-align: center;
}

/* 地域表示 */
.card-detail-area {
    font-size: 0.875rem;
    color: #666;
    margin: 0.5rem 0 1rem;
}

/* 店舗リンク */
.card-detail-store-link {
    display: block;
    text-align: center;
    padding: 0.75rem 1rem;
    margin-top: 1rem;
    background: #f8f9fa;
    color: #0066cc;
    text-decoration: none;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    border: 1px solid #e0e0e0;
    transition: background 0.2s;
}

.card-detail-store-link:hover {
    background: #e9ecef;
    color: #004c99;
}

.card-detail-info {
    margin-bottom: 1rem;
}

.card-detail-info p {
    margin: 0.25rem 0;
    font-size: 0.875rem;
    color: #666;
}

.card-detail-info strong {
    color: #333;
}

/* 来店履歴リスト */
.visit-history-title {
    font-size: 0.875rem;
    font-weight: bold;
    margin: 1rem 0 0.5rem;
    padding-top: 0.75rem;
    border-top: 1px solid #eee;
}

.visit-history-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.visit-history-item {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.8rem;
}

.visit-history-item:last-child {
    border-bottom: none;
}

.visit-history-date {
    color: #666;
}

.visit-history-points {
    color: #667eea;
    font-weight: bold;
}

.visit-history-empty {
    color: #999;
    font-size: 0.8rem;
    text-align: center;
    padding: 1rem 0;
}
