/* =====================================
   スタジオベルカ 予約サイト スタイル
   ===================================== */

:root {
  --color-bg: #ffffff;
  --color-surface: #f7f7f5;
  --color-surface-2: #eeece8;
  --color-border: #e0ddd7;
  --color-text: #1a1a1a;
  --color-text-muted: #777;
  --color-accent: #b8924a; /* ゴールド（白背景用に少し濃く） */
  --color-accent-dark: #8a6a30;
  --color-success: #2e7d32;
  --color-error: #c62828;
  --color-warning: #e65100;
  --font: 'Noto Sans JP', -apple-system, BlinkMacSystemFont, sans-serif;
  --radius: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,0.10);
  --transition: 0.2s ease;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

/* スキップナビゲーション（アクセシビリティ） */
.skip-nav {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--color-accent);
  color: #fff;
  padding: 8px 16px;
  z-index: 9999;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  border-radius: 0 0 var(--radius) 0;
  transition: top 0.15s ease;
}
.skip-nav:focus {
  top: 0;
}

body {
  font-family: var(--font);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.7;
  font-size: 16px;
}

#stripe-diagnostic-banner {
  position: fixed;
  inset: 0 0 auto;
  z-index: 10000;
  min-height: 44px;
  padding: 10px 16px;
  background: #7f1d1d;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 24px;
  text-align: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.24);
}

body.stripe-diagnostic-mode {
  padding-top: 44px;
}

a { color: var(--color-accent); text-decoration: none; }
a:hover { opacity: 0.8; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 20px;
}

/* =====================================
   Header
   ===================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--color-border);
  padding: 16px 0;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 3px;
  color: var(--color-accent);
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  font-size: 14px;
  color: var(--color-text-muted);
  transition: color var(--transition);
}

nav a:hover { color: var(--color-text); }

.btn-nav {
  background: var(--color-accent);
  color: #000 !important;
  padding: 8px 20px;
  border-radius: 4px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 1px;
}

.btn-nav:hover { opacity: 1 !important; background: var(--color-accent-dark); }

/* =====================================
   Hero
   ===================================== */
.hero {
  padding: 120px 0 100px;
  text-align: center;
  background: radial-gradient(ellipse at center top, #f0ebe0 0%, var(--color-bg) 70%);
}

.hero-sub {
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--color-accent);
  margin-bottom: 16px;
}

.hero h1 {
  font-size: clamp(36px, 6vw, 64px);
  font-weight: 700;
  letter-spacing: 6px;
  margin-bottom: 20px;
}

.hero-desc {
  font-size: 16px;
  color: var(--color-text-muted);
  line-height: 2;
  margin-bottom: 40px;
}

/* =====================================
   Buttons
   ===================================== */
.btn-primary {
  display: inline-block;
  background: var(--color-accent);
  color: #000;
  padding: 14px 40px;
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-primary:hover:not(:disabled) {
  background: var(--color-accent-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(200, 169, 110, 0.3);
  color: #000;
  opacity: 1;
}

.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--color-surface-2);
  color: var(--color-text);
  padding: 10px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 14px;
  transition: all var(--transition);
  white-space: nowrap;
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.btn-outline {
  background: transparent;
  color: var(--color-text-muted);
  padding: 14px 24px;
  border-radius: var(--radius);
  border: 1px solid var(--color-border);
  cursor: pointer;
  font-size: 15px;
  transition: all var(--transition);
}

.btn-outline:hover {
  border-color: var(--color-text);
  color: var(--color-text);
}

/* =====================================
   Plans Section
   ===================================== */
.plans-section, .booking-section, .cancel-section, .info-section {
  padding: 80px 0;
}

.section-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: 2px;
  margin-bottom: 48px;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 2px;
  background: var(--color-accent);
  margin: 12px auto 0;
}

.plans-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
}

.plan-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
  overflow: hidden;
}

.plan-card:hover {
  border-color: var(--color-accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.plan-card.special {
  border-color: var(--color-accent);
  background: linear-gradient(135deg, #fdf6e8, var(--color-surface));
}

.plan-card .badge {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--color-accent);
  color: #000;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-bottom-left-radius: var(--radius);
}

.plan-card .plan-hours {
  font-size: 28px;
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1;
}

.plan-card .plan-hours-unit {
  font-size: 12px;
  color: var(--color-text-muted);
}

.plan-card .plan-name {
  font-size: 13px;
  color: var(--color-text-muted);
  margin: 8px 0 4px;
}

.plan-card .plan-price {
  font-size: 20px;
  font-weight: 700;
  margin-top: 8px;
}

.plan-card .plan-price-unit {
  font-size: 12px;
  color: var(--color-text-muted);
  font-weight: 400;
}

.plan-card .plan-per-hour {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.loading {
  color: var(--color-text-muted);
  text-align: center;
  padding: 40px;
}

/* =====================================
   Booking Section
   ===================================== */
.booking-section {
  background: var(--color-surface);
}

/* 埋め込みページは隣接する予約変更・キャンセルと背景色を統一する */
.booking-widget-page .booking-section {
  background: var(--color-bg);
}

.booking-card {
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 24px;
}

.step-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.step-num {
  width: 36px;
  height: 36px;
  background: var(--color-accent);
  color: #000;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.step-header h3 {
  font-size: 18px;
  font-weight: 700;
}

.form-group {
  margin-bottom: 24px;
}

.form-group label,
.form-group .form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--color-text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.booking-state-select {
  display: none !important;
}

.plan-choice-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.plan-choice-button {
  min-height: 58px;
  padding: 10px 12px;
  border: 1.5px solid var(--color-border);
  border-radius: 10px;
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition), background var(--transition), box-shadow var(--transition);
}

.plan-choice-button strong,
.plan-choice-button span {
  display: block;
}

.plan-choice-button strong { font-size: 13px; line-height: 1.35; }
.plan-choice-button span { margin-top: 4px; color: var(--color-text-muted); font-size: 12px; }

.plan-choice-button.is-active {
  border-color: var(--color-accent);
  background: rgba(184, 146, 74, 0.1);
  box-shadow: 0 0 0 1px var(--color-accent);
}

.plan-choice-button:focus-visible,
.consecutive-day-button:focus-visible,
.choice-load-error button:focus-visible {
  outline: 3px solid rgba(184, 146, 74, 0.35);
  outline-offset: 2px;
}

.choice-loading {
  grid-column: 1 / -1;
  color: var(--color-text-muted);
  font-size: 13px;
}

.choice-load-error {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(239, 83, 80, 0.35);
  border-radius: 10px;
  background: rgba(239, 83, 80, 0.06);
  color: var(--color-error);
  font-size: 13px;
}

.choice-load-error[hidden] { display: none; }

.required {
  color: var(--color-error);
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  color: var(--color-text);
  font-size: 15px;
  font-family: var(--font);
  transition: border-color var(--transition);
  appearance: none;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--color-accent);
}

.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M6 8L0 0h12z' fill='%23888'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

/* 日付input カラースキーム */
input[type="date"] {
  color-scheme: dark;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* スロット選択 */
.slots-container {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
}

.slots-container h4 {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.slots-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 8px;
}

.slot-btn {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 12px 8px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--color-text);
  font-size: 14px;
  font-family: var(--font);
}

.slot-btn:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.slot-btn.selected {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #000;
  font-weight: 700;
}

.no-slots {
  color: var(--color-text-muted);
  font-size: 14px;
  padding: 16px 0;
  grid-column: 1 / -1;
}

/* 選択確認サマリー */
.selected-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-bottom: 24px;
  font-size: 14px;
  color: var(--color-text-muted);
}

.selected-summary strong {
  color: var(--color-text);
}

/* クーポン */
.coupon-row {
  display: flex;
  gap: 8px;
}

.coupon-row input {
  flex: 1;
}

.coupon-message {
  font-size: 13px;
  margin-top: 8px;
}

.coupon-message.success { color: var(--color-success); }
.coupon-message.error { color: var(--color-error); }

/* 予約変更ポリシー */
.modify-policy-instruction {
  margin-bottom: 8px;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-size: 14px;
  line-height: 1.8;
}

.modify-policy-instruction span {
  color: #e53e3e;
  font-weight: 600;
}

.policy-disclosure {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 8px;
  margin-bottom: 20px;
  color: #92400e;
  font-size: 14px;
  line-height: 1.9;
  overflow: hidden;
}

.policy-disclosure summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  color: #7c4a03;
  font-weight: 700;
}

.policy-disclosure summary::-webkit-details-marker {
  display: none;
}

.policy-disclosure summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: rgba(184, 146, 74, 0.16);
  color: #8a6a30;
  font-size: 16px;
  line-height: 1;
}

.policy-disclosure[open] summary::after {
  content: "-";
}

.policy-disclosure summary em {
  margin-left: auto;
  color: #b45309;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.policy-disclosure[open] summary em {
  visibility: hidden;
}

.policy-disclosure-body {
  border-top: 1px solid #fde68a;
  padding: 12px 14px 14px;
}

.policy-disclosure-body p {
  margin: 0;
  white-space: pre-line;
}

/* キャンセル申請ステータス */
.cancel-message {
  display: none;
  margin-bottom: 12px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.7;
}

.cancel-message.is-visible {
  display: block;
}

.cancel-message.is-loading {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fffbeb;
  color: #7c5d1f;
  border: 1px solid #f2d68b;
}

.cancel-message.is-success {
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #86efac;
}

.cancel-message.is-error {
  background: #fef2f2;
  color: #dc2626;
  border: 1px solid #fca5a5;
}

.cancel-message-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  border: 2px solid rgba(124, 93, 31, 0.25);
  border-top-color: #b8924a;
  border-radius: 50%;
  animation: cancel-message-spin 0.8s linear infinite;
}

@keyframes cancel-message-spin {
  to { transform: rotate(360deg); }
}

/* 料金サマリー */
.price-summary {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin: 8px 0 24px;
}

.price-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--color-text-muted);
}

.discount-row .discount {
  color: var(--color-success);
}

.total-row {
  border-top: 1px solid var(--color-border);
  margin-top: 8px;
  padding-top: 12px;
  font-weight: 700;
  font-size: 18px;
  color: var(--color-text);
}

/* フォームアクション */
.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
}

/* Stripe決済要素 */
.stripe-element {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 48px;
}

.error-message {
  color: var(--color-error);
  font-size: 13px;
  margin-top: 8px;
}

/* 完了画面 */
.completion-icon {
  width: 72px;
  height: 72px;
  background: var(--color-success);
  color: white;
  border-radius: 50%;
  font-size: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
}

#step-4 {
  text-align: center;
}

#step-4 h3 {
  font-size: 24px;
  margin-bottom: 12px;
}

.completion-msg {
  color: var(--color-text-muted);
  margin-bottom: 24px;
  line-height: 2;
}

.completion-details {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 20px;
  margin: 24px 0;
  text-align: left;
  font-size: 14px;
  line-height: 2;
}

/* Spinner */
.spinner {
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.3);
  border-top-color: #000;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* =====================================
   Info Section
   ===================================== */
.info-section {
  padding: 60px 0;
  border-top: 1px solid var(--color-border);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 40px;
}

.info-grid h3 {
  font-size: 12px;
  letter-spacing: 2px;
  color: var(--color-accent);
  text-transform: uppercase;
  margin-bottom: 12px;
}

.info-grid p {
  font-size: 14px;
  color: var(--color-text-muted);
  line-height: 1.8;
}

.footer-policy-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  max-width: 260px;
}

.footer-policy-card p {
  margin: 0;
}

.footer-policy-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 6px 12px;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
}

.footer-policy-link:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  opacity: 1;
}

/* =====================================
   Footer
   ===================================== */
footer {
  border-top: 1px solid var(--color-border);
  padding: 24px 0;
  text-align: center;
  font-size: 12px;
  color: var(--color-text-muted);
}

/* =====================================
   公開カレンダー（空き状況）
   ===================================== */
.availability-section {
  padding: 80px 0;
  border-top: 1px solid var(--color-border);
}

.pub-cal-legend {
  display: grid;
  gap: 8px;
  max-width: 680px;
  margin: -18px auto 22px;
  color: var(--color-text);
  font-size: 13px;
  line-height: 1.7;
}

.pub-cal-legend p {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
}

.pub-cal-legend-swatch {
  width: 34px;
  height: 18px;
  flex: 0 0 auto;
  margin-top: 3px;
  border-radius: 3px;
}

.pub-cal-legend-swatch-unavailable {
  background: repeating-linear-gradient(
    45deg,
    rgba(82, 82, 82, 0.62),
    rgba(82, 82, 82, 0.62) 5px,
    rgba(176, 176, 176, 0.28) 5px,
    rgba(176, 176, 176, 0.28) 10px
  );
  border: 1px solid rgba(82, 82, 82, 0.66);
}

.pub-cal-legend-swatch-buffer {
  background: repeating-linear-gradient(
    45deg,
    rgba(184, 124, 38, 0.26),
    rgba(184, 124, 38, 0.26) 5px,
    rgba(245, 180, 83, 0.10) 5px,
    rgba(245, 180, 83, 0.10) 10px
  );
  border: 1px solid rgba(184, 124, 38, 0.48);
}

.pub-cal-legend-swatch-available {
  background: #fff;
  border: 1px solid #d6d6d6;
}

.pub-cal-nav {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-bottom: 20px;
}

.pub-cal-nav-btns {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pub-cal-nav span {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-text);
  text-align: center;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 12px;
  border-radius: var(--radius);
}

.pub-cal-outer {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid #e0e0e0;
  border-radius: var(--radius);
}

.pub-cal-inner {
  min-width: 560px;
}

.pub-cal-head-row {
  display: flex;
  border-bottom: 1px solid #e0e0e0;
  background: #f9f9f9;
}

.pub-cal-time-spacer {
  width: 48px;
  flex-shrink: 0;
  border-right: 1px solid #e0e0e0;
}

.pub-cal-day-hd {
  flex: 1;
  text-align: center;
  padding: 10px 4px;
  font-size: 12px;
  color: #666;
  border-right: 1px solid #e0e0e0;
}

.pub-cal-day-hd:last-child {
  border-right: none;
}

.pub-cal-day-hd.is-today {
  color: var(--color-accent);
  font-weight: 700;
}

.pub-cal-body-row {
  display: flex;
}

.pub-cal-time-col {
  width: 48px;
  flex-shrink: 0;
  border-right: 1px solid #e0e0e0;
  background: #f9f9f9;
  position: relative;
}

.pub-cal-tl {
  position: absolute;
  right: 4px;
  font-size: 10px;
  color: #999;
  line-height: 1;
  white-space: nowrap;
  transform: translateY(-50%);
}

.pub-cal-day-body {
  flex: 1;
  position: relative;
  border-right: 1px solid #e0e0e0;
  cursor: pointer;
  background: #fff;
  transition: background 0.15s;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.pub-cal-day-body:last-child {
  border-right: none;
}

.pub-cal-day-body:hover {
  background: #f5f5f5;
}

.pub-cal-day-body.is-past {
  background: #f5f5f5;
  cursor: default;
  opacity: 0.6;
}

.pub-cal-day-body.is-past:hover {
  background: #f5f5f5;
}

.pub-cal-hl {
  position: absolute;
  left: 0;
  right: 0;
  height: 1px;
  background: #ebebeb;
  pointer-events: none;
}

.pub-cal-hl-half {
  background: transparent;
  border-top: 1px dashed #e4e4e4;
}

/* .pub-cal-tl-half は廃止（absolute配置に移行済み） */

.pub-cal-ev {
  position: absolute;
  left: 2px;
  right: 2px;
  border-radius: 3px;
  pointer-events: none;
  user-select: none;
}

/* 予約済み（confirmed / pending_payment）: グレーハッチング */
.pub-cal-ev-reserved {
  background: repeating-linear-gradient(
    45deg,
    rgba(82, 82, 82, 0.62),
    rgba(82, 82, 82, 0.62) 5px,
    rgba(176, 176, 176, 0.28) 5px,
    rgba(176, 176, 176, 0.28) 10px
  );
  border: 1px solid rgba(82, 82, 82, 0.66);
  z-index: 2;
}

/* ブロック（blocked）: グレーハッチング */
.pub-cal-ev-blocked {
  background: repeating-linear-gradient(
    45deg,
    rgba(82, 82, 82, 0.62),
    rgba(82, 82, 82, 0.62) 5px,
    rgba(176, 176, 176, 0.28) 5px,
    rgba(176, 176, 176, 0.28) 10px
  );
  border: 1px solid rgba(82, 82, 82, 0.66);
  z-index: 2;
}

/* 30分バッファ: 予約本体とは別色 */
.pub-cal-ev-buffer {
  background: repeating-linear-gradient(
    45deg,
    rgba(184, 124, 38, 0.26),
    rgba(184, 124, 38, 0.26) 5px,
    rgba(245, 180, 83, 0.10) 5px,
    rgba(245, 180, 83, 0.10) 10px
  );
  border: 1px solid rgba(184, 124, 38, 0.48);
  z-index: 1;
}

.pub-cal-drag-preview {
  position: absolute;
  left: 2px;
  right: 2px;
  background: rgba(184, 146, 74, 0.25);
  border: 2px dashed var(--color-accent);
  border-radius: 4px;
  pointer-events: none;
  z-index: 5;
  display: none;
}

.pub-cal-day-body:not(.is-past) {
  cursor: crosshair;
}

.pub-cal-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 12px;
}

/* 予約フォームモーダル（公開カレンダーからの予約入力） */
.reservation-flow-modal {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.reservation-flow-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 13, 18, 0.58);
}

.reservation-flow-dialog {
  position: relative;
  z-index: 1;
  width: min(720px, 100%);
  max-height: calc(100dvh - 36px);
  overflow-y: auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.26);
}

.reservation-flow-content {
  padding: 28px 22px 24px;
}

.reservation-flow-close {
  position: sticky;
  top: 12px;
  z-index: 2;
  float: right;
  width: 36px;
  height: 36px;
  margin: 12px 12px -48px 0;
  border: 1px solid rgba(26, 26, 46, 0.12);
  border-radius: 50%;
  background: #fff;
  color: var(--color-primary);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
}

.reservation-flow-close:hover,
.reservation-flow-close:focus-visible {
  background: var(--color-secondary);
  outline: none;
}

@media (max-width: 640px) {
  .reservation-flow-modal {
    align-items: flex-end;
    padding: 0;
  }

  .reservation-flow-dialog {
    width: 100%;
    max-height: 92dvh;
    border-radius: 16px 16px 0 0;
  }

  .reservation-flow-content {
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0));
  }
}

/* スロット選択モーダル（ボトムシート） */
.slot-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

/* 自動リサイズiframeでは、親画面内で実際に見えている範囲へ絶対配置する。 */
.booking-widget-page .slot-modal.slot-modal-embedded {
  position: absolute;
  inset: auto 0 auto 0;
  min-height: 0;
  padding: 16px;
  align-items: center;
  box-sizing: border-box;
}

.booking-widget-page .slot-modal.slot-modal-embedded .slot-modal-backdrop {
  position: absolute;
}

.booking-widget-page .slot-modal.slot-modal-embedded .slot-modal-sheet {
  max-height: min(760px, 88vh);
  border-radius: 20px;
}

.embedded-viewport-probes {
  position: absolute;
  inset: 0 0 auto 0;
  height: 0;
  pointer-events: none;
  opacity: 0;
  overflow: visible;
}

.embedded-viewport-probes > i {
  position: absolute;
  left: 0;
  width: 1px;
  height: 1px;
}

.slot-modal-booking-flow .booking-card {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 24px 20px;
  border: 0;
  border-radius: 0 0 20px 20px;
}

.slot-modal-booking-flow .step-header {
  margin-bottom: 24px;
}

.slot-modal.is-booking-flow .sheet-handle-bar {
  margin-bottom: 4px;
}

.slot-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
}

.slot-modal-sheet {
  position: relative;
  z-index: 1;
  background: #fff;
  border-radius: 20px;
  width: 100%;
  max-width: 560px;
  max-height: 88vh;
  overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom, 0);
  box-shadow: 0 -4px 32px rgba(0,0,0,0.18);
  animation: slideUpSheet 0.28s ease;
}

@keyframes slideUpSheet {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.sheet-handle-bar {
  width: 40px;
  height: 4px;
  background: #ddd;
  border-radius: 2px;
  margin: 12px auto 0;
}

.sheet-section {
  padding: 12px 20px;
  border-bottom: 1px solid #f0f0f0;
}
.sheet-section:last-child { border-bottom: none; }

.sheet-date {
  font-size: 15px;
  font-weight: 600;
  color: #1a1a1a;
  margin-bottom: 10px;
}

.multi-day-booking-panel {
  background: linear-gradient(180deg, #fff 0%, #fcfaf6 100%);
}

.inline-multi-day-booking-panel {
  margin: 4px 0 20px;
  padding: 14px;
  border: 1px solid #e5dfd3;
  border-radius: 12px;
}

.multi-day-booking-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  color: #1a1a1a;
  font-size: 14px;
  font-weight: 700;
}

.multi-day-booking-heading small {
  color: var(--color-text-muted);
  font-size: 11px;
  font-weight: 500;
}

.booking-days-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border: 1px solid #e5dfd3;
  border-radius: 12px;
  background: #f4f1eb;
}

.booking-days-option {
  min-height: 40px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: #6f675a;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.booking-days-option.is-active {
  background: #fff;
  color: #1f1b16;
  box-shadow: 0 2px 10px rgba(57, 45, 25, 0.1);
}

.booking-days-option:focus-visible {
  outline: 3px solid rgba(184, 146, 74, 0.35);
  outline-offset: 2px;
}

.consecutive-days-controls {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  gap: 8px 12px;
  margin-top: 12px;
}

.consecutive-days-controls[hidden] { display: none; }
.consecutive-days-controls label,
.consecutive-days-controls .form-label { font-size: 13px; font-weight: 600; }

.consecutive-day-buttons {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 6px;
}

.consecutive-day-button {
  min-height: 40px;
  padding: 8px 4px;
  border: 1.5px solid #d8cfbf;
  border-radius: 8px;
  background: #fff;
  color: #6f675a;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.consecutive-day-button.is-active {
  border-color: var(--color-accent);
  background: rgba(184, 146, 74, 0.12);
  color: var(--color-text);
}
.consecutive-days-controls p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--color-text-muted);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 480px) {
  .plan-choice-buttons { grid-template-columns: 1fr; }
  .consecutive-day-buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.multi-day-status-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.multi-day-status-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid #e6e1d8;
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
}
.multi-day-status-item strong { font-size: 11px; }
.multi-day-status-item.is-available strong { color: #18794e; }
.multi-day-status-item.is-unavailable {
  border-color: #efc8c8;
  background: #fff6f6;
}
.multi-day-status-item.is-unavailable strong { color: #b42318; }

.sheet-time-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.time-sel {
  flex: 1;
  padding: 10px 8px;
  border: 1.5px solid #d0d0d0;
  border-radius: 8px;
  font-size: 16px;
  font-weight: 600;
  background: #fff;
  color: #1a1a1a;
  text-align: center;
  appearance: none;
  cursor: pointer;
}
.time-sel:focus { border-color: var(--color-accent); outline: none; }

.time-sep {
  font-size: 18px;
  color: #999;
  flex-shrink: 0;
}

.sheet-slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-adj-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--color-accent);
  background: #fff;
  color: var(--color-accent);
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s, color 0.15s;
  touch-action: manipulation; /* ダブルタップズーム防止 */
  user-select: none;
}
.time-adj-btn:hover {
  background: var(--color-accent);
  color: #fff;
}

.sheet-progress-wrap { flex: 1; }

.sheet-progress-bar {
  background: #efefef;
  border-radius: 6px;
  height: 28px;
  overflow: hidden;
  cursor: ew-resize;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.sheet-progress-bar:focus-visible {
  outline: 3px solid rgba(184, 146, 74, 0.38);
  outline-offset: 3px;
}

.sheet-progress-bar.is-dragging {
  cursor: grabbing;
}

.sheet-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-accent-dark), var(--color-accent));
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding-right: 8px;
  transition: width 0.2s ease;
  min-width: 32px;
  pointer-events: none;
}

#sheet-duration-label {
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}

.sheet-best-plan {
  background: #1a1a1a;
  color: #fff;
  border-radius: 12px;
  padding: 16px;
  position: relative;
}

.best-plan-auto {
  font-size: 10px;
  font-weight: 600;
  color: var(--color-accent);
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.best-plan-name {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 4px;
}

.best-plan-calc {
  font-size: 12px;
  color: #aaa;
  margin-bottom: 8px;
}

.best-plan-total {
  font-size: 24px;
  font-weight: 800;
}

.best-plan-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--color-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
}

.sheet-upsell {
  background: #fffbf0;
  border: 1px solid #f0d898;
  border-radius: 10px;
  margin: 0 20px;
  padding: 10px 14px !important;
  font-size: 13px;
  color: #5a4010;
  min-height: 40px; /* 表示/非表示でレイアウトがずれないよう高さを確保 */
  visibility: hidden; /* JSで visibility:visible に切り替え */
}

.other-plans-summary {
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
  list-style: none;
  padding: 4px 0;
}
.other-plans-summary::-webkit-details-marker { display: none; }
.other-plans-summary::before { content: "▶ "; font-size: 10px; }
details[open] .other-plans-summary::before { content: "▼ "; }

.other-plans-list {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.other-plan-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid #e0e0e0;
  border-radius: 8px;
  font-size: 13px;
  cursor: pointer;
  transition: border-color 0.15s;
}
.other-plan-row:hover { border-color: var(--color-accent); }
.other-plan-row .plan-row-name { color: #333; font-weight: 500; }
.other-plan-row .plan-row-price { color: #1a1a1a; font-weight: 700; }

.sheet-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px 20px 24px !important;
}

.sheet-book-btn {
  width: 100%;
  padding: 14px;
  font-size: 16px;
  font-weight: 700;
}

.sheet-cancel-btn {
  width: 100%;
  padding: 10px;
  font-size: 14px;
}

/* 埋め込みフォームは、予約変更・キャンセルと同じPCカード幅に揃える */
@media (min-width: 641px) {
  .booking-widget-page #booking .booking-card {
    width: 100%;
    max-width: 480px;
    margin: 0 auto 24px;
  }
}

/* =====================================
   Responsive
   ===================================== */
@media (max-width: 600px) {
  .booking-card {
    padding: 24px 20px;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-actions {
    flex-direction: column-reverse;
  }

  .btn-primary, .btn-outline {
    width: 100%;
    text-align: center;
  }

  .pub-cal-nav-btns .btn-outline {
    width: auto;
    padding: 6px 12px;
    font-size: 12px;
    white-space: nowrap;
  }

  /* カレンダー：横スクロールなし・7日間を画面幅に収める */
  .pub-cal-outer {
    overflow: visible;
    -webkit-overflow-scrolling: auto;
  }
  .pub-cal-inner {
    min-width: unset;
    width: 100%;
  }
  .pub-cal-time-spacer,
  .pub-cal-time-col {
    width: 28px;
  }
  .pub-cal-tl {
    font-size: 8px;
    right: 2px;
  }
  .pub-cal-day-hd {
    font-size: 10px;
    padding: 6px 2px;
  }
  /* 30分刻みの横線・ラベルを非表示 */
  .pub-cal-hl-half,
  .pub-cal-tl-half {
    display: none;
  }

  .plans-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  nav a:not(.btn-nav) {
    display: none;
  }
}

@media (max-width: 640px) {
  .booking-widget-page .slot-modal.slot-modal-embedded {
    padding: 8px;
    padding-top: 8px;
  }

  .booking-widget-page .slot-modal.slot-modal-embedded .slot-modal-sheet {
    max-height: min(720px, calc(100svh - 16px));
  }
}

/* =====================================
   機材保険 タブ選択
   ===================================== */
.insurance-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.insurance-info-link {
  font-size: 12px;
  color: var(--color-accent);
  text-decoration: none;
  white-space: nowrap;
}
.insurance-info-link:hover {
  text-decoration: underline;
}

.insurance-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.insurance-tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 14px 12px;
  border: 2px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  cursor: pointer;
  transition: var(--transition);
}

.insurance-tab:hover {
  border-color: var(--color-accent);
}

.insurance-tab.selected {
  border-color: var(--color-accent);
  background: #fdf8f0;
  color: var(--color-accent-dark);
}

.insurance-tab-name {
  font-size: 16px;
  font-weight: 600;
}

.insurance-tab-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-accent);
}

.insurance-tab.selected .insurance-tab-price {
  color: var(--color-accent-dark);
}

.insurance-info-panel {
  margin-top: 10px;
  padding: 14px 16px;
  background: #fffbf2;
  border: 1px solid #e8d9b0;
  border-radius: var(--radius);
  font-size: 13px;
  color: #5a4a2a;
  line-height: 1.7;
}
.insurance-info-lead {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid #e8d9b0;
  font-style: italic;
  color: #7a6030;
}
.insurance-info-lead p {
  margin: 0 0 6px;
}
.insurance-info-lead p:last-child {
  margin-bottom: 0;
}
.insurance-info-list {
  margin: 0;
  padding-left: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.insurance-info-list li {
  padding-left: 12px;
  border-left: 3px solid #c8a85a;
  line-height: 1.6;
}
.insurance-info-list li strong {
  display: block;
  color: #4a3a1a;
  margin-bottom: 2px;
}

/* =============================================
   Flatpickr カレンダーカスタマイズ
   ============================================= */
.flatpickr-date {
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23b8924a' stroke-width='2'%3E%3Crect x='3' y='4' width='18' height='18' rx='2'/%3E%3Cline x1='16' y1='2' x2='16' y2='6'/%3E%3Cline x1='8' y1='2' x2='8' y2='6'/%3E%3Cline x1='3' y1='10' x2='21' y2='10'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 40px !important;
}
.flatpickr-calendar {
  font-family: var(--font);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--color-border);
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.flatpickr-day:hover {
  background: var(--color-surface-2);
}
.flatpickr-months .flatpickr-prev-month:hover svg,
.flatpickr-months .flatpickr-next-month:hover svg {
  fill: var(--color-accent);
}
.flatpickr-current-month .numInputWrapper:hover,
.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
  background: var(--color-surface);
}
