/*
 * Product listing grid (category, search and brand pages): same columns as the live shop.
 *  < 768px: 2 per row | >= 768px: 3 | >= 1024px: 4 | >= 1280px: 5
 * Overrides Hyva's sidebar-era "grid-cols-1 sm:grid-cols-2 md:grid-cols-1 lg:grid-cols-2 xl:grid-cols-3" utilities.
 * Plain CSS, no Tailwind rebuild.
 */
body.page-products .products.products-grid > ul {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}
@media (min-width: 768px) {
    body.page-products .products.products-grid > ul {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
@media (min-width: 1024px) {
    body.page-products .products.products-grid > ul {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}
@media (min-width: 1280px) {
    body.page-products .products.products-grid > ul {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

/* long product codes in titles must wrap instead of pushing out of the card */
body.page-products .products.products-grid .product-item-link {
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}
@media (max-width: 767px) {
    body.page-products .products.products-grid .product-item-link {
        font-size: .9375rem;
        line-height: 1.3;
    }

    /* less side padding on phones: page edges 24px -> 12px, card inner padding 24px -> 8px, smaller gap */
    body.page-products .page-main > .columns,
    body.page-products .page-main > .container,
    body.page-products .breadcrumbs > .container {
        padding-left: .75rem;
        padding-right: .75rem;
    }
    body.page-products .products.products-grid > ul {
        gap: .5rem;
    }
    body.page-products .products.products-grid .product-item {
        padding-left: .5rem;
        padding-right: .5rem;
    }

    /* sort dropdown: align to the left (the empty "modes" box took the first column and the sorter was justify-end) */
    body.page-products .toolbar-products .modes:not(:has(*)) {
        display: none;
    }
    body.page-products .toolbar-products .toolbar-sorter {
        justify-content: flex-start;
    }
}

/* ---------- Product card ----------
 * The card markup (Mageplaza_Shopbybrand/templates/hyva/product/list/item.phtml) is the same everywhere.
 * Only on product listing pages (body.page-products, inside .products-grid) it looks like the live shop card:
 * no rating, no brand logo, no stock text / add to cart / wishlist / compare, but delivery time + "Zum Produkt".
 * Sliders and widgets keep their look (the footer is hidden there).
 */
.gp-card__footer {
    display: none;
}
body.page-products .products-grid .gp-card {
    height: 100%;
    padding: 1rem;
    background: #fff;
}
body.page-products .products-grid .gp-card .gp-card__rating,
body.page-products .products-grid .gp-card .product-brand-logo,
body.page-products .products-grid .gp-card .gp-card__actions {
    display: none;
}
body.page-products .products-grid .gp-card .product-info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
body.page-products .products-grid .gp-card .gp-card__title {
    margin: .25rem 0 .75rem;
    color: #212121;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: left;
}
body.page-products .products-grid .gp-card .gp-card__title a {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    min-height: calc(1.35em * 3);
    overflow: hidden;
    color: inherit;
}
body.page-products .products-grid .gp-card .gp-card__title a:hover {
    color: #ff6101;
}
body.page-products .products-grid .gp-card .pt-1 {
    text-align: left;
}
body.page-products .products-grid .gp-card .gp-card__footer {
    display: block !important; /* overrides the inline display:none default */
    margin-top: auto;
    padding-top: .75rem;
}
body.page-products .products-grid .gp-card__delivery {
    margin: 0 0 .75rem;
    color: #333;
    font-size: .8125rem;
    line-height: 1.35;
}
body.page-products .products-grid .gp-card__delivery strong {
    color: #2e9e46;
}
body.page-products .products-grid .gp-card__button {
    display: block;
    width: 100%;
    padding: .7rem 1rem;
    background: #000;
    border-radius: 2px;
    color: #fff;
    font-size: .875rem;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
    transition: background-color .2s;
}
body.page-products .products-grid .gp-card__button:hover,
body.page-products .products-grid .gp-card__button:focus {
    background: #ff6101;
    color: #fff;
}
@media (max-width: 767px) {
    body.page-products .products-grid .gp-card__button {
        padding: .6rem .5rem;
        font-size: .8125rem;
    }
}

/* ---------- Prices in the card, like live: price 18px orange bold, below it "Exkl. Steuern: x,xx €" 12px orange bold ---------- */
body.page-products .products-grid .gp-card .price-box .price-including-tax .price {
    color: #ff6101;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.3;
}
body.page-products .products-grid .gp-card .price-box .price-wrapper.price-excluding-tax {
    display: block;
    margin-top: 2px;
    color: #ff6101;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
}
body.page-products .products-grid .gp-card .price-box .price-wrapper.price-excluding-tax::after {
    content: none;
}
body.page-products .products-grid .gp-card .price-box .price-wrapper.price-excluding-tax::before {
    content: attr(data-label) ": ";
    font-size: 12px;
    font-weight: 700;
}
body.page-products .products-grid .gp-card .price-box .price-wrapper.price-excluding-tax .price {
    color: #ff6101;
    font-size: 12px;
    font-weight: 700;
}
/* list price: small, black, struck through */
body.page-products .products-grid .gp-card .price-box .old-price .price {
    color: #000;
    font-size: 12px;
    font-weight: 700;
}

/* "Hot" badge (live: red skewed tag in the top left corner of the product card) */
.gp-card {
    position: relative;
}
.gp-badge {
    position: absolute;
    z-index: 2;
    top: 12px;
    left: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 22px;
    padding: 0 7px 0 12px;
    border-radius: 3px;
    background: #e41f12;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    transform: skew(-15deg);
}
.gp-badge::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 100%;
    border-radius: 3px 0 0 3px;
    background: inherit;
    transform: skew(15deg);
    transform-origin: bottom left;
}
.gp-badge__text {
    line-height: normal;
    transform: skew(15deg);
}
