/* Desktop: gallery stays in view while the product info column scrolls. */
@media (min-width: 1024px) {
    /* page-main overflow:hidden would stop the gallery from sticking to the viewport */
    .catalog-product-view .page-main {
        overflow: visible;
    }

    /* Glen product content is 1240px wide. */
    .catalog-product-view .columns {
        max-width: 1240px;
    }

    .catalog-product-view .pdp-layout {
        gap: 16px;
    }

    /* Same split as Glencara and dev.gemcara.com: gallery ~57%, info ~43%. */
    .catalog-product-view .gallery-sticky-col {
        flex: 57 1 0;
        width: auto;
        align-self: stretch;
        min-width: 0;
    }

    .catalog-product-view .product-info-column {
        flex: 43 1 0;
        width: auto;
        min-width: 0;
    }

    .catalog-product-view #gallery {
        position: sticky;
        top: calc(var(--page-header-height, 100px) + 12px);
        z-index: 10;
        background: #fff;
    }
}

/* Mobile floating price card and add-to-cart bar. */
.pdp-float-bar,
.pdp-mobile-atc {
    display: none;
}

@media (max-width: 1023px) {
    body.catalog-product-view.has-pdp-float-bar,
    body.catalog-product-view.has-pdp-float-atc {
        padding-bottom: var(--pdp-float-offset, 0px);
    }

    .pdp-float-bar.is-on {
        display: flex;
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: calc(8px + env(safe-area-inset-bottom));
        z-index: 40;
        align-items: center;
        gap: 12px;
        margin: 0;
        padding: 8px 16px 8px 8px;
        border: 1px solid #e5e7eb;
        border-radius: 16px;
        background: #fff;
        box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    }

    .pdp-float-thumb {
        flex: 0 0 auto;
        width: 92px;
        height: 72px;
        padding: 4px;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        background: #fff;
        overflow: hidden;
    }

    .pdp-float-thumb img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: contain;
    }

    .pdp-float-prices {
        flex: 1 1 auto;
        min-width: 0;
        text-align: right;
    }

    .pdp-float-save {
        color: #2468b2;
        font-size: 16px;
        font-weight: 700;
        line-height: 1.2;
    }

    .pdp-float-final,
    .pdp-float-final .price {
        color: #1f2937;
        font-size: 28px;
        font-weight: 700;
        line-height: 1.15;
    }

    .pdp-float-retail,
    .pdp-float-retail .price {
        color: #9ca3af;
        font-size: 16px;
        font-weight: 500;
        line-height: 1.2;
        text-decoration: line-through;
    }

    body.has-pdp-float-atc .pdp-mobile-atc {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 41;
        align-items: center;
        justify-content: center;
        width: 100%;
        height: 64px;
        margin: 0;
        padding: 0 16px;
        border: 0;
        border-radius: 0;
        background: #2468b2;
        color: #fff;
        font-size: 20px;
        font-weight: 700;
        line-height: 1.2;
        cursor: pointer;
    }

    body.has-pdp-float-atc .pdp-mobile-atc:hover {
        background: #1d4f8a;
    }

    body.has-pdp-float-atc .pdp-mobile-atc:disabled {
        opacity: 0.6;
        cursor: not-allowed;
    }

    body.has-pdp-float-bar.has-pdp-float-atc .pdp-mobile-atc {
        bottom: var(--pdp-bar-height, 0px);
    }

    body.catalog-product-view.has-pdp-float-bar #custom-chat-launcher,
    body.catalog-product-view.has-pdp-float-atc #custom-chat-launcher {
        bottom: calc(var(--pdp-float-offset, 72px) + 16px);
    }
}
