body.everklin-transformed #main [data-product-image-stage] {
    position: relative;
}

body.everklin-transformed #main [data-product-image-stage] .product-image-expand {
    position: absolute;
    z-index: 3;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    width: 100%;
    padding: 12px;
    border: 0;
    border-radius: inherit;
    background: transparent;
    box-shadow: none;
    color: #243a2c;
    cursor: zoom-in;
    font: inherit;
}

.product-image-expand > span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 13px;
    min-height: 44px;
    border: 1px solid #c7d3ba;
    border-radius: 999px;
    background: #fff;
    box-shadow: 0 4px 18px rgb(26 47 30 / 13%);
    font-size: .8rem;
    font-weight: 700;
}

body.everklin-transformed #main .product-image-expand:focus-visible,
.product-image-viewer button:focus-visible {
    outline: 2px solid #587532;
    outline-offset: -3px;
}

html:has(.product-image-viewer[open]) {
    overflow: hidden;
}

body.everklin-transformed .product-image-viewer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    color: #233b2e;
    background: #f1f5e8;
    color-scheme: light;
    overflow: hidden;
}

.product-image-viewer[open] {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
}

.product-image-viewer__toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 8px;
    padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) 10px max(12px, env(safe-area-inset-left));
    background: #fff;
    border-bottom: 1px solid #d4dec9;
}

.product-image-viewer__toolbar h2 {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    color: inherit;
    font-size: clamp(.84rem, 3.4vw, 1.05rem);
    line-height: 1.25;
    overflow-wrap: anywhere;
    margin: 0;
}

.product-image-viewer__toolbar form {
    margin: 0;
}

.product-image-viewer__toolbar button {
    min-width: 44px;
    min-height: 44px;
    padding: 0 10px;
    border: 1px solid #d4dec9;
    border-radius: 10px;
    background: #f4f7ef;
    color: inherit;
    font: 700 .85rem/1 system-ui, sans-serif;
    cursor: pointer;
}

.product-image-viewer__toolbar button[aria-pressed="true"] {
    background: #e3ecd8;
    border-color: #a6ba8e;
}

.product-image-viewer__toolbar form button {
    font-size: 1.5rem;
}

.product-image-viewer__canvas {
    padding: 8px max(8px, env(safe-area-inset-right)) max(8px, env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
    overflow: auto;
    overscroll-behavior: contain;
    background: radial-gradient(ellipse at center, #fff 0%, #f3f6ea 64%, #e5ecd9 100%);
}

.product-image-viewer__canvas img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    margin: 0;
    /* Zoom positions the canvas immediately after resizing the image. */
    transition-property: none !important;
}

.product-image-viewer__canvas.is-enlarged img {
    max-width: none;
    width: max(135%, 95vh);
    height: auto;
}

@media (max-width: 767px) {
    html body.everklin-transformed #main#main#main :is(
        .fph-product-summary__top .fph-product-summary__visual,
        .product-hero-grid .product-image-stage,
        .iic-product-hero .iic-packshot,
        .sample-hero .sample-hero__packshot,
        .room-product-detail__hero-grid > figure
    ) {
        position: relative;
        isolation: isolate;
        display: grid !important;
        place-items: center;
        box-sizing: border-box;
        width: 100% !important;
        max-width: none !important;
        min-height: 0 !important;
        height: clamp(320px, 70vh, 580px) !important;
        height: clamp(320px, 70svh, 580px) !important;
        margin: 0 !important;
        padding: 14px 12px 58px !important;
        border-radius: 16px !important;
        background: radial-gradient(ellipse at center, #fff 0%, #f4f6eb 57%, #e5ecd8 100%) !important;
    }

    html body.everklin-transformed #main#main#main :is(
        .fph-product-summary__top .fph-product-summary__visual,
        .product-hero-grid .product-image-stage,
        .iic-product-hero .iic-packshot,
        .sample-hero .sample-hero__packshot,
        .room-product-detail__hero-grid > figure
    ) > :is(img, picture) {
        display: block !important;
        width: 100% !important;
        height: 100% !important;
        max-width: none !important;
        max-height: none !important;
        min-height: 0 !important;
        object-fit: contain !important;
        margin: 0 !important;
        border: 0 !important;
        transform: none !important;
    }

    html body.everklin-transformed #main#main#main .fph-product-summary__visual figcaption {
        display: none !important;
    }

    html body.everklin-transformed #main#main#main :is(.fph-product-summary__top, .product-hero-grid .product-gallery) {
        grid-template-columns: minmax(0, 1fr);
    }

    html body.everklin-transformed #main#main#main [data-ich-product-summary] {
        scroll-margin-top: 0 !important;
    }
}

@media (max-width: 767px) and (orientation: landscape) {
    html body.everklin-transformed #main#main#main [data-product-image-stage] {
        height: clamp(290px, 72svh, 400px) !important;
    }
}
