/* AGAFORT Homepage Deals Product Grid V1
   Canonical owner: product_section → homepage_sections (group_key=deals_v1).
   Equal-fraction columns; white surface only; outer shell transparent. */

[data-ag-deals-product-grid],
.ag-dh-deals-product-grid-section-inner {
    background: transparent !important;
}

html.ag-hl-on .ag-dh-deals-product-grid-section-inner,
.ag-dh-deals-product-grid-section-inner,
html.ag-hl-on [data-ag-deals-product-grid] > .ag-hp2-section-inner.ag-dh-wrap,
.ag-dh-page [data-ag-deals-product-grid] > .ag-hp2-section-inner.ag-dh-wrap {
    max-width: var(--ag-hl-max-w, 1184px) !important;
    width: 100%;
    margin-inline: auto !important;
    padding-inline: var(--ag-hl-pad, 8px) !important;
    box-sizing: border-box !important;
    background: transparent !important;
}

.ag-dh-deals-product-grid-section-inner > .ag-hp2-row,
.ag-dh-deals-product-grid-section-inner [data-ag-hsd]:not([data-ag-deals-grid-surface]) {
    max-width: 100% !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
}

.ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface],
html.ag-hbg-on .ag-dh-block.ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface],
html.ag-hbg-on .ag-dh-deals-product-grid-section-inner .ag-dh-block.ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface] {
    --ag-deals-v1-pad: 8px;
    --ag-deals-v1-gap: 8px;
    --ag-deals-v1-cols-desktop: 6;
    --ag-deals-v1-cols-tablet: 4;
    --ag-deals-v1-cols-mobile: 2;
    --ag-product-card-min-width: 0px;
    --ag-product-card-max-width: none;
    --ag-product-desktop-columns: var(--ag-deals-v1-cols-desktop);
    --ag-product-tablet-columns: var(--ag-deals-v1-cols-tablet);
    --ag-product-mobile-columns: var(--ag-deals-v1-cols-mobile);
    box-sizing: border-box;
    width: 100%;
    max-width: 100%;
    margin-inline: auto;
    margin-block: 0 1rem;
    padding: var(--ag-deals-v1-pad);
    background-color: var(--ag-surface, #ffffff) !important;
    background: var(--ag-surface, #ffffff) !important;
    background-image: none !important;
    border-radius: var(--ag-dh-radius, 8px);
    border: 1px solid #f1f5f9;
    /* V1-R1: do not clip stacked price blocks that grow past fixed card slots */
    overflow-x: hidden;
    overflow-y: visible;
}

.ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface] .ag-dh-section-header,
.ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface] .ag-dh-block-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: calc(-1 * var(--ag-deals-v1-pad)) calc(-1 * var(--ag-deals-v1-pad)) var(--ag-deals-v1-pad);
    padding: 0.75rem 1rem;
    background: var(--ag-module-header-bg, var(--ag-color-accent, #F68B1E));
    color: var(--ag-module-header-color, var(--ag-color-text, #313133));
    border-radius: var(--ag-dh-radius, 8px) var(--ag-dh-radius, 8px) 0 0;
    min-height: 48px;
}

.ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface] .ag-dh-section-header-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: inherit;
}

.ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface] .ag-dh-view-all {
    display: none;
}

.ag-dh-deals-product-grid-v1__rail.ag-dh-product-rail-grid,
.ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface] .ag-dh-product-rail-grid {
    display: grid !important;
    grid-template-columns: repeat(var(--ag-deals-v1-cols-desktop, 6), minmax(0, 1fr)) !important;
    gap: var(--ag-deals-v1-gap) !important;
    justify-content: stretch !important;
    align-items: stretch !important;
    overflow-x: hidden !important;
    overflow-y: visible !important;
    scroll-snap-type: none !important;
    width: 100%;
    max-width: 100%;
}

.ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface] .ag-dh-product-rail-grid > * {
    min-width: 0 !important;
    max-width: none !important;
    width: 100% !important;
    height: auto !important;
    align-self: stretch !important;
}

/* Compact card presentation for deals grid — V1-R1 price visibility */
.ag-pc-present-homepage-deals-grid,
.ag-pc-present-homepage-deals-grid.ag-dh-product-card--fixed {
    --ag-product-card-min-width: 0px;
    --ag-product-card-max-width: none;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    box-shadow: none !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    overflow: visible !important;
}

.ag-pc-present-homepage-deals-grid .ag-dh-product-body,
.ag-pc-present-homepage-deals-grid .ag-dh-product-body-main,
.ag-pc-present-homepage-deals-grid.ag-dh-product-card--fixed .ag-dh-product-body,
.ag-pc-present-homepage-deals-grid.ag-dh-product-card--fixed .ag-dh-product-body-main {
    padding: 0.35rem 0.15rem 0.55rem !important;
    gap: 0.25rem !important;
    overflow: visible !important;
    min-height: 0 !important;
    flex: 1 1 auto !important;
}

.ag-pc-present-homepage-deals-grid .ag-dh-product-media-wrap,
.ag-pc-present-homepage-deals-grid .ag-dh-product-media {
    aspect-ratio: 1 / 1;
    height: auto !important;
    max-height: none !important;
}

.ag-pc-present-homepage-deals-grid .ag-dh-product-media img,
.ag-pc-present-homepage-deals-grid .ag-dh-product-media .ag-img {
    object-fit: contain;
    max-height: none !important;
}

/* Two-line title — beat .ag-dh-product-card--fixed single-line lock */
.ag-pc-present-homepage-deals-grid .ag-dh-product-title,
.ag-pc-present-homepage-deals-grid.ag-dh-product-card--fixed .ag-dh-product-title {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    height: auto !important;
    min-height: calc(1.25em * 2) !important;
    max-height: calc(1.25em * 2) !important;
    font-size: 0.8125rem !important;
    line-height: 1.25 !important;
    margin: 0 !important;
}

/*
 * V1-R1 root cause repair:
 * `.ag-dh-product-card--fixed .ag-dh-price-row` locks height/min/max to 1.55rem with overflow:hidden
 * for a single horizontal price line. Deals stacks current + struck old prices vertically, so both
 * glyphs were clipped inside that 24.8px slot. Override only for homepage-deals-grid.
 */
.ag-pc-present-homepage-deals-grid .ag-dh-price-row,
.ag-pc-present-homepage-deals-grid.ag-dh-product-card--fixed .ag-dh-price-row,
.ag-dh-deals-product-grid-v1 .ag-pc-present-homepage-deals-grid .ag-dh-price-row {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    flex-wrap: nowrap !important;
    gap: 0.15rem !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin: 0 !important;
    overflow: visible !important;
}

.ag-pc-present-homepage-deals-grid .ag-dh-price-row strong,
.ag-pc-present-homepage-deals-grid .ag-dh-price-row del,
.ag-pc-present-homepage-deals-grid.ag-dh-product-card--fixed .ag-dh-price-row strong,
.ag-pc-present-homepage-deals-grid.ag-dh-product-card--fixed .ag-dh-price-row del {
    display: block !important;
    white-space: nowrap !important;
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: 100%;
    height: auto !important;
    max-height: none !important;
    line-height: 1.25 !important;
}

.ag-pc-present-homepage-deals-grid .ag-dh-price-row strong,
.ag-pc-present-homepage-deals-grid.ag-dh-product-card--fixed .ag-dh-price-row strong {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: var(--ag-color-text, #313133);
}

.ag-pc-present-homepage-deals-grid .ag-dh-price-row del,
.ag-pc-present-homepage-deals-grid.ag-dh-product-card--fixed .ag-dh-price-row del {
    font-size: 0.75rem !important;
    color: #9ca3af;
}

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

[dir="rtl"] .ag-pc-present-homepage-deals-grid .ag-dh-price-row {
    align-items: flex-start;
}

@media (max-width: 991.98px) {
    .ag-dh-deals-product-grid-v1__rail.ag-dh-product-rail-grid,
    .ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface] .ag-dh-product-rail-grid {
        grid-template-columns: repeat(var(--ag-deals-v1-cols-tablet, 4), minmax(0, 1fr)) !important;
    }
}

@media (max-width: 575.98px) {
    .ag-dh-deals-product-grid-v1__rail.ag-dh-product-rail-grid,
    .ag-dh-deals-product-grid-v1[data-ag-deals-grid-surface] .ag-dh-product-rail-grid {
        grid-template-columns: repeat(var(--ag-deals-v1-cols-mobile, 2), minmax(0, 1fr)) !important;
    }
}
