/* AGAFORT Homepage Product Rails V1-R1 — Flash + Recommended compact presentation.
   Presentation-only. Shares canonical Product Card payload/pricing/stock owners.
   Uniform height: stretch siblings; reserved title/price/stock regions; stock bar baseline. */

/* —— Shared compact rail card surface —— */
.ag-pc-present-homepage-flash-compact,
.ag-pc-present-homepage-recommended-compact {
    padding: 0 !important;
    box-shadow: none !important;
    border: 1px solid #e8edf3 !important;
    border-radius: 8px !important;
    background: #fff !important;
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
    min-height: 0 !important;
    overflow: hidden !important;
    align-self: stretch !important;
}

.ag-pc-present-homepage-flash-compact .ag-dh-product-body,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-body,
.ag-pc-present-homepage-flash-compact .ag-dh-product-body-main,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-body-main {
    display: flex !important;
    flex-direction: column !important;
    flex: 1 1 auto !important;
    min-height: 0 !important;
    gap: 0.28rem !important;
    overflow: hidden !important;
}

.ag-pc-present-homepage-flash-compact .ag-dh-product-media-wrap,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-media-wrap,
.ag-pc-present-homepage-flash-compact .ag-dh-product-media,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-media {
    aspect-ratio: 1 / 1;
    width: 100%;
    max-width: none;
    height: auto !important;
    max-height: none !important;
    margin-inline: 0;
    flex: 0 0 auto;
}

.ag-pc-present-homepage-flash-compact .ag-dh-product-media img,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-media img,
.ag-pc-present-homepage-flash-compact .ag-dh-product-media .ag-img,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-media .ag-img {
    width: 100%;
    height: 100%;
    max-height: none !important;
    object-fit: contain;
}

.ag-pc-present-homepage-flash-compact .ag-dh-product-body,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-body {
    padding: 0.45rem 0.45rem 0.75rem !important;
}

.ag-pc-present-homepage-flash-compact .ag-dh-product-title,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-title {
    display: block !important;
    height: 1.3em !important;
    min-height: 1.3em !important;
    max-height: 1.3em !important;
    font-size: 0.8125rem !important;
    line-height: 1.3 !important;
    margin: 0 !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
}

/* Stacked price: reserve current + compare lines so stock baseline stays fixed */
.ag-pc-present-homepage-flash-compact .ag-dh-price-row,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0.1rem !important;
    height: calc(1.2em + 0.1rem + 1.2em) !important;
    min-height: calc(1.2em + 0.1rem + 1.2em) !important;
    max-height: calc(1.2em + 0.1rem + 1.2em) !important;
    overflow: hidden !important;
    flex: 0 0 auto !important;
}

.ag-pc-present-homepage-flash-compact .ag-dh-price-row strong,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row strong,
.ag-pc-present-homepage-flash-compact .ag-dh-price-row .ag-dh-price-current,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row .ag-dh-price-current,
.ag-pc-present-homepage-flash-compact .ag-dh-price-row del,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row del,
.ag-pc-present-homepage-flash-compact .ag-dh-price-row .ag-dh-price-compare,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row .ag-dh-price-compare {
    display: block !important;
    white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    max-width: 100%;
    line-height: 1.2 !important;
    min-height: 1.2em !important;
    max-height: 1.2em !important;
}

.ag-pc-present-homepage-flash-compact .ag-dh-price-row strong,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row strong,
.ag-pc-present-homepage-flash-compact .ag-dh-price-row .ag-dh-price-current,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row .ag-dh-price-current {
    font-size: 0.9375rem;
    font-weight: 700;
}

.ag-pc-present-homepage-flash-compact .ag-dh-price-row del,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row del,
.ag-pc-present-homepage-flash-compact .ag-dh-price-row .ag-dh-price-compare,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row .ag-dh-price-compare {
    font-size: 0.75rem;
    color: #9ca3af;
}

.ag-pc-present-homepage-flash-compact .ag-dh-price-row .ag-dh-price-compare.is-empty,
.ag-pc-present-homepage-recommended-compact .ag-dh-price-row .ag-dh-price-compare.is-empty {
    visibility: hidden !important;
}

.ag-pc-present-homepage-flash-compact .ag-dh-product-cat,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-cat,
.ag-pc-present-homepage-flash-compact .ag-dh-rating,
.ag-pc-present-homepage-recommended-compact .ag-dh-rating,
.ag-pc-present-homepage-flash-compact .ag-dh-product-meta,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-meta,
.ag-pc-present-homepage-flash-compact .ag-dh-product-footer,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-footer,
.ag-pc-present-homepage-flash-compact .ag-dh-product-actions,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-actions,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-stock-slot,
.ag-pc-present-homepage-recommended-compact .ag-stock-progress,
.ag-pc-present-homepage-recommended-compact .ag-dh-product-badge--flash {
    display: none !important;
}

/* Flash compact: reserved stock meta + track; bar anchored to shared baseline */
.ag-pc-present-homepage-flash-compact .ag-dh-product-stock-slot {
    display: flex !important;
    flex-direction: column !important;
    justify-content: flex-end !important;
    margin-top: auto !important;
    height: 2.55rem !important;
    min-height: 2.55rem !important;
    max-height: 2.55rem !important;
    overflow: hidden !important;
    visibility: visible !important;
    flex: 0 0 auto !important;
}

.ag-pc-present-homepage-flash-compact .ag-dh-product-stock-slot.is-empty {
    visibility: hidden !important;
}

.ag-pc-present-homepage-flash-compact .ag-stock-progress {
    width: 100%;
    margin-top: 0 !important;
    display: grid !important;
    grid-template-rows: 1.05em auto !important;
    gap: 0.2rem !important;
    align-content: end !important;
}

.ag-pc-present-homepage-flash-compact .ag-stock-progress--compact .ag-stock-progress__track {
    height: 4px;
    border-radius: 999px;
}

.ag-pc-present-homepage-flash-compact .ag-stock-progress__meta {
    margin-bottom: 0 !important;
    min-height: 1.05em !important;
    max-height: 1.05em !important;
    overflow: hidden !important;
    white-space: nowrap !important;
}

.ag-pc-present-homepage-flash-compact .ag-stock-progress__meta.is-empty {
    visibility: hidden !important;
}

.ag-pc-present-homepage-flash-compact .ag-stock-progress__remaining,
.ag-pc-present-homepage-flash-compact .ag-stock-progress__label,
.ag-pc-present-homepage-flash-compact .ag-stock-progress__percent {
    font-size: 0.6875rem;
}

/* —— Flash Sales rail: exact six complete cards, no peek —— */
.ag-fs-section[data-ag-flash-compact] {
    --ag-fs-carousel-peek: 0px;
    --ag-product-card-min-width: 0px;
    --ag-product-card-max-width: none;
    overflow: visible;
}

.ag-fs-section[data-ag-flash-compact] .ag-fs-carousel {
    padding-inline: 2.35rem;
    overflow: visible;
}

.ag-fs-section[data-ag-flash-compact] .ag-fs-track,
.ag-fs-section[data-ag-flash-compact] .ag-fs-track.ag-dh-product-rail-carousel {
    --ag-fs-visible-cols: 6;
    grid-auto-columns: calc((100% - (6 - 1) * var(--ag-fs-carousel-gap, var(--ag-fs-card-gap, 12px))) / 6) !important;
    padding-inline-end: 0 !important;
    padding-block: 4px 10px;
    margin-block: 0;
    overflow-x: auto;
    overflow-y: clip;
    align-items: stretch;
}

.ag-fs-section[data-ag-flash-compact] .ag-fs-nav--prev {
    inset-inline-start: 0.15rem;
}

.ag-fs-section[data-ag-flash-compact] .ag-fs-nav--next {
    inset-inline-end: 0.15rem;
}

.ag-fs-section[data-ag-flash-compact] .ag-dh-product-card,
.ag-fs-section[data-ag-flash-compact] .ag-fs-track > * {
    padding: 0 !important;
    height: 100% !important;
    align-self: stretch;
}

.ag-fs-section[data-ag-flash-compact] .ag-dh-product-media-wrap,
.ag-fs-section[data-ag-flash-compact] .ag-dh-product-media {
    height: auto !important;
    max-height: none !important;
    aspect-ratio: 1 / 1;
}

.ag-fs-section[data-ag-flash-compact] .ag-dh-product-media img {
    max-height: none !important;
}

@media (max-width: 575.98px) {
    .ag-fs-section[data-ag-flash-compact] .ag-fs-carousel {
        padding-inline: 0;
    }

    .ag-pc-present-homepage-flash-compact .ag-dh-product-stock-slot {
        height: 2.35rem !important;
        min-height: 2.35rem !important;
        max-height: 2.35rem !important;
    }
}

/* —— Recommended Products rail: exact six complete cards —— */
.ag-rp-section,
[data-ag-recommended-products].ag-rp-section {
    --ag-rp-gap: var(--ag-scs-col-gap, 24px);
    --ag-rp-columns-desktop: 6;
    --ag-rp-columns-tablet: 4;
    --ag-rp-columns-mobile: 2;
    --ag-product-card-min-width: 0px;
    --ag-product-card-max-width: none;
    /* Content Inner Gutters V1: surface pad 0; viewport owns side gutters. */
    padding: 0 0 var(--ag-scs-pad-block-end, 24px);
    overflow: visible;
}

.ag-rp-header {
    min-height: 48px;
    max-height: 56px;
    margin-bottom: 0;
    padding: 6px var(--ag-scs-pad-inline, 24px);
}

.ag-rp-carousel {
    position: relative;
    padding-inline: var(--ag-scs-pad-inline, 24px);
    padding-block-start: var(--ag-scs-pad-block-start, 16px);
    overflow: visible;
    box-sizing: border-box;
}

.ag-rp-track,
.ag-rp-track.ag-dh-product-rail-carousel,
[data-ag-recommended-products] .ag-rp-track.ag-dh-product-rail-carousel {
    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)) !important;
    gap: var(--ag-rp-gap) !important;
    justify-content: start !important;
    overflow-x: auto;
    overflow-y: clip;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-block: 4px 10px;
    padding-inline: 0 !important;
    padding-inline-end: 0 !important;
    max-width: 100%;
    align-items: stretch;
    box-sizing: border-box;
}

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

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

.ag-rp-nav {
    position: absolute;
    top: 38%;
    transform: translateY(-50%);
    z-index: 3;
    width: 1.85rem;
    height: 1.85rem;
    inset-inline: auto;
}

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

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

@media (max-width: 991.98px) {
    .ag-fs-section[data-ag-flash-compact] .ag-fs-track,
    .ag-fs-section[data-ag-flash-compact] .ag-fs-track.ag-dh-product-rail-carousel {
        --ag-fs-visible-cols: 4;
        grid-auto-columns: calc((100% - (4 - 1) * var(--ag-fs-carousel-gap, var(--ag-fs-card-gap, 12px))) / 4) !important;
    }

    .ag-rp-section,
    [data-ag-recommended-products].ag-rp-section {
        --ag-rp-gap: var(--ag-scs-col-gap-tablet, 16px);
        padding-block-end: var(--ag-scs-pad-block-end-tablet, 16px);
    }

    .ag-rp-header {
        padding-inline: var(--ag-scs-pad-inline-tablet, 16px);
    }

    .ag-rp-carousel {
        padding-inline: var(--ag-scs-pad-inline-tablet, 16px);
        padding-block-start: var(--ag-scs-pad-block-start-tablet, 12px);
    }

    .ag-rp-track,
    .ag-rp-track.ag-dh-product-rail-carousel,
    [data-ag-recommended-products] .ag-rp-track.ag-dh-product-rail-carousel {
        grid-auto-columns: calc((100% - (var(--ag-rp-gap) * (var(--ag-rp-columns-tablet) - 1))) / var(--ag-rp-columns-tablet)) !important;
    }
}

@media (max-width: 575.98px) {
    .ag-rp-section,
    [data-ag-recommended-products].ag-rp-section {
        --ag-rp-gap: var(--ag-scs-col-gap-mobile, 12px);
        padding-block-end: var(--ag-scs-pad-block-end-mobile, 12px);
    }

    .ag-rp-header {
        padding-inline: var(--ag-scs-pad-inline-mobile, 12px);
    }

    .ag-rp-carousel {
        padding-inline: var(--ag-scs-pad-inline-mobile, 12px);
        padding-block-start: var(--ag-scs-pad-block-start-mobile, 10px);
    }

    .ag-fs-section[data-ag-flash-compact] .ag-fs-track,
    .ag-fs-section[data-ag-flash-compact] .ag-fs-track.ag-dh-product-rail-carousel {
        --ag-fs-visible-cols: 2;
        grid-auto-columns: calc((100% - (2 - 1) * var(--ag-fs-carousel-gap, var(--ag-fs-card-gap, 12px))) / 2) !important;
    }

    .ag-rp-track,
    .ag-rp-track.ag-dh-product-rail-carousel,
    [data-ag-recommended-products] .ag-rp-track.ag-dh-product-rail-carousel {
        grid-auto-columns: calc((100% - (var(--ag-rp-gap) * (var(--ag-rp-columns-mobile) - 1))) / var(--ag-rp-columns-mobile)) !important;
    }

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