.vlpp {
    --vlpp-accent: var(--vl-theme-accent, var(--color-primary-500, #c39568));
    --vlpp-text: var(--vl-theme-text, var(--color-primary-200, #dcd2ca));
    --vlpp-label: var(--vl-theme-accent, var(--color-primary-400, #b49a84));
    --vlpp-line: color-mix(in srgb, var(--vlpp-text) 30%, transparent);
    --vlpp-error: #e56c90;
    /* Separate the completed personalization from the product benefits below. */
    margin-block: 32px 0; padding-block-end: 112px; color: var(--vlpp-text);
    font-family: var(--font-sofia, inherit); font-size: 16px; line-height: 1.5;
}
.vlpp *, .vlpp *::before, .vlpp *::after { box-sizing: border-box; }
/* Prices → original purchase control → 112px breathing room → benefits. */
.vlpp--purchase-before-benefits { margin-block-end: 24px; padding-block-end: 0; }
.vlpp-after-purchase { padding-block-start: 112px; clear: both; }
form.cart:has(.vlpp--purchase-before-benefits) .single_add_to_cart_button { display: block; float: none; margin: 0; }
.vlpp [hidden] { display: none !important; }
.vlpp .vlpp-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.vlpp .vlpp-field { border: 0; padding: 0; margin: 0 0 40px; min-width: 0; }
.vlpp .vlpp-field legend { display: flex; align-items: flex-start; flex-wrap: nowrap; gap: 8px; float: none; padding: 0; margin-bottom: 16px; color: var(--vlpp-text); font: 500 18px/28px var(--font-sofia, sans-serif); width: 100%; }
.vlpp .vlpp-field legend.vlpp-sr-only { width: 1px; margin: 0; }
.vlpp .vlpp-legend-label { flex: 1; min-width: 0; }
.vlpp .vlpp-cost { display: grid; flex: 0 0 auto; min-width: 80px; min-height: 28px; margin-left: auto; font-size: inherit; font-weight: 400; line-height: 28px; font-variant-numeric: tabular-nums; text-align: right; opacity: .65; white-space: nowrap; }
.vlpp .vlpp-cost > span { grid-area: 1 / 1; }
.vlpp .vlpp-cost-reserve { visibility: hidden; pointer-events: none; user-select: none; }
.vlpp .vlpp-required, .vlpp .vlpp-error { color: var(--vlpp-error); }
/* Scoped important overrides the theme's global important input utilities. */
.vlpp .vlpp-field textarea, .vlpp .vlpp-field input[type="text"] { width: 100%; height: auto !important; min-height: 56px; border: 1px solid transparent !important; border-radius: 16px !important; padding: 16px !important; font: 500 18px/24px var(--font-sofia, sans-serif) !important; background: var(--color-primary-200, #dcd2ca) !important; color: #27231e !important; margin: 0; }
.vlpp .vlpp-field textarea { resize: vertical; min-height: 96px; }
.vlpp .vlpp-field textarea:focus-visible, .vlpp .vlpp-field input[type="text"]:focus-visible { outline: 2px solid var(--vlpp-accent); outline-offset: 8px; }
.vlpp .vlpp-options { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.vlpp .vlpp-fonts, .vlpp .vlpp-options--two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vlpp .vlpp-radios { grid-template-columns: 1fr; gap: 8px; }
.vlpp .vlpp-option { position: relative; display: block; cursor: pointer; min-width: 0; margin: 0; }
.vlpp .vlpp-option--image > input { position: absolute; width: 1px; height: 1px; opacity: 0; padding: 0; margin: 0; }
.vlpp .vlpp-option-body { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.vlpp .vlpp-option-media { display: grid; position: relative; border-radius: var(--vl-media-radius, 24px); }
/* Paint selection inside the existing frame: neither layout nor its visible bounds grow. */
.vlpp .vlpp-option-media::after { content: ''; position: absolute; inset: 0; border: 2px solid transparent; border-radius: inherit; pointer-events: none; }
.vlpp .vlpp-option-media > img { display: block; width: 100%; height: auto; max-width: 100%; aspect-ratio: auto; object-fit: contain; border-radius: inherit; }
.vlpp .vlpp-option-caption { display: flex; flex-wrap: nowrap; justify-content: space-between; align-items: baseline; gap: 8px; width: 100%; color: var(--vlpp-label); font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.vlpp .vlpp-option-caption > span { min-width: 0; }
.vlpp .vlpp-option-caption small { flex: 0 0 auto; margin-left: auto; font: inherit; font-variant-numeric: tabular-nums; opacity: .75; white-space: nowrap; }
.vlpp .vlpp-option input:checked + .vlpp-option-body .vlpp-option-media::after { border-color: var(--vlpp-accent); }
.vlpp .vlpp-option input:focus-visible + .vlpp-option-body .vlpp-option-media { outline: 2px solid var(--vlpp-text); outline-offset: 8px; }
.vlpp .vlpp-option input:disabled + .vlpp-option-body { opacity: .4; cursor: not-allowed; }
.vlpp .vlpp-selection-mark { display: none; position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; background: var(--vlpp-accent); border: 1px solid var(--vlpp-text); border-radius: 50%; }
.vlpp .vlpp-selection-mark::after { content: ''; position: absolute; left: 8px; top: 4px; width: 6px; height: 11px; border: solid #27231e; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.vlpp .vlpp-option input:checked + .vlpp-option-body .vlpp-selection-mark { display: block; }
.vlpp .vlpp-option--text, .vlpp .vlpp-toggle { display: flex; align-items: center; gap: 8px; min-height: 40px; color: var(--vlpp-label); cursor: pointer; }
.vlpp .vlpp-option--text > .vlpp-option-body, .vlpp .vlpp-toggle > span:not(.vlpp-cost) { flex: 1; min-width: 0; }
.vlpp .vlpp-option--text .vlpp-option-caption { font-size: 16px; }
.vlpp .vlpp-option--text > input, .vlpp .vlpp-toggle > input { appearance: none; -webkit-appearance: none; position: relative; flex: 0 0 24px; width: 24px; height: 24px; margin: 0; padding: 0; border: 1.5px solid var(--vlpp-label); background: transparent; cursor: pointer; }
.vlpp .vlpp-option--text > input[type="radio"] { border-radius: 50%; }
.vlpp .vlpp-option--text > input[type="checkbox"], .vlpp .vlpp-toggle > input { border-radius: 4px; }
.vlpp .vlpp-option--text > input[type="radio"]:checked::after { content: ''; position: absolute; inset: 4px; border-radius: 50%; background: var(--vlpp-label); }
.vlpp .vlpp-option--text > input[type="checkbox"]:checked, .vlpp .vlpp-toggle > input:checked { background: var(--vlpp-accent); border-color: var(--vlpp-accent); }
.vlpp .vlpp-option--text > input[type="checkbox"]:checked::after, .vlpp .vlpp-toggle > input:checked::after { content: ''; position: absolute; left: 7px; top: 3px; width: 7px; height: 12px; border: solid #27231e; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.vlpp .vlpp-option--text > input:focus-visible, .vlpp .vlpp-toggle > input:focus-visible { outline: 2px solid var(--vlpp-text); outline-offset: 8px; }
.vlpp .vlpp-font-preview { min-height: 144px; align-items: center; justify-content: center; padding: 24px 16px; font-size: 32px; line-height: 1.5; text-align: center; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--vlpp-label); }
.vlpp .vlpp-font-preview:not([hidden]) { display: flex; }
.vlpp .vlpp-help { display: block; font-size: 14px; line-height: 1.5; opacity: .7; margin: 8px 0 16px; }
.vlpp [data-vlpp-count] { text-align: right; font-size: 12px; margin: 8px 0 0; }
.vlpp .vlpp-heading { margin: 48px 0 24px; }
.vlpp .vlpp-error { margin: 8px 0 0; font-size: 14px; }
.vlpp .vlpp-field.has-error { outline: 1px solid var(--vlpp-error); outline-offset: 8px; border-radius: 8px; }
.vlpp .vlpp-summary { display: grid; gap: 16px; border-top: 1px solid var(--vlpp-line); padding-top: 24px; margin-top: 32px; }
.vlpp .vlpp-summary > div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; }
.vlpp .vlpp-upload-picker { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; position: relative; border: 1px solid var(--vlpp-line); border-radius: 16px; padding: 8px; cursor: pointer; }
.vlpp .vlpp-upload-picker input[type="file"] { position: absolute; inset: 0; width: 100%; height: 100% !important; padding: 0 !important; margin: 0; opacity: 0; cursor: pointer; }
.vlpp .vlpp-upload-picker:focus-within { outline: 2px solid var(--vlpp-text); outline-offset: 8px; }
.vlpp .vlpp-upload-picker:has(input:disabled) { opacity: .55; }
.vlpp .vlpp-upload-picker input:disabled { cursor: wait; }
.vlpp .vlpp-upload-button { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 16px 24px; border-radius: 8px; background: var(--vlpp-label); color: #27231e; font-weight: 700; }
.vlpp .vlpp-upload-button .vl-ui-icon { display: block; flex: 0 0 24px; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: var(--vl-icon-stroke-width, 1.5px); stroke-linecap: round; stroke-linejoin: round; }
.vlpp .vlpp-upload-hint { font-size: 14px; padding-right: 8px; opacity: .7; }
.vlpp .vlpp-upload-list { padding: 0; margin: 16px 0 0; list-style: none; display: grid; gap: 16px; }
.vlpp .vlpp-upload-list:empty, .vlpp .vlpp-upload-status:empty { display: none; }
.vlpp .vlpp-upload-item { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; gap: 16px; border: 1px solid var(--vlpp-line); border-radius: 16px; padding: 0; }
.vlpp .vlpp-upload-thumb { display: flex; align-items: center; justify-content: center; width: 80px; height: 80px; overflow: hidden; border-radius: 15px 0 0 15px; background: color-mix(in srgb, var(--vlpp-text) 8%, transparent); font-size: 14px; font-weight: 600; }
.vlpp .vlpp-upload-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.vlpp .vlpp-upload-detail { display: grid; gap: 8px; min-width: 0; }
.vlpp .vlpp-upload-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.vlpp .vlpp-upload-state { font-size: 12px; opacity: .8; }
.vlpp .vlpp-upload-item[data-state="error"] { border-color: var(--vlpp-error); }
.vlpp .vlpp-upload-item[data-state="error"] .vlpp-upload-state { color: var(--vlpp-error); opacity: 1; }
.vlpp .vlpp-upload-item progress { appearance: none; display: block; width: 100%; height: 8px; border: 0; border-radius: 8px; overflow: hidden; background: var(--vlpp-line); accent-color: var(--vlpp-accent); }
.vlpp .vlpp-upload-item progress::-webkit-progress-bar { background: var(--vlpp-line); border-radius: 8px; }
.vlpp .vlpp-upload-item progress::-webkit-progress-value { background: var(--vlpp-accent); border-radius: 8px; }
.vlpp .vlpp-upload-item progress::-moz-progress-bar { background: var(--vlpp-accent); border-radius: 8px; }
.vlpp .vlpp-upload-remove { display: grid; place-items: center; width: 40px; height: 40px; margin: 0 8px 0 0; padding: 0; border: 1px solid var(--vlpp-line); border-radius: 50%; background: transparent; color: var(--vlpp-text); cursor: pointer; line-height: 1; }
.vlpp .vlpp-upload-remove .vl-ui-icon { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: var(--vl-icon-stroke-width, 1.5px); stroke-linecap: round; stroke-linejoin: round; }
.vlpp .vlpp-upload-remove:hover { border-color: currentColor; }
.vlpp .vlpp-upload-remove:focus-visible { outline: 2px solid var(--vlpp-text); outline-offset: 8px; }
.vlpp .vlpp-upload-status { opacity: 1; }
.vlpp .vlpp-field[aria-busy="true"] .vlpp-upload-status::before { content: ''; display: inline-block; width: 16px; height: 16px; margin-right: 8px; border: 2px solid var(--vlpp-line); border-top-color: var(--vlpp-accent); border-radius: 50%; vertical-align: middle; animation: vlpp-spin 1s linear infinite; }
/* Local demo trial only: presentation never changes the order schema. */
.vlpp--design-preview .vlpp-preview-layout { display: grid; gap: 48px; }
.vlpp--design-preview .vlpp-preview-group, .vlpp--design-preview .vlpp-preview-group-fields { min-width: 0; }
.vlpp--design-preview .vlpp-preview-group-fields { display: grid; gap: 32px; }
.vlpp--design-preview .vlpp-field { margin: 0; }
.vlpp--design-preview .vlpp-heading { margin: 0 0 24px; color: var(--vlpp-text); font: 600 24px/32px var(--font-sofia, sans-serif); }
.vlpp--design-preview .vlpp-field legend:not(.vlpp-sr-only) { margin-bottom: 8px; }
/* Prices follow their label typography; the reserved grid still prevents shifts. */
.vlpp--design-preview .vlpp-cost { font: inherit; font-variant-numeric: proportional-nums; letter-spacing: inherit; }
.vlpp--design-preview .vlpp-field textarea { resize: none; }
.vlpp--design-preview .vlpp-text-control, .vlpp--design-preview .vlpp-upload-picker, .vlpp--design-preview .vlpp-upload-item { border: 1px solid var(--vlpp-line); border-radius: var(--vl-media-radius, 24px); background: color-mix(in srgb, var(--vlpp-text) 6%, transparent); }
/* One shared frame, also for keyboard focus. Its dimensions never change. */
.vlpp--design-preview .vlpp-text-control:focus-within, .vlpp--design-preview .vlpp-upload-picker:focus-within { outline: none; border-color: var(--vlpp-accent); box-shadow: inset 0 0 0 1px var(--vlpp-accent); }
.vlpp--design-preview .vlpp-field--compact-text textarea { display: block; min-height: 56px; background: transparent !important; color: var(--vlpp-text) !important; border: 0 !important; border-radius: inherit !important; outline: none !important; box-shadow: none !important; }
.vlpp--design-preview .vlpp-text-footer { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin: 0; padding: 0 16px 8px; }
.vlpp--design-preview .vlpp-text-footer .vlpp-help { margin: 0; }
.vlpp--design-preview .vlpp-text-footer [data-vlpp-count] { flex: 0 0 auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.vlpp--design-preview .vlpp-upload-button { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 8px 16px; border-radius: calc(var(--vl-media-radius, 24px) - 8px); background: color-mix(in srgb, var(--vlpp-accent) 16%, transparent); color: var(--vlpp-text); font-weight: 600; }
.vlpp--design-preview .vlpp-upload-picker:hover .vlpp-upload-button { background: color-mix(in srgb, var(--vlpp-accent) 24%, transparent); }
.vlpp--design-preview .vlpp-upload-thumb { border-radius: calc(var(--vl-media-radius, 24px) - 1px) 0 0 calc(var(--vl-media-radius, 24px) - 1px); }
.vlpp--design-preview .vlpp-upload-thumb img { border-radius: 0 !important; }
.vlpp--design-preview .vlpp-upload-meta { margin-top: 8px; }
.vlpp--design-preview .vlpp-upload-meta .vlpp-help { margin: 0; }
.vlpp--design-preview .vlpp-upload-status { margin-bottom: 0; }
@keyframes vlpp-spin { to { transform: rotate(360deg); } }
@media (max-width: 767px) {
    /* Keep desktop column counts; only tighten spacing on small screens. */
    .vlpp .vlpp-options { gap: 16px; }
    /* A 30-character engraving can wrap; leave two lines above the helper row. */
    .vlpp--design-preview .vlpp-field--compact-text textarea { min-height: 80px; }
    .vlpp .vlpp-radios { grid-template-columns: 1fr; gap: 8px; }
    .vlpp .vlpp-upload-item { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px; }
    .vlpp .vlpp-upload-thumb { width: 64px; height: 64px; }
    .vlpp .vlpp-upload-hint { display: none; }
    .vlpp .vlpp-upload-button { width: 100%; text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .vlpp .vlpp-field[aria-busy="true"] .vlpp-upload-status::before { animation: none; } }

/* Only explicitly personalized products get this adapter; WCPA pages are untouched. */
.vlpp [data-vlpp-photo-auxiliary] { display: none !important; }
.vlpp .vlpp-photo-instructions { margin: 16px 0 8px; }
.vlpp .vlpp-photo-instructions + .vlpp-upload-list { margin-top: 8px; }
.vlpp .vlpp-photo-actions { margin-top: 16px; }
.vlpp .vlpp-photo-button { box-sizing: border-box; font: inherit; color: var(--vlpp-text); background: transparent; border: 0; margin: 0; cursor: pointer; text-transform: none; letter-spacing: normal; box-shadow: none; }
.vlpp .vlpp-photo-add { width: 100%; min-height: 48px; padding: 8px 16px; border: 1px dashed var(--vlpp-label); border-radius: var(--vl-media-radius, 24px); font-size: 14px; line-height: 24px; }
.vlpp .vlpp-photo-button:hover:not(:disabled) { background: color-mix(in srgb, var(--vlpp-accent) 12%, transparent); }
.vlpp .vlpp-photo-button:focus-visible { outline: 2px solid var(--vlpp-accent); outline-offset: 2px; }
.vlpp .vlpp-photo-button:disabled { opacity: .3; cursor: default; }
.vlpp .vlpp-photo-note { margin: 8px 0 0; }
.vlpp .vlpp-photo-note:empty { display: none; }
.vlpp .vlpp-upload-item--ordered { position: relative; grid-template-columns: 40px minmax(0, 1fr); gap: 8px; border: 0; border-radius: 0; background: transparent; overflow: visible; }
.vlpp .vlpp-upload-item--ordered > .vlpp-upload-remove { margin: 0; }
.vlpp .vlpp-photo-card { display: grid; grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-width: 0; min-height: 80px; border: 1px solid var(--vlpp-line); border-radius: var(--vl-media-radius, 24px); background: color-mix(in srgb, var(--vlpp-text) 6%, transparent); }
.vlpp .vlpp-photo-card > .vlpp-upload-thumb { align-self: stretch; width: 80px; height: auto; min-height: 80px; position: relative; border-radius: calc(var(--vl-media-radius, 24px) - 1px) 0 0 calc(var(--vl-media-radius, 24px) - 1px); }
.vlpp .vlpp-photo-card > .vlpp-upload-thumb img { position: absolute; inset: 0; }
.vlpp .vlpp-photo-card > .vlpp-upload-detail { padding-block: 8px; gap: 0; }
.vlpp .vlpp-photo-position { font-size: 14px; line-height: 20px; font-weight: 600; white-space: nowrap; }
.vlpp .vlpp-photo-top { font-size: 12px; line-height: 16px; color: var(--vlpp-accent); white-space: nowrap; }
.vlpp .vlpp-upload-item--ordered:first-child .vlpp-photo-position { color: var(--vlpp-accent); }
.vlpp .vlpp-photo-controls { display: flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: 0; padding-right: 8px; }
.vlpp .vlpp-photo-controls .vlpp-photo-button { display: grid; place-items: center; flex: 0 0 auto; width: 40px; height: 40px; padding: 0; border-radius: 8px; font: 20px/1 sans-serif; }
.vlpp .vlpp-upload-item--ordered[data-state="error"] .vlpp-photo-card { border-color: var(--vlpp-error); }
@media (max-width: 1023px) {
    /* Short captions leave all controls beside the text, centered in the same row. */
    .vlpp .vlpp-photo-card { grid-template-columns: 64px minmax(0, 1fr) auto; }
    .vlpp .vlpp-photo-card > .vlpp-upload-thumb { width: 64px; }
}
.vlpp-purchase-bar { display: contents; }
.vlpp-purchase-bar-summary { display: none; }
@media (width < 40rem) {
    /* The fixed purchase bar is outside the flow; keep just the 112px benefits gap. */
    form.cart:has(.vlpp-purchase-bar) .vlpp--purchase-before-benefits { margin-block-end: 0; }
    /* Keep the inline fallback unless the mobile purchase bar was initialized. */
    form.cart:has(.vlpp-purchase-bar) .vlpp .vlpp-summary { display: none; }
    body:has(.vlpp-purchase-bar) { padding-bottom: var(--vlpp-purchase-bar-height, 144px); }
    form.cart .vlpp-purchase-bar {
        box-sizing: border-box; position: fixed; inset: auto 0 0; z-index: 50;
        display: flex; flex-direction: column; gap: 8px;
        margin: 0; padding: 8px var(--vl-site-grid-gutter, 16px) calc(8px + env(safe-area-inset-bottom, 0px));
        color: var(--vl-theme-text, var(--color-primary-200, #dcd2ca));
        background: color-mix(in srgb, var(--color-primary-900, #0d0d0e) 94%, transparent);
        border-top: 1px solid color-mix(in srgb, currentColor 16%, transparent);
        -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    }
    .vlpp-purchase-bar-summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-width: 0; }
    .vlpp-purchase-bar-label { min-width: 0; font-size: 14px; font-weight: 700; line-height: 20px; }
    .vlpp-purchase-bar-label small { display: block; color: var(--color-primary-400, #b49a84); font: 700 12px/16px var(--font-sofia, sans-serif); }
    .vlpp-purchase-bar-summary strong { flex: 0 0 auto; font-size: 24px; line-height: 32px; font-variant-numeric: tabular-nums; white-space: nowrap; }
    /* Override only the theme's old independently fixed CTA, retaining its look. */
    form.cart .vlpp-purchase-bar .single_add_to_cart_button {
        position: static !important; inset: auto !important; width: 100% !important;
        margin: 0 !important; padding: 16px !important; min-height: 56px;
        box-sizing: border-box; float: none; z-index: auto !important;
    }
}
