/* Purchase panel: service pages open the same configuration form in a dialog. The form page itself is the only scroll area. */
html.purchase-panel-open { overflow: hidden; scrollbar-gutter: stable; }
.purchase-panel { width: min(960px, calc(100vw - 48px)); max-width: none; height: min(940px, calc(100vh - 48px)); height: min(940px, calc(100dvh - 48px)); max-height: none; margin: auto; border: 0; border-top: 4px solid var(--gold); padding: 0; overflow: hidden; overscroll-behavior: contain; color: var(--ink); background: var(--paper); box-shadow: 0 24px 64px rgba(6, 18, 28, 0.38); }
.purchase-panel[open] { display: flex; flex-direction: column; }
.purchase-panel::backdrop { background: rgba(6, 18, 28, 0.66); }
.purchase-panel__bar { display: flex; flex-shrink: 0; align-items: center; justify-content: space-between; gap: 16px; padding: 6px 8px 6px 24px; color: var(--white); background: var(--ink); }
.purchase-panel__title { min-width: 0; margin: 0; overflow: hidden; color: inherit; font: 800 clamp(1.35rem, 2.6vw, 1.7rem)/1.1 'Barlow Condensed', sans-serif; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }
.purchase-panel__close { display: inline-flex; flex-shrink: 0; align-items: center; justify-content: center; gap: 6px; min-width: 44px; min-height: 44px; border: 0; padding: 8px 12px; color: inherit; background: transparent; font: 800 0.95rem/1 'Barlow', sans-serif; cursor: pointer; }
.purchase-panel__close svg { width: 22px; height: 22px; }
.purchase-panel__close:hover { color: var(--gold); }
:is(.purchase-panel, .purchase-panel-toast) :focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
.purchase-panel__body { position: relative; flex: 1; min-height: 0; }
.purchase-panel__frame { display: block; width: 100%; height: 100%; border: 0; background: var(--paper); }
/* The frame stays hidden until the embedded form has removed its page chrome. */
.purchase-panel__body:not([data-state='ready']) .purchase-panel__frame { visibility: hidden; }
.purchase-panel__notice { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center; }
.purchase-panel__body[data-state='ready'] .purchase-panel__notice { display: none; }
.purchase-panel__notice p { max-width: 440px; margin: 0; font-weight: 600; }
.purchase-panel__notice a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 800; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 6px; }

/* Added To Cart is a confirmation, not a step: it does not block the page or move focus from the Buy link. */
.purchase-panel-toast { position: fixed; z-index: 1000; right: max(16px, env(safe-area-inset-right, 0px)); bottom: max(16px, env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; width: min(420px, calc(100vw - 32px)); border-left: 4px solid var(--gold); padding: 12px 8px 14px 18px; color: var(--white); background: var(--ink); box-shadow: 0 16px 40px rgba(6, 18, 28, 0.32); }
.purchase-panel-toast[hidden] { display: none; }
.purchase-panel-toast[data-position='top'] { top: calc(var(--header-height, 72px) + max(12px, env(safe-area-inset-top, 0px))); bottom: auto; }
.purchase-panel-toast__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.purchase-panel-toast__text { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 8px; align-items: center; margin: 6px 0 0; overflow-wrap: anywhere; }
.purchase-panel-toast__text svg { width: 22px; height: 22px; color: var(--gold); }
.purchase-panel-toast__text strong { font: 800 1.35rem/1.1 'Barlow Condensed', sans-serif; text-transform: uppercase; }
.purchase-panel-toast__text span { grid-column: 2; color: rgba(255, 255, 255, 0.82); }
.purchase-panel-toast__dismiss { display: inline-grid; flex-shrink: 0; place-items: center; width: 44px; height: 44px; border: 0; padding: 0; color: inherit; background: transparent; cursor: pointer; }
.purchase-panel-toast__dismiss svg { width: 20px; height: 20px; }
.purchase-panel-toast__actions { display: flex; flex-wrap: wrap; gap: 10px; padding-right: 10px; }
.purchase-panel-toast__action { display: inline-flex; flex: 1 1 140px; align-items: center; justify-content: center; min-height: 44px; border: 2px solid var(--gold); padding: 8px 16px; color: var(--white); background: transparent; font: 800 0.8rem/1 'Barlow', sans-serif; letter-spacing: 0.08em; text-decoration: none; text-transform: uppercase; cursor: pointer; }
.purchase-panel-toast__action--cart { color: var(--ink); background: var(--gold); }
.purchase-panel-live { position: absolute; width: 1px; height: 1px; margin: -1px; border: 0; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Embedded form: only the surrounding page chrome is removed. The script never marks the configuration form. */
html.purchase-panel-embedded, html.purchase-panel-embedded body { --header-height: 0px; }
html.purchase-panel-embedded { overscroll-behavior: contain; }
html.purchase-panel-embedded [data-purchase-panel-hidden] { display: none !important; }
html.purchase-panel-embedded .estimate-app.section-pad { padding-block: 0; }
html.purchase-panel-embedded .estimate-app > .shell { width: 100%; }
html.purchase-panel-embedded .estimate-stage { border: 0; box-shadow: none; }

@media (max-width: 700px) {
    .purchase-panel { width: 100%; height: 100%; height: 100dvh; margin: 0; border-top: 0; padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); box-shadow: none; }
    .purchase-panel__bar { margin-inline: calc(-1 * env(safe-area-inset-left, 0px)) calc(-1 * env(safe-area-inset-right, 0px)); padding: max(4px, env(safe-area-inset-top, 0px)) max(4px, env(safe-area-inset-right, 0px)) 4px max(16px, env(safe-area-inset-left, 0px)); border-bottom: 3px solid var(--gold); }
    .purchase-panel-toast { right: max(12px, env(safe-area-inset-right, 0px)); bottom: max(12px, env(safe-area-inset-bottom, 0px)); left: max(12px, env(safe-area-inset-left, 0px)); width: auto; }
}
