/**
 * ポイントカード画面専用スタイル
 * CSS変数を使用してクライアントごとに簡単にカスタマイズ可能
 */

/* ============================================
   タブ切り替え
   ============================================ */
.tab-content {
    display: none;
}

.tab-content.active {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    /* flexboxの子要素が縮小できるようにする */
}

#store_info-tab.active {
    padding: 0;
    position: relative;
    overflow: hidden;
    /* 子要素のabsolute配置のため */
    height: 100%;
}

#reward-tab {
    gap: var(--spacing-md);
    background: var(--tab-reward-bg);
    /* カードページの背景グラデーション */
    padding-top: var(--header-height);
    /* 固定ヘッダー分（reward.js が --header-height を計測） */
    padding-block-end: var(--bottom-nav-height);
    /* 固定下部ナビ分（reward.js が --bottom-nav-height を計測、nav 側に safe-area 込み） */
    position: relative;
    /* noCardMessageの基準位置 */
}

#store_info-tab {
    position: relative;
    padding: 0;
    overflow: hidden;
    background: var(--tab-store-info-bg);
    /* タブ毎の背景色を調整可能 */
}

/* 姉妹店時の店舗一覧はヘッダー分の余白を設ける */
#store_info-tab #sister-stores-view {
    padding-top: var(--header-height);
    padding-block-end: calc(var(--bottom-nav-height) + var(--spacing-sm));
    background: var(--tab-sister-stores-view-bg);
    height: 100dvh;
}

/* 単店の店舗詳細は背景画像がヘッダーの下に潜り込むため、padding-topは0 */
#store_info-tab .single-store-view {
    padding-top: 0;
    position: relative;
    min-height: 100%;
    display: flex;
    flex-direction: column;
    background: var(--tab-single-store-view-bg);
}

/* ============================================
   ヘッダー中央：店舗セレクタ・ブランド（レイアウト固定／色・サイズ・余白は client.css :root）
   ============================================ */
.store-selector {
    flex: 1;
    margin: 0 var(--header-store-selector-margin-inline, var(--spacing-md));
    position: relative;
}

.store-select-button {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: var(--header-store-selector-border, 1px solid rgba(255, 255, 255, 0.3));
    border-radius: var(--input-radius);
    background: var(--header-store-selector-bg, rgba(255, 255, 255, 0.2));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--header-store-selector-color, var(--text-light));
    font-size: var(--header-store-selector-font-size, var(--font-sm));
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    transition: all 0.3s ease;
}

.store-select-button:hover {
    background: var(--header-store-selector-bg-hover, rgba(255, 255, 255, 0.3));
}

.store-select-button svg {
    margin-left: var(--spacing-xs);
    transition: transform 0.3s ease;
}

.store-select-button.active svg {
    transform: rotate(180deg);
}

.store-select-list {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1000;
    margin: 0;
    padding: 0;
    list-style: none;
    border: var(--header-store-list-border, 1px solid rgba(255, 255, 255, 0.3));
    border-radius: var(--input-radius);
    background: var(--header-store-list-bg, rgba(255, 255, 255, 0.95));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--header-store-list-shadow, 0 4px 12px rgba(0, 0, 0, 0.15));
    max-height: var(--header-store-list-max-height, 200px);
    overflow-y: auto;
}

.store-select-list li {
    padding: var(--spacing-sm) var(--spacing-md);
    color: var(--header-store-list-item-color, var(--text-primary));
    font-size: var(--header-store-selector-font-size, var(--font-sm));
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-bottom: var(--header-store-list-item-border, 1px solid rgba(0, 0, 0, 0.05));
}

.store-select-list li:last-child {
    border-bottom: none;
}

.store-select-list li:hover {
    background-color: var(--header-store-list-item-hover-bg, rgba(0, 0, 0, 0.05));
}

.store-select-list li.active {
    background-color: var(--header-store-list-item-active-bg, rgba(102, 126, 234, 0.1));
    color: var(--header-store-list-item-active-color, var(--btn-primary-bg));
    font-weight: var(--header-store-list-item-active-font-weight, 500);
}

.header-store-brand {
    flex: 1;
    margin: 0 var(--header-store-brand-margin-inline, var(--spacing-md));
    min-width: 0;
    display: none;
    align-items: var(--header-store-brand-align-items, center);
    justify-content: var(--header-store-brand-justify-content, center);
    gap: var(--header-store-brand-gap, var(--spacing-sm));
}

.header-store-brand.is-visible {
    display: flex;
}

.header-store-logo__img {
    width: var(--header-store-logo-size, 32px);
    height: var(--header-store-logo-size, 32px);
    border-radius: var(--input-radius);
    object-fit: contain;
    flex-shrink: 0;
}

.header-store-logo__img.is-hidden {
    display: none !important;
}

.header-store-brand__img {
    width: auto;
    max-width: var(--header-store-banner-max-width, min(220px, 100%));
    max-height: var(--header-store-banner-max-height, 38px);
    height: auto;
    object-fit: contain;
    flex-shrink: 1;
}

.header-store-brand__img.is-hidden {
    display: none !important;
}

.header-store-brand[data-header-brand="3"].is-visible {
    justify-content: var(--header-store-brand-justify-banner, center);
}

.header-store-brand__name.is-hidden {
    display: none !important;
}

.header-store-brand__name {
    font-size: var(--header-store-brand-name-font-size, var(--font-sm));
    font-weight: var(--header-store-brand-name-font-weight, 600);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ============================================
   カード情報カード（3D回転）
   ============================================ */
.card-flip-container {
    perspective: 1000px;
    margin-inline: var(--spacing-lg);
    margin-block: auto;
    cursor: pointer;
    position: relative;
    /* noCardMessageの基準位置 */
}

.card-flip-inner {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: calc(100% / 1.585);
    /* クレジットカードサイズの比率を維持（可変） */
    /* または名刺サイズ: padding-bottom: calc(100% / 1.655); */
    transition: transform 0.6s, opacity 0.3s ease;
    transform-style: preserve-3d;
}

/* 満タンになった特典が使えるカードが1枚以上ある場合の重なり表現 */
.card-flip-inner.has-full-cards::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #3b91c0;
    border-radius: var(--card-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: -1;
    pointer-events: none;
    opacity: 0.6;
    transform-origin: bottom left;
    transform: translate(-1px, -5px) scale(1) rotate(-1deg);
}

/* noCardMessageが表示されているとき、.card-flip-innerのトーンを落とす */
.card-flip-container.no-card-active .card-flip-inner {
    opacity: 0.3;
}

.card-flip-inner.flipped {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--card-radius);
    overflow: hidden;
}

.card-back {
    transform: rotateY(180deg);
    padding: 0;
}

.card-back-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.card-info-card {
    margin: 0;
    /* クレジットカードサイズの比率を維持（可変） */
    aspect-ratio: 1.585 / 1;
    /* または名刺サイズ: aspect-ratio: 1.655 / 1; */
    height: 100%;
    display: flex;
    flex-direction: column;
    box-shadow: none;
}

/* カード未発行メッセージ（.card-flip-containerの前面中央に配置） */
#noCardMessage {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    /* .card-flip-containerより前面に表示 */
    width: 100%;
    max-width: 100%;
    pointer-events: auto;
    /* クリック可能にする */
    text-align: center;
    padding: var(--spacing-xl);
}

.card-header-labels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-xs);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}



.card-info-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.card-info-cell {
    text-align: center;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: .5em;
}

.card-label,
.card-number,
.user-name {
    font-size: var(--font-xs);
    color: var(--text-secondary);
    font-weight: 500;
    text-align: center;
}


/* ============================================
   スタンプグリッド
   ============================================ */
.stamp-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    /* デフォルト値、JavaScriptで動的に変更される */
    gap: 0px;
    margin-top: var(--spacing-xs);
    border: var(--stamp-grid-border);
    border-radius: 8px;
    overflow: hidden;
    background: transparent;
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.stamp-cell {
    aspect-ratio: 1;
    border: var(--stamp-grid-border);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--card-bg);
    position: relative;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.stamp-cell.has-stamp {
    background: var(--stamp-color);
    /* border-color: var(--stamp-grid-border); */
}

/* スタンプ画像（実体は案件の assets/img/stamp.png。client.css で指定） */
.stamp-cell.has-stamp::before {
    content: '';
    position: absolute;
    width: 85%;
    height: 85%;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    z-index: 1;
}

.stamp-cell.number {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    font-weight: 500;
    z-index: 1;
}

/* 使用済みスタンプ（パターンB用） */
.stamp-cell.has-stamp.used {
    opacity: 0.3;
    position: relative;
}

.stamp-cell.has-stamp.used::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, transparent 45%, rgba(0, 0, 0, 0.3) 50%, transparent 55%);
    pointer-events: none;
    z-index: 2;
}

/* ============================================
   ポイント情報
   ============================================ */
.points-info {
    display: flex;
    justify-content: space-around;
    align-items: center;
    flex-direction: row;
    gap: var(--spacing-md);
    /* margin-bottom: var(--spacing-md); */
    padding: var(--spacing-md);
    background: var(--color-base);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    box-shadow: 0 3px 5px var(--color-main-50), 0 -3px 5px var(--color-main-50), inset 0 3px 5px var(--color-white), inset 0 -3px 5px var(--color-white);
}

.reward-button {
    /* flex: 1; */
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    /* cardクラスで背景・角丸・影が適用される */
    margin-bottom: 0;
    /* cardクラスのmargin-bottomを上書き */
    padding: var(--spacing-sm) var(--spacing-md);
    /* 凹のニューモーフィズム */
    box-shadow:
        inset 4px 4px 8px oklch(0 0 0 / 0.15),
        inset -4px -4px 8px oklch(1 0 0 / 0.8);
}

.reward-icon {
    font-size: var(--font-xl);
    flex-shrink: 0;
}

.reward-button span:not(.reward-icon) {
    font-size: var(--font-sm);
    color: var(--text-primary);
    font-weight: 500;
}

.points-display {
    min-width: 82px;
    display: flex;
    align-items: center;
    justify-content: center;
    /* cardクラスで背景・角丸・影が適用される */
    margin-bottom: 0;
    /* cardクラスのmargin-bottomを上書き */
    font-weight: 600;
    color: var(--accent-blue);
    flex-shrink: 0;
    width: auto;
    /* flexboxの子要素として正しく動作するように */
    padding: var(--spacing-sm);
    /* 凹のニューモーフィズム */
    box-shadow:
        inset 4px 4px 8px oklch(0 0 0 / 0.15),
        inset -4px -4px 8px oklch(1 0 0 / 0.8);
}

.points-display #totalPoints {
    font-size: 24px;
    font-weight: 600;
    margin-right: 4px;
}

/* ============================================
   履歴
   ============================================ */
.history-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-bottom: 0;
    border-radius: 32px 32px 0 0;
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    /* 下部ナビとの余白は #reward-tab の padding-block-end で確保 */
    min-height: 0;
    max-height: 33dvh;
    margin-top: auto;
    /* 上部の要素の下に配置し、残りのスペースを埋める */
}

.history-title {
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.history-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.history-table thead {
    background: rgba(74, 144, 226, 0.1);
}

.history-table th {
    padding: var(--spacing-sm);
    text-align: left;
    font-size: var(--font-xs);
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid rgba(74, 144, 226, 0.2);
}

.history-table td {
    padding: var(--spacing-sm);
    font-size: var(--font-sm);
    color: var(--text-primary);
    border-bottom: 1px solid rgba(74, 144, 226, 0.1);
}

/* 日付列 */
.history-table th:nth-child(1),
.history-table td:nth-child(1) {
    width: 25%;
    min-width: 90px;
}

/* ポイント列 */
.history-table th:nth-child(2),
.history-table td:nth-child(2) {
    width: 25%;
    min-width: 80px;
}

/* メモ列 */
.history-table th:nth-child(3),
.history-table td:nth-child(3) {
    width: 50%;
    max-width: 50%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
}

.history-table tbody tr:last-child td {
    border-bottom: none;
}

.history-table tbody tr:hover {
    background: rgba(74, 144, 226, 0.05);
}

/* 全文表示ツールチップ */
.history-table .full-text-tooltip {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-bottom: 8px;
    padding: 8px 12px;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    font-size: var(--font-xs);
    border-radius: 8px;
    white-space: normal;
    max-width: 200px;
    z-index: 1000;
    display: none;
    pointer-events: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.history-table .full-text-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: rgba(0, 0, 0, 0.9);
}

.history-table td:hover .full-text-tooltip,
.history-table td.active .full-text-tooltip {
    display: block;
}

/* スマホでのタップ表示 */
@media (hover: none) and (pointer: coarse) {

    .history-table td:nth-child(3).active {
        background: rgba(74, 144, 226, 0.15);
    }
}

/* ============================================
   店舗情報
   ============================================ */

/* 背景画像エリア */
.store-background {
    position: absolute;
    top: calc(-1 * var(--header-height));
    /* ヘッダー高さ分上に移動 */
    left: 0;
    right: 0;
    height: calc(26vh + var(--header-height));
    /* ヘッダー実高さを加算 */
    background-image: url('https://images.unsplash.com/photo-1540555700478-4be289fbecef?w=800&h=600&fit=crop');
    /* 仮の背景画像（spa/salon風の画像） */
    background-size: cover;
    background-position: center;
    z-index: 0;
}

.store-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
}

/* スタッフ情報カルーセル */
.staff-carousel-container {
    position: absolute;
    top: calc(26vh - 50px);
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    overflow: visible;
    /* クリックイベントは子要素に委譲 */
    /* overflow: visibleでスタッフアイコンがはみ出しても表示される */
}

.staff-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: var(--spacing-md);
    width: 100dvw;
    padding-inline: calc((100dvw - 85dvw - var(--spacing-md) * 2) / 2);
    margin-block-start: 60px;
    pointer-events: auto;
    /* カルーセル自体はクリック可能 */
    /* 最初と最後のカードも中央に表示されるようにpaddingを設定 */
}

.staff-carousel::-webkit-scrollbar {
    display: none;
}

.staff-card {
    min-width: 85dvw;
    padding-inline: var(--spacing-lg);
    padding-block-end: var(--spacing-md);
    padding-block-start: 40px;
    scroll-snap-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    /* スタッフアイコンの絶対配置の基準 */
    background: var(--glass-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--card-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-inline: var(--spacing-md);
}

.staff-avatar {
    position: absolute;
    top: 0;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--input-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--font-xxl);
    margin-bottom: 0;
    overflow: hidden;
    flex-shrink: 0;
    z-index: 3;
    border: 1px solid var(--card-bg);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.staff-card .staff-avatar {
    /* .staff-card内の.avatarは非表示（カルーセル外のアイコンを使用） */
    display: none;
}

.staff-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.staff-name {
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    margin-top: var(--spacing-md);
    color: var(--text-primary);
}

.staff-message {
    font-size: var(--font-md);
    color: var(--text-secondary);
    text-align: left;
    width: 100%;
}

/* スタッフページネーション */
.staff-pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
    /* ページネーションと店舗情報カードの間にスペースを確保 */
    pointer-events: auto;
    /* ページネーションはクリック可能 */
}

.staff-pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: all 0.3s ease;
}

.staff-pagination-dot.active {
    background: rgba(255, 255, 255, 1);
    width: 24px;
    border-radius: 4px;
}

/* 店舗詳細カード */
.store-detail-card {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48vh;
    z-index: 1;
    background: var(--card-bg);
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    padding: var(--spacing-lg);
    padding-top: 0;
    /* padding-topを0にして、ハンドルと余白をコンテンツ内で管理 */
    padding-block-end: calc(var(--bottom-nav-height) + var(--spacing-sm));
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: height 0.3s ease-out;
    /* スワイプで拡張する際のアニメーション */
}

/* 店舗詳細カードのドラッグハンドル（横棒）と余白コンテナ */
.store-detail-card-handle {
    position: sticky;
    top: 0;
    width: 100%;
    z-index: 100;
    background: var(--card-bg);
    /* 背景色を設定してコンテンツが下に滑り込むように見せる */
    padding-top: var(--spacing-md);
    padding-bottom: var(--spacing-lg);
    /* ハンドルの上下に余白を確保 */
    display: flex;
    justify-content: center;
    align-items: flex-start;
    cursor: grab;
    /* 要素全体にカーソルを適用 */
}

.store-detail-card-handle:active {
    cursor: grabbing;
}

/* ハンドルの横棒部分 */
.store-detail-card-handle::before {
    content: '';
    width: 40px;
    height: 4px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 2px;
    transition: background 0.2s ease;
}

.store-detail-card-handle:active::before {
    background: rgba(0, 0, 0, 0.3);
}

.store-detail-card.expanded .store-detail-card-handle::before {
    background: rgba(0, 0, 0, 0.3);
}

.store-detail-card-handle:active {
    cursor: grabbing;
    background: rgba(0, 0, 0, 0.3);
}

/* 店舗詳細カードが拡張された状態 */
.store-detail-card.expanded {
    height: calc(90dvh - var(--bottom-nav-height));
    /* 画面全体に拡張（下部ナビの実高さを考慮、nav 側に safe-area 込み） */
    z-index: 10;
    /* 拡張時は前面に表示 */
}

/* 店舗画像カルーセル */
.store-images-carousel {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.store-images-carousel::-webkit-scrollbar {
    display: none;
}

.store-image-item {
    min-width: calc(70% - var(--spacing-sm) / 2);
    scroll-snap-align: start;
    aspect-ratio: 16 / 9;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: #FFF;
    margin: 8px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.02), 0 0 6px rgba(0, 0, 0, 0.08);
}

.store-image-item:first-child {
    min-width: calc(70% - var(--spacing-sm) / 2);
}

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

/* 画像ページネーション */
.images-pagination {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.images-pagination-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--input-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.images-pagination-dot.active {
    background: var(--accent-blue);
    width: 24px;
    border-radius: 4px;
}

/* 店舗情報リスト */
.store-info,
.store-info-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.store-info-item {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
}

.store-info-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
}

.store-info-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.store-info-value {
    flex: 1;
    font-size: var(--font-md);
    color: var(--text-primary);
    word-break: break-word;
}

.store-info-value a {
    color: var(--accent-blue);
    text-decoration: none;
}

.store-info-value a:hover {
    text-decoration: underline;
}

/* SNSリンク */
.store-sns-links {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    align-items: center;
}

.store-sns-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-light);
    color: var(--text-primary);
    transition: all 0.3s ease;
    text-decoration: none;
}

.store-sns-link:hover {
    background: var(--accent-blue);
    color: var(--text-light);
    transform: scale(1.1);
}

.store-sns-link svg {
    width: 18px;
    height: 18px;
    stroke: currentColor;
}

/* 検索・並び替えセクション（姉妹店時） */
.store-control-section {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--spacing-sm);
}

.store-search-section {
    flex: 1;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.store-search-input {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    border: none;
    border-radius: var(--input-radius);
    background: var(--card-bg);
    font-size: var(--font-md);
    color: var(--text-primary);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.store-search-input::placeholder {
    color: var(--text-muted);
}

.store-sort-section {
    display: flex;
    gap: var(--spacing-xs);
    flex-shrink: 0;
}

.sort-btn {
    width: 35px;
    height: 35px;
    padding: 0;
    border: 2px solid var(--primary-color);
    border-radius: var(--input-radius);
    background: var(--card-bg);
    color: var(--primary-color);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sort-btn svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
}

.sort-btn.active {
    background: var(--primary-color);
    color: var(--text-light);
    border-color: var(--primary-color);
}

.sort-btn:hover {
    background: var(--primary-color);
    color: var(--text-light);
    opacity: 0.9;
}

.sort-btn:not(.active):hover {
    background: var(--primary-color);
    color: var(--text-light);
    opacity: 0.8;
}

/* 店舗一覧（姉妹店時） */
.store-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-light);
}

.store-card {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    flex-direction: row;
    gap: var(--spacing-md);
    align-items: center;
    padding: var(--spacing-md);
}

.store-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* サムネイル（左） */
.store-card-thumbnail {
    flex-shrink: 0;
    width: 120px;
    aspect-ratio: 4 / 3;
    border-radius: var(--card-radius);
    overflow: hidden;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: center;
}

.store-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.store-card-thumbnail-placeholder {
    font-size: 32px;
    color: var(--text-muted);
}

#store_info-tab #sister-stores-view .store-card-thumbnail {
    display: none;
}

/* コンテンツ（右） */
.store-card-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: 0;
    padding-block: var(--spacing-xs);
}

.store-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
}

.store-card-header h4 {
    font-size: var(--font-md);
    font-weight: 600;
    margin: 0;
    color: var(--text-primary);
    flex: 1;
}

.store-card-body {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.store-card-address {
    font-size: var(--font-3xs);
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.4;
}

.store-card-access {
    font-size: var(--font-3xs);
    color: var(--text-muted);
    margin: 0;
}

.store-card p {
    font-size: var(--font-3xs);
    color: var(--text-secondary);
}

/* ============================================
   モーダル
   ============================================ */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* JavaScriptでdisplay: blockが設定されてもflexboxを維持 */
.modal[style*="display: block"],
.modal[style*="display: flex"] {
    display: flex !important;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--card-radius);
    padding: var(--spacing-xl);
    max-width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2001;
}

/* 店舗詳細モーダルは全画面表示 */
#store-detail-modal .modal-content {
    max-width: 100%;
    width: 100%;
    max-height: 100vh;
    height: 100vh;
    padding: 0;
    border-radius: 0;
    overflow: hidden;
    position: relative;
}

/* モーダル内の店舗詳細表示（単店と同じスタイル） */
#store-detail-modal .single-store-view {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* モーダル内の背景画像（単店と同じスタイル） */
#store-detail-modal .store-background {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 26vh;
    background-size: cover;
    background-position: center;
    z-index: 0;
}

/* モーダル内のスタッフカルーセル（単店と同じスタイル） */
#store-detail-modal .staff-carousel-container {
    position: absolute;
    top: calc(26vh - 50px);
    left: 0;
    right: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    pointer-events: none;
    overflow: visible;
}

/* モーダル内の店舗詳細カード（単店と同じスタイル） */
#store-detail-modal .store-detail-card {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 48vh;
    z-index: 1;
    background: var(--card-bg);
    border-radius: var(--card-radius) var(--card-radius) 0 0;
    padding: var(--spacing-lg);
    padding-top: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: height 0.3s ease-out;
}

/* モーダル内の店舗詳細カードが拡張された状態 */
#store-detail-modal .store-detail-card.expanded {
    height: 90vh;
    z-index: 10;
}

.modal-close {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 32px;
    height: 32px;
    border: none;
    background: var(--bg-light);
    border-radius: 50%;
    font-size: var(--font-xl);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    transition: background 0.3s ease;
    z-index: 2002;
}

/* 店舗詳細モーダルの閉じるボタンは前面に表示 */
#store-detail-modal .modal-close {
    z-index: 2003;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-close:hover {
    background: var(--input-border);
}

/* 外部ページ埋め込み：ヘッダー・下部ナビの外側は覆わず、その間だけオーバーレイ */
#embed-page-modal.modal {
    position: fixed;
    top: var(--header-height, 0px);
    left: 0;
    right: 0;
    bottom: var(--bottom-nav-height, 0px);
    z-index: 1050;
    /* .bottom-nav(1000) より上、全画面 .modal(2000) より下 */
    align-items: stretch;
    justify-content: stretch;
    overscroll-behavior: contain;
}

#embed-page-modal .modal-overlay {
    position: absolute;
    inset: 0;
}

#embed-page-modal .embed-page-modal-content {
    align-self: stretch;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: unset;
    padding: calc(var(--spacing-xl) + 8px) var(--spacing-md) var(--spacing-md);
    overscroll-behavior: contain;
}

#embed-page-modal .embed-page-modal-body {
    flex: 1;
    min-height: 0;
    overflow-x: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overscroll-behavior-y: contain;
}

#embed-page-modal .embed-page-modal__loading {
    margin: 0;
    padding: var(--spacing-xl);
    text-align: center;
    color: var(--text-muted);
    font-size: var(--font-sm);
}

/* 店舗詳細画面の配信履歴 */
.store-delivery-history {
    margin-top: var(--spacing-lg);
    padding: var(--spacing-md);
    background-color: var(--bg-secondary);
    border-radius: var(--radius-md);
}

.store-delivery-history h4 {
    margin: 0 0 var(--spacing-md) 0;
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
}

.delivery-item {
    padding: var(--spacing-sm);
}

.delivery-date {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--spacing-xs);
}

.delivery-title {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.delivery-body {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    line-height: 1.6;
    white-space: pre-wrap;
}

/* ============================================
   通知モーダル
   ============================================ */
.notification-modal-content {
    width: 90%;
    max-width: 500px;
    padding: var(--spacing-lg);
}

.notification-modal-title {
    font-size: var(--font-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    text-align: center;
}

.notification-list {
    max-height: 60vh;
    overflow-y: auto;
}

.notification-item {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border-radius: var(--input-radius);
    margin-bottom: var(--spacing-xs);
    cursor: pointer;
    transition: background 0.3s ease;
    position: relative;
}

.notification-item:hover {
    background: var(--bg-light);
}

.notification-item.unread {
    background: rgba(74, 144, 226, 0.05);
}

.notification-item.unread:hover {
    background: rgba(74, 144, 226, 0.1);
}

.notification-icon {
    font-size: 24px;
    flex-shrink: 0;
    line-height: 1;
}

.notification-content {
    flex: 1;
    min-width: 0;
}

.notification-title {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    word-wrap: break-word;
}

.notification-message {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.4;
    word-wrap: break-word;
}

.notification-store-name {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 2px;
}

.notification-date {
    font-size: var(--font-xs);
    color: var(--text-muted);
    margin-top: 4px;
}

.unread-badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 8px;
    height: 8px;
    background: var(--accent-blue);
    border-radius: 50%;
    flex-shrink: 0;
}

.notification-detail-content {
    width: 90%;
    max-width: 500px;
    padding: var(--spacing-lg);
}

.notification-detail-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-md);
}

.notification-detail-icon {
    font-size: 32px;
    flex-shrink: 0;
}

.notification-detail-title {
    font-size: var(--font-lg);
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.notification-detail-date {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-bottom: var(--spacing-lg);
}

.notification-detail-message {
    font-size: var(--font-md);
    color: var(--text-primary);
    line-height: 1.8;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* ============================================
   特典一覧モーダル
   ============================================ */
.rewards-modal-content {
    width: 90%;
    max-width: 500px;
    padding: var(--spacing-lg);
    max-height: 80vh;
    overflow-y: auto;
}

.rewards-modal-title {
    font-size: var(--font-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    text-align: center;
}

.rewards-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.reward-item {
    background: var(--card-bg);
    border-radius: var(--card-radius);
    padding: var(--spacing-md);
    box-shadow: var(--card-shadow);
    border: 2px solid transparent;
    transition: all 0.2s ease;
}

.reward-item.available {
    border-color: var(--accent-blue);
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(59, 130, 246, 0.05) 100%);
}

.reward-item-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
}

.reward-points {
    font-size: var(--font-lg);
    font-weight: 700;
    color: var(--accent-blue);
    min-width: 60px;
}

.reward-name {
    font-size: var(--font-md);
    font-weight: 600;
    color: var(--text-primary);
    flex: 1;
}

.reward-description {
    font-size: var(--font-sm);
    color: var(--text-secondary);
    margin-top: var(--spacing-xs);
    line-height: 1.6;
}

.reward-remaining {
    font-size: var(--font-sm);
    color: var(--text-muted);
    margin-top: var(--spacing-xs);
    font-style: italic;
}

.rewards-empty {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-muted);
}

/* ============================================
   ヘルプ・お問い合わせモーダル
   ============================================ */
.help-contact-content {
    width: 90%;
    max-width: 500px;
    padding: var(--spacing-lg);
    max-height: 80vh;
    overflow-y: auto;
}

.help-contact-title {
    font-size: var(--font-xl);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
    text-align: center;
}

.help-contact-body {
    color: var(--text-primary);
}

.help-contact-info {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.help-contact-info h4 {
    font-size: var(--font-lg);
    font-weight: 600;
    margin-bottom: var(--spacing-md);
    color: var(--text-primary);
}

.help-contact-info strong {
    display: block;
    margin-bottom: var(--spacing-xs);
    color: var(--text-secondary);
    font-size: var(--font-sm);
    font-weight: 500;
}

.help-contact-info p {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-md);
    line-height: 1.6;
}

.help-contact-info a {
    color: var(--color-accent-blue);
    text-decoration: none;
}

.help-contact-info a:hover {
    text-decoration: underline;
}

/* ============================================
   レスポンシブ
   ============================================ */
@media (max-width: 768px) {
    .help-contact-content {
        width: 95%;
        padding: var(--spacing-md);
    }
}