.bp-photo { max-width: 920px; margin: 2rem auto; padding-inline: 1rem; }
.bp-example { display: grid; grid-template-columns: minmax(140px, 240px) 1fr; gap: 1.5rem; align-items: center; }
.bp-example img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: .5rem; }
.bp-example li + li { margin-top: .6rem; }
.bp-form { margin-top: 1.5rem; border: 1px solid currentColor; border-radius: .65rem; padding: 1.25rem; }
.bp-form [hidden] { display: none !important; }
.bp-form label { display: block; margin-block: .7rem; }
.bp-form input { display: block; max-width: 100%; margin-top: .3rem; }
.bp-form canvas, .bp-crop-preview { display: block; width: min(100%, 300px); height: auto; }
.bp-status:empty { display: none; }
@media (max-width: 540px) { .bp-example { grid-template-columns: 1fr; } }

.bp-example-photo { position: relative; }
.bp-example-photo img { display: block; }

.bp-photo {
    --bp-action: var(--wp--preset--color--primary, #1b3a8c);
    --bp-hover: var(--wp--preset--color--secondary, #2b4ca0);
}
.bp-form button, .bp-photo-picker, .bp-form input::file-selector-button {
    min-height: 44px;
    border: 1px solid var(--bp-action);
    border-radius: var(--wp--custom--radius--control, 8px);
    background: var(--bp-action);
    color: var(--wp--preset--color--white, #fff);
    box-shadow: var(--wp--custom--shadow--control, none);
    padding: .65rem 1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: background-color .15s, color .15s;
}
.bp-form button { margin: .35rem .35rem .35rem 0; }
.bp-photo-picker {
    position: absolute;
    inset: auto 12px 12px;
    width: calc(100% - 24px);
}
.bp-form button[data-back], .bp-form input::file-selector-button {
    background: var(--wp--preset--color--background, #fff);
    color: var(--bp-action);
    box-shadow: none;
}
.bp-form input::file-selector-button { margin-right: .65rem; }
.bp-form button:not(:disabled):hover, .bp-photo-picker:hover, .bp-form input::file-selector-button:hover {
    background: var(--bp-hover);
    color: var(--wp--preset--color--white, #fff);
}
.bp-photo button:focus-visible { outline: 2px solid var(--bp-action); outline-offset: 3px; }
.bp-photo-picker:focus-visible { outline-color: #fff !important; }
.bp-form button:disabled { opacity: .55; cursor: default; box-shadow: none; }

.bp-order-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(230px, 34%);
    gap: 1.25rem;
    align-items: start;
    margin-top: 1.5rem;
}
.bp-order-layout .bp-form { margin-top: 0; }
.bp-form select { display: block; max-width: 100%; margin-top: .3rem; min-height: 44px; font: inherit; }
.bp-order-summary {
    position: sticky;
    top: calc(var(--wp-admin--admin-bar--height, 0px) + 1rem);
    padding: 1.25rem;
    border: 1px solid currentColor;
    border-radius: .65rem;
    background: var(--wp--preset--color--background, #fff);
}
.bp-photo .bp-order-summary h3 {
    margin: 0 0 .75rem;
    font-size: 1.375rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}
.bp-order-summary dl { margin-bottom: 0; }
.bp-order-summary dl > div { display: flex; justify-content: space-between; gap: .5rem; margin-top: .6rem; }
.bp-order-summary dd { margin: 0; text-align: end; }
.bp-order-total { border-top: 1px solid currentColor; padding-top: .65rem; font-weight: 700; }
@media (max-width: 700px) {
    .bp-order-layout { grid-template-columns: minmax(0, 1fr); }
    .bp-order-summary { position: static; }
}

.bp-form canvas { touch-action: none; cursor: grab; }
.bp-form canvas:active { cursor: grabbing; }

#carica-foto { scroll-margin-top: 8rem; }
