/* お問い合わせ商品リスト / 最近チェックした商品（KOYOU_WIT-116） */
:root {
  --rc-main: #08848d;
  --rc-main-dark: #066a71;
  --rc-del: #c0392b;
  --rc-border: #d9e2e2;
  --rc-bg: #eaf3f3;
}

/* ---------- フロートパネル ---------- */
.rc-panel { position: fixed; z-index: 100000; font-size: 14px; line-height: 1.5; color: #1d2b2b; }
.rc-panel[hidden] { display: none; }
.rc-panel * { box-sizing: border-box; }
.rc-body { background: #fff; border: 1px solid var(--rc-border); border-top: 4px solid var(--rc-main); border-radius: 6px; box-shadow: 0 4px 18px rgba(0, 0, 0, .14); padding: 12px; display: flex; flex-direction: column; }
.rc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.rc-title { font-size: 16px; }
.rc-close, .rc-link { background: none; border: 0; padding: 0; color: #5a6a6a; font: inherit; cursor: pointer; }
.rc-close { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; }
.rc-close:hover { color: var(--rc-main); }
.rc-close-i { width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.rc-link { color: var(--rc-main); text-decoration: underline; }
.rc-list { overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* 2件以上のフロートは、OSの自動非表示設定でもレールを表示する */
.rc-panel .rc-list.has-multiple { overflow-y: scroll; }
.rc-panel .rc-list.has-multiple,
.rc-tablewrap.is-scrollable { scrollbar-width: auto; scrollbar-color: #6b7878 #eaf3f3; }
/* Chromium/Safariでは標準色指定を戻し、明示幅のスクロールバーを使う */
@supports selector(::-webkit-scrollbar) {
  .rc-panel .rc-list.has-multiple,
  .rc-tablewrap.is-scrollable { scrollbar-color: auto; }
}
.rc-panel .rc-list.has-multiple::-webkit-scrollbar,
.rc-tablewrap.is-scrollable::-webkit-scrollbar { width: 12px; height: 12px; -webkit-appearance: none; }
.rc-panel .rc-list.has-multiple::-webkit-scrollbar-track,
.rc-tablewrap.is-scrollable::-webkit-scrollbar-track { background: #eaf3f3; border-radius: 6px; }
.rc-panel .rc-list.has-multiple::-webkit-scrollbar-thumb,
.rc-tablewrap.is-scrollable::-webkit-scrollbar-thumb { background: #6b7878; border: 2px solid #eaf3f3; border-radius: 6px; }
.rc-item { display: grid; grid-template-columns: 64px 1fr; gap: 4px 10px; padding: 10px 6px; border-bottom: 1px solid var(--rc-border); transition: background-color .2s; }
.rc-img img { width: 64px; height: 64px; max-width: none; aspect-ratio: 1 / 1; object-fit: cover; display: block; border-radius: 3px; }
.rc-info { display: flex; flex-direction: column; min-width: 0; }
.rc-name { font-weight: bold; color: inherit; text-decoration: none; overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.rc-sub { color: #6b7878; font-size: 12px; }
.rc-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 8px; }
.rc-amount { color: var(--rc-main); font-weight: bold; }
.rc-unit { font-size: 11px; color: #6b7878; font-weight: normal; }
.rc-ops { grid-column: 1 / -1; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.rc-qtyl { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #4a5a5a; }
.rc-qty-na { color: #8a9696; font-size: 12px; }

/* 数量の＋－ */
.rc-stepper { display: inline-flex; align-items: stretch; border: 1px solid #b8c4c4; border-radius: 4px; overflow: hidden; background: #fff; }
.rc-step { width: 36px; min-height: 36px; padding: 0; border: 0; background: var(--rc-bg); color: var(--rc-main); font: inherit; font-size: 16px; font-weight: bold; line-height: 1; cursor: pointer; transition: background-color .15s, color .15s; }
.rc-step:hover:not(:disabled) { background: var(--rc-main); color: #fff; }
.rc-step:disabled { color: #b8c4c4; cursor: default; }
.rc-qty { width: 48px; min-height: 36px; padding: 2px 4px; border: 0; border-left: 1px solid #b8c4c4; border-right: 1px solid #b8c4c4; border-radius: 0; font-size: 16px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.rc-qty::-webkit-outer-spin-button, .rc-qty::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 削除・元に戻す */
.rc-del, .rc-undo { min-height: 36px; min-width: 64px; padding: 4px 12px; border-radius: 4px; font: inherit; font-size: 13px; cursor: pointer; transition: background-color .15s, color .15s, border-color .15s; }
.rc-del { background: #fff; border: 1px solid #c9d2d2; color: #5a6a6a; }
.rc-del:hover, .rc-del:focus-visible { background: var(--rc-del); border-color: var(--rc-del); color: #fff; }
.rc-undo { background: var(--rc-main); border: 1px solid var(--rc-main); color: #fff; font-weight: bold; }
.rc-undo:hover, .rc-undo:focus-visible { background: var(--rc-main-dark); border-color: var(--rc-main-dark); }
/* 削除済みの行: グレー表示（「元に戻す」以外は薄くする） */
.rc-item.is-removed, .rc-table tr.is-removed td { background: #eceeee; }
.rc-item.is-removed .rc-img, .rc-item.is-removed .rc-info, .rc-item.is-removed .rc-qtyl,
.rc-table tr.is-removed td:not(.rc-t-op) > * { opacity: .45; }
.rc-item.is-removed .rc-name, .rc-table tr.is-removed td[data-l="商品名"] a { text-decoration: line-through; }

/* 商品合計 */
.rc-total { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 0 10px; }
.rc-shipping-note { color: #c0392b; font-size: 16px; font-weight: bold; }
.rc-panel .rc-shipping-note { font-size: inherit; }
.rc-total-l { font-weight: bold; }
.rc-total-l small { font-weight: normal; font-size: 11px; }
.rc-total-v { color: var(--rc-main); font-weight: bold; font-size: 18px; }
.rc-total-n { flex-basis: 100%; text-align: right; font-size: 11px; color: #6b7878; }
.rc-panel .rc-total { padding: 8px 6px 0; }

.rc-more { margin: 6px 0; font-size: 12px; color: #6b7878; }
.rc-go { display: block; margin-top: 8px; padding: 12px; text-align: center; background: var(--rc-main); color: #fff !important; border-radius: 999px; text-decoration: none; font-weight: bold; transition: background-color .15s, box-shadow .15s, transform .15s; }
.rc-go:hover, .rc-go:focus-visible { background: var(--rc-main-dark); box-shadow: 0 4px 12px rgba(8, 132, 141, .35); transform: translateY(-1px); }
.rc-go.is-disabled { background: #b8c4c4; box-shadow: none; transform: none; pointer-events: none; }
/* フロートの開くボタン（上向き矢印で開けることを示す） */
.rc-bar { display: none; width: 100%; min-height: 48px; padding: 0 16px; background: var(--rc-main); color: #fff; border: 0; border-radius: 10px 10px 0 0; font: inherit; font-weight: bold; cursor: pointer; justify-content: space-between; align-items: center; gap: 10px; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); transition: background-color .15s, box-shadow .15s, transform .15s; }
.rc-bar:hover, .rc-bar:focus-visible { background: var(--rc-main-dark); box-shadow: 0 4px 16px rgba(0, 0, 0, .28); }
.rc-bar-i { flex: 0 0 auto; width: 22px; height: 22px; border-radius: 50%; background: rgba(255, 255, 255, .22); position: relative; transition: transform .15s; }
.rc-bar-i::before { content: ""; position: absolute; left: 50%; top: 50%; width: 7px; height: 7px; border-left: 2px solid #fff; border-top: 2px solid #fff; transform: translate(-50%, -25%) rotate(45deg); }
.rc-bar:hover .rc-bar-i { transform: translateY(-2px); }

/* PC（1181px以上 = ヘッダーのPCグロナビ表示と同じ）: 画面右下のフロート。1880px未満は本文と重なるため閉じたタブから始め、開くとフロートで表示（1880px以上は開いた状態） */
@media (min-width: 1181px) {
  .rc-panel { right: 12px; bottom: 12px; width: 320px; max-height: calc(100vh - 120px); display: flex; flex-direction: column; }
  .rc-panel .rc-body { max-height: calc(100vh - 120px); }
  .rc-panel .rc-list { max-height: min(290px, calc(100vh - 340px)); } /* 商品2点ぶん程度。超える分は一覧内をスクロール */
  .rc-panel:not(.is-open) { width: auto; }
  .rc-panel:not(.is-open) .rc-body { display: none; }
  .rc-panel:not(.is-open) .rc-bar { display: flex; border-radius: 10px; width: auto; padding: 0 12px 0 16px; }
  .rc-panel:not(.is-open) .rc-bar:hover { transform: translateY(-2px); }
}

/* 狭い画面・SP: 問い合わせ商品のみの下部バー（初期は閉じる）。開くと縦一覧。シートの外側（暗い背景）をタップしても閉じる */
@media (max-width: 1180px) {
  .rc-panel { left: 0; right: 0; bottom: 0; padding: 0 8px env(safe-area-inset-bottom); }
  .rc-bar { display: flex; }
  .rc-panel.is-open .rc-bar { display: none; }
  .rc-panel:not(.is-open) .rc-body { display: none; }
  .rc-panel.is-open { top: 0; background: rgba(0, 0, 0, .45); padding: 0; display: flex; align-items: flex-end; cursor: pointer; }
  .rc-panel.is-open .rc-body { cursor: auto; }
  .rc-panel.is-open .rc-body { width: 100%; max-height: 90vh; border-radius: 12px 12px 0 0; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
  .rc-panel.is-open .rc-list { max-height: min(290px, 40vh); } /* 商品2点ぶん程度（3点目は少し見せてスクロールを示す） */
  .rc-panel .rc-more { display: block; }
  html.rc-lock, html.rc-lock body { overflow: hidden; }
}
@media (min-width: 1181px) { .rc-more { display: none; } }

/* ---------- 通知・エラー ---------- */
.rc-toast { position: fixed; left: 50%; bottom: 72px; transform: translate(-50%, 20px); z-index: 100001; max-width: calc(100vw - 32px); padding: 10px 16px; background: #1d2b2b; color: #fff; border-radius: 6px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; }
.rc-toast.is-show { opacity: 1; transform: translate(-50%, 0); }
.rc-error { display: block; margin-top: 6px; color: #c0392b; font-size: 13px; }
[data-resta-cart-add].is-busy { opacity: .6; pointer-events: none; }
/* 追加済み: メインのボタンは赤→グレー、各店舗の行はグレーの文字（白文字が読める濃さのグレー） */
.btn[data-resta-cart-add].is-added { --bgColor: #6b7878; --txtColor: #fff; --v-iconColor: #fff; }
.btn[data-resta-cart-add].is-added:hover { --bgColor: #586464; }
a[data-resta-cart-add].is-added:not(.btn) { --txtColor: #6b7878; color: #6b7878; font-weight: bold; }

/* ---------- /contact/ の商品一覧 ---------- */
.rc-formlist { margin: 0 0 24px; }
.rc-formlist[hidden] { display: none; }
.rc-form-top { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 4px 16px; margin: 0 0 8px; }
.rc-form-h { font-size: 18px; margin: 0; }
.rc-formlist .rc-total-v { font-size: 20px; }
.rc-tablewrap { overflow-x: auto; }
.rc-tablewrap.is-scrollable { max-height: 380px; overflow-y: auto; }
.rc-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.rc-table th { position: sticky; top: 0; z-index: 1; background: var(--rc-bg); text-align: left; padding: 8px; border: 1px solid var(--rc-border); white-space: nowrap; }
.rc-table td { padding: 8px; border: 1px solid var(--rc-border); vertical-align: middle; }
.rc-table td[data-l="写真"] { width: 72px; }
.rc-table img { width: 56px; height: 56px; min-width: 56px; max-width: none; aspect-ratio: 1 / 1; object-fit: cover; display: block; } /* 正方形にトリミング（縦横比は崩さない） */
.rc-t-price { white-space: nowrap; }
.rc-t-price .rc-amount { display: block; }
.rc-table .rc-t-op { text-align: center; width: 1%; white-space: nowrap; }
.rc-note { font-size: 12px; color: #6b7878; margin: 6px 0; }
.rc-note-stock { color: #4a5a5a; }
/* 確認画面表示中は一覧の編集を止める（内容は表示したまま） */
.wpcf7:has(#wpcf7cpcnf) .rc-formlist .rc-stepper,
.wpcf7:has(#wpcf7cpcnf) .rc-formlist .rc-del,
.wpcf7:has(#wpcf7cpcnf) .rc-formlist .rc-undo { pointer-events: none; opacity: .5; }
@media (max-width: 767px) {
  .rc-form-top { flex-direction: column; align-items: stretch; }
  .rc-table thead { display: none; }
  .rc-table, .rc-table tbody { display: block; width: 100%; }
  .rc-table tr { display: grid; grid-template-columns: 64px 1fr auto; grid-template-areas: "img name name" "img code code" "qty qty qty" "price price del"; gap: 2px 10px; border: 1px solid var(--rc-border); border-radius: 4px; padding: 10px; margin-bottom: 8px; }
  .rc-table tr.is-removed { background: #eceeee; }
  .rc-table td { display: block; border: 0; padding: 0; width: auto; }
  .rc-table td::before { content: none; }
  .rc-table td[data-l="写真"] { grid-area: img; width: auto; }
  .rc-table td[data-l="写真"] img { width: 64px; height: 64px; min-width: 64px; }
  .rc-table td[data-l="商品名"] { grid-area: name; font-weight: bold; }
  .rc-table td[data-l="商品番号"] { grid-area: code; font-size: 12px; color: #6b7878; }
  .rc-table td[data-l="商品番号"]::before { content: "商品番号："; }
  .rc-table td[data-l="希望数量"] { grid-area: qty; display: flex; align-items: center; gap: 10px; margin-top: 6px; font-size: 12px; color: #4a5a5a; }
  .rc-table td[data-l="希望数量"]::before { content: attr(data-l); }
  .rc-table td[data-l="合計金額（税込）"] { grid-area: price; align-self: center; white-space: normal; }
  .rc-table td[data-l="合計金額（税込）"]::before { content: "合計金額（税込）"; display: block; font-size: 11px; color: #6b7878; }
  .rc-table td[data-l="削除"] { grid-area: del; justify-self: end; align-self: center; width: auto; }
}

/* ---------- 最近チェックした商品（類似商品の直下。SPは非表示） ---------- */
#resta-recent { padding-top: 0; padding-bottom: 40px; margin-top: -32px; } /* 類似商品の下余白と重ねない */
#resta-recent[hidden] { display: none; }

/* ---------- 横スライダー（類似商品・最近チェックした商品）: 1段で折り返さない ---------- */
.rc-slider { position: relative; }
.rc-track { display: flex; flex-wrap: nowrap !important; gap: 0; overflow-x: auto; scroll-snap-type: x proximity; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; scrollbar-width: thin; padding-bottom: 8px; }
.rc-track > .p-product__item { flex: 0 0 168px !important; width: 168px !important; max-width: none !important; scroll-snap-align: start; margin-right: 8px; }
.rc-arrow { position: absolute; top: 90px; z-index: 2; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--rc-border); background: rgba(255, 255, 255, .95); box-shadow: 0 2px 8px rgba(0, 0, 0, .18); color: var(--rc-main); font-size: 26px; line-height: 1; cursor: pointer; display: flex; align-items: center; justify-content: center; padding: 0 0 3px; }
.rc-arrow[hidden] { display: none; }
.rc-prev { left: -8px; }
.rc-next { right: -8px; }
@media (max-width: 767px) {
  .rc-track > .p-product__item { flex-basis: 38vw !important; width: 38vw !important; }
  .rc-arrow { display: none; } /* SPはスワイプ */
}

#resta-recent.rc-recent-auto { margin-top: 0; padding-top: 40px; padding-bottom: 40px; }

/* 空リスト時のみ表示する、追加ボタン基準の吹き出し */
.rc-guide-anchor { position: relative; }
.rc-guide { position: absolute; z-index: 100; bottom: calc(100% + 14px); left: 0; width: 100%; box-sizing: border-box; margin: 0; padding: 18px 16px 12px; border: 2px solid var(--rc-main); border-radius: 10px; background: #f0faf9; box-shadow: 0 5px 20px rgba(0,0,0,.2); color: #1d2b2b; text-align: left; font-size: 14px; line-height: 1.7; }
.rc-guide[hidden], .rc-panel-guide[hidden] { display: none !important; }
.rc-guide::after { content: ''; position: absolute; bottom: -9px; left: calc(50% - 8px); width: 14px; height: 14px; background: #f0faf9; border-right: 2px solid var(--rc-main); border-bottom: 2px solid var(--rc-main); transform: rotate(45deg); }
.rc-guide-title { display: block; padding-right: 24px; color: var(--rc-main-dark); font-size: 17px; line-height: 1.5; }
.rc-guide ol { margin: 10px 0 0; padding-left: 1.8em; list-style: decimal; }
.rc-guide li { margin: 4px 0; }
.rc-guide-close { position: absolute; top: 0; right: 0; width: 44px; height: 44px; border: 0; background: transparent; color: #466; font-size: 26px; cursor: pointer; }
/* 1点だけのリストに、閉じたバー・開いたパネルのどちらでも案内 */
.rc-panel-guide { margin: 0 0 10px; padding: 12px; border: 2px solid #e2ad24; border-radius: 8px; background: #fff5ce; color: #513d0b; font-size: 13px; line-height: 1.6; text-align: left; }
.rc-panel-guide strong { display: block; font-size: 16px; margin-bottom: 4px; }
.rc-panel-guide span { display: block; }
.rc-panel-guide-bubble { position: absolute; bottom: calc(100% + 10px); right: 0; width: 300px; max-width: calc(100vw - 16px); margin: 0; box-shadow: 0 4px 14px rgba(0,0,0,.15); }
.rc-panel-guide-bubble::after { content: ''; position: absolute; bottom: -8px; right: 28px; width: 12px; height: 12px; transform: rotate(45deg); border-right: 2px solid #e2ad24; border-bottom: 2px solid #e2ad24; background: #fff5ce; }
.rc-panel.is-open > .rc-panel-guide-bubble { display: none; }
@media (max-width: 1180px) { .rc-panel-guide-bubble { right: 8px; } }

/* ふわっと現れ、小さく一度弾んで静止する */
@keyframes rc-guide-appear {
  0% { opacity: 0; transform: translateY(14px); }
  55% { opacity: 1; transform: translateY(-5px); }
  78% { opacity: 1; transform: translateY(2px); }
  100% { opacity: 1; transform: translateY(0); }
}
.rc-guide:not([hidden]), .rc-panel-guide:not([hidden]) {
  animation: rc-guide-appear .85s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
  .rc-guide:not([hidden]), .rc-panel-guide:not([hidden]) { animation: none; }
}

/* 案内・通知をSPでも任意に閉じる */
.rc-message-close { display: inline-flex; align-items: center; justify-content: center; flex: 0 0 44px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 4px; background: transparent; color: inherit; font: inherit; font-size: 26px; line-height: 1; cursor: pointer; }
.rc-message-close:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
.rc-panel-guide { padding-right: 52px; }
.rc-body .rc-panel-guide { position: relative; }
.rc-panel-guide .rc-message-close { position: absolute; top: 0; right: 0; }
.rc-toast { display: flex; align-items: center; gap: 8px; padding: 4px 4px 4px 16px; pointer-events: none; }
.rc-toast.is-show { pointer-events: auto; }
.rc-toast[hidden] { display: none; }
.rc-toast-message { min-width: 0; overflow-wrap: anywhere; }
