.product-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
    gap: 14px;
    padding: 8px 0;
}

.product-card {
    min-width: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--panel);
    box-shadow: var(--shadow-sm, 0 4px 14px #0000000d);
}

.product-media-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
}

.product-media-card__image,
.product-media-card__content {
    grid-area: 1 / 1;
    min-width: 0;
}

.product-card-image {
    position: relative;
    height: 300px;
    overflow: hidden;
    background: rgb(9 14 30);
}

.product-card-image img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-card-image > .product-image-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 8px;
    color: rgb(255 255 255 / .65);
    font-size: 13px;
    opacity: .55;
    text-align: center;
}

.product-media-card__image::after {
    position: absolute;
    z-index: 1;
    inset: 25% 0 0;
    background: var(--image-card-fade);
    content: "";
    pointer-events: none;
}

.product-media-card__image[data-image-state="loading"] .product-image-placeholder {
    display: none;
}

.product-media-card__content {
    z-index: 2;
    align-self: end;
    padding: 14px 16px 16px;
    color: #fff;
    text-shadow: 0 1px 2px rgb(0 0 0 / .45);
}

.product-media-card__content h4 {
    display: -webkit-box;
    margin: 0 0 5px;
    overflow: hidden;
    overflow-wrap: anywhere;
    font-size: 18px;
    line-height: 1.25;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-media-card__content > p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: rgb(255 255 255 / .82);
    overflow-wrap: anywhere;
    font-size: 14px;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-card-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 8px;
    margin: 12px 0 0;
}

.product-card-metrics > div {
    min-width: 0;
}

.product-card-metrics dt {
    color: rgb(255 255 255 / .78);
    font-size: 13px;
}

.product-card-metrics dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
}

.product-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    background: var(--panel);
}

.product-card-actions form {
    margin: 0;
}

.product-card-picker {
    position: relative;
    display: grid;
    grid-template-rows: auto 1fr;
    width: 100%;
    min-height: 172px;
    overflow: hidden;
    padding: 0;
    border-radius: 12px;
    text-align: start;
}

.account-product-picker::after {
    position: absolute;
    z-index: 1;
    inset: 25% 0 0;
    background: linear-gradient(
        to top,
        rgb(9 14 30 / 1) 0%,
        rgb(9 14 30 / .97) 26%,
        rgb(9 14 30 / .82) 48%,
        rgb(9 14 30 / .35) 76%,
        transparent 100%
    );
    content: "";
    pointer-events: none;
}

.product-card-picker .product-card-image,
.product-card-picker > .saved-product-thumbnail,
.product-card-picker > .product-image-placeholder {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}

.product-card-picker .product-card-image {
    padding: 0;
    border-radius: 0;
}

.product-card-picker-info {
    position: relative;
    z-index: 2;
    grid-row: 2;
    align-self: end;
    min-width: 0;
    padding: 0 12px 10px;
    overflow-wrap: anywhere;
    color: #fff;
    text-shadow: 0 1px 2px rgb(0 0 0 / .45);
}

.product-card-picker-info b {
    color: #fff !important;
    display: -webkit-box !important;
    overflow: hidden;
    font-size: 15px !important;
    line-height: 1.3;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.product-card-picker-info span {
    color: rgb(255 255 255 / .82) !important;
}

.product-card-picker-info > span {
    font-size: 13px !important;
}

.product-card-picker-info .product-picker-price {
    color: #fff !important;
    font-weight: 700;
}

.product-card-picker .product-source-tag {
    position: relative;
    z-index: 3;
    grid-row: 1;
    justify-self: start;
    margin: 8px 8px 0;
    max-width: calc(100% - 16px);
    white-space: normal;
    overflow-wrap: anywhere;
}

.product-card-picker > .saved-product-thumbnail {
    border-radius: 0;
    object-fit: cover;
}

.product-card-picker > .product-image-placeholder {
    display: grid;
    place-items: center;
    background: rgb(9 14 30);
    color: rgb(255 255 255 / .72);
}

.machine-product-image .product-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    height: 100%;
    min-height: 48px;
    color: rgb(255 255 255 / .72);
    font-size: 13px;
    text-align: center;
}

.machine-product-image[data-image-state="loading"] .product-image-placeholder::before {
    content: none;
}

.pre-shop-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0 !important;
    padding: 0 !important;
}

.pre-shop-card .product-card-image,
.pre-shop-card .product-media-card__content {
    grid-area: 1 / 1;
}

.pre-shop-card .product-card-image {
    height: 300px;
    margin: 0;
    border-radius: 15px 15px 0 0;
}

.pre-shop-card .product-media-card__content {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin: 0;
}

.pre-shop-card .product-media-card__content h4,
.pre-shop-card .product-media-card__content p {
    margin: 0;
}

.pre-shop-card .product-media-card__content p {
    margin-top: 4px;
    color: rgb(255 255 255 / .82);
    font-size: 14px;
}

.pre-shop-card .product-media-card__content strong {
    display: inline-block;
    margin-top: 6px;
}

.pre-shop-card > :not(.product-card-image) {
    margin-inline: 16px;
}

.pre-shop-card > .pre-shop-metrics {
    margin-block-start: 14px;
}

.pre-shop-card > .pre-shop-progress {
    margin-block-start: 14px;
}

.pre-shop-card > small {
    margin-block: 8px 12px;
}

.pre-shop-card > .pre-shop-edit-form {
    margin-block-end: 16px;
}

.pre-shop-card .pre-shop-metrics dt {
    color: var(--muted);
}

.pre-shop-card .pre-shop-metrics dd {
    color: var(--text-1);
}

.pre-shop-card-head.product-media-card__content {
    position: relative;
    display: flex;
    visibility: visible;
    align-items: flex-end;
    min-width: 0;
    color: #fff;
    background: none;
    text-shadow: 0 1px 2px rgb(0 0 0 / .45);
}

.pre-shop-card-head.product-media-card__content > div {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.pre-shop-card-head [data-pre-shop-status] {
    flex: 0 1 auto;
    max-width: 40%;
    white-space: normal;
    overflow-wrap: anywhere;
}

#tab-manage .machine-product-edit-form {
    box-sizing: border-box;
    grid-template-columns: minmax(0, 1fr);
    min-width: 0;
    width: 100%;
}

#tab-manage .machine-product-edit {
    flex: 1 1 100%;
    min-width: 0;
    width: 100%;
}

.machine-product-image[data-image-state="unavailable"] .product-image-placeholder {
    color: rgb(255 255 255 / .62);
}

@media (max-width: 600px) {
    .product-card-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .product-card-image {
        height: 290px;
    }

    .product-card-picker {
        min-height: 172px;
    }
}
