/* Machinery list page (service, EN + IT). Holds the rules of the former inline style block and one svc- class for
   each former style attribute, so the policy needs no inline style (D-10, D-11). Same declarations as before;
   colours that equal a :root variable are written as var(--dark), var(--primary), var(--light). Linked only
   by the service route through its css list (hashed URL from the build). */

/* Listing Cards */
.listing-card {
    border: var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    height: 100%;
    transition: box-shadow .2s ease, transform .2s ease;
    background: #fff;
}
.listing-card:hover {
    box-shadow: var(--shadow-md);
}
@media (hover: hover) and (min-width: 992px) {
    .listing-card:hover { transform: translateY(-2px); }
}
@media (prefers-reduced-motion: reduce) {
    .listing-card, .listing-card .card-img { transition: none; }
    .listing-card:hover, .listing-card:hover .card-img { transform: none; }
}
.listing-card .img-wrap { overflow: hidden; position: relative; }
.listing-card .own-farm-badge {
    position: absolute; left: 10px; top: 10px; z-index: 2; pointer-events: none;
    background: rgba(15,66,41,.92); color: #fff; font-family: "Jost", sans-serif; font-size: .875rem; font-weight: 600;
    letter-spacing: .02em; padding: 4px 10px; border-radius: 14px;
}
.listing-card .card-img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 10;   /* the same frame for every machine, whatever the photo's own ratio */
    object-fit: cover;
    display: block;
    transition: transform 0.4s;
}
.listing-card:hover .card-img { transform: scale(1.03); }
.listing-card .card-body {
    padding: 1.2rem;
    display: flex;
    flex-direction: column;
}
.listing-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 0.6rem;
}
.badge-pill {
    font-size: 0.875rem;
    font-weight: 400;
    padding: 4px 11px;
    border-radius: 20px;
    background: #fff;                 /* white with a thin outline: no green-on-green clash with the card */
    color: var(--dark);
    border: 1px solid #cfd8d1;
    display: inline-block;
}
.badge-pill i { color: var(--primary-text); }
.listing-card .price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 0;
}
.listing-card .price-label {
    font-size: 0.75rem;
    color: #888;
    margin-bottom: 0.8rem;
}

/* Sidebar */
.filter-sidebar {
    background: #fff;
    border: var(--card-border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    position: sticky;
    top: 90px;
    box-shadow: var(--shadow-sm);
}
.filter-sidebar .sidebar-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark);
    padding-bottom: 0.8rem;
    border-bottom: 2px solid var(--primary);
    margin-bottom: 1.2rem;
}
.filter-sidebar .section-label {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #555;
    margin-bottom: 0.8rem;
    margin-top: 1.6rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #f0f0f0;
}
.filter-sidebar .form-check {
    padding-top: 0.3rem;
    padding-bottom: 0.3rem;
}
.filter-sidebar .form-check-label {
    font-size: 0.92rem;
    cursor: pointer;
}
.filter-sidebar .form-check-input:checked {
    background-color: var(--primary);
    border-color: var(--primary);
}
.filter-sidebar .count-badge {
    font-size: 0.72rem;
    background: var(--light);
    color: var(--primary);
    border-radius: 10px;
    padding: 1px 8px;
    float: right;
}
.total-count {
    background: var(--light);
    border-radius: 8px;
    padding: 1rem 1.2rem;
    margin-bottom: 0.8rem;
}
.total-count .number {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--primary);
    line-height: 1;
}
.total-count .label {
    font-size: 0.85rem;
    color: #555;
    margin-top: 0.2rem;
}
.btn-reset {
    font-size: 0.82rem;
    color: #888;
    text-decoration: underline;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}
.btn-reset:hover { color: var(--primary); }
.listing-card.hidden { display: none; }

/* Former style attributes of the page (D-11). The sidebar title rule needs both classes: it must beat
   .filter-sidebar .sidebar-title above, as the style attribute did. */
.svc-filters-col { padding-top: 52px; }
.svc-filter-head { background: var(--light); border-radius: var(--radius-md); padding: 1rem 1.2rem; }
.filter-sidebar .sidebar-title.svc-filter-title { border: none; padding: 0; font-size: 1.1rem; }
.svc-why { background: #fff; border: var(--card-border); border-radius: var(--radius-lg); padding: 1.6rem; box-shadow: var(--shadow-sm); }
.svc-why-title, .svc-why-text { color: var(--dark); font-weight: 700; }
.svc-why-item { background: var(--light); border: 1px solid #c3e6cb; border-radius: var(--radius-md); padding: 0.9rem 1rem; }
.svc-why-icon { width: 52px; height: 52px; background: #fff; border-radius: 50%; }
.svc-why-icon-i { font-size: 1.2rem; }

/* Mobile only (< 992px): filters behind a button, listings first */
.filters-toggle, .filters-done, .why-us-mobile { display: none; }
@media (max-width: 991.98px) {
    .filters-col { padding-top: 0 !important; }
    .filters-toggle {
        display: flex; align-items: center; justify-content: space-between; width: 100%;
        background: #fff; border: var(--card-border); border-radius: var(--radius-md); padding: .9rem 1.1rem;
        font-size: 1rem; font-weight: 600; color: var(--dark); box-shadow: var(--shadow-sm);
        gap: .5rem; text-align: left; overflow-wrap: anywhere;
    }
    .filters-toggle .fa-chevron-down { transition: transform .2s; }
    .filters-toggle[aria-expanded="true"] .fa-chevron-down { transform: rotate(180deg); }
    .filters-count { background: var(--primary); color: #fff; border-radius: 10px; padding: 0 8px; font-size: .78rem; margin-left: .5rem; }
    .filter-sidebar { display: none; position: static; margin-top: .75rem; padding: 1.25rem; }
    .filter-sidebar.open { display: block; }
    .filters-done { display: block; width: 100%; margin-top: 1.25rem; }
    .why-us-desktop { display: none; }
    .why-us-mobile { display: block; }
}

/* Compact page banner: the first machines are visible without scrolling (EN + IT) */
.svc-header { padding: 2.25rem 0 2rem; margin-bottom: 1.5rem; }
.svc-header-title { font-family: "Jost", sans-serif; font-weight: 700; font-size: clamp(1.7rem, 4vw, 2.6rem); line-height: 1.15; margin: 0 0 .75rem; }
.svc-header .breadcrumb { font-size: .95rem; }
