.product-custom-content {
    display: flow-root;
    overflow-wrap: anywhere;
    line-height: 1.7;
}

.product-custom-content.ck-content {
    --ck-content-font-family: inherit;
    font-family: inherit;
}

.product-custom-content img {
    max-width: 100%;
    height: auto;
    box-sizing: border-box;
}

.product-custom-content .image {
    max-width: 100%;
}

.product-custom-content .image > img {
    width: 100%;
}

.ck-content .product-image-layout {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(12px, 2vw, 24px);
    width: 100%;
    max-width: 100%;
    margin: 1.25em auto;
    align-items: start;
}

.ck-content .product-image-column {
    min-width: 0;
    overflow-wrap: anywhere;
}

.ck-content .product-image-column .image {
    display: block;
    float: none;
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.ck-content .product-image-column img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
}

.ck-editor .product-image-column {
    padding: 8px;
    border: 1px dashed #d5dbe1;
    border-radius: 6px;
}

.ck-content .product-image-layout-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.ck-content .product-image-layout-fixed-height {
    align-items: stretch;
}

.ck-content .product-image-layout-fixed-height > .product-image-column {
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-sizing: border-box;
    overflow: auto;
}

.ck-content .product-image-layout-fixed-height .product-image-column > .image {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
}

.ck-content .product-image-layout-fixed-height .product-image-column .image > img {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    object-fit: contain;
}

.ck-content .product-image-layout-fixed-height figcaption {
    flex: 0 0 auto;
}

.product-image-size-dialog {
    width: min(440px, calc(100vw - 32px));
    box-sizing: border-box;
    padding: 24px;
    border: 1px solid #d5dbe1;
    border-radius: 12px;
    font-family: inherit;
}

.product-image-size-dialog::backdrop { background: rgb(0 0 0 / 40%); }
.product-image-size-dialog h3 { font-size: 20px; margin: 0 0 16px; }
.product-image-size-dialog label { display: block; margin-bottom: 16px; }
.product-image-size-dialog input { display: block; width: 100%; box-sizing: border-box; padding: 8px; margin-top: 6px; }
.product-image-size-dialog button { padding: 6px 10px; margin-top: 8px; cursor: pointer; }

.product-image-options-dialog input[type="checkbox"] {
    display: inline-block;
    width: auto;
    margin: 0 6px 0 0;
}

.product-image-options-dialog input[type="color"] {
    height: 44px;
    padding: 4px;
}

.product-image-options-preview {
    display: block;
    max-width: 100%;
    max-height: 180px;
    width: auto;
    height: auto;
    box-sizing: border-box;
    margin: 12px auto;
}

.ck-content img[data-content-border-width] { box-sizing: border-box; }
.product-custom-content img[data-content-image-modal="1"] { cursor: zoom-in; }
.product-custom-content img[data-content-image-modal="1"]:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }

html.product-content-modal-open { overflow: hidden; }

.product-content-image-modal {
    width: fit-content;
    max-width: 95vw;
    max-height: 95dvh;
    padding: 44px 16px 16px;
    box-sizing: border-box;
    border: 0;
    border-radius: 12px;
    background: #fff;
}

.product-content-image-modal::backdrop { background: rgb(0 0 0 / 80%); }
.product-content-image-modal img { display: block; width: auto; height: auto; max-width: 85vw; max-height: 80dvh; object-fit: contain; }
.product-content-image-modal button { position: absolute; top: 8px; right: 12px; border: 0; background: transparent; color: #222; font-size: 24px; cursor: pointer; }
