/* ──────────────────────────────────────────────────────────────────────────
   Widget Studio — the redesigned /settings/booking-widget screen.
   All selectors are `ws-` prefixed to avoid clashing with Bootstrap / app CSS.
   Chrome (chooser, sections, preview) uses the app navy; the live preview
   iframe renders the real widget, so widget styling is NOT duplicated here.
   ────────────────────────────────────────────────────────────────────────── */

.ws-wrap { --ws-navy: #003264; --ws-line: #e6ebf1; --ws-muted: var(--ed-text-muted); }

/* 1 ── Widget-type chooser ─────────────────────────────────────────────── */
.ws-placer { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin: 18px 0 22px; }
.ws-opt { position: relative; background: #fff; border: 2px solid var(--ws-line); border-radius: 14px; padding: 15px 16px 13px; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.ws-opt:hover { border-color: #c4d2e0; }
.ws-opt.ws-active { border-color: var(--ws-navy); box-shadow: 0 6px 18px rgba(0,50,100,.10); }
.ws-opt .ws-ic { width: 36px; height: 36px; border-radius: 10px; background: #eef3f8; display: grid; place-items: center; margin-bottom: 9px; }
.ws-opt .ws-ic svg { width: 19px; height: 19px; stroke: var(--ws-navy); fill: none; stroke-width: 2; }
.ws-opt h3 { margin: 0 0 3px; font-size: 14.5px; font-weight: 600; color: #1f2933; }
.ws-opt p { margin: 0; font-size: 11.5px; color: var(--ws-muted); line-height: 1.45; }
.ws-opt .ws-tick { position: absolute; top: 12px; right: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--ws-navy); color: #fff; display: none; place-items: center; font-size: 12px; }
.ws-opt.ws-active .ws-tick { display: grid; }

/* 2 ── Studio tabs (Widget settings | Embed options) ───────────────────── */
.ws-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--ws-line); margin: 18px 0 20px; }
.ws-tab { appearance: none; background: transparent; border: 0; border-bottom: 2px solid transparent; padding: 10px 16px; margin-bottom: -1px; font-size: 14px; font-weight: 600; color: var(--ws-muted); cursor: pointer; }
.ws-tab:hover { color: #1f2933; }
.ws-tab.ws-tab-on { color: var(--ws-navy); border-bottom-color: var(--ws-navy); }
.ws-tabpane[x-cloak] { display: none !important; }

/* Embed tab: chooser on top, then options + code (left) | live preview (right).
   Full width here (its own tab) so neither column is squashed. The preview-pane
   keeps its 3 children; CSS grid lays them into 2 columns. */
/* Embed tab: options → code → preview, each full width, stacked. */
.ws-embed-tab .ws-preview-pane { position: static; display: flex; flex-direction: column; gap: 16px; }
.ws-embed-tab .ws-pcfg { margin: 0; }
.ws-embed-tab .ws-frame iframe { height: 720px; }
/* Product-list preview starts compact and the equipdash-resize bridge (JS)
   shrink-wraps it to the cards — so a short row never leaves dead white space. */
.ws-embed-tab .ws-frame iframe.ws-fit-frame { height: 360px; }
/* srcdoc previews (the "Book now" button) — tall enough for the full-screen
   booking pop-up to open over the mockup; the eqstudio-resize bridge trims it. */
.ws-embed-tab .ws-srcdoc-frame iframe { height: 560px; }

/* Placeholder website nav bar — frames the live preview so the widget reads as
   sitting WITHIN the owner's own site, not floating in a void. Sits between the
   browser chrome and the embedded widget. */
.ws-sitenav { display: flex; align-items: center; gap: 13px; padding: 11px 16px; background: #fff; border-bottom: 1px solid #eceff3; }
.ws-snlogo { width: 92px; height: 15px; border-radius: 5px; background: #dbe2ea; flex: none; }
.ws-snlink { width: 40px; height: 9px; border-radius: 5px; background: #eef1f5; flex: none; }
.ws-snlink:first-of-type { margin-left: auto; }
.ws-sncta { width: 62px; height: 23px; border-radius: 7px; background: #d7e0ea; flex: none; }
.ws-frame.ws-mobile .ws-snlink { display: none; }

/* Faux customer-website page — grey placeholder content (the owner's OWN page)
   with our widget embedded within it, so they see exactly how it drops in.
   Mirrors the product/experience detail Embed tab preview. */
.ws-ph { background: #eef1f5; border-radius: 7px; animation: wsplp 2s cubic-bezier(.4, 0, .6, 1) infinite; }
.ws-ph-bar { height: 26px; width: 55%; margin-bottom: 16px; }
.ws-ph-line { height: 12px; margin-bottom: 10px; }
.ws-ph-line.short { width: 62%; }
.ws-ph-img { height: 200px; background: linear-gradient(135deg, #dde6ee, #c4d2e0); border-radius: 9px; margin: 14px 0 18px; }
@keyframes wsplp { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }

/* single_product — two-column: placeholder page content | the embedded widget. */
.ws-embed-tab .ws-faux-page { display: flex; gap: 22px; padding: 22px; align-items: flex-start; background: #fff; }
.ws-embed-tab .ws-faux-col { flex: 1; min-width: 0; }
.ws-embed-tab .ws-faux-embed { width: 384px; flex: none; }
.ws-embed-tab .ws-faux-embed iframe { width: 100%; height: 660px; border: 1px solid var(--ws-line); border-radius: 12px; background: #fff; display: block; }
.ws-frame.ws-tablet .ws-faux-page, .ws-frame.ws-mobile .ws-faux-page { flex-direction: column; }
.ws-frame.ws-tablet .ws-faux-embed, .ws-frame.ws-mobile .ws-faux-embed { width: 100%; }

/* product_list — full-width row embedded mid-page, placeholder content around it. */
.ws-embed-tab .ws-faux-block { padding: 14px 22px 20px; background: #fff; }
.ws-embed-tab .ws-faux-block-top { padding: 20px 22px 4px; }
.ws-embed-tab .ws-faux-rowframe { display: block; width: 100%; border: 0; background: #fff; }

/* Landing-page mock for the product_list preview — hero, intro, section heading
   and footer, so the embedded row reads as sitting INSIDE a real website. */
.ws-embed-tab .ws-hero { height: 150px; background: linear-gradient(120deg, #c9d6e3, #aebfd0 55%, #93a8bf); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 13px; }
.ws-embed-tab .ws-hero-h { width: 46%; height: 22px; border-radius: 7px; background: rgba(255, 255, 255, .85); }
.ws-embed-tab .ws-hero-sub { width: 30%; height: 12px; border-radius: 6px; background: rgba(255, 255, 255, .55); }
.ws-embed-tab .ws-intro { background: #f6f8fa; padding: 20px 26px; display: flex; flex-direction: column; align-items: center; gap: 9px; }
.ws-embed-tab .ws-intro .ws-ph-line { width: 72%; max-width: 640px; margin: 0; }
.ws-embed-tab .ws-intro .ws-ph-line.short { width: 46%; }
.ws-embed-tab .ws-secrow { display: flex; align-items: center; justify-content: space-between; padding: 24px 26px 6px; }
.ws-embed-tab .ws-sec-h { width: 190px; height: 18px; border-radius: 6px; background: #dbe2ea; }
.ws-embed-tab .ws-sec-more { width: 96px; height: 12px; border-radius: 6px; background: #eef1f5; }
.ws-embed-tab .ws-foot { margin-top: 20px; background: #1e2a37; padding: 24px 26px; display: flex; align-items: center; gap: 16px; }
.ws-embed-tab .ws-foot-brand { width: 96px; height: 15px; border-radius: 5px; background: rgba(255, 255, 255, .35); }
.ws-embed-tab .ws-foot-l { width: 54px; height: 9px; border-radius: 5px; background: rgba(255, 255, 255, .18); }
.ws-embed-tab .ws-foot-l:first-of-type { margin-left: auto; }

/* Browser-window chrome around every preview (so it reads like the customer's
   own site, matching the product/experience detail Embed tab). */
.ws-browserbar { display: flex; align-items: center; gap: 6px; padding: 8px 12px; background: #e8edf2; border-bottom: 1px solid var(--ws-line); }
.ws-bdot { width: 9px; height: 9px; border-radius: 50%; background: #cdd7e1; flex: none; }
.ws-burl { margin-left: 8px; flex: 1; min-width: 0; background: #fff; border: 1px solid var(--ws-line); border-radius: 6px; font-size: 11px; color: var(--ws-muted); padding: 3px 9px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ws-embed-note { font-size: 12.5px; color: var(--ws-muted); margin: -6px 0 16px; line-height: 1.5; }

/* Faux host-page preview for the "Book now" button type (it's a floating button
   on the customer's own page, not an iframe of the widget). */
.ws-faux { position: relative; background: #fff; border-radius: 11px; box-shadow: 0 10px 28px rgba(15,40,70,.12); width: 100%; max-width: 560px; min-height: 380px; padding: 22px; overflow: hidden; }
.ws-faux-bar { height: 34px; width: 55%; background: #eef2f6; border-radius: 8px; margin-bottom: 16px; }
.ws-faux-line { height: 11px; background: #eef1f5; border-radius: 5px; margin-bottom: 10px; }
.ws-faux-line.ws-short { width: 62%; }
.ws-faux-img { height: 140px; background: linear-gradient(135deg, #dde6ee, #c4d2e0); border-radius: 10px; margin: 16px 0; }
.ws-faux-fab { position: absolute; bottom: 18px; right: 18px; display: inline-flex; align-items: center; gap: 7px; color: #fff; border-radius: 999px; padding: 11px 18px; font-weight: 600; font-size: 13px; box-shadow: 0 8px 20px rgba(15,40,70,.22); white-space: nowrap; }
.ws-faux-fab.ws-left { right: auto; left: 18px; }

/* 3 ── Left: collapsible setting groups ────────────────────────────────── */
.ws-controls { background: #fff; border: 1px solid var(--ws-line); border-radius: 14px; overflow: hidden; }
.ws-sect { border-bottom: 1px solid var(--ws-line); }
.ws-sect:last-child { border-bottom: 0; }
.ws-sect-hd { display: flex; align-items: center; gap: 12px; padding: 15px 18px; cursor: pointer; user-select: none; }
.ws-sect-hd .ws-ti { flex: 1; min-width: 0; }
.ws-sect-hd .ws-t { font-weight: 600; font-size: 14.5px; color: #1f2933; }
.ws-sect-hd .ws-sum { display: block; font-size: 11.5px; color: var(--ws-muted); margin-top: 2px; }
.ws-sect-hd .ws-chev { color: var(--ws-muted); transition: transform .2s; flex: none; }
.ws-sect.ws-open .ws-sect-hd .ws-chev { transform: rotate(90deg); }
.ws-sect-hd .ws-tag { font-size: 10px; font-weight: 700; letter-spacing: .03em; color: #0a7d3d; background: #e2f7ea; border-radius: 5px; padding: 2px 6px; flex: none; }
.ws-sect-bd { padding: 4px 18px 18px; }
.ws-sect-bd[x-cloak] { display: none !important; }

/* ── Control system (mirrors the approved mockup) ───────────────────────── */

/* Sub-groups within a section */
.ws-grp + .ws-grp { margin-top: 14px; padding-top: 13px; border-top: 1px solid var(--ws-line); }
.ws-gtitle { font-size: 11px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--ws-muted); margin: 2px 0 9px; }

/* label … control row */
.ws-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; }
.ws-row .ws-lbl { font-size: 13.5px; color: #1f2933; }
.ws-row .ws-lbl small { display: block; color: var(--ws-muted); font-size: 11.5px; margin-top: 1px; line-height: 1.4; }
.ws-hint { font-size: 11.5px; color: var(--ws-muted); margin: 2px 0 0; line-height: 1.45; }
.ws-subfields { margin-top: 8px; }
.ws-always { font-size: 11.5px; color: var(--ws-muted); font-style: italic; }

/* Toggle switch */
.ws-sw { position: relative; width: 40px; height: 23px; flex: none; display: inline-block; margin: 0; }
.ws-sw input { opacity: 0; width: 0; height: 0; position: absolute; }
.ws-sw .ws-tr { position: absolute; inset: 0; background: #cdd7e1; border-radius: 999px; transition: .18s; cursor: pointer; }
.ws-sw .ws-tr::before { content: ""; position: absolute; width: 17px; height: 17px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .18s; box-shadow: 0 1px 2px rgba(0,0,0,.2); }
.ws-sw input:checked + .ws-tr { background: var(--ws-navy); }
.ws-sw input:checked + .ws-tr::before { transform: translateX(17px); }

/* Segmented control + tri-state (Req/Opt/Hidden). Radios stay underneath so
   wire:model.live binding is unchanged. */
.ws-seg { display: inline-flex; flex-wrap: wrap; background: #eef3f8; border-radius: 9px; padding: 3px; flex: none; }
.ws-seg input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.ws-seg label { margin: 0; font-size: 12px; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--ws-muted); white-space: nowrap; line-height: 1.3; transition: background .15s, color .15s; }
.ws-seg input:checked + label { background: #fff; color: #1f2933; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }
.ws-seg input:focus-visible + label { outline: 2px solid var(--ws-navy); outline-offset: 1px; }
.ws-seg.ws-tri input:checked + label { color: #fff; background: var(--ws-navy); box-shadow: none; }
.ws-seg.ws-tri input.ws-hid:checked + label { background: #94a3b8; }

/* Segmented control built from buttons (waiver timing — boolean via wire:click) */
.ws-segbtn { display: inline-flex; background: #eef3f8; border-radius: 9px; padding: 3px; flex: none; }
.ws-segbtn button { border: 0; background: transparent; font: inherit; font-size: 12px; padding: 5px 11px; border-radius: 7px; cursor: pointer; color: var(--ws-muted); white-space: nowrap; }
.ws-segbtn button.ws-on { background: #fff; color: #1f2933; box-shadow: 0 1px 3px rgba(0,0,0,.12); font-weight: 600; }

/* Color swatches + custom picker + hex */
.ws-swatches { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ws-swatches .ws-sw-c { width: 25px; height: 25px; border-radius: 7px; cursor: pointer; border: 2px solid #fff; box-shadow: 0 0 0 1px var(--ws-line); }
.ws-swatches .ws-sw-c.ws-on { box-shadow: 0 0 0 2px var(--ws-navy); }
.ws-swatches input[type=color] { width: 29px; height: 29px; border: 1px solid var(--ws-line); border-radius: 7px; background: #fff; padding: 2px; cursor: pointer; }
.ws-hexin { width: 94px; border: 1px solid var(--ws-line); border-radius: 7px; background: #fff; padding: 6px 8px; font-family: "SF Mono", Menlo, monospace; font-size: 11.5px; text-transform: uppercase; letter-spacing: .02em; color: #1f2933; }
.ws-hexin:focus { outline: none; border-color: var(--ws-navy); }

/* Text inputs / textareas */
.ws-tin { width: 100%; border: 1px solid var(--ws-line); border-radius: 9px; background: #f9fafb; padding: 9px 11px; font: inherit; font-size: 13px; color: #1f2933; }
.ws-tin:focus { outline: none; border-color: var(--ws-navy); background: #fff; }
textarea.ws-tin { resize: vertical; min-height: 58px; }
.ws-fieldlbl { font-size: 12px; color: var(--ws-muted); margin: 0 0 5px; display: block; }
.ws-two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }

/* Voucher amount list — compact read-only rows with inline edit, so a shop with
   six price points reads as a list instead of six input boxes shouting at once. */
.ws-amts { display: flex; flex-direction: column; gap: 4px; max-width: 320px; margin-top: 6px; }
.ws-amt { display: flex; align-items: center; gap: 8px; border: 1px solid var(--ws-line); border-radius: 9px; background: #f9fafb; padding: 6px 8px 6px 11px; }
.ws-amt-val { flex: 1; font-size: 13px; color: #1f2933; }
.ws-amt input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 13px; color: #1f2933; padding: 0; }
.ws-amt input:focus { outline: none; }
.ws-amt-btn { border: 0; background: transparent; color: var(--ws-muted); font-size: 12px; line-height: 1; padding: 4px 5px; border-radius: 6px; cursor: pointer; }
.ws-amt-btn:hover { background: #eef1f5; color: var(--ws-navy); }
.ws-amt-add { align-self: flex-start; border: 1px dashed var(--ws-line); background: #fff; color: var(--ws-navy); font-size: 12.5px; border-radius: 9px; padding: 6px 12px; cursor: pointer; }
.ws-amt-add:hover { border-color: var(--ws-navy); }

/* URL slug box */
.ws-urlbox { display: flex; align-items: stretch; border: 1px solid var(--ws-line); border-radius: 9px; overflow: hidden; max-width: 520px; }
.ws-urlbox .ws-pre { background: #f3f5f8; color: var(--ws-muted); font-size: 12.5px; display: flex; align-items: center; padding: 0 10px; white-space: nowrap; }
.ws-urlbox input { border: 0; background: #fff; padding: 9px 10px; font: inherit; font-size: 13px; flex: 1; min-width: 0; }
.ws-urlbox input:focus { outline: none; }
.ws-urlrow { display: flex; gap: 8px; align-items: stretch; max-width: 560px; }
.ws-urlrow .ws-urlbox { flex: 1; max-width: none; }
.ws-copybtn { flex: none; border: 1px solid var(--ws-line); background: #fff; border-radius: 9px; padding: 0 14px; font-size: 12.5px; font-weight: 600; color: var(--ws-navy); cursor: pointer; white-space: nowrap; }
.ws-copybtn:hover { background: #f0f6ff; border-color: var(--ws-navy); }

/* "Manage levels" disclosure link */
.ws-disc { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ws-navy); cursor: pointer; padding: 6px 0; background: none; border: 0; font-weight: 600; }
.ws-disc svg { width: 14px; height: 14px; }

/* Settings tab capped so rows stay tight like the mockup (a full-width tab
   would stretch each label-to-control row across the whole page). */
.ws-settings { max-width: 880px; }

/* "Saved automatically" chip */
.ws-saved { display: none; align-items: center; gap: 6px; font-size: 12px; color: #0a7d3d; transition: opacity .3s; }
.ws-saved.ws-saved-on { display: inline-flex; }
.ws-saved .ws-dot { width: 7px; height: 7px; border-radius: 50%; background: #2ee06a; }

/* Inline link inside hint text (the app's global <a> can compute to block,
   which would force a line break before/after — keep it inline). */
.ws-link { display: inline; color: var(--ws-navy); font-weight: 600; }
.ws-link:hover { text-decoration: underline; }

/* Field info tooltip icon */
.ws-info { color: var(--ws-muted); font-size: 12px; margin-left: 4px; cursor: help; opacity: .7; }
.ws-info:hover { opacity: 1; color: var(--ws-navy); }

/* Advanced section tag (grey vs the green "new" tag) */
.ws-sect-hd .ws-tag.ws-adv { color: var(--ws-muted); background: #eef1f5; }

/* 4 ── Right: options → code → preview ─────────────────────────────────── */
.ws-preview-pane { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.ws-pcfg { background: #fff; border: 1px solid var(--ws-line); border-radius: 14px; padding: 14px 16px; }
.ws-pcfg .ws-pchd { font-weight: 600; font-size: 13.5px; color: #1f2933; }
.ws-pcfg .ws-pcsub { font-size: 11.5px; color: var(--ws-muted); margin: 4px 0 12px; line-height: 1.45; }
.ws-pcfg .ws-note { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; border-radius: 9px; padding: 8px 10px; font-size: 11.5px; line-height: 1.45; margin-top: 4px; }

.ws-embed { background: #0e1b2b; border-radius: 14px; padding: 13px 15px; }
.ws-embed .ws-eh { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.ws-embed .ws-eh .ws-et { font-weight: 600; color: #fff; font-size: 13px; flex: 1; }
.ws-embed textarea { width: 100%; background: transparent; border: 0; resize: none; color: #9fd0ff; font-family: "SF Mono", Menlo, monospace; font-size: 11px; line-height: 1.55; padding: 0; }
.ws-embed textarea:focus { outline: none; }
.ws-copy { background: #1c8cff; color: #fff; border: 0; border-radius: 8px; font-size: 12px; font-weight: 600; padding: 7px 13px; cursor: pointer; white-space: nowrap; }
.ws-copy:hover { opacity: .9; }

.ws-pv-box { background: #fff; border: 1px solid var(--ws-line); border-radius: 14px; overflow: hidden; }
.ws-pv-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--ws-line); }
.ws-pv-bar .ws-lab { font-size: 12px; color: var(--ws-muted); flex: 1; }
.ws-device { display: inline-flex; gap: 4px; }
.ws-device button { border: 1px solid var(--ws-line); background: #fff; border-radius: 8px; width: 33px; height: 29px; display: grid; place-items: center; cursor: pointer; color: var(--ws-muted); }
.ws-device button.ws-on { border-color: var(--ws-navy); color: var(--ws-navy); background: #f0f6ff; }
.ws-device svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; }
.ws-refresh { border: 1px solid var(--ws-line); background: #fff; border-radius: 8px; height: 29px; padding: 0 10px; font-size: 11.5px; cursor: pointer; color: var(--ws-muted); }
.ws-refresh:hover { color: var(--ws-navy); border-color: var(--ws-navy); }

.ws-stage { background: #eef1f5; padding: 16px; display: grid; place-items: start center; }
.ws-frame { background: #fff; border-radius: 11px; box-shadow: 0 10px 28px rgba(15,40,70,.12); width: 100%; transition: max-width .25s; overflow: hidden; }
.ws-frame.ws-tablet { max-width: 360px; }
.ws-frame.ws-mobile { max-width: 280px; }
.ws-frame iframe { display: block; width: 100%; height: 620px; border: 0; }

.ws-pv-empty { padding: 40px 24px; text-align: center; color: var(--ws-muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 1100px) {
	.ws-preview-pane { position: static; }
	.ws-placer { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
	.ws-placer { grid-template-columns: 1fr; }
}
