/* Product grid card styles (extracted from product-grid-items blade). */
/* Global override for all product images */
        .product-item img,
        .topbar-product-card img,
        .product-image {
            object-fit: contain !important;
            width: auto !important;
            height: auto !important;
            max-width: 100% !important;
            max-height: 100% !important;
        }
        
        /* Product card and image container */
        .topbar-product-card {
            transition: all 0.3s ease;
            height: 100%;
            display: flex;
            flex-direction: column;
        }

        .topbar-product-card .position-relative,
        .topbar-product-card .product-image-container {
            width: 100%;
            height: 300px !important;
            min-height: 300px !important;
            flex-shrink: 0;
            overflow: hidden;
            display: flex !important;
            align-items: flex-start !important;
            justify-content: center !important;
            background-color: transparent;
            position: relative;
        }

        .topbar-product-card .product-image,
        .product-item .product-image,
        .topbar-product-card img,
        .product-item img {
            max-width: 100% !important;
            max-height: 100% !important;
            width: auto !important;
            height: auto !important;
            object-fit: contain !important;
            /* Align image tops for consistent grid */
            object-position: top center !important;
            transition: all 0.3s ease;
            display: block !important;
            margin: 0 auto !important;
        }

        /* SUP-1211: tile uses the product photo box (centered contain) + empty info for uniform card height. */
        .product-grid-tile {
            display: flex !important;
            flex-direction: column !important;
            align-self: stretch !important;
        }
        .product-grid-tile > .product-grid-tile-card {
            flex: 1 1 auto !important;
            width: 100% !important;
            height: 100% !important;
            min-height: 100% !important;
        }
        .product-grid-tile.product-item .product-grid-tile-media,
        .product-grid-tile.product-item .product-image-container,
        .product-grid-tile .product-grid-tile-media,
        .product-grid-tile .product-image-container {
            position: relative !important;
            flex-shrink: 0 !important;
            width: 100% !important;
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            overflow: hidden !important;
            background-image: none !important;
        }
        .product-grid-tile .product-grid-tile-link {
            display: flex !important;
            align-items: center !important;
            justify-content: center !important;
            width: 100% !important;
            height: 100% !important;
        }
        .product-grid-tile.product-item .product-grid-tile-image,
        .product-grid-tile.product-item .product-image-container img,
        .product-grid-tile.product-item img,
        .product-grid-tile .product-grid-tile-image,
        .product-grid-tile .product-image-container img,
        .product-grid-tile img {
            max-width: 100% !important;
            max-height: 100% !important;
            width: auto !important;
            height: auto !important;
            object-fit: contain !important;
            object-position: center !important;
            margin: 0 auto !important;
            transform: none !important;
            position: relative !important;
            inset: auto !important;
        }
        .product-grid-tile .product-grid-tile-info {
            flex-grow: 1 !important;
            min-height: 4.5rem;
            pointer-events: none;
        }

        .product-image-link {
            text-decoration: none;
        }

        .product-image-link:hover {
            text-decoration: none;
        }

        .topbar-product-card:hover .product-image {
            transform: scale(1.05);
        }

        /* Colour-variant swatches: card img rules use width:auto (intrinsic), which blows up swatch images */
        .topbar-product-card .product-color-list,
        .product-item .product-color-list {
            max-width: 100%;
            flex-wrap: wrap;
            row-gap: 8px;
        }

        .topbar-product-card .product-color-list img,
        .product-item .product-color-list img,
        .topbar-product-card a.color-badge img,
        .product-item a.color-badge img {
            width: 100% !important;
            height: 100% !important;
            max-width: 100% !important;
            max-height: 100% !important;
            min-width: 0 !important;
            min-height: 0 !important;
            object-fit: cover !important;
            margin: 0 !important;
        }

        /* Align image container content from top for consistent grid */
        .product-image-container {
            display: flex !important;
            align-items: flex-start !important;
            justify-content: center !important;
            text-align: center !important;
        }

        .product-image-container img {
            display: block !important;
            margin: 0 auto !important;
            max-width: 100% !important;
            max-height: 100% !important;
            height: auto !important;
        }

        /* Ensure proper image loading and centering */
        .product-image-container img {
            opacity: 1;
            transition: opacity 0.3s ease, transform 0.3s ease;
            background-color: #ffffff;
            min-height: 200px;
        }

        .product-image-container img[src=""] {
            opacity: 0;
        }

        /* Loading state styling */
        .product-image-container {
            background-color: #ffffff;
            background-image: url('/theme/defaultlaravel/assets/images/placeholder-light-grey.svg');
            background-size: contain;
            background-repeat: no-repeat;
            background-position: center;
        }

        .product-image-container img:not([src=""]) {
            background-image: none;
        }

        /* Ensure product info remains consistent */
        .product-info {
            display: flex;
            flex-direction: column;
            flex-grow: 1;
        }

        .product-title-wrapper {
            min-height: 40px;
        }

        .product-title {
            height: auto;
            overflow: visible;
            display: block;
            -webkit-line-clamp: unset;
            -webkit-box-orient: unset;
            white-space: normal;
            word-break: normal;
        }

        .topbar-product-card {
            align-items: stretch;
        }

        .topbar-product-card .product-info {
            display: flex;
            flex-direction: column;
            flex-grow: 1;
            align-items: stretch;
        }

        .topbar-product-card .product-title-wrapper {
            flex-grow: 0;
            display: block;
        }

        .topbar-product-card .product-title {
            width: 100%;
        }

        @media (max-width: 992px) {
            .topbar-product-card .position-relative,
            .topbar-product-card .product-image-container {
                height: 250px !important;
                min-height: 250px !important;
            }
        }

        .topbar-product-card .product-image-container {
            isolation: isolate;
        }
        .topbar-product-card .product-image-container .product-image-link {
            z-index: 1 !important;
        }
        .topbar-product-card .product-image-container > .new-label,
        .topbar-product-card .product-image-container > .product-tag {
            z-index: 40 !important;
        }

        /* Badge colours/position: Setup Wizard Step 4 (theme-product-badge-css in master layout) */

        /* Available sizes: centered below colour thumbnails, hover only */
        .topbar-product-card .product-hover-available,
        .product-item .product-hover-available {
            display: none;
            width: 100%;
            margin-top: 0.5rem;
            text-align: center;
        }
        .product-hover-available__row {
            justify-content: center;
            text-align: center;
        }
        @media (hover: hover) and (pointer: fine) {
            .topbar-product-card:hover .product-hover-available,
            .product-item:hover .product-hover-available {
                display: block;
            }
        }
        @media (hover: none), (pointer: coarse) {
            .topbar-product-card .product-hover-available,
            .product-item .product-hover-available {
                display: block;
            }
        }

        @media (max-width: 576px) {
            .topbar-product-card .position-relative,
            .topbar-product-card .product-image-container {
                height: 200px !important;
                min-height: 200px !important;
            }
        }
    