xa-fliesen-generator {
    display: block;
    --xa-store-accent: #bc8380;
    --xa-store-ink: #242630;
    --xa-store-line: #dedee2;
    --xa-store-warning-background: #fff8de;
    --xa-store-warning-border: #e9d08a;
    --xa-store-warning-ink: #805400;
}

.xa-has-generator-cart .additional-checkout-buttons {
    display: none;
}

.xa-store-generator {
    display: flex;
    flex-direction: column;
    gap: 20px;
    color: var(--xa-store-ink, #242630);
    font-family: inherit;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
}

.xa-store-generator h2,
.xa-store-generator h3,
.xa-store-generator p {
    margin: 0;
}

.xa-store-price {
    font-size: 28px;
    font-weight: 500;
}

.xa-store-generator h2 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.25;
}

.xa-store-generator h3 {
    font-size: 14px;
    font-weight: 600;
}

.xa-store-generator > p {
    color: #80818d;
}

.xa-store-offer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    gap: 24px;
    padding: 4px 0 20px;
    border-bottom: 1px solid #dedee2;
}

.xa-store-tax {
    font-size: 13px;
    color: #80818d;
}

.xa-store-tax a {
    text-decoration: underline;
}

.xa-store-generator > .xa-store-summary {
    display: none;
}

.xa-store-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    min-width: 44px;
    padding: 10px 16px;
    border: 1px solid #b8b8bf;
    border-radius: 8px;
    background: white;
    color: #242630;
    cursor: pointer;
    font: inherit;
}

.xa-store-button[hidden],
.xa-store-mobile-only {
    display: none;
}

.xa-store-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.xa-store-action-label {
    text-align: left;
}

.xa-store-action-subtitle {
    display: block;
    font-size: 12px;
}

@media (min-width: 1000px) {
    .xa-store-generator {
        gap: 16px;
    }

    .xa-store-generator > h2 {
        margin-bottom: -8px;
    }

    .xa-store-offer {
        padding-bottom: 12px;
    }

    .xa-store-more .xa-store-button {
        min-height: 62px;
    }

    .xa-store-more {
        gap: 16px;
        padding-top: 12px;
        border-top: 1px dashed #dedee2;
    }

    .xa-store-actions .xa-store-button {
        min-height: 54px;
        font-weight: 600;
    }

    .xa-store-actions {
        margin-top: 16px;
    }
}

.xa-store-edit {
    white-space: nowrap;
    display: none;
}

.xa-store-edit .xa-store-icon {
    width: 16px;
    height: 16px;
}

.xa-store-preview {
    color: #ad6865;
    border-color: #bc8380;
}

.xa-store-button:disabled {
    opacity: 0.5;
    cursor: default;
}

.xa-store-button:focus-visible,
.xa-store-field input:focus-visible,
.xa-store-field select:focus-visible {
    outline: 2px solid #bc8380;
    outline-offset: 3px;
}

.xa-store-primary {
    background: #bc8380;
    border-color: #bc8380;
    color: white;
}

.xa-store-size,
.xa-store-more {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.xa-store-size {
    grid-template-columns: 1fr 1fr;
    align-items: center;
    row-gap: 14px;
}

.xa-store-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.xa-store-alert {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px;
    border: 1px solid var(--xa-store-warning-border, #e9d08a);
    border-radius: 8px;
    background: var(--xa-store-warning-background, #fff8de);
    color: var(--xa-store-warning-ink, #805400);
    font-size: 14px;
    line-height: 1.5;
}

.xa-store-alert[hidden] {
    display: none;
}

.xa-store-alert > .xa-store-icon {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin-top: 1px;
}

.xa-store-alert-content {
    min-width: 0;
}

.xa-store-alert-title {
    display: block;
    margin-bottom: 4px;
    font-weight: 600;
}

.xa-store-alert-message {
    margin: 0;
}

.xa-store-size > .xa-store-alert,
.xa-store-size > .xa-store-hint {
    grid-column: 1 / -1;
}

.xa-store-field input,
.xa-store-field select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 56px;
    padding: 10px 14px;
    border: 1px solid #dedee2;
    border-radius: 10px;
    font: inherit;
    color: inherit;
    background: white;
}

.xa-store-row {
    display: grid;
    grid-template-columns: 56px minmax(90px, 1fr) 164px;
    align-items: center;
    gap: 14px;
    padding: 6px 0;
    border-bottom: 1px solid #dedee2;
}

.xa-store-row > .xa-store-image-action {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: 5px;
}

@media (min-width: 1400px) {
    .xa-store-row {
        grid-template-columns: 56px minmax(160px, 1fr) 164px;
    }
}

.xa-store-name {
    overflow-wrap: anywhere;
}

.xa-store-name small {
    display: block;
    margin-top: 4px;
    color: #686871;
}

.xa-store-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.xa-store-library canvas {
    max-width: 100%;
    height: auto;
}

.xa-store-edit {
    color: #ad6865;
    border-color: #bc8380;
}

.xa-store-quantity {
    display: flex;
    align-items: center;
    gap: 4px;
}

.xa-store-quantity .xa-store-field span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
}

.xa-store-quantity .xa-store-button {
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    padding: 0;
    border-radius: 50%;
    font-size: 22px;
}

.xa-store-quantity input {
    height: 44px;
    min-height: 44px;
    text-align: center;
    padding: 8px 2px;
    appearance: textfield;
}

.xa-store-summary {
    padding: 16px;
    background: #f4f4f4;
    border-radius: 12px;
    font-weight: 600;
}

.xa-store-summary small {
    display: block;
    margin-top: 6px;
    font-weight: 400;
    color: #777985;
}

.xa-store-top-summary small {
    font-size: 12px;
}

.xa-store-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.xa-store-cart-action .xa-store-button {
    width: 100%;
    height: 100%;
}

.xa-store-sticky-details {
    display: none;
}

.xa-store-custom-badge {
    display: none;
}

.xa-store-minimum {
    display: block;
    color: #747581;
    font-size: 13px;
}

.xa-store-status {
    color: #686871;
    font-size: 14px;
}

.xa-store-dialog {
    box-sizing: border-box;
    width: min(800px, 90vw);
    max-height: 85dvh;
    padding: 0;
    border: 0;
    border-radius: 14px;
    color: #242630;
    background: white;
    font-family: inherit;
}

html:has(.xa-store-dialog[open]),
body:has(.xa-store-dialog[open]) {
    overflow: hidden;
}

.xa-store-dialog[open] {
    display: flex;
    flex-direction: column;
}

.xa-store-dialog::backdrop {
    background: rgb(0 0 0 / 40%);
}

.xa-store-dialog header,
.xa-store-dialog footer {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding: 24px;
}

.xa-store-footer-start {
    margin-right: auto;
}
.xa-store-dialog header {
    justify-content: space-between;
    border-bottom: 1px solid #dedee2;
}

.xa-store-dialog header h2 {
    margin: 0;
    font-size: 20px;
}

.xa-store-dialog footer {
    justify-content: flex-end;
    border-top: 1px solid #dedee2;
}

.xa-store-dialog-body {
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow: auto;
    padding: 24px;
}

.xa-store-library {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.xa-store-library img {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    margin-bottom: 8px;
}

.xa-store-library > .xa-store-button {
    flex-direction: column;
}

.xa-store-crop {
    display: block;
    max-width: 100%;
    object-fit: contain;
    touch-action: none;
}

.xa-store-field input[type="range"] {
    min-height: 44px;
    width: 100%;
}

.xa-store-crop-dialog {
    width: min(1040px, 94vw);
    font-weight: 400;
}
.xa-store-crop-dialog header {
    align-items: flex-start;
    padding: 24px;
}
.xa-store-crop-dialog header h2 {
    font-size: 26px;
    font-weight: 400;
    line-height: 1.2;
}
.xa-store-crop-subtitle {
    margin: 8px 0 0;
    color: #80818d;
    font-size: 16px;
}
.xa-store-crop-dialog .xa-store-dialog-body > * {
    flex-shrink: 0;
}
.xa-store-crop-layout {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 24px;
}
.xa-store-crop-stage {
    min-width: 0;
    text-align: center;
}
.xa-store-crop-image {
    position: relative;
    width: min(100%, max(500px, calc((85dvh - 500px) * 1.455)));
    margin-inline: auto;
    border-radius: 8px;
    background: #343434;
}
.xa-store-crop-image canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 8px;
    cursor: move;
    touch-action: none;
}
.xa-store-crop-handle {
    position: absolute;
    z-index: 4;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    transform: translate(-50%, -50%);
    touch-action: none;
}
/* The full 44px target stays invisible; focus is shown on the grip itself. */
.xa-store-crop-handle:focus-visible {
    outline: none;
}
.xa-store-crop-handle::before {
    content: "";
    width: 18px;
    height: 18px;
    background: white;
    border-radius: 3px;
    box-shadow: 0 0 2px rgb(0 0 0 / 25%);
}
.xa-store-crop-handle:focus::before {
    background: #1e40af;
}
.xa-store-crop-handle-nw,
.xa-store-crop-handle-se {
    cursor: nwse-resize;
}
.xa-store-crop-handle-ne,
.xa-store-crop-handle-sw {
    cursor: nesw-resize;
}
.xa-store-crop-tools {
    position: absolute;
    z-index: 3;
    left: 50%;
    bottom: 12px;
    display: flex;
    align-items: center;
    max-width: calc(100% - 16px);
    padding: 4px;
    gap: 2px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgb(0 0 0 / 15%);
    transform: translateX(-50%);
}
.xa-store-crop-tools .xa-store-button {
    border: 0;
    white-space: nowrap;
    padding: 8px 12px;
    font-size: 14px;
}
.xa-store-crop-tools .xa-store-icon {
    color: #bc8380;
}
.xa-store-crop-stage p {
    margin: 0;
}
.xa-store-crop-dimensions {
    margin-top: 12px !important;
    font-size: 18px;
}
.xa-store-crop-help {
    margin-top: 6px !important;
    color: #80818d;
    font-size: 14px;
}
.xa-store-crop:focus-visible {
    outline: 2px solid #bc8380;
    outline-offset: 3px;
}
.xa-store-crop-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.xa-store-crop-controls:has(> .xa-store-crop-swap:only-child) {
    display: none;
}
.xa-store-crop-swap {
    display: none;
}
@media (max-width: 700px) {
    .xa-store-crop-dialog header {
        padding: 18px;
    }
    .xa-store-crop-dialog header h2 {
        font-size: 23px;
    }
    .xa-store-crop-subtitle {
        font-size: 14px;
    }
    .xa-store-crop-dialog .xa-store-dialog-body {
        padding: 18px;
    }
    .xa-store-crop-layout {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .xa-store-crop-image {
        width: 100%;
    }
    .xa-store-crop-tools .xa-store-button {
        padding: 8px;
        gap: 6px;
        font-size: 12px;
    }
    .xa-store-crop-swap {
        display: inline-flex;
    }

    .xa-store-crop-controls:has(> .xa-store-crop-swap:only-child) {
        display: flex;
    }
    .xa-store-crop-dialog footer {
        padding: 14px 18px max(14px, env(safe-area-inset-bottom));
        flex-wrap: wrap;
    }
    .xa-store-crop-dialog footer > .xa-store-button {
        flex: 1;
        min-height: 48px;
        font-size: 14px;
        padding: 10px 8px;
    }
    .xa-store-crop-dialog footer > .xa-store-primary {
        flex: 1.25;
        white-space: nowrap;
    }
    .xa-store-crop-dialog footer > .xa-store-footer-start {
        flex: 1 1 100%;
        margin-right: 0;
    }
}

@media (max-width: 1100px) {
    .xa-store-row {
        grid-template-columns: 56px minmax(0, 1fr) 144px;
        gap: 10px;
    }

    .xa-store-row > .xa-store-image-action {
        grid-row: span 2;
    }

    .xa-store-quantity {
        grid-column: 3;
        grid-row: span 2;
    }

    .xa-store-edit {
        display: inline-flex;
        grid-column: 2;
        grid-row: 2;
        justify-self: start;
    }
}

@media (max-width: 700px) {
    .xa-store-custom-badge {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-align: center;
        width: 76px;
        height: 76px;
        flex: 0 0 76px;
        border-radius: 50%;
        background: #bc8380;
        color: white;
        font-size: 12px;
        line-height: 1.3;
        padding: 8px;
    }

    .xa-store-offer {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .xa-store-mobile-only {
        display: block;
    }

    .xa-store-desktop-only,
    .xa-store-rows > h3 {
        display: none;
    }

    .xa-store-generator {
        gap: 16px;
    }

    .xa-store-generator > .xa-store-introduction {
        margin-top: -8px;
    }

    .xa-store-generator > .xa-store-editor-help {
        margin-top: -8px;
        font-size: 12px;
    }

    .xa-store-size-title {
        grid-column: 1 / -1;
        font-size: 18px;
    }

    .xa-store-top-summary {
        display: none;
    }

    .xa-store-generator > .xa-store-summary {
        display: block;
    }

    .xa-store-generator h2 {
        font-size: 21px;
    }

    .xa-store-size {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    xa-fliesen-generator {
        padding-bottom: calc(100px + env(safe-area-inset-bottom));
    }

    .xa-store-actions {
        display: block;
        order: 7;
    }

    .xa-store-actions > .xa-store-button {
        width: 100%;
    }

    .xa-store-cart-action {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        z-index: 20;
        display: grid;
        grid-template-columns: minmax(90px, 1fr) minmax(0, 1.4fr);
        align-items: center;
        gap: 20px;
        padding: 16px 20px max(16px, env(safe-area-inset-bottom));
        background: #bc8380;
        color: white;
    }

    .xa-store-cart-action .xa-store-button {
        background: white;
        color: #a4514f;
        border-color: white;
        height: 52px;
    }

    .xa-store-sticky-price {
        display: block;
        font-size: 20px;
    }

    .xa-store-sticky-details {
        display: block;
    }

    .xa-store-sticky-details .xa-store-tax,
    .xa-store-sticky-details .xa-store-minimum {
        color: white;
        font-size: 11px;
        margin: 2px 0 0;
    }

    .xa-store-row {
        padding: 8px;
        margin-top: 10px;
        border: 1px solid #dedee2;
        border-radius: 12px;
        grid-template-columns: 40px minmax(0, 1fr) 134px;
        column-gap: 6px;
        row-gap: 4px;
    }

    .xa-store-row > .xa-store-image-action {
        width: 40px;
        height: 40px;
    }

    .xa-store-edit {
        padding: 4px;
        gap: 4px;
        font-size: 12px;
        max-width: 100%;
    }

    .xa-store-quantity {
        gap: 0;
        border: 1px solid #dedee2;
        border-radius: 28px;
    }

    .xa-store-quantity .xa-store-button,
    .xa-store-quantity input {
        width: 44px;
        min-width: 0;
        min-height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
    }

    .xa-store-quantity .xa-store-field {
        width: 44px;
        flex-shrink: 0;
    }

    .xa-store-summary {
        order: 6;
    }
    .xa-store-preview {
        order: 7;
    }
    .xa-store-status {
        order: 8;
    }
    .xa-store-more {
        gap: 12px;
    }

    .xa-store-action-subtitle {
        display: none;
    }

    .xa-store-more .xa-store-button {
        gap: 8px;
        padding: 10px 8px;
        font-size: 12px;
    }
    .xa-store-library {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .xa-store-dialog {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }

    .xa-store-dialog footer {
        padding-bottom: max(24px, env(safe-area-inset-bottom));
    }
}

@media (max-width: 380px) {
    .xa-store-edit .xa-store-icon {
        display: none;
    }
}
.xa-store-crop-layout {
    grid-template-columns: minmax(0, 1fr);
}
.xa-store-crop-workspace {
    display: block;
    min-width: 0;
}
.xa-store-crop-motifs {
    min-width: 0;
}
.xa-store-crop-motifs h3 {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 400;
}
.xa-store-crop-motif-rail {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    align-items: center;
    gap: 8px;
}
.xa-store-crop-motif-nav {
    padding: 0;
    width: 44px;
    height: 44px;
    font-size: 26px;
}
.xa-store-crop-motif-track {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding: 4px 4px 10px;
    scroll-snap-type: x proximity;
}
.xa-store-crop-motif {
    position: relative;
    flex: 0 0 76px;
    height: 76px;
    padding: 5px;
    border-radius: 10px;
    scroll-snap-align: start;
}
.xa-store-crop-motif img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
}
.xa-store-crop-motif-quantity {
    position: absolute;
    right: 7px;
    bottom: 7px;
    padding: 1px 5px;
    border-radius: 5px;
    background: white;
    color: #444;
    font-size: 12px;
    line-height: 18px;
}
.xa-store-crop-motif-selected {
    display: none;
    position: absolute;
    top: 0;
    right: 0;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #b68581;
    color: white;
    font-size: 13px;
    align-items: center;
    justify-content: center;
}
.xa-store-crop-motif[aria-pressed="true"] {
    border: 2px solid #b68581;
    background: #faf0ef;
}
.xa-store-crop-motif[aria-pressed="true"] .xa-store-crop-motif-selected {
    display: flex;
}
@media (max-width: 700px) {
    .xa-store-crop-motif-rail {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
    }
    .xa-store-crop-motif-nav {
        display: none;
    }
    .xa-store-crop-motif {
        flex-basis: 64px;
        height: 64px;
    }
    .xa-store-crop-motif-track {
        gap: 8px;
    }
}
.xa-store-upload {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border: 1px solid #dedee2;
    border-radius: 8px;
    margin-top: 12px;
}
.xa-store-upload[hidden] {
    display: none;
}
.xa-store-upload p {
    flex: 1 1 100%;
    margin: 0;
}
.xa-store-upload progress {
    flex: 1;
    min-width: 100px;
    accent-color: #bc8380;
}

.xa-store-row > .xa-store-image-action {
    height: auto;
    max-height: none;
    object-fit: contain;
    background: white;
}

.xa-store-crop-workspace {
    display: block;
}

.xa-store-image-action {
    position: relative;
    display: flex;
    flex-direction: column;
    padding: 0;
    border: 0;
    background: transparent;
    gap: 4px;
    max-height: none;
}
.xa-store-image-action .xa-store-crop-preview {
    width: 100%;
    height: auto;
    border-radius: 5px;
}
@media (max-width: 1100px) {
    .xa-store-row > .xa-store-image-action {
        grid-row: 1 / span 2;
        height: auto;
        width: 64px;
        object-fit: contain;
    }
    .xa-store-row {
        grid-template-columns: 64px minmax(0, 1fr) 134px;
        gap: 10px;
    }
    .xa-store-image-action canvas {
        border: 1px solid #bc8380;
        padding: 3px;
    }
    .xa-store-image-action small {
        color: #bc8380;
        font-size: 12px;
    }
    .xa-store-image-badge {
        position: absolute;
        right: -4px;
        bottom: 20px;
        width: 26px;
        height: 26px;
        display: grid;
        place-items: center;
        border-radius: 50%;
        background: white;
        color: #bc8380;
        border: 1px solid #dedee2;
    }
    .xa-store-image-badge svg {
        width: 18px;
        height: 18px;
    }
    .xa-store-edit {
        border: 0;
        background: transparent;
        padding: 0 2px;
        min-height: 44px;
        text-decoration: underline;
        font-size: 14px;
        gap: 6px;
    }
    .xa-store-more .xa-store-icon {
        width: 26px;
        height: 26px;
    }
}

.xa-store-crop-tools .xa-store-crop-swap {
    display: inline-flex;
}
@media (max-width: 700px) {
    .xa-store-crop-tools .xa-store-crop-swap {
        display: none;
    }
}

/* Mobile: the plain motif thumbnail is the single editor entry point. */
@media (max-width: 700px) {
    .xa-store-row .xa-store-edit,
    .xa-store-image-action .xa-store-image-badge,
    .xa-store-image-action small {
        display: none;
    }

    .xa-store-row {
        grid-template-rows: auto;
    }

    .xa-store-row > .xa-store-image-action,
    .xa-store-row > .xa-store-name,
    .xa-store-row > .xa-store-quantity {
        grid-row: 1;
    }

    .xa-store-image-action canvas {
        border: 0;
        padding: 0;
    }
}

.xa-store-motif-name-action {
    display: inline-flex;
    justify-content: flex-start;
    min-height: 44px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #a65350;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    font: inherit;
    text-align: left;
}

@media (max-width: 700px) {
    .xa-store-motif-name-text {
        display: none;
    }

    .xa-store-motif-name-action {
        display: inline-flex;
        justify-content: flex-start;
        min-height: 44px;
        padding: 0;
        border: 0;
        background: transparent;
        color: #a65350;
        text-decoration: underline;
        text-underline-offset: 4px;
        text-decoration-thickness: 1px;
        font: inherit;
        text-align: left;
    }
}

/* Shared XaDialog header action: all customer dialogs use the same geometry. */
.xa-store-button.xa-store-dialog-close {
    width: 44px;
    min-width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #353541;
    flex-shrink: 0;
}
.xa-store-dialog-close .xa-store-icon {
    width: 20px;
    height: 20px;
}
.xa-store-dialog-close:hover {
    background: #f4f4f6;
}
.xa-store-field > span {
    font-size: 14px;
    font-weight: 600;
}

.xa-store-row > .xa-store-image-action,
.xa-store-row > .xa-store-name,
.xa-store-row > .xa-store-quantity {
    grid-row: 1;
}
.xa-store-row > .xa-store-quantity {
    grid-column: 3;
    justify-self: end;
}

/* Xa motif library: selection, existing motifs and filters have distinct states. */
.xa-store-library-dialog {
    width: min(1040px, 94vw);
}
.xa-store-library-description {
    margin: 0;
    color: #737783;
    line-height: 1.5;
}
.xa-store-library-toolbar {
    display: flex;
    gap: 12px;
    align-items: stretch;
}
.xa-store-library-search {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    border: 1px solid #c5c7d0;
    border-radius: 8px;
    padding: 0 14px;
}
.xa-store-library-search:focus-within {
    outline: 2px solid #a65350;
    outline-offset: 2px;
}
.xa-store-library-search input {
    width: 100%;
    min-width: 0;
    min-height: 54px;
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    outline: none;
}
.xa-store-library-search .xa-store-icon {
    flex-shrink: 0;
}
.xa-store-library-metadata {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 14px;
}
.xa-store-library-hide {
    border: 0;
    padding: 0;
    background: transparent;
    font-size: 13px;
}
.xa-store-library-hide::after {
    content: "";
    width: 38px;
    height: 24px;
    border-radius: 16px;
    background: radial-gradient(circle at 12px 12px, white 0 9px, transparent 10px), #c5c7d0;
    flex-shrink: 0;
}
.xa-store-library-hide[aria-pressed="true"]::after {
    background: radial-gradient(circle at 26px 12px, white 0 9px, transparent 10px), #b48783;
}
.xa-store-library-dialog .xa-store-library {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}
.xa-store-library-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 12px;
    border: 1px solid #dedee2;
    border-radius: 8px;
    text-align: left;
    justify-content: flex-start;
    color: #242630;
    background: white;
}
.xa-store-library-card img {
    margin: 0;
    border-radius: 3px;
}
.xa-store-library-card:disabled {
    opacity: 1;
    color: #242630;
    cursor: default;
}
.xa-store-library-card[aria-pressed="true"] {
    border-color: #b48783;
    background: #fcf8f7;
    box-shadow: inset 0 0 0 1px #b48783;
}
.xa-store-library-name {
    width: 100%;
    line-height: 1.4;
    overflow-wrap: anywhere;
}
.xa-store-library-used {
    align-self: flex-start;
    padding: 3px 8px;
    border-radius: 12px;
    background: #edeef0;
    color: #51555f;
    font-size: 12px;
}
.xa-store-library-check {
    position: absolute;
    top: 20px;
    right: 20px;
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #a1a5b0;
    background: white;
    color: white;
    font-size: 21px;
}
[aria-pressed="true"] > .xa-store-library-check {
    border-color: #b48783;
    background: #b48783;
}
.xa-store-library-selection {
    margin-right: auto;
    font-size: 14px;
    font-weight: 600;
}
.xa-store-library-empty {
    grid-column: 1 / -1;
}
.xa-store-library-filters[hidden],
.xa-store-pagination[hidden] {
    display: none;
}
@media (max-width: 700px) {
    .xa-store-library-dialog {
        width: 100%;
        max-width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        margin: 0;
        border-radius: 0;
    }
    .xa-store-library-dialog .xa-store-dialog-body,
    .xa-store-library-dialog header,
    .xa-store-library-dialog footer {
        padding: 20px;
    }
    .xa-store-library-dialog .xa-store-library {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .xa-store-library-dialog footer {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 12px;
        padding-bottom: max(20px, env(safe-area-inset-bottom));
    }
    .xa-store-library-dialog footer > .xa-store-primary {
        grid-column: 1 / -1;
        width: 100%;
    }
    .xa-store-library-metadata {
        flex-wrap: wrap;
    }
    .xa-store-library-card {
        padding: 10px;
    }
    .xa-store-library-check {
        top: 16px;
        right: 16px;
        width: 28px;
        height: 28px;
    }
}

/* Shared destructive confirmation variant. */
.xa-store-delete-confirm {
    width: min(540px, 94vw);
    height: fit-content;
    max-height: 85dvh;
    margin: auto;
    border-radius: 18px;
    box-shadow: 0 20px 70px rgb(0 0 0 / 20%);
}
.xa-store-delete-confirm header {
    border: 0;
    padding: 28px 28px 16px;
}
.xa-store-delete-confirm header h2 {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 24px;
    font-weight: 600;
}
.xa-store-delete-symbol {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: #fef0ef;
    color: #d92d20;
}
.xa-store-delete-symbol .xa-store-icon {
    width: 26px;
    height: 26px;
}
.xa-store-delete-confirm .xa-store-dialog-body {
    padding: 12px 28px 24px;
    gap: 10px;
}
.xa-store-delete-confirm .xa-store-dialog-body p {
    margin: 0;
    line-height: 1.5;
}
.xa-store-confirm-detail {
    color: #72727e;
}
.xa-store-delete-confirm footer {
    border: 0;
    padding: 0 28px 28px;
}
.xa-store-button.xa-store-delete-action {
    background: #d92d20;
    border-color: #d92d20;
    color: white;
}
.xa-store-button.xa-store-delete-action:hover {
    background: #b42318;
    border-color: #b42318;
}
@media (max-width: 700px) {
    .xa-store-delete-confirm header h2 {
        font-size: 22px;
        gap: 12px;
    }
    .xa-store-delete-confirm footer > .xa-store-button {
        flex: 1;
    }
}

.xa-store-preview-card {
    position: relative;
    min-width: 0;
}
.xa-store-preview-card canvas {
    display: block;
    width: 100%;
}
.xa-store-preview-card-actions {
    position: absolute;
    right: 10px;
    bottom: 10px;
    display: flex;
    gap: 8px;
}
.xa-store-preview-card-actions .xa-store-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: white;
    color: #242630;
    box-shadow: 0 2px 8px rgb(0 0 0 / 20%);
}
.xa-store-preview-card-actions .xa-store-preview-delete {
    color: #d92d20;
}
.xa-store-preview-card-actions .xa-store-button:hover {
    background: #f7f7f8;
}

.xa-store-motif-name-action:has(.xa-store-motif-size) {
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 4px;
    text-decoration: none;
}
.xa-store-motif-title {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
}
.xa-store-motif-name-action .xa-store-motif-size {
    margin: 0;
    color: #80818d;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.3;
}

.xa-store-button.xa-store-link {
    border: 0;
    background: transparent;
    padding: 0;
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 4px;
    justify-content: flex-start;
}

[data-xa-cart-native][hidden],
[data-xa-cart-page][hidden] {
    display: none !important;
}

.xa-cart-page {
    padding-block: 48px 64px;
    color: var(--xa-store-ink, #242630);
}

.xa-cart-page h1 {
    font-size: clamp(28px, 3vw, 38px);
    font-weight: 500;
    margin: 0 0 12px;
}

.xa-cart-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 48px;
    align-items: start;
    margin-top: 28px;
}

.xa-cart-items {
    min-width: 0;
}

.xa-cart-item {
    display: grid;
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: start;
    column-gap: 28px;
    row-gap: 24px;
    padding-block: 28px;
    border-bottom: 1px solid var(--xa-store-line, #dedee2);
}

.xa-cart-item:first-child {
    padding-top: 0;
}

.xa-cart-mosaic {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 5px;
    border: 1px solid var(--xa-store-line, #dedee2);
    border-radius: 8px;
}

.xa-cart-mosaic canvas {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 3px;
}

.xa-cart-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.xa-cart-unavailable {
    grid-column: 1 / -1;
}

.xa-cart-details h2,
.xa-cart-product-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    line-height: 1.4;
}

.xa-cart-details p {
    margin: 0;
}

.xa-cart-muted {
    color: #747580;
    font-size: 14px;
}

.xa-cart-item-actions {
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.xa-cart-product-image {
    display: block;
}

.xa-cart-product-image img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    border-radius: 8px;
}

.xa-cart-quantity {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 180px;
    font-size: 14px;
}

.xa-cart-line-price {
    align-self: end;
    justify-self: end;
    font-size: 22px;
    font-weight: 600;
}

.xa-cart-summary {
    position: sticky;
    top: 110px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 28px;
    border-radius: 12px;
    background: #f5f2f1;
}

.xa-cart-summary h2 {
    font-size: 22px;
    font-weight: 600;
    margin: 0;
}

.xa-cart-subtotal {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding-block: 20px;
    border-block: 1px solid var(--xa-store-line, #dedee2);
    font-weight: 600;
}

.xa-cart-total {
    text-align: right;
    font-size: 22px;
}

.xa-cart-continue {
    text-align: center;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.xa-cart-full-preview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.xa-cart-full-preview canvas {
    display: block;
    width: 100%;
    height: auto;
}

@media (max-width: 999px) {
    .xa-cart-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    .xa-cart-summary {
        position: static;
    }
}

@media (max-width: 599px) {
    .xa-cart-page {
        padding-block: 28px 40px;
    }

    .xa-cart-item {
        grid-template-columns: 110px minmax(0, 1fr);
        column-gap: 16px;
        row-gap: 20px;
    }

    .xa-cart-details h2,
    .xa-cart-product-title {
        font-size: 17px;
    }

    .xa-cart-details {
        font-size: 14px;
        gap: 6px;
    }

    .xa-cart-item-actions {
        gap: 16px;
    }

    .xa-cart-product-image img {
        height: 110px;
    }

    .xa-cart-quantity {
        max-width: none;
        width: 150px;
    }

    .xa-cart-summary {
        padding: 24px 18px;
    }

    .xa-cart-line-price {
        font-size: 20px;
    }

    .xa-cart-full-preview {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
