/* AGAFORT Homepage Recommended Products V1 — compact rail (canonical Product Card). */

.ag-rp-section {
    --ag-rp-gap: 12px;
    --ag-rp-columns-desktop: 6;
    --ag-rp-columns-tablet: 4;
    --ag-rp-columns-mobile: 2;
    margin-block: 0;
    padding: 8px;
    border-radius: 12px;
    background: var(--ag-surface, #ffffff);
    border: 1px solid #f1f5f9;
    box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
    overflow: visible;
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
}

.ag-dh-recommended-section-inner > .ag-dh-wrap,
.ag-dh-recommended-section-inner > [data-ag-hsd].ag-dh-wrap {
    max-width: 100% !important;
    margin-inline: 0 !important;
    background: transparent !important;
    padding-inline: 0 !important;
    box-shadow: none !important;
}

.ag-rp-header {
    display: block;
    align-items: unset;
    justify-content: unset;
    gap: 0;
    min-height: 0;
    padding: 0;
    margin-bottom: var(--ag-ush-content-gap, 12px);
    border-radius: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: visible;
    background: transparent;
}

.ag-rp-header .ag-dh-section-header {
    margin-bottom: 0;
}

.ag-rp-header-main {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.ag-rp-header-copy {
    min-width: 0;
}

.ag-rp-header-kicker {
    display: none;
}

.ag-rp-header-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
    color: #312f33;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ag-rp-view-more {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    flex: 0 0 auto;
    font-size: 0.875rem;
    font-weight: 600;
    color: #f97316;
    text-decoration: none;
    white-space: nowrap;
}

.ag-rp-view-more:hover,
.ag-rp-view-more:focus-visible {
    color: #ea580c;
    text-decoration: underline;
}

.ag-rp-carousel {
    position: relative;
}

.ag-rp-track {
    display: grid !important;
    grid-auto-flow: column;
    grid-auto-columns: calc((100% - (var(--ag-rp-gap) * (var(--ag-rp-columns-desktop) - 1))) / var(--ag-rp-columns-desktop));
    gap: var(--ag-rp-gap) !important;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-block: 2px;
    max-width: 100%;
}

.ag-rp-track::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
}

.ag-rp-track > .ag-dh-product-card {
    scroll-snap-align: start;
    min-width: 0;
    width: 100%;
    max-width: 100%;
    height: 100%;
    box-sizing: border-box;
}

/* Compact Homepage Recommended card: image + title + price only */
.ag-rp-section .ag-dh-product-card--compact {
    padding: 0;
    box-shadow: none;
    border: 1px solid #eef2f7;
    border-radius: 8px;
    background: #fff;
}

.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-media,
.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-media-wrap {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: 185px;
    margin-inline: auto;
}

.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-media img,
.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-media .ag-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-body {
    padding: 0.5rem 0.4rem 0.65rem;
}

.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-cat,
.ag-rp-section .ag-dh-product-card--compact .ag-dh-rating,
.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-meta,
.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-stock-slot,
.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-footer,
.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-actions {
    display: none !important;
}

.ag-rp-section .ag-dh-product-card--compact .ag-dh-product-title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.8125rem;
    line-height: 1.3;
    color: #313133;
    margin: 0 0 0.35rem;
}

.ag-rp-section .ag-dh-product-card--compact .ag-dh-price-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    height: calc(1.2em + 0.1rem + 1.2em);
    min-height: calc(1.2em + 0.1rem + 1.2em);
    max-height: calc(1.2em + 0.1rem + 1.2em);
    overflow: hidden;
}

.ag-rp-section .ag-dh-product-card--compact .ag-dh-price-row .ag-dh-price-compare.is-empty {
    visibility: hidden;
}

.ag-rp-section .ag-dh-product-card--compact .ag-dh-price-row strong {
    font-size: 0.9375rem;
    font-weight: 700;
    color: #111827;
}

.ag-rp-section .ag-dh-product-card--compact .ag-dh-price-row del {
    font-size: 0.75rem;
    color: #9ca3af;
}

.ag-rp-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    display: grid;
    place-items: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.ag-rp-nav--prev {
    inset-inline-start: -0.35rem;
}

.ag-rp-nav--next {
    inset-inline-end: -0.35rem;
}

.ag-rp-nav[hidden],
.ag-rp-nav:disabled {
    opacity: 0.35;
    cursor: default;
}

.ag-rp-empty {
    padding: 1.25rem 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.9rem;
}

@media (max-width: 991.98px) {
    .ag-rp-track {
        grid-auto-columns: calc((100% - (var(--ag-rp-gap) * (var(--ag-rp-columns-tablet) - 1))) / var(--ag-rp-columns-tablet));
    }
}

@media (max-width: 575.98px) {
    .ag-rp-track {
        grid-auto-columns: calc((100% - (var(--ag-rp-gap) * (var(--ag-rp-columns-mobile) - 1))) / var(--ag-rp-columns-mobile));
    }

    .ag-rp-nav {
        display: none;
    }

    .ag-rp-header-title {
        font-size: 0.975rem;
    }
}
