/* ProductDetails image-grid layout (extracted from productDetailsWithImageGrid.blade.php) */
.productMain .swiper-wrapper .swiper-slide img {
        width: 100%;
        height: auto !important;
        object-fit: contain;
    }

.square-xs {
        height: 3rem !important;
        width: 3rem !important;
    }

    .product-option-panel {
        border: 1px solid #e3e6ec;
        border-radius: 18px;
        padding: 18px 20px;
        background: #f9fafc;
        margin-bottom: 20px;
    }

    .product-option-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
    }

    .product-option-label {
        text-transform: uppercase;
        letter-spacing: 0.06em;
        font-size: 13px;
        color: #555;
        font-weight: 700;
    }

    .product-option-value {
        font-weight: 600;
        font-size: 14px;
        color: #111;
        background: #fff;
        padding: 4px 14px;
        border-radius: 999px;
        border: 1px solid #d9dce3;
        min-height: 32px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 4px;
    }

    .product-option-value.is-empty {
        color: #8d94a3;
        border-style: dashed;
    }

    /* Size Guide modal - same z-index strategy as checkout Terms & Conditions. */
    .size-guide-modal,
    .size-guide-modal.show,
    body .size-guide-modal {
        z-index: 9999999 !important;
    }
    .size-guide-modal .modal-dialog,
    .size-guide-modal .modal-content {
        z-index: 10000000 !important;
    }
    .size-guide-modal .btn-close {
        z-index: 10000001 !important;
        pointer-events: auto !important;
        cursor: pointer !important;
    }
    body.modal-open .modal-backdrop {
        z-index: 9999998 !important;
    }

    .social-share a {
        color: var(--wizard-default-text-color, #212529) !important;
    }
    .social-share a:link,
    .social-share a:visited {
        color: var(--wizard-default-text-color, #212529) !important;
    }

    .social-share a svg {
        fill: currentColor !important;
    }
    .social-share a svg path,
    .social-share a svg g {
        fill: currentColor !important;
        stroke: currentColor !important;
    }

    .social-share a:hover,
    .social-share a:focus,
    .social-share a:hover:visited,
    .social-share a:focus:visited {
        color: var(--wizard-link-hover-color, var(--wizard-primary-bg, #0d6efd)) !important;
    }

    .product-option-grid {
        margin-top: 16px;
    }

    .product-color-list,
    .product-size-list {
        display: flex;
        flex-wrap: wrap;
        gap: 10px;
        margin-top: 10px;
    }

    .product-color-list a,
    .product-size-list a {
        flex: 0 0 auto;
        min-width: initial;
        width: auto !important;
        padding: 10px 18px;
        white-space: nowrap;
        display: flex;
        align-items: center;
        justify-content: center;
        border: 1px solid #cfd3dc;
        border-radius: 8px;
        font-size: 14px;
        color: var(--wizard-default-text-color, #212529) !important;
        background: #fff;
        transition: all 0.2s ease;
        position: relative;
        min-height: 42px;
        text-decoration: none !important;
    }
    .product-color-list a:link,
    .product-color-list a:visited,
    .product-size-list a:link,
    .product-size-list a:visited {
        color: var(--wizard-default-text-color, #212529) !important;
    }

    .product-color-list a::after,
    .product-size-list a::after {
        content: '';
        position: absolute;
        inset: 3px;
        border-radius: 6px;
        border: 2px solid transparent;
        transition: border-color 0.2s ease;
    }

    .product-color-list a:hover,
    .product-size-list a:hover {
        border-color: #7a8496;
        color: var(--wizard-default-text-color, #212529) !important;
        text-decoration: none !important;
    }

    .product-color-list a.active-colour,
    .product-size-list a.active-size {
        border-color: #111;
        background: #111;
        color: #fff !important;
    }

    .product-color-list a.active-colour::after,
    .product-size-list a.active-size::after {
        border-color: transparent;
    }

.square-rg {
        height: auto !important;
        width: auto !important;
        min-height: 42px;
        padding: 10px 18px;
    }

    .width-size-panel {
        padding: 0;
        background: transparent;
        margin: 25px 0 15px;
    }

    .width-size-buttons {
        display: flex;
        gap: 12px;
        padding: 0 0 16px;
        flex-wrap: wrap;
    }

    .width-size-buttons.single-width .width-btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
    }

    .width-size-buttons .width-btn {
        flex: 0 0 auto;
        width: auto;
        min-width: 0;
        border: 1px solid #e8eaed;
        background: #fff;
        padding: 16px 24px;
        cursor: pointer;
        font-weight: 600;
        color: #4a4f5c;
        font-size: 1rem;
        transition: all 0.2s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        border-radius: 6px;
        margin: 0;
    }

    .width-size-buttons .width-btn .width-btn-icon {
        font-size: 1.1rem;
        color: inherit;
    }

    .width-size-buttons .width-btn.active {
        background: #fff;
        color: #111;
        border-color: #b0b4bc;
    }

    .width-size-buttons .width-btn:not(.active) {
        border-color: #e8eaed;
    }

    .width-size-buttons .width-btn:not(.active):hover {
        background: #f8f9fa;
        border-color: #dfe1e5;
        color: #333;
    }

    /* Product title hierarchy: brand (main), product name + variant (secondary) */
    .product-title-block {
        scroll-margin-top: calc(4.5rem + env(safe-area-inset-top, 0px));
    }
    .product-title-brand {
        font-size: 0.9rem !important;
        font-family: var(--wizard-body-font, inherit) !important;
        font-weight: 600 !important;
        color: #111 !important;
        line-height: 1.35;
        letter-spacing: 0.04em;
        text-transform: uppercase;
        margin-bottom: 0.35rem !important;
    }
    .product-title-brand-link {
        color: inherit;
        text-decoration: none;
    }
    .product-title-brand-link:hover {
        color: #333;
        text-decoration: underline;
    }
    .product-title-name,
    .product-title-variant {
        color: #212529;
        line-height: 1.4;
    }
    h1.product-title-name {
        font-size: 1.25rem !important;
        font-weight: 600 !important;
        color: #212529 !important;
        font-family: var(--wizard-body-font, inherit) !important;
        line-height: 1.35 !important;
        margin-bottom: 0 !important;
        margin-top: 0.15rem;
    }
    .product-title-variant {
        margin-top: 0.25rem;
        font-size: 0.9rem;
        color: #212529;
    }
    .product-title-variant .product-title-colour-prefix {
        font-size: 0.9rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.02em;
    }

    .width-size-label {
        color: #333;
        font-size: 1rem;
    }

    .width-size-content {
        padding: 0 0 15px;
    }

    .product-size-list.size-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 10px;
        text-align: start !important;
    }

    .product-size-list.size-grid a {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 52px !important;
        position: relative;
        background: #fff !important;
        border: 1px solid #e8eaed !important;
        border-radius: 6px;
        color: var(--wizard-default-text-color, #212529) !important;
    }

    .product-size-list.size-grid a:hover {
        border-color: #d0d4dc !important;
        color: var(--wizard-default-text-color, #212529) !important;
        text-decoration: none !important;
    }

    .product-size-list.size-grid a.active-size {
        background: #111 !important;
        border-color: #111 !important;
        color: #fff !important;
    }
    .product-size-list.size-grid a.active-size span {
        color: #fff !important;
    }

    .product-size-list.size-grid a.unavailable {
        background: #f5f5f5 !important;
        color: #999;
        cursor: pointer;
        opacity: 0.85;
    }

    .product-size-list.size-grid a.unavailable .size-label-strike {
        text-decoration: line-through;
        position: relative;
    }

    .product-size-list.size-grid a.unavailable .size-notify-icon {
        position: absolute;
        top: 4px;
        right: 4px;
        font-size: 12px;
        color: #666;
    }

    .product-size-list.size-grid a.unavailable:hover .size-notify-icon {
        color: #333;
    }

    section.edit_product .product-stock-availability-table,
    section.edit_product .partial-stock-distribution-by-variation {
        width: 100%;
        max-width: 100%;
        clear: both;
        visibility: visible;
        opacity: 1;
        overflow-x: auto;
    }

    section.edit_product .product-stock-availability-table table {
        width: 100%;
        min-width: 0;
    }

    /* Phones/tablets: stack columns + visible purchase stack (sizes, cart, categories, share) */
    @media (max-width: 991.98px) {
        section.edit_product .row > [class*="col-"].product-details,
        section.edit_product .row > .product-details {
            flex: 0 0 100%;
            max-width: 100%;
            width: 100%;
        }

        section.edit_product .product-details {
            position: relative;
            z-index: 2;
            background: #fff;
            overflow: visible !important;
            padding-top: 1.25rem !important;
        }

        section.edit_product .product-title-block {
            padding-top: 0.25rem;
        }

        body.scrolled section.edit_product .product-details .product-title-block {
            padding-top: 0.5rem;
        }

        section.edit_product .pdp-purchase-stack,
        section.edit_product .pdp-purchase-stack .pdp-core-purchase-options,
        section.edit_product .pdp-purchase-stack .width-size-panel,
        section.edit_product .pdp-purchase-stack .width-size-content,
        section.edit_product .pdp-purchase-stack #add-to-cart-form,
        section.edit_product .pdp-purchase-stack .social-share,
        section.edit_product .pdp-purchase-stack .mt-4,
        section.edit_product .product-details-nested-blocks-area--populated,
        section.edit_product .product-details-nested-blocks-area[data-area-id="colours_replacement"],
        section.edit_product .product-details-nested-blocks-area[data-area-id="colours_replacement"] .blocks-container,
        section.edit_product .product-details-nested-blocks-area[data-area-id="colours_replacement"] section[data-block-type="product_list"] {
            display: block !important;
            visibility: visible !important;
            opacity: 1 !important;
            height: auto !important;
            min-height: 0 !important;
            max-width: 100% !important;
            overflow: visible !important;
        }

        /* Size chips must stay a horizontal wrap — never inherit display:block from the stack above */
        section.edit_product .pdp-purchase-stack .product-size-list.size-grid,
        section.edit_product .pdp-purchase-stack #size-selector .product-size-list.size-grid {
            display: flex !important;
            flex-direction: row !important;
            flex-wrap: wrap !important;
            gap: 10px !important;
            justify-content: flex-start !important;
            align-items: stretch !important;
            width: 100% !important;
            text-align: start !important;
        }

        section.edit_product .pdp-purchase-stack #add-to-cart-form .d-flex {
            display: flex !important;
        }

        section.edit_product .product-stock-availability-table,
        section.edit_product .partial-stock-distribution-by-variation {
            margin-top: 0.75rem;
            margin-bottom: 0.75rem;
        }

        section.edit_product .product-details > .p_i_zoom {
            display: none !important;
            width: 0 !important;
            height: 0 !important;
            overflow: hidden !important;
            pointer-events: none !important;
        }

        /* Slideshow: auto height on mobile — fixed min-height caused empty space and slide bleed */
        section.edit_product .pdp-gallery-slideshow .productMain {
            height: auto !important;
            min-height: 0 !important;
            max-height: 75vh !important;
            overflow: hidden !important;
        }

        section.edit_product .pdp-gallery-slideshow .productMain .swiper-wrapper,
        section.edit_product .pdp-gallery-slideshow .productMain .swiper-slide,
        section.edit_product .pdp-gallery-slideshow .productMain .swiper-slide img {
            height: auto !important;
            max-height: 75vh !important;
        }

        section.edit_product .productMain.productMain--pdp-mobile {
            min-height: min(60vw, 360px) !important;
        }

        section.edit_product .row > [class*="col-"].order-1,
        section.edit_product .row > [class*="col-"].order-xl-1,
        section.edit_product .row > [class*="col-"].order-xl-2 {
            display: block !important;
            visibility: visible !important;
            min-height: 1px;
        }

        section.edit_product .pdp-gallery-slideshow:not(.pdp-gallery--mobile-only),
        section.edit_product .product-images-grid {
            display: block !important;
            visibility: visible !important;
            width: 100% !important;
            min-height: 200px;
        }

        section.edit_product .pdp-gallery--desktop-only {
            display: none !important;
        }

        section.edit_product .pdp-gallery--mobile-only {
            display: block !important;
            visibility: visible !important;
            width: 100% !important;
            min-height: 200px;
        }

        section.edit_product.pdp-page-section {
            padding-top: 1rem !important;
        }
    }

    /* Mobile optimizations */
    @media (max-width: 767px) {

        .product-color-list,
        .product-size-list {
            justify-content: flex-start;
        }

        .product-color-list a,
        .product-size-list a {
            font-size: 12px;
            padding: 6px 12px;
        }

        .product-size-list.size-grid {
            display: flex !important;
            flex-direction: row !important;
            flex-wrap: wrap !important;
            gap: 10px !important;
            justify-content: flex-start !important;
            visibility: visible !important;
            min-height: 44px;
            width: 100% !important;
        }

        .product-size-list.size-grid a {
            flex: 0 0 auto !important;
            width: auto !important;
            min-width: 44px;
            min-height: 44px;
        }

        #add-to-cart-form {
            display: block !important;
            visibility: visible !important;
            width: 100%;
        }

        .product-stock-availability-table table,
        .partial-stock-distribution-by-variation {
            font-size: 12px;
        }
    }

    /* Product information section (collapsible) */
    .product-information-section {
        font-size: 0.9375rem;
        border: 1px solid #e8eaed;
        border-radius: 12px;
        background: #fafbfc;
        overflow: hidden;
    }
    .product-information-header {
        background: #fff;
        padding: 0.75rem 1rem !important;
        border-color: #e8eaed !important;
    }
    .product-information-title {
        font-size: 0.5625rem !important;
        letter-spacing: 0.12em !important;
        color: #5c6570 !important;
        font-weight: 500 !important;
        font-family: var(--wizard-body-font, inherit) !important;
        line-height: 1.3 !important;
        margin: 0 !important;
    }
    .product-information-toggle:hover {
        background: #f0f2f5;
    }
    .product-information-body {
        padding-left: 1rem !important;
        padding-right: 1rem !important;
        padding-bottom: 1rem !important;
    }
    .product-information-description {
        color: #444;
        line-height: 1.55;
        font-size: 0.8125rem;
    }
    .product-information-description :is(h1, h2, h3, h4, h5, h6, strong) {
        font-size: 0.75rem !important;
        font-family: var(--wizard-body-font, inherit) !important;
        font-weight: 500 !important;
        letter-spacing: normal !important;
        text-transform: none !important;
        color: #5c6570 !important;
        line-height: 1.35 !important;
        margin: 0.65rem 0 0.3rem !important;
    }
    .product-information-description :is(h1, h2, h3, h4, h5, h6):first-child {
        margin-top: 0 !important;
    }
    .product-information-description p {
        margin-bottom: 0.65rem;
    }
    .product-information-description p:last-child {
        margin-bottom: 0;
    }
    .product-information-description ul,
    .product-information-description ol {
        padding-left: 1.15rem;
        margin-bottom: 0.75rem;
    }
    .product-information-description li {
        margin-bottom: 0.35rem;
    }
    .product-information-specs li {
        margin-bottom: 0.4rem;
        padding-left: 0;
        position: relative;
        list-style: none;
        color: #444;
        line-height: 1.55;
        font-size: 0.9375rem;
    }
    .product-information-specs li::before {
        content: none;
        display: none;
    }
    .product-information-identifiers {
        margin-top: 0.75rem;
    }
    .pdp-product-metadata {
        font-size: 0.875rem;
        line-height: 1.5;
        color: #6c757d;
    }
    .pdp-product-metadata > p {
        margin-bottom: 0.5rem;
    }

    /* Product image grid: images fill column width with natural height (width 100%, height auto) */
    .product-images-grid .thumbnail-container {
        position: relative;
        overflow: visible;
        height: auto;
        min-height: 0;
    }
    .product-images-grid .thumbnail-container .p_i_zoom {
        overflow: hidden;
    }
    .product-images-grid .custom-sticker {
        pointer-events: none;
    }
    .product-images-grid .product-image-sticker-layer {
        z-index: 50 !important;
    }
    .product-gallery-promo-host {
        position: relative;
    }
    .product-gallery-promo-host .product-image-sticker-layer--promo-gallery {
        z-index: 60 !important;
    }
    .product-gallery-promo-host .promo-image-sticker img {
        max-width: min(220px, 42vw) !important;
        max-height: min(220px, 42vw) !important;
    }
    .product-images-grid .promo-image-sticker img {
        max-width: min(140px, 35vw) !important;
        max-height: min(140px, 35vw) !important;
    }
    .product-images-grid .thumbnail-container img {
        width: 100%;
        height: auto;
        object-fit: contain;
        display: block;
        vertical-align: middle;
    }

    /* Update the zoom pane to overlay the image */
    .p_i_zoom {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 10;
        pointer-events: none;
        background: transparent;
        display: none;
        /* Initially hidden */
        overflow: hidden;
    }

    .p_i_zoom .detail {
        position: absolute;
        width: 100%;
        height: 100%;
        background-repeat: no-repeat;
        background-position: center;
        background-size: contain;
        /* Changed from cover to contain for better image display */
    }

    .active-colour {
        border: 2px solid #006cb6;
        color: white !important;
        font-weight: bold;
        background-color: black
    }

    .active-size {
        border: 2px solid #111;
        color: white !important;
        font-weight: bold;
        background-color: #111
    }

    /* Quantity row between size selector and add to cart */
    .pdp-quantity-row {
        margin-top: 1rem;
        margin-bottom: 0.75rem;
    }

    .pdp-quantity-row .input-step {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        min-width: 110px;
        height: 40px;
        pointer-events: auto;
    }

    .pdp-quantity-row .input-step input.product-quantity {
        display: block !important;
        width: 42px !important;
        min-width: 42px;
        pointer-events: auto !important;
        cursor: text;
        -webkit-user-select: text;
        user-select: text;
        background: #fff;
    }

    .pdp-quantity-row .quantity_minus,
    .pdp-quantity-row .quantity_plus {
        cursor: pointer;
        pointer-events: auto;
    }

    @media (max-width: 767px) {

        /* Ensure the cart button and wishlist are on the same line */
        #add-to-cart-form .d-flex {
            display: flex !important;
            align-items: center;
        }

        /* Button stretches from start to heart */
        #add-to-cart-form .add-to-cart-row .flex-grow-1 {
            flex-grow: 1;
            min-width: 0;
        }

        /* Add to Cart / primary button sizing (colors from theme in master layout) */
        #add-to-cart-form .btn-primary {
            padding: 10px 20px;
            white-space: nowrap;
        }

        .wishlist-btn {
            flex-shrink: 0;
        }
        /* Product page wishlist: no background, no border - heart icon only */
        .wishlist-btn-product {
            background-color: transparent !important;
            background: transparent !important;
            color: #333 !important;
            border: none !important;
            border-radius: 6px !important;
        }
        .wishlist-btn-product:hover {
            background-color: transparent !important;
            background: transparent !important;
            color: #333 !important;
            border: none !important;
        }
        .wishlist-btn-product i {
            color: #333 !important;
        }

        .product-images-grid {
            margin-bottom: 1rem;
        }

        .product-details {
            padding-top: 1rem;
        }

        /* Ensure product details are visible on mobile */
        .col-md-6 {
            width: 100%;
        }

        @media (max-width: 768px) {
            .product-details {
                display: block !important;
            }
        }

        /* Make color and size selectors more prominent on mobile */
        .product-color-list a {
            min-width: 40px;
            min-height: 40px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* Improve carousel navigation on mobile */
        .swiper-button-next,
        .swiper-button-prev {
            width: 30px;
            height: 30px;
            background-color: rgba(255, 255, 255, 0.7);
            border-radius: 50%;
        }

        .swiper-button-next:after,
        .swiper-button-prev:after {
            font-size: 14px;
            font-weight: bold;
            color: #333;
        }
    }

    body.pagebuilder-mode .product-details-nested-blocks-area {
        min-height: 50px;
    }

    body:not(.pagebuilder-mode) .product-field-inline-placeholder,
    body:not(.pagebuilder-mode) .product-short-description .inline-empty-placeholder,
    body:not(.pagebuilder-mode) .product-information-description .inline-empty-placeholder {
        display: none !important;
    }

    body:not(.pagebuilder-mode) .product-short-description:has(.product-field-inline-placeholder),
    body:not(.pagebuilder-mode) .product-short-description:has(.inline-empty-placeholder),
    body:not(.pagebuilder-mode) .product-information-description:has(.product-field-inline-placeholder),
    body:not(.pagebuilder-mode) .product-information-description:has(.inline-empty-placeholder) {
        display: none !important;
    }

    /* Pagebuilder editing: reveal empty short description + product information for inline add */
    body.pagebuilder-mode .product-short-description.product-field-inline-editable,
    body.pagebuilder-mode .product-short-description:has(.product-field-inline-placeholder),
    body.pagebuilder-mode .product-short-description:has(.inline-empty-placeholder) {
        display: block !important;
        visibility: visible !important;
    }

    body.pagebuilder-mode .product-information-section[data-pdp-storefront-visible="0"] {
        display: block !important;
        visibility: visible !important;
        margin: 1rem 0 !important;
        padding: 0 !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        border: 1px solid #e8eaed !important;
    }

    body.pagebuilder-mode .product-information-section .product-information-description.product-field-inline-editable,
    body.pagebuilder-mode .product-information-section .product-information-description:has(.product-field-inline-placeholder),
    body.pagebuilder-mode .product-information-section .product-information-description:has(.inline-empty-placeholder) {
        display: block !important;
        visibility: visible !important;
    }

    /* Hide empty product information accordion on the storefront (pagebuilder editing keeps it visible). */
    body:not(.pagebuilder-mode) .product-information-section[data-pdp-storefront-visible="0"],
    body:not(.pagebuilder-mode) .product-information-section:not(:has(.product-information-specs li)):not(:has(.product-information-description *)),
    body:not(.pagebuilder-mode) .product-information-section:has(.product-information-body:not(:has(*))),
    body:not(.pagebuilder-mode) .product-information-section .product-information-body:empty {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
    }

    body:not(.pagebuilder-mode) .product-information-section:not(:has(.product-information-specs li)) .product-information-description:empty,
    body:not(.pagebuilder-mode) .product-information-section:not(:has(.product-information-specs li)) .product-information-description:has(.product-field-inline-placeholder),
    body:not(.pagebuilder-mode) .product-information-section:not(:has(.product-information-specs li)) .product-information-description:has(.inline-empty-placeholder) {
        display: none !important;
    }

    body:not(.pagebuilder-mode) .product-information-section:not(:has(.product-information-specs li)):has(.product-information-description:empty),
    body:not(.pagebuilder-mode) .product-information-section:not(:has(.product-information-specs li)):has(.product-information-description:not(:has(*))) {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
    }

    .product-information-section[data-pdp-storefront-visible="0"] {
        display: none !important;
    }

    body:not(.pagebuilder-mode) .add-more-blocks-to-product-details {
        display: none !important;
    }
    
    /* Hide PageBuilder add-block placeholders by default - only show when editing mode is active */
    .add-more-blocks-to-product-details {
        display: none !important;
    }
    
    body.pagebuilder-mode .add-more-blocks-to-product-details {
        display: block !important;
    }
    
    /* Hide empty product-details-nested-blocks-area (exclude saved/populated areas) */
    .product-details-nested-blocks-area--empty:not(.product-details-nested-blocks-area--always-visible):not(.product-details-nested-blocks-area--populated) {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    body.pagebuilder-mode .product-details-nested-blocks-area--empty {
        display: block !important;
        min-height: 50px !important;
        margin: 12px 0 !important;
        padding: 6px 0 !important;
        height: auto !important;
        overflow: visible !important;
        border: 2px dashed #007bff !important;
        background: #f8f9ff !important;
    }

    .add-block-to-container,
    .add-more-blocks-to-container {
        display: none !important;
    }
    body.pagebuilder-mode .add-block-to-container,
    body.pagebuilder-mode .add-more-blocks-to-container {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Hide product-details-nested-blocks-area when blocks-container is empty (exclude saved/populated areas) */
    body:not(.pagebuilder-mode) .product-details-nested-blocks-area:not(.product-details-nested-blocks-area--always-visible):not(.product-details-nested-blocks-area--populated) .blocks-container:empty {
        display: none !important;
    }
    
    /* Hide parent area when blocks-container is effectively empty (exclude saved/populated areas) */
    body:not(.pagebuilder-mode) .product-details-nested-blocks-area:not(.product-details-nested-blocks-area--always-visible):not(.product-details-nested-blocks-area--populated):has(.blocks-container:empty) {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
    }

    /* Colour / related-product grid on PDP (iPhone Safari must not collapse nested block output) */
    section.edit_product .product-details-nested-blocks-area--populated .blocks-container,
    section.edit_product .product-details-nested-blocks-area[data-area-id="colours_replacement"] .blocks-container {
        width: 100% !important;
        max-width: 100% !important;
        min-height: 1px;
        overflow: visible !important;
    }

    section.edit_product .product-details-nested-blocks-area[data-area-id="colours_replacement"] section[data-block-type="product_list"] {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
    }

    section.edit_product .product-details-nested-blocks-area[data-area-id="colours_replacement"] .products-grid-row {
        display: flex !important;
        flex-wrap: wrap !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
        --bs-gutter-x: 0.75rem;
        margin-right: calc(-0.5 * var(--bs-gutter-x));
        margin-left: calc(-0.5 * var(--bs-gutter-x));
    }

    section.edit_product .product-details-nested-blocks-area[data-area-id="colours_replacement"] .other-products-thumbnails,
    section.edit_product .product-details-nested-blocks-area[data-area-id="colours_replacement"] .product-color-list,
    section.edit_product .product-details-nested-blocks-area[data-area-id="colours_replacement"] .colour-badges {
        display: flex !important;
        flex-wrap: wrap !important;
        visibility: visible !important;
        opacity: 1 !important;
        max-width: 100% !important;
    }
    
    /* Empty nested areas stay visible only in PageBuilder (for adding blocks), not on the live store */
    body.pagebuilder-mode .product-details-nested-blocks-area--always-visible,
    body.pagebuilder-mode .product-details-nested-blocks-area--empty:not(.product-details-nested-blocks-area--populated) {
        display: block !important;
        min-height: 50px;
        height: auto !important;
        margin: 20px 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }
    body:not(.pagebuilder-mode) .product-details-nested-blocks-area--always-visible.product-details-nested-blocks-area--empty,
    body:not(.pagebuilder-mode) .product-details-nested-blocks-area--always-visible:has(.blocks-container:empty),
    body:not(.pagebuilder-mode) .product-details-nested-blocks-area--empty:not(.product-details-nested-blocks-area--populated) {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
    }

    /* Populated PDP areas whose blocks produced no visible output */
    body:not(.pagebuilder-mode) .product-details-nested-blocks-area--populated:not(:has(.blocks-container [data-block-id])):not(:has(.blocks-container section[data-block-type])):not(:has(.blocks-container .product-list-async-placeholder)),
    body:not(.pagebuilder-mode) .product-details-nested-blocks-area:not(.product-details-nested-blocks-area--empty):not(:has(.blocks-container [data-block-id])):not(:has(.blocks-container section[data-block-type])):not(:has(.blocks-container .product-list-async-placeholder)),
    body:not(.pagebuilder-mode) .container-nested-blocks-area:not(:has([data-block-id])):not(:has(section[data-block-type])):not(:has(.product-list-async-placeholder)) {
        display: none !important;
        margin: 0 !important;
        padding: 0 !important;
        height: 0 !important;
        min-height: 0 !important;
        overflow: hidden !important;
        border: 0 !important;
    }
    
    /* Hide container block "add blocks" placeholder when NOT in pagebuilder mode (purple button not clicked) */
    .add-more-blocks-to-container {
        display: none !important;
    }
    body.pagebuilder-mode .add-more-blocks-to-container {
        display: flex !important;
    }
    /* Hide empty columns (that only have the add-block placeholder) when NOT in pagebuilder mode */
    body:not(.pagebuilder-mode) .container-column:has(> .add-more-blocks-to-container:only-child) {
        display: none !important;
    }

    /* Core PDP purchase UI must never be collapsed (storefront + pagebuilder) */
    section.edit_product .pdp-purchase-stack,
    section.edit_product .pdp-purchase-stack .pdp-core-purchase-options,
    section.edit_product .pdp-core-purchase-options,
    section.edit_product .pdp-core-purchase-options .width-size-panel,
    section.edit_product .pdp-core-purchase-options .width-size-content,
    section.edit_product .pdp-core-purchase-options #add-to-cart-form,
    section.edit_product .pdp-core-purchase-options .product-option-panel {
        display: block !important;
        visibility: visible !important;
        height: auto !important;
        min-height: 0 !important;
        overflow: visible !important;
        opacity: 1 !important;
    }

    /* Do not put size-grid in the display:block catch-all — chips must stay horizontal */
    section.edit_product .pdp-core-purchase-options .product-size-list.size-grid,
    section.edit_product .pdp-purchase-stack .product-size-list.size-grid,
    section.edit_product #size-selector .product-size-list.size-grid,
    .pdp-purchase-stack .product-size-list.size-grid {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: flex-start !important;
        align-items: stretch !important;
        width: 100% !important;
        max-width: 100% !important;
        text-align: start !important;
        visibility: visible !important;
        height: auto !important;
        opacity: 1 !important;
        overflow: visible !important;
    }

    section.edit_product .pdp-core-purchase-options .product-size-list.size-grid a,
    section.edit_product .pdp-purchase-stack .product-size-list.size-grid a,
    section.edit_product #size-selector .product-size-list.size-grid a,
    .pdp-purchase-stack .product-size-list.size-grid a.square-rg {
        flex: 0 0 auto !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: auto !important;
        min-width: 52px !important;
        min-height: 42px !important;
        padding: 10px 14px !important;
        margin: 0 !important;
        float: none !important;
        box-sizing: border-box !important;
        background: #fff !important;
        border: 1px solid #d0d5dd !important;
        border-radius: 6px !important;
        color: #212529 !important;
        font-size: 14px !important;
        font-weight: 500 !important;
        line-height: 1.2 !important;
        text-decoration: none !important;
        white-space: nowrap !important;
        cursor: pointer !important;
    }

    section.edit_product .pdp-core-purchase-options .product-size-list.size-grid a:hover,
    section.edit_product .pdp-purchase-stack .product-size-list.size-grid a:hover,
    section.edit_product #size-selector .product-size-list.size-grid a:hover {
        border-color: #111827 !important;
        color: #111827 !important;
    }

    section.edit_product .pdp-core-purchase-options .product-size-list.size-grid a.active-size,
    section.edit_product .pdp-purchase-stack .product-size-list.size-grid a.active-size,
    section.edit_product #size-selector .product-size-list.size-grid a.active-size {
        background: #111 !important;
        border-color: #111 !important;
        color: #fff !important;
        font-weight: 600 !important;
    }

    /*
     * PDP right column: left-align title and price. Image Grid uses col-md-4/5/6 (not only col-md-6).
     * Layout wrappers often set text-align: center; override for product info + price.
     */
    section.edit_product [class*="col-"].product-details,
    section.edit_product .product-details {
        text-align: start !important;
    }
    section.edit_product .product-details .product-title-block,
    section.edit_product .product-details .product-title-block h1,
    section.edit_product .product-details .price-and-loyalty-block,
    section.edit_product .product-details .price-and-loyalty-block p,
    section.edit_product .product-details .price-and-loyalty-block .loyalty-points-below-price {
        text-align: start !important;
        width: 100%;
    }

    /* Beat global wizard h1–h6 sizes (master layout) inside PDP */
    section.edit_product .product-details .product-title-brand,
    section.edit_product .product-details .product-title-brand-link {
        font-size: 0.9rem !important;
        font-family: var(--wizard-body-font, inherit) !important;
        font-weight: 600 !important;
    }
    section.edit_product .product-details h1.product-title-name {
        font-size: 1.25rem !important;
        font-family: var(--wizard-body-font, inherit) !important;
        font-weight: 600 !important;
    }
    section.edit_product .product-details .product-information-title {
        font-size: 0.5625rem !important;
        font-family: var(--wizard-body-font, inherit) !important;
        font-weight: 500 !important;
    }
    section.edit_product .product-details .product-information-description h1,
    section.edit_product .product-details .product-information-description h2,
    section.edit_product .product-details .product-information-description h3,
    section.edit_product .product-details .product-information-description h4,
    section.edit_product .product-details .product-information-description h5,
    section.edit_product .product-details .product-information-description h6 {
        font-size: 0.75rem !important;
        font-family: var(--wizard-body-font, inherit) !important;
        font-weight: 500 !important;
        line-height: 1.35 !important;
        margin: 0.65rem 0 0.3rem !important;
        color: #5c6570 !important;
        letter-spacing: normal !important;
        text-transform: none !important;
    }
    section.edit_product .product-details .product-information-description strong {
        font-size: inherit !important;
        font-weight: 600 !important;
    }
