/* =============================================================================
   Category listing cards (.productlistapparelarea ul li) - equal-height grid.

   LAYOUT ONLY. Every font, colour and the peach box-shadow still come from
   css-shop/style.css (.pname a, .attname, .seller, .prodSalePrice, .starOuter,
   .productlistapparelarea ul li ...) - nothing visual is redefined here, the
   rules below only change how the boxes are sized and stacked.

   Why: the cards were floated <li>s whose height followed their content, and
   the always-emitted .attname div is 10px when empty vs 28px with text, so
   rows didn't line up. Now the <ul> is a CSS grid (equal row heights), each
   card is a flex column, the image sits in a square box, the title is a fixed
   2-line block, .attname keeps its 28px even when empty, and the price is
   pinned to the bottom of the card.

   Loaded after style.css / responsive.css by Master/ShopMaster.master and
   Master/AttractAndEntertainMaster.master (the masters behind shop*_02.aspx).
   ============================================================================= */

.productlistapparelarea ul,
.productlistproductarea ul {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px 2%;                    /* same 2% gutter the floats used */
    width: 100%;
}

    .productlistapparelarea ul li,
    .productlistproductarea ul li {
        width: auto;                 /* was 23.5% floats */
        float: none;
        margin: 0;
        min-height: 0;               /* the grid row equalises heights now */
        display: flex;
        flex-direction: column;
        background: #ffffff;
        position: relative;
        border: 1px solid #e8ecf1;
        border-radius: 10px;
        overflow: hidden;
        box-shadow: none;
        transition: box-shadow .15s ease, transform .15s ease;
    }

        .productlistapparelarea ul li:hover,
        .productlistproductarea ul li:hover {
            box-shadow: 0 10px 24px rgba(0, 0, 0, .10);
            /* no lift: moving the card under the mouse made it flicker at the bottom edge */
        }

    /* ---- image: square box on a light grey ground, picture centred, never stretched ---- */
    .productlistapparelarea ul li .productimage,
    .productlistproductarea ul li .productimage {
        position: relative;
        aspect-ratio: 1 / 1;
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
        padding: 10px;
        box-sizing: border-box;
    }

        .productlistapparelarea ul li .productimage > a,
        .productlistproductarea ul li .productimage > a {
            display: flex;
            align-items: center;
            justify-content: center;
            width: 100%;
            height: 100%;
        }

        .productlistapparelarea ul li .productimage img,
        .productlistproductarea ul li .productimage img {
            width: auto;
            height: auto;
            max-width: 100%;
            max-height: 100%;
            padding: 0;
            object-fit: contain;
            box-sizing: border-box;
        }

        /* "New" / "% Off" ribbon: style.css forces top/right to auto, which in a
           flex box would float it to the centre - pin it to the top-left corner */
        .productlistapparelarea ul li .productimage .ribbon-wrapper-green,
        .productlistproductarea ul li .productimage .ribbon-wrapper-green {
            position: absolute;
            top: 0 !important;
            left: 0 !important;
            right: auto !important;
            z-index: 1;
        }

    /* ---- text block: padded, rows spaced evenly ---- */
    .productlistapparelarea ul li .productdesc,
    .productlistproductarea ul li .productdesc {
        display: flex;
        flex-direction: column;
        flex: 1 1 auto;
        gap: 4px;
        padding: 10px 12px 12px;
    }

        .productlistapparelarea ul li .productdesc .pname,
        .productlistproductarea ul li .productdesc .pname {
            padding: 0;
        }

        .productlistapparelarea ul li .productdesc .attname,
        .productlistproductarea ul li .productdesc .attname,
        .productlistapparelarea ul li .productdesc .seller,
        .productlistproductarea ul li .productdesc .seller {
            padding-left: 0;
        }

        .productlistapparelarea ul li .productdesc .starOuter,
        .productlistproductarea ul li .productdesc .starOuter {
            padding-left: 0;
            padding-right: 0;
        }

        /* title: fixed 2-line block (was 1 line + ellipsis), same 18px/500/#292929 */
        .productlistapparelarea ul li .productdesc .pname a,
        .productlistproductarea ul li .productdesc .pname a {
            white-space: normal;
            max-width: none;
            display: -webkit-box;
            -webkit-line-clamp: 2;
            -webkit-box-orient: vertical;
            line-height: 22px;
            height: 44px;
            overflow: hidden !important;
        }

        /* attribute line keeps its height whether or not it has text */
        .productlistapparelarea ul li .productdesc .attname,
        .productlistproductarea ul li .productdesc .attname {
            display: block;
            width: auto;
            min-height: 28px;
            line-height: 18px;
            box-sizing: border-box;
        }

        .productlistapparelarea ul li .productdesc .seller,
        .productlistproductarea ul li .productdesc .seller {
            float: none;
            width: auto;
            padding-right: 5px;
        }

        /* price on a footer line, pinned to the bottom of the card */
        .productlistapparelarea ul li .productdesc .prodPrice,
        .productlistproductarea ul li .productdesc .prodPrice {
            float: none;
            margin-top: auto;
            padding-top: 8px;
            border-top: 1px solid #e8ecf1;
            display: flex;
            align-items: center;
            flex-wrap: wrap;
        }

            .productlistapparelarea ul li .productdesc .prodPrice .prodSalePrice,
            .productlistproductarea ul li .productdesc .prodPrice .prodSalePrice {
                float: none;
                padding-left: 0;
            }

@media (max-width: 1199.98px) {
    .productlistapparelarea ul {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .productlistapparelarea ul {
        grid-template-columns: minmax(0, 1fr);
        gap: 20px 0;
    }
}

/* =============================================================================
   .productlistproductarea (Sporting, Electronics, Grocery, Hardware, Health,
   Automobile, Books, Crafts, Farm, Lighting ...) shares the exact card markup
   with the Apparel page, so every rule above applies to it too. Only the
   column counts differ: this class was 15% floats (6-up) on desktop and 40%
   (2-up) on phones, and those counts are kept.
   ============================================================================= */
.productlistproductarea ul {
    grid-template-columns: repeat(6, minmax(0, 1fr));
}

    .productlistproductarea ul li .productimage {
        min-height: 0;
    }

@media (max-width: 1399.98px) {
    .productlistproductarea ul {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 1199.98px) {
    .productlistproductarea ul {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .productlistproductarea ul {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767.98px) {
    .productlistproductarea ul {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 3%;
    }
}

/* =============================================================================
   Listing pager ("Page: 1 of 3" + page numbers). style.css pins it absolutely
   25px above the bottom of .productlistholder, which puts it on top of the last
   row of cards. It now sits in normal flow under the grid, centred, with the
   numbers as small pills (current page in the site's orange, as before).
   Layout only: the pager controls and their postbacks are unchanged.
   ============================================================================= */
.productlistholder .productlistnext-prevarea {
    position: static;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px 16px;
    clear: both;
    width: 100%;
    margin: 0;
    padding: 22px 0 6px;
    line-height: 20px;
    text-align: center;
}

    .productlistholder .productlistnext-prevarea span[id$="lblCurrentPage"] {
        font-size: 13px;
        color: #6a6a6a;
    }

    .productlistholder .productlistnext-prevarea .page {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin: 0;
    }

        .productlistholder .productlistnext-prevarea .page a,
        .productlistholder .productlistnext-prevarea .page span {
            display: inline-block;
            box-sizing: border-box;
            min-width: 32px;
            height: 32px;
            margin: 0;
            padding: 0 9px;
            border: 1px solid #d9dde3;
            border-radius: 6px;
            background: #ffffff;
            box-shadow: none;
            color: #292929;
            font-size: 13px;
            font-weight: 600;
            line-height: 30px;
            text-align: center;
            text-decoration: none;
        }

        .productlistholder .productlistnext-prevarea .page a:hover {
            border-color: #F68D1E;
            color: #F68D1E;
        }

        .productlistholder .productlistnext-prevarea .page span {
            border-color: #F68D1E;
            background: #F68D1E;
            color: #ffffff;
        }

/* =============================================================================
   Tablets and laptops (up to 1199.98px).
   ============================================================================= */
@media (max-width: 1199.98px) {
    /* price row: the h3 is an inline-block at 100% of the text block, and inside
       it .prodSalePrice (16px, float:left) and .prodCartArea (60px, float:right)
       fight over ~170px. The price text dropped under the currency badge and the
       cart icon hung about 11px outside the card. One flex row: price left,
       cart right, nothing wraps. */
    .productlistapparelarea ul li .productdesc,
    .productlistproductarea ul li .productdesc {
        box-sizing: border-box;
        max-width: 100%;
    }

    .productlistapparelarea ul li .productdesc h3,
    .productlistproductarea ul li .productdesc h3 {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 6px;
        box-sizing: border-box;
        width: 100%;
        max-width: 100%;
        overflow: hidden;
    }

        .productlistapparelarea ul li .productdesc h3 .prodSalePrice,
        .productlistproductarea ul li .productdesc h3 .prodSalePrice {
            float: none;
            flex: 1 1 auto;
            min-width: 0;
            margin: 0;
            padding: 0;
            text-align: left;
            white-space: nowrap;
            /* badge and number on one centre line: as inline content the 19px badge
               sat on the text baseline, visibly higher than the 22px number */
            display: flex;
            align-items: center;
            gap: 5px;
            line-height: 1;
        }

            .productlistapparelarea ul li .productdesc h3 .prodSalePrice img,
            .productlistproductarea ul li .productdesc h3 .prodSalePrice img {
                display: block;
                padding: 0;
                vertical-align: middle;
            }

        .productlistapparelarea ul li .productdesc h3 .prodCartArea a,
        .productlistproductarea ul li .productdesc h3 .prodCartArea a {
            display: block;
            line-height: 0;
        }

        .productlistapparelarea ul li .productdesc h3 .prodCartArea img,
        .productlistproductarea ul li .productdesc h3 .prodCartArea img {
            display: block;
            padding: 0;
        }

        .productlistapparelarea ul li .productdesc h3 .prodCartArea,
        .productlistproductarea ul li .productdesc h3 .prodCartArea {
            float: none;
            flex: 0 0 auto;
            width: auto;
        }
}

@media (max-width: 991.98px) {
    /* breadcrumb: the store name (h2) and the "Home > ..." trail are floats inside
       a 70%-wide box. Once they no longer fit on one line the trail (float:right)
       dropped to a second line hugging the right edge. Put it under the name,
       left-aligned. */
    .topbreadcrambarea .linkarea .links {
        float: none;
        clear: both;
        padding-left: 1px;
        text-align: left;
    }
}
