/* ============================================================
   Qoon Booking Widget — Scoped Styles
   All selectors prefixed with .qoon- to avoid theme conflicts
   ============================================================ */

/* ── Trigger button ───────────────────────────────────────── */
.qoon-trigger {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  background: var(--qoon-btn-color, #2B4D1F);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.qoon-trigger:hover  { opacity: .88; transform: translateY(-1px); }
.qoon-trigger:active { transform: translateY(0); }

.qoon-link {
  color: var(--qoon-btn-color, #2B4D1F);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

/* ── Spinner ──────────────────────────────────────────────── */
.qoon-spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: qoon-spin .7s linear infinite;
  vertical-align: middle;
}
@keyframes qoon-spin { to { transform: rotate(360deg); } }

/* ── Modal backdrop ───────────────────────────────────────── */
.qoon-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 999990;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  opacity: 0;
  transition: opacity .2s ease;
}
.qoon-backdrop.qoon-open { opacity: 1; }

/* ── Modal shell ──────────────────────────────────────────── */
.qoon-modal {
  background: #FAF7F2;
  border-radius: 16px;
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,.25);
  transform: translateY(16px);
  transition: transform .22s ease;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 14px;
  color: #1C1B18;
  position: relative;
  -webkit-overflow-scrolling: touch;
}
.qoon-backdrop.qoon-open .qoon-modal { transform: translateY(0); }

/* ── Modal header ─────────────────────────────────────────── */
.qoon-modal-head {
  background: #2B4D1F;
  color: #fff;
  padding: 18px 22px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-radius: 16px 16px 0 0;
  position: sticky;
  top: 0;
  z-index: 10;
}
.qoon-modal-title { font-size: 16px; font-weight: 600; line-height: 1.3; }
.qoon-modal-sub   { font-size: 12px; opacity: .65; margin-top: 3px; }
.qoon-modal-close {
  background: rgba(255,255,255,.15);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .12s;
}
.qoon-modal-close:hover { background: rgba(255,255,255,.25); }

/* ── Modal body layout: 2-col ─────────────────────────────── */
.qoon-modal-body {
  display: grid;
  grid-template-columns: 1fr 260px;
  min-height: 400px;
}
@media (max-width: 600px) {
  .qoon-modal-body { grid-template-columns: 1fr; }
  .qoon-summary    { border-left: none !important; border-top: 0.5px solid rgba(0,0,0,.1); }
}

/* ── Main wizard area ─────────────────────────────────────── */
.qoon-wizard { padding: 22px; }

/* ── Step tabs ────────────────────────────────────────────── */
.qoon-steps {
  display: flex;
  border-bottom: 0.5px solid rgba(0,0,0,.1);
  margin-bottom: 20px;
}
.qoon-step-tab {
  flex: 1;
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #8C8880;
  cursor: default;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -0.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color .12s;
}
.qoon-step-tab .qoon-step-num {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #E8E0D3;
  color: #8C8880;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s, color .12s;
}
.qoon-step-tab.qoon-active { color: #2B4D1F; border-bottom-color: #2B4D1F; }
.qoon-step-tab.qoon-active .qoon-step-num { background: #2B4D1F; color: #fff; }
.qoon-step-tab.qoon-done   { color: #4A4840; }
.qoon-step-tab.qoon-done   .qoon-step-num { background: #3D6B2C; color: #fff; }

/* ── Step panels ──────────────────────────────────────────── */
.qoon-step-panel { display: none; }
.qoon-step-panel.qoon-active { display: block; }

/* ── Calendar ─────────────────────────────────────────────── */
.qoon-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.qoon-cal-nav h4 { font-size: 14px; font-weight: 600; }
.qoon-cal-btn {
  width: 30px;
  height: 30px;
  border: 0.5px solid rgba(0,0,0,.15);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  font-size: 15px;
  color: #4A4840;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .12s;
}
.qoon-cal-btn:hover { background: #E8E0D3; }
.qoon-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.qoon-cal-dow {
  text-align: center;
  font-size: 10px;
  font-weight: 600;
  color: #8C8880;
  padding: 5px 0;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.qoon-cal-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 500;
  border: 0.5px solid transparent;
  transition: background .1s, border-color .1s;
  color: #1C1B18;
}
.qoon-cal-day:hover             { background: #E8E0D3; }
.qoon-cal-day.qoon-empty        { pointer-events: none; }
.qoon-cal-day.qoon-past         { color: #C0BDB5; pointer-events: none; }
.qoon-cal-day.qoon-selected     { background: #2B4D1F; color: #fff; border-color: #2B4D1F; }
.qoon-cal-day.qoon-today:not(.qoon-selected) { border-color: #C4622D; font-weight: 700; }
.qoon-avail-dot                 { width: 4px; height: 4px; border-radius: 50%; }
.qoon-cal-day.qoon-avail        .qoon-avail-dot { background: #3D6B2C; }
.qoon-cal-day.qoon-limited      .qoon-avail-dot { background: #B8962E; }
.qoon-cal-day.qoon-soldout      { color: #C0BDB5; }
.qoon-cal-day.qoon-soldout      .qoon-avail-dot { background: #D0C9BE; }

/* ── Slots ────────────────────────────────────────────────── */
.qoon-slots-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #8C8880;
  margin: 18px 0 8px;
}
.qoon-slots-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.qoon-slot {
  padding: 8px 14px;
  border: 0.5px solid rgba(0,0,0,.15);
  border-radius: 7px;
  cursor: pointer;
  font-size: 12px;
  background: #fff;
  color: #1C1B18;
  font-weight: 500;
  text-align: center;
  transition: all .1s;
  min-width: 76px;
}
.qoon-slot:hover              { background: #E8E0D3; border-color: rgba(0,0,0,.2); }
.qoon-slot.qoon-selected      { background: #2B4D1F; color: #fff; border-color: #2B4D1F; }
.qoon-slot.qoon-full          { opacity: .4; pointer-events: none; }
.qoon-slot-time               { font-size: 14px; font-weight: 700; }
.qoon-slot-remain             { font-size: 10px; opacity: .7; margin-top: 1px; }

/* ── Cal legend ───────────────────────────────────────────── */
.qoon-cal-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 10px;
}
.qoon-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  color: #8C8880;
}
.qoon-legend-dot { width: 7px; height: 7px; border-radius: 50%; }

/* ── Pax rows ─────────────────────────────────────────────── */
.qoon-pax-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 0.5px solid rgba(0,0,0,.08);
}
.qoon-pax-row:last-child { border-bottom: none; }
.qoon-pax-label { font-size: 14px; font-weight: 500; }
.qoon-pax-desc  { font-size: 11px; color: #8C8880; margin-top: 2px; }
.qoon-pax-price { font-size: 13px; color: #C4622D; font-weight: 600; margin-top: 2px; }
.qoon-pax-ctrl  { display: flex; align-items: center; gap: 12px; }
.qoon-pax-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0.5px solid rgba(0,0,0,.18);
  background: #fff;
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4A4840;
  transition: background .1s;
}
.qoon-pax-btn:hover    { background: #E8E0D3; }
.qoon-pax-btn:disabled { opacity: .3; pointer-events: none; }
.qoon-pax-count        { font-size: 16px; font-weight: 700; min-width: 18px; text-align: center; }

/* ── Contact form ─────────────────────────────────────────── */
.qoon-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.qoon-form-grid .qoon-full { grid-column: 1 / -1; }
@media (max-width: 480px) {
  .qoon-form-grid          { grid-template-columns: 1fr; }
  .qoon-form-grid .qoon-full { grid-column: 1; }
}
.qoon-field { display: flex; flex-direction: column; gap: 4px; }
.qoon-field label {
  font-size: 11px;
  font-weight: 600;
  color: #4A4840;
  letter-spacing: .02em;
}
.qoon-field label .qoon-req { color: #C4622D; }
.qoon-field input,
.qoon-field textarea {
  padding: 9px 12px;
  border: 0.5px solid rgba(0,0,0,.2);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  color: #1C1B18;
  background: #fff;
  outline: none;
  transition: border-color .12s, box-shadow .12s;
  width: 100%;
  box-sizing: border-box;
}
.qoon-field input:focus,
.qoon-field textarea:focus {
  border-color: #2B4D1F;
  box-shadow: 0 0 0 3px rgba(43,77,31,.08);
}
.qoon-field textarea { resize: vertical; min-height: 70px; }
.qoon-field .qoon-hint { font-size: 10px; color: #8C8880; }

/* ── Notice ───────────────────────────────────────────────── */
.qoon-notice {
  background: #FFFBF0;
  border: 0.5px solid rgba(184,150,46,.3);
  border-left: 3px solid #B8962E;
  border-radius: 6px;
  padding: 10px 12px;
  font-size: 12px;
  color: #4A4840;
  margin-bottom: 16px;
}
.qoon-notice strong { color: #B8962E; }

/* ── Buttons ──────────────────────────────────────────────── */
.qoon-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: 0.5px solid rgba(0,0,0,.15);
  background: #fff;
  color: #1C1B18;
  transition: background .1s;
}
.qoon-btn:hover       { background: #E8E0D3; }
.qoon-btn-primary {
  background: #2B4D1F;
  color: #fff;
  border-color: transparent;
  padding: 11px 20px;
  font-size: 14px;
}
.qoon-btn-primary:hover { background: #3D6B2C; }
.qoon-btn-primary:disabled { opacity: .4; pointer-events: none; }
.qoon-btn-pay {
  width: 100%;
  justify-content: center;
  background: #C4622D;
  color: #fff;
  border-color: transparent;
  padding: 13px;
  font-size: 15px;
  border-radius: 10px;
}
.qoon-btn-pay:hover    { background: #E8794A; }
.qoon-btn-pay:disabled { opacity: .4; pointer-events: none; }

.qoon-step-nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
}

/* ── Summary sidebar ──────────────────────────────────────── */
.qoon-summary {
  border-left: 0.5px solid rgba(0,0,0,.1);
  background: #fff;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.qoon-summary h4 {
  font-size: 13px;
  font-weight: 700;
  color: #4A4840;
  margin-bottom: 14px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.qoon-sum-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 7px 0;
  font-size: 12px;
  border-bottom: 0.5px solid rgba(0,0,0,.07);
}
.qoon-sum-row:last-of-type { border-bottom: none; }
.qoon-sum-key   { color: #8C8880; }
.qoon-sum-val   { font-weight: 500; }
.qoon-sum-empty { color: #C0BDB5; font-style: italic; font-weight: 400; font-size: 11px; }
.qoon-sum-divider { height: 0.5px; background: rgba(0,0,0,.1); margin: 8px 0; }
.qoon-sum-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0 0;
}
.qoon-sum-total-label { font-size: 13px; font-weight: 700; }
.qoon-sum-total-val   { font-size: 20px; font-weight: 700; color: #2B4D1F; }
.qoon-trust {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 0.5px solid rgba(0,0,0,.08);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.qoon-trust-item { font-size: 11px; color: #8C8880; display: flex; align-items: center; gap: 5px; }

/* ── Confirm screen ───────────────────────────────────────── */
.qoon-confirm {
  text-align: center;
  padding: 40px 24px;
}
.qoon-confirm-icon {
  width: 64px;
  height: 64px;
  background: #2B4D1F;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  margin: 0 auto 18px;
}
.qoon-confirm h3   { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.qoon-confirm-ref  {
  display: inline-block;
  background: #F2EDE4;
  border: 0.5px solid rgba(0,0,0,.15);
  border-radius: 7px;
  padding: 7px 16px;
  font-family: monospace;
  font-size: 17px;
  font-weight: 700;
  color: #2B4D1F;
  letter-spacing: .1em;
  margin: 12px 0 16px;
}
.qoon-confirm p { font-size: 13px; color: #8C8880; max-width: 300px; margin: 0 auto; }

/* ── Error / loading states ───────────────────────────────── */
.qoon-loading { text-align: center; padding: 40px 20px; color: #8C8880; font-size: 13px; }
.qoon-error   { text-align: center; padding: 30px 20px; color: #A32D2D; font-size: 13px; }

/* ── Inline widget root ───────────────────────────────────── */
.qoon-inline-root  { font-family: system-ui, -apple-system, sans-serif; font-size: 14px; }
.qoon-inline-loading { padding: 20px; color: #8C8880; font-size: 13px; }
