/* The Cavanni Fitting Room (loaded only where it is offered). */
.fit {
	width: min(1180px, 100% - 32px); max-width: none; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px);
	padding: 0; border: 1px solid var(--line-d); background: var(--ink); color: var(--text-d);
}
.fit::backdrop { background: rgba(13, 11, 10, .78); }
.fit[open] { display: flex; animation: dialogIn .5s var(--ease-out); }
.fit__shell { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.fit__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px clamp(18px, 3vw, 32px) 12px; }
.fit__k { display: flex; align-items: center; gap: 10px; font: 500 var(--fs-xs)/1 var(--f-sans); letter-spacing: .26em; text-transform: uppercase; color: var(--gold); }
.fit__k .emblem { width: 16px; height: 16px; }
.fit__title { margin-top: 10px; font: 300 clamp(1.4rem, 1.1rem + 1.2vw, 2.1rem)/1.15 var(--f-serif); }
.fit__tabs { display: flex; gap: 28px; padding: 0 clamp(18px, 3vw, 32px); border-bottom: 1px solid var(--line-d2); }
.fit__tabs [role="tab"] { position: relative; min-height: 46px; font: 500 var(--fs-xs)/1 var(--f-sans); letter-spacing: .22em; text-transform: uppercase; color: var(--muted-d); }
.fit__tabs [role="tab"]::after { content: ""; position: absolute; left: 0; right: .22em; bottom: -1px; height: 1px; background: var(--gold); transform: scaleX(0); transition: transform .4s var(--ease-out); }
.fit__tabs [aria-selected="true"] { color: var(--text-d); }
.fit__tabs [aria-selected="true"]::after { transform: scaleX(1); }
.fit__tabs [role="tab"]:disabled { opacity: .35; cursor: not-allowed; }
.fit__body { flex: 1; min-height: 0; overflow-y: auto; padding: 18px clamp(18px, 3vw, 32px); }
.fit__note { margin-top: 12px; color: var(--muted-d); font-size: var(--fs-sm); }

/* Stage */
.stage { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 4 / 3; max-height: 62vh; max-height: 62dvh; margin-inline: auto; background: var(--ink-2); overflow: hidden; }
.stage__canvas { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.stage__video { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.stage__intro { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 20px; padding: 24px; text-align: center; background: radial-gradient(circle at 50% 40%, var(--ink-3), var(--ink-2) 70%); }
.stage__mark { width: 64px; height: 64px; color: var(--gold); }
.stage__lead { max-width: 40ch; font: 300 1.25rem/1.45 var(--f-serif); color: rgba(243, 237, 228, .88); }
.stage__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.stage__actions label { cursor: pointer; }
.stage__actions label:focus-within { outline: 1px solid var(--gold); outline-offset: 3px; }
.stage__status {
	position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 2; max-width: calc(100% - 32px);
	padding: 10px 16px; background: rgba(13, 11, 10, .78); color: var(--text-d); font-size: var(--fs-sm); text-align: center;
}
.stage__status:empty { display: none; }
.stage.is-loading .stage__mark path { stroke-dasharray: 1; animation: drawloop 2.2s var(--ease) infinite; }
@keyframes drawloop { 0% { stroke-dashoffset: 1; } 60%, 100% { stroke-dashoffset: 0; } }
.stage__tools { position: absolute; z-index: 2; right: 14px; top: 14px; display: flex; gap: 8px; }
.stage__tools > * { background: rgba(13, 11, 10, .72); color: var(--text-d); }
.stage__size { display: flex; align-items: center; gap: 2px; padding: 0 6px; font: 500 10px/1 var(--f-sans); letter-spacing: .2em; text-transform: uppercase; }
.stage__tools .ibtn { width: 44px; height: 44px; }
.stage__tools .ibtn .ic { width: 20px; height: 20px; }
.ibtn--snap { color: var(--gold) !important; }

/* Picker + footer */
.fit__foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px clamp(18px, 3vw, 32px) calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line-d2); }
.fit__picker { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; min-width: 0; }
.fit__picker::-webkit-scrollbar { display: none; }
.fit__pick { flex: none; width: 52px; height: 64px; border: 1px solid transparent; background: var(--ivory); overflow: hidden; transition: border-color .25s var(--ease), opacity .25s var(--ease); }
.fit__pick img { width: 100%; height: 100%; object-fit: cover; }
.fit__pick[aria-pressed="true"] { border-color: var(--gold); outline: 1px solid var(--gold); }
.fit__pick.is-dim { opacity: .35; }
.fit__cta { flex: none; min-height: 48px; padding: 0 22px; background: var(--gold); border-color: var(--gold); color: var(--ink); }
.fit__cta::before { background: var(--ivory); }

/* Photo fitting */
.photo { display: grid; gap: 18px; }
.photo__cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.photo__drop, .photo__result { position: relative; display: grid; place-items: center; aspect-ratio: 3 / 4; max-height: 52vh; background: var(--ink-2); overflow: hidden; }
.photo__drop img, .photo__result img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
.photo__empty { display: grid; justify-items: center; gap: 14px; padding: 24px; text-align: center; color: var(--muted-d); font-size: var(--fs-sm); }
.photo__empty .ic { width: 30px; height: 30px; color: var(--gold); }
.photo__drop label { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); cursor: pointer; background: rgba(13, 11, 10, .7); color: var(--text-d); border-color: rgba(243, 237, 228, .5); }
.photo__drop label:focus-within { outline: 1px solid var(--gold); }
.photo__drop label::before { background: var(--ivory); }
.photo__drop label:hover { color: var(--ink); }
.photo__placeholder { display: grid; justify-items: center; gap: 16px; padding: 24px; text-align: center; color: var(--muted-d); font: 300 1.15rem/1.4 var(--f-serif); }
.photo__mark { width: 52px; height: 52px; color: var(--gold); }
.is-working .photo__mark path { stroke-dasharray: 1; animation: drawloop 2.2s var(--ease) infinite; }
.photo .check { color: var(--muted-d); }
.photo .check__box { border-color: var(--muted-d); }
.photo .check a { color: var(--gold); }
.photo__actions { display: flex; flex-wrap: wrap; gap: 12px; }
.photo__actions .btn { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.photo__actions .btn::before { background: var(--ivory); }
.photo__actions .btn--ghost { background: transparent; color: var(--text-d); border-color: rgba(243, 237, 228, .5); }
.fit .form__status[data-state="error"] { color: var(--error-d); }
.fit .form__status[data-state="ok"] { color: var(--gold); }

@media (max-width: 699px) {
	.fit { width: 100%; height: 100%; max-height: none; margin: 0; border: 0; }
	.fit[open] { display: flex; }
	.stage { aspect-ratio: 3 / 4; max-height: none; }
	.photo__cols { grid-template-columns: minmax(0, 1fr); }
	.photo__result:has(> .photo__placeholder:not([hidden])) { aspect-ratio: auto; min-height: 140px; }
	.fit__foot { flex-wrap: wrap; }
	.fit__cta { width: 100%; }
}
