/**
 * Sale slider / top deals (Slick carousel).
 * Shared card layout for all contexts: editorial singles, category hubs, portal, homepage.
 * Do not use flex scroll on .topdeals_container (Slick owns layout).
 */

.topdeals-title,
.vgl-homepage__sale-slider .section-title {
    margin-bottom: var(--vgl-space-4);
    color: var(--vgl-color-text);
    font-size: var(--vgl-font-size-xl);
}

.topdeals-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--vgl-space-3);
    margin-bottom: var(--vgl-space-4);
}

.topdeals-header .topdeals-title {
    margin-bottom: 0;
}

.topdeals-header__link {
    font-size: var(--vgl-font-size-sm);
    font-weight: 600;
    color: var(--vgl-color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.topdeals-header__link:hover {
    color: var(--vgl-color-primary-hover);
    text-decoration: none;
}

.sales_slider_container {
    margin-block: var(--vgl-space-6);
    min-height: 220px;
}

.vgl-editorial-sale-slider {
    margin-top: var(--vgl-space-8);
    margin-bottom: var(--vgl-space-4);
}

.topdeals_container br {
    display: none;
}

.topdeals_container .slick-track > p {
    display: none !important;
}

.topdeals_container {
    position: relative;
    max-width: 1190px;
    margin: 0 auto;
}

.topdeals_container:not(.slick-initialized) {
    visibility: hidden;
    min-height: 420px;
}

.topdeals_container.slick-initialized {
    visibility: visible;
}

.topdeals_container.low_wide {
    max-width: 850px;
}

/* Equal-height slides (same pattern as #review-related-products) */
.topdeals_container .slick-list {
    overflow: hidden;
}

.topdeals_container .slick-track {
    display: flex !important;
    align-items: stretch;
}

.topdeals_container .slick-slide {
    height: auto;
    display: flex;
}

.topdeals_container .slick-slide > div {
    display: flex;
    width: 100%;
    height: 100%;
}

.topdeals_container .topdeal_wrapper {
    display: flex;
    width: 100%;
    height: 100%;
    padding: 0 var(--vgl-space-2);
    outline: none;
}

.topdeals_container > .topdeal_wrapper {
    opacity: 0;
}

.topdeals_container.slick-initialized > .topdeal_wrapper {
    opacity: 1;
}

/* Card */
.topdeals_container .topdeal_product {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    min-height: 400px;
    margin-bottom: var(--vgl-space-4);
    overflow: hidden;
    padding: var(--vgl-space-4);
    border: 1px solid var(--vgl-color-border, #e9e9e9);
    background-color: var(--vgl-color-surface, #fff);
    border-radius: var(--vgl-radius, 3px);
    text-align: center;
    box-sizing: border-box;
    transition: box-shadow var(--vgl-transition, 0.15s ease), border-color var(--vgl-transition, 0.15s ease);
}

.topdeals_container .topdeal_product:hover {
    border-color: #d7d7d7;
    box-shadow: var(--vgl-shadow-sm, 0 1px 5px #ddd);
}

/* Price row — prev + badge on one line, current price below */
.topdeals_container .topdeal_product .prices {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    align-items: center;
    justify-items: center;
    gap: var(--vgl-space-1) var(--vgl-space-2);
    width: 100%;
    min-height: 4.25rem;
    margin-bottom: var(--vgl-space-2);
    flex-shrink: 0;
}

.topdeals_container .topdeal_product .prices .prev_price {
    grid-column: 1;
    grid-row: 1;
    width: auto;
    padding: 0;
    display: block;
    font-size: var(--vgl-font-size-sm);
    text-decoration: line-through;
    color: var(--vgl-color-text-muted, #676767);
}

.topdeals_container .topdeal_product .prices .price-changing.price-reduction {
    grid-column: 2;
    grid-row: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 3.25rem;
    padding: var(--vgl-space-1) var(--vgl-space-2);
    font-size: var(--vgl-font-size-base);
    font-weight: 700;
    line-height: 1.1;
    background-color: var(--vgl-color-accent, #f2504e);
    color: var(--vgl-color-text-inverse, #fff);
    border-radius: var(--vgl-radius-sm, 7px);
    text-align: center;
    transform: rotate(8deg);
}

.topdeals_container .topdeal_product .prices .current_price {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin-top: 0;
    font-size: var(--vgl-font-size-xl);
    font-weight: 700;
    text-align: center;
    color: var(--vgl-color-accent, #f2504e);
}

.topdeals_container .topdeal_product .prices .is-placeholder {
    visibility: hidden;
}

/* Product image — grows to fill middle of card */
.topdeals_container .prod_img {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 auto;
    min-height: 160px;
    max-height: 200px;
    text-align: center;
}

.topdeals_container .prod_img img {
    max-width: 90%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Footer — CTA + merchant pinned to card bottom */
.topdeal_product__footer {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--vgl-space-2);
    width: 100%;
    margin-top: auto;
    padding-top: var(--vgl-space-3);
    flex-shrink: 0;
}

.topdeal_product .vgl-button.red {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: var(--vgl-space-3) var(--vgl-space-4);
    font-size: var(--vgl-font-size-sm);
    font-weight: 600;
    line-height: 1.2;
    border-radius: var(--vgl-radius);
    text-decoration: none;
    box-sizing: border-box;
}

.topdeal_product .top_merchant {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    width: 100%;
    text-decoration: none;
}

.topdeal_product .top_merchant > img {
    max-width: 75%;
    max-height: 44px;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: 0 auto;
}

/* Slick arrow controls: see components/slider.css */

.vgl-homepage__sale-slider .topdeals_container {
    width: 100%;
    margin-left: 0;
}

.vgl-homepage__sale-slider .topdeals_container.low_wide .slick-list {
    margin: 0 auto;
}

@media (max-width: 768px) {
    .topdeals_container .topdeal_product {
        min-height: 380px;
    }

    .topdeals_container .prod_img {
        min-height: 140px;
        max-height: 180px;
    }
}
