/* Nuspace — showroom visit booking window and the /visit/ page. */

html.ns-visit-lock { overflow: hidden; }
.ns-visit {
	width: min(560px, calc(100vw - 24px)); max-height: min(760px, calc(100dvh - 24px)); padding: 0; border: 0; border-radius: 16px;
	background: var(--white, #fff); color: var(--ink, #3d3936); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45);
	font-family: var(--font-text, system-ui, sans-serif); font-size: 1rem; line-height: 1.5; overflow: hidden;
}
.ns-visit[open] { display: flex; flex-direction: column; }
.ns-visit::backdrop { background: rgba(20, 18, 16, .55); }
.ns-visit__head { display: flex; justify-content: space-between; gap: 1rem; align-items: start; padding: 20px 22px 14px; border-bottom: 1px solid var(--line, #e4e1dc); }
.ns-visit__head h2 { margin: 0; font-size: 1.3rem; line-height: 1.25; }
.ns-visit__head p { margin: 4px 0 0; color: var(--ink-soft, #6b6661); font-size: .9rem; }
.ns-visit__x { flex: none; display: grid; place-items: center; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--surface-warm, #f6f3ee); color: var(--ink, #3d3936); cursor: pointer; }
.ns-visit__x:hover { background: var(--line, #e4e1dc); }
.ns-visit__body { position: relative; padding: 18px 22px 22px; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; }
.ns-visit__step { margin: 0 0 10px; font-weight: 600; font-size: .95rem; }
.ns-visit__muted { color: var(--ink-soft, #6b6661); font-size: .88rem; margin: 10px 0 0; }
.ns-visit__err { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #fdecea; color: #9b2c22; font-size: .92rem; }
.ns-visit__err a { color: inherit; }
.ns-visit__loading { padding: 40px 0; text-align: center; color: var(--ink-soft, #6b6661); }

/* Calendar */
.ns-cal__nav { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.ns-cal__nav strong { font-size: 1rem; }
.ns-cal__nav button { display: grid; place-items: center; width: 36px; height: 36px; border: 1px solid var(--line, #e4e1dc); border-radius: 50%; background: var(--white, #fff); color: var(--ink, #3d3936); cursor: pointer; }
.ns-cal__nav button:disabled { opacity: .35; cursor: default; }
.ns-cal__grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; }
.ns-cal__dow { font-size: .72rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--ink-soft, #6b6661); padding: 4px 0; }
.ns-cal__day { display: grid; place-items: center; aspect-ratio: 1; max-height: 52px; border-radius: 10px; font-size: .95rem; font-variant-numeric: tabular-nums; }
.ns-cal__day.is-off { color: #bdb7af; }
button.ns-cal__day { border: 1px solid var(--line, #e4e1dc); background: var(--white, #fff); color: var(--ink, #3d3936); font: inherit; font-weight: 600; cursor: pointer; }
button.ns-cal__day:hover { border-color: var(--primary, #0272ad); color: var(--primary, #0272ad); }
button.ns-cal__day.is-on { background: var(--primary, #0272ad); border-color: var(--primary, #0272ad); color: #fff; }
.ns-cal__day.is-today { box-shadow: inset 0 -3px 0 var(--accent, #04a6f7); }
[data-times] { margin-top: 18px; }

/* Times */
.ns-times { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.ns-times button { padding: 10px 6px; border: 1px solid var(--line, #e4e1dc); border-radius: 999px; background: var(--white, #fff); color: var(--ink, #3d3936); font: inherit; font-weight: 600; font-size: .92rem; cursor: pointer; font-variant-numeric: tabular-nums; }
.ns-times button:hover { border-color: var(--primary, #0272ad); color: var(--primary, #0272ad); }
.ns-visit button:focus-visible { outline: 3px solid var(--accent, #04a6f7); outline-offset: 2px; }

/* Details */
.ns-visit__pick { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 10px 14px; margin-bottom: 14px; border-radius: 10px; background: var(--surface-warm, #f6f3ee); }
.ns-visit__change { border: 0; background: none; color: var(--primary, #0272ad); font: inherit; font-weight: 600; cursor: pointer; padding: 4px; }
.ns-visit__form { display: grid; gap: 12px; }
.ns-visit__form label { display: block; margin: 0; font-weight: 600; font-size: .9rem; color: var(--ink, #3d3936); }
.ns-visit__form label span { font-weight: 400; color: var(--ink-soft, #6b6661); }
.ns-visit__form input, .ns-visit__form textarea { display: block; box-sizing: border-box; margin-top: 6px; width: 100%; max-width: 100%; padding: 11px 13px; border: 1px solid var(--line-strong, #cfcac3); border-radius: 10px; background: var(--white, #fff); font: inherit; font-size: 16px; font-weight: 400; color: var(--ink, #3d3936); }
/* 16px: below that, iPhones zoom the page in when a box is tapped, and the page then scrolls sideways. */
.ns-visit__form input:focus, .ns-visit__form textarea:focus { outline: none; border-color: var(--primary, #0272ad); box-shadow: 0 0 0 3px rgba(4, 166, 247, .18); }
.ns-visit__hp { position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0; }
.ns-visit__go { justify-self: start; padding: 13px 26px; border: 0; border-radius: 999px; background: var(--primary, #0272ad); color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.ns-visit__go:hover { background: var(--primary-dark, #015a89); }
.ns-visit__go:disabled { opacity: .7; cursor: wait; }

/* Done */
.ns-visit__done { text-align: center; padding: 8px 4px 4px; }
.ns-visit__done h3 { margin: 10px 0 8px; font-size: 1.2rem; }
.ns-visit__done p { margin: 0 0 10px; }
.ns-visit__done .ns-visit__go { justify-self: center; margin-top: 8px; }
.ns-visit__tick { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: #e7f5ec; color: #1e7a45; }

/* Phones: a bottom sheet. Slides up, rounded top corners, a strip of the page stays visible above it. */
@media (max-width: 520px) {
	.ns-visit {
		width: 100%; max-width: 100%; height: auto; max-height: calc(100dvh - 48px);
		inset: auto 0 0 0; margin: 0; border-radius: 18px 18px 0 0;   /* Anchored to the bottom only, so it's as tall as its content. */
		padding-bottom: env(safe-area-inset-bottom, 0px);   /* Clear the iPhone home bar. */
	}
	.ns-visit__head { position: relative; padding-top: 26px; touch-action: none; }
	.ns-visit__head::before { content: ""; position: absolute; top: 9px; left: 50%; width: 40px; height: 5px; margin-left: -20px; border-radius: 3px; background: var(--line-strong, #cfcac3); }
	.ns-visit__head, .ns-visit__body { padding-left: 16px; padding-right: 16px; }
}
@media (max-width: 520px) and (prefers-reduced-motion: no-preference) {
	@keyframes ns-sheet-up { from { transform: translateY(100%); } to { transform: none; } }
	@keyframes ns-fade-in { from { opacity: 0; } to { opacity: 1; } }
	.ns-visit[open] { animation: ns-sheet-up .28s cubic-bezier(.2, .8, .2, 1); }
	.ns-visit[open]::backdrop { animation: ns-fade-in .28s ease; }
}

/* /visit/ page (confirm, cancel) */
.ns-visit-page { padding: clamp(40px, 8vw, 88px) var(--gutter, 16px); background: var(--surface-warm, #f6f3ee); }
.ns-visit-card { max-width: 620px; margin: 0 auto; padding: clamp(24px, 5vw, 40px); border-radius: 16px; background: var(--white, #fff); box-shadow: 0 10px 30px -18px rgba(0, 0, 0, .35); }
.ns-visit-card > p, .ns-visit-card > form { margin: 0 0 16px; }
.ns-visit-card > .ns-visit-btn { margin-bottom: 18px; }
.ns-visit-card h1 { font-size: clamp(1.6rem, 1.3rem + 1.2vw, 2.1rem); margin: 0 0 12px; }
.ns-visit-eyebrow { margin: 0 0 6px; font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--primary, #0272ad); }
.ns-visit-dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 18px 0; padding: 16px 18px; border-radius: 12px; background: var(--surface-warm, #f6f3ee); }
.ns-visit-dl dt { font-weight: 600; }
.ns-visit-dl dd { margin: 0; }
.ns-visit-btn { display: inline-block; padding: 13px 26px; border-radius: 999px; background: var(--primary, #0272ad); color: #fff !important; font-weight: 600; text-decoration: none; }
.ns-visit-btn:hover { background: var(--primary-dark, #015a89); }
.ns-visit-link { border: 0; padding: 0; background: none; color: var(--primary, #0272ad); font: inherit; text-decoration: underline; cursor: pointer; }
.ns-visit-muted { color: var(--ink-soft, #6b6661); font-size: .92rem; }
.ns-visit-card a:not(.ns-visit-btn) { color: var(--primary, #0272ad); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 520px) { .ns-visit-dl { grid-template-columns: 1fr; } }
