/* Design preview from the cart thumbnail: the garment with the design on each printed side. */
dialog.webko-preview {
    width: min(920px, calc(100vw - 32px));
    max-height: calc(100dvh - 32px);
    /* The theme's reset sets margin: 0 on everything, which pins a modal dialog to the top left. */
    margin: auto;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: #fff;
    color: #111;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    overflow: auto;
}

/* One printed side: a narrower box, so the garment fits on screen without scrolling. */
dialog.webko-preview.webko-preview--single {
    width: min(520px, calc(100vw - 32px));
}

dialog.webko-preview::backdrop {
    background: rgba(0, 0, 0, 0.55);
}

.webko-preview__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    border-bottom: 1px solid #eee;
}

.webko-preview__title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.webko-preview__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #f2f2f2;
    color: #111;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
}

.webko-preview__close:hover,
.webko-preview__close:focus-visible {
    background: #e4e4e4;
}

.webko-preview__views {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    padding: 20px;
}

.webko-preview__view {
    margin: 0;
    text-align: center;
}

.webko-preview__view img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 200px);
    object-fit: contain;
    border-radius: 8px;
    background: #f6f6f6;
}

.webko-preview__view figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: #555;
}

.webko-preview__foot {
    padding: 0 20px 20px;
    text-align: center;
}

.webko-preview__edit {
    font-size: 15px;
    text-decoration: underline;
}

@media (max-width: 560px) {
    .webko-preview__views {
        grid-template-columns: 1fr;
        padding: 16px;
    }
}
