/* Recommendation presentation follows DESIGN.md; native selection and cart forms stay authoritative. */
.catalog-product-view .ht-product-recommendations {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    margin-block: 32px;
    padding-block: 24px;
    border-block-start: 1px solid var(--ht-color-line, #d9dde3);
}
.catalog-product-view .ht-product-recommendations h2 {
    margin: 0 0 24px;
    color: var(--ht-color-ink, #111313);
    font-size: 21px;
    font-weight: 600;
}
.catalog-product-view .ht-product-recommendations__viewport {
    overflow: visible;
}
.catalog-product-view .ht-product-recommendations__list.product-items {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    grid-auto-rows: 1fr;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}
.catalog-product-view .ht-product-recommendations__list.product-items::before,
.catalog-product-view .ht-product-recommendations__list.product-items::after {
    display: none;
}
.catalog-product-view .ht-product-recommendations__list.product-items > .product-item {
    display: flex;
    float: none;
    min-width: 0;
    width: auto;
    margin: 0;
    padding: 0;
    text-align: start;
}
.catalog-product-view .ht-product-recommendations .product-item-info {
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    border: 1px solid var(--ht-color-line, #d9dde3);
    border-radius: 16px;
    background: var(--ht-color-surface, #fff);
    overflow: hidden;
}
.catalog-product-view .ht-product-recommendations .product-item-photo {
    display: block;
    padding: 12px;
    border-block-end: 1px solid var(--ht-color-line, #d9dde3);
    background: var(--ht-color-soft, #f6f7f9);
}
.catalog-product-view .ht-product-recommendations .product-image-container {
    display: block;
    width: 100% !important;
    height: auto;
    aspect-ratio: 1;
}
.catalog-product-view .ht-product-recommendations .product-image-wrapper {
    display: block;
    height: 100%;
    padding: 0 !important;
}
.catalog-product-view .ht-product-recommendations img.product-image-photo {
    position: static;
    display: block;
    width: 100%;
    height: 100%;
    max-height: none;
    margin: 0;
    object-fit: contain;
}
.catalog-product-view .ht-product-recommendations .product-item-details {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
    padding: 14px 16px 16px;
}
.catalog-product-view .ht-product-recommendations .product-item-name {
    min-height: 44px;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    line-height: 22px;
}
.catalog-product-view .ht-product-recommendations .product-item-name .product-item-link {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    overflow-wrap: anywhere;
    color: var(--ht-color-ink, #111313) !important;
}
.catalog-product-view .ht-product-recommendations .product-item-link:hover,
.catalog-product-view .ht-product-recommendations .product-item-link:focus-visible {
    color: var(--ht-color-primary, #d71920) !important;
}
.catalog-product-view .ht-product-recommendations .price-box {
    margin: auto 0 0;
    line-height: 24px;
}
.catalog-product-view .ht-product-recommendations .price-box .price {
    color: var(--ht-color-primary, #d71920);
    font-size: 16px;
    font-weight: 800;
}
.catalog-product-view .ht-product-recommendations .price-box .old-price .price {
    color: var(--ht-color-muted, #5f646b);
    font-size: 12px;
    font-weight: 600;
}
.catalog-product-view .ht-product-recommendations form[data-role="tocart-form"] {
    margin: 0;
    width: 100%;
}
.catalog-product-view .ht-product-recommendations .action.primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    width: 100%;
    min-height: 44px;
    padding: 10px 12px !important;
    border: 1px solid var(--ht-color-primary, #d71920) !important;
    border-radius: 10px !important;
    background: var(--ht-color-primary, #d71920) !important;
    color: var(--ht-color-surface, #fff) !important;
    font-size: 14px;
    font-weight: 700;
    line-height: 22px;
    white-space: normal;
}
.catalog-product-view .ht-product-recommendations .action.primary:hover {
    border-color: var(--ht-color-primary-dark, #aa1419) !important;
    background: var(--ht-color-primary-dark, #aa1419) !important;
}
.catalog-product-view .ht-product-recommendations .action.primary:active {
    border-color: var(--ht-color-primary-active, #821014) !important;
    background: var(--ht-color-primary-active, #821014) !important;
}
.catalog-product-view .ht-product-recommendations .action.primary:disabled {
    border-color: var(--ht-color-line, #d9dde3) !important;
    background: var(--ht-color-soft-accent, #f1f3f5) !important;
    color: var(--ht-color-muted, #5f646b) !important;
    cursor: not-allowed;
}
.catalog-product-view .ht-product-recommendations :focus-visible {
    outline: 2px solid var(--ht-color-primary, #d71920);
    outline-offset: -3px;
}
@media (max-width: 1279px) {
    .catalog-product-view .ht-product-recommendations__list.product-items {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (max-width: 1023px) {
    .catalog-product-view .ht-product-recommendations__list.product-items {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (max-width: 767px) {
    .catalog-product-view .ht-product-recommendations__list.product-items {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .catalog-product-view .ht-product-recommendations .product-item-info { border-radius: 14px; }
    .catalog-product-view .ht-product-recommendations .product-item-photo { padding: 10px; }
    .catalog-product-view .ht-product-recommendations .product-item-details { padding: 12px; }
    .catalog-product-view .ht-product-recommendations .action.primary { border-radius: 8px !important; }
}

/* Related products occupy one row on tablet/desktop; mobile keeps its two-column grid. */
@media (min-width: 768px) and (max-width: 1023px) {
    .catalog-product-view .ht-product-recommendations--related .product-items > .product-item:nth-child(n + 4) {
        display: none;
    }
}
@media (min-width: 1024px) and (max-width: 1279px) {
    .catalog-product-view .ht-product-recommendations--related .product-items > .product-item:nth-child(n + 5) {
        display: none;
    }
}
