/*
 * Product list (views/products.html, templates/products.html.twig):
 * docs/design/2026-10-public-refresh/screens/02-product-list.html as classes.
 * Tokens come from site.css (:root --pp-*). Loaded after site.css; every rule
 * is scoped to the products page (#page-wrapper gets the state name as a class).
 */

#page-wrapper.products { padding: 40px 56px 56px; background: #fff; }

/* ---------- Head: breadcrumb, title, pills, count ---------- */

.products .products-head { display: flex; flex-direction: column; gap: 12px; }

.products .breadcrumb-trail ol {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 14px;
    color: var(--pp-muted);
}
.products .breadcrumb-trail li {
    display: inline;
    float: none;
    margin: 0;
    padding: 0;
}
.products .breadcrumb-trail li + li::before {
    content: "/";
    padding: 0 8px;
    color: var(--pp-muted);
}
.products .breadcrumb-trail a { text-decoration: none; }
.products .breadcrumb-trail a:hover { text-decoration: underline; }
.products .breadcrumb-trail li[aria-current] { color: var(--pp-text); }

.products h1.pageHeader {
    margin: 0;
    font-size: 36px;
    line-height: 1.15;
    font-weight: 300;
    color: var(--pp-heading);
}

.products .products-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--pp-line);
}

.products .subcategory-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.products .subcategory-pills a {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 16px;
    border: 1px solid #d0d0d0;
    border-radius: 18px;
    color: var(--pp-text);
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
}
.products .subcategory-pills a:hover { border-color: var(--pp-red); color: var(--pp-red); }
.products .subcategory-pills a.active,
.products .subcategory-pills a.active:hover {
    background: var(--pp-red);
    border-color: var(--pp-red);
    color: #fff;
    font-weight: 600;
}

/* The count sits right of the pills; with no pills it still sits right. */
.products .products-count { margin-left: auto; font-size: 14px; color: var(--pp-muted); }

/* ---------- Empty state ---------- */

.products .products-empty {
    margin: 24px 0 0;
    padding: 48px 24px;
    background: var(--pp-band);
    border-radius: var(--pp-radius-card);
    text-align: center;
    font-size: 20px;
    font-weight: 300;
    color: var(--pp-muted);
}

/* ---------- Rows ---------- */

.products #productsList { margin: 0; padding: 0; list-style: none; }
.products #productsList > li {
    display: block;
    float: none;
    height: auto;
    margin: 0;
    padding: 0;
    overflow: visible;
    border-top: 0;
    border-bottom: 1px solid var(--pp-line-2);
}
.products #productsList > li:hover { border-top: 0; border-bottom-color: var(--pp-line-2); }

.products .product-row {
    display: flex;
    align-items: center;
    gap: 24px;
    margin: 0 -12px;
    padding: 20px 12px;
    border-radius: var(--pp-radius-card);
    color: inherit;
    text-decoration: none;
}
.products .product-row:hover,
.products .product-row:focus { background: var(--pp-tint); color: inherit; text-decoration: none; }

.products .product-thumb {
    flex: 0 0 168px;
    height: 112px;
    overflow: hidden;
    border-radius: var(--pp-radius);
    background: #f2f2f0;
}
.products #productsList .product-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;   /* the whole machine, never cropped */
    padding: 6px;
}
.products .product-thumb-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #9a9a9a;
}

.products .product-text {
    flex: 1 1 auto;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.products .product-text h2 {
    margin: 0;
    font-size: 19px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--pp-heading);
}

/* Two lines whatever the record's HTML holds: block children are flattened
   to inline so the clamp counts lines of one paragraph. */
.products #productsList .description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: var(--pp-text-2);
}
.products #productsList .description p,
.products #productsList .description ul,
.products #productsList .description ol,
.products #productsList .description li,
.products #productsList .description div,
.products #productsList .description h1,
.products #productsList .description h2,
.products #productsList .description h3,
.products #productsList .description h4,
.products #productsList .description h5,
.products #productsList .description h6 {
    display: inline;
    float: none;
    margin: 0;
    padding: 0;
    font: inherit;
    color: inherit;
    list-style: none;
}
.products #productsList .description li + li::before,
.products #productsList .description p + *::before { content: " "; }
.products #productsList .description img,
.products #productsList .description table { display: none; }

.products .chev {
    flex: 0 0 auto;
    color: #9a9a9a;
    transition: transform .2s ease;
}
.products .product-row:hover .chev,
.products .product-row:focus .chev { color: var(--pp-red); transform: translateX(3px); }

/* ---------- Phone ---------- */

@media (max-width: 700px) {
    #page-wrapper.products { padding: 24px 16px 32px; }
    .products h1.pageHeader { font-size: 28px; }
    .products .product-row { gap: 14px; padding: 16px 12px; }
    .products .product-thumb { flex-basis: 96px; height: 64px; }
    .products .product-text h2 { font-size: 16px; }
    .products #productsList .description { font-size: 14px; }
    .products .chev { display: none; }
}
