/* ============================================================
   MECSPE PRODOTTI v2 — Layout OVIP
   ============================================================ */
.mecspe-wrap * { box-sizing: border-box; margin: 0; padding: 0; }
.mecspe-wrap {
    font-family: Arial, sans-serif;
    font-size: 14px;
    color: #333;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 12px 48px;
    background: #f0f0f0;
}

/* ── DROPDOWN BAR IN CIMA ── */
.mecspe-dd-bar {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    background: #fff;
    border: 1px solid #ccc;
    padding: 12px;
    margin-bottom: 20px;
    align-items: center;
}
.mecspe-dd {
    flex: 1 1 180px;
    padding: 8px 10px;
    border: 1px solid #ccc;
    font-size: 13px;
    background: #fff;
    color: #333;
    cursor: pointer;
}
.mecspe-dd:focus { outline: none; border-color: #1a6eb5; }
.mecspe-dd-btn {
    padding: 8px 24px;
    background: #1a6eb5;
    color: #fff;
    border: none;
    font-size: 13px;
    font-weight: bold;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}
.mecspe-dd-btn:hover { background: #155a96; }

/* ── TITOLO PAGINA ── */
.mecspe-page-title {
    font-size: 22px;
    font-weight: bold;
    color: #222;
    margin-bottom: 14px;
}

/* ── LAYOUT ── */
.mecspe-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 16px;
    align-items: start;
}

/* ── SIDEBAR ── */
.mecspe-sidebar {
    background: #fff;
    border: 1px solid #ccc;
}
.mecspe-sidebar-title {
    background: #1a6eb5;
    color: #fff;
    font-size: 15px;
    font-weight: bold;
    padding: 10px 14px;
}
.mecspe-acc-item {
    border-bottom: 1px solid #ddd;
}
.mecspe-acc-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: #fff;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 700;
    color: #222;
    cursor: pointer;
    user-select: none;
    box-sizing: border-box;
}
.mecspe-acc-toggle span {
    font-size: 18px;
    color: #1a6eb5;
    transition: transform .2s;
    display: inline-block;
    flex-shrink: 0;
    line-height: 1;
}
.mecspe-acc-toggle.open span { transform: rotate(90deg); }
.mecspe-acc-body {
    padding: 6px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.mecspe-cb-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 12.5px;
    cursor: pointer;
    color: #444;
    padding: 2px 0;
}
.mecspe-cb-label input[type="checkbox"] {
    width: 14px; height: 14px; cursor: pointer; flex-shrink: 0;
    accent-color: #1a6eb5;
}
/* KM range */
.mecspe-km-range { display: flex; align-items: center; gap: 6px; }
.mecspe-km-input {
    flex: 1; padding: 5px 6px; border: 1px solid #ccc;
    font-size: 12px; width: 100%;
}
.mecspe-km-input:focus { outline: none; border-color: #1a6eb5; }

/* ── MAIN ── */
.mecspe-main { min-width: 0; }

/* Barra risultati */
.mecspe-results-bar {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
    margin-bottom: 12px !important;
    background: #fff !important;
    border: 1px solid #ccc !important;
    padding: 8px 12px !important;
}
.mecspe-cancella-btn {
    padding: 6px 14px !important;
    background: #1a6eb5 !important;
    color: #fff !important;
    border: none !important;
    font-size: 12px !important;
    font-weight: bold !important;
    cursor: pointer !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}
.mecspe-cancella-btn:hover { background: #155a96 !important; }
.mecspe-count {
    font-size: 13px !important;
    color: #555 !important;
    flex: 1 !important;
    white-space: nowrap !important;
}
.mecspe-select-sort {
    padding: 6px 10px !important;
    border: 1px solid #ccc !important;
    font-size: 12.5px !important;
    background: #fff !important;
    cursor: pointer !important;
    width: auto !important;
    max-width: 200px !important;
    flex-shrink: 0 !important;
}

/* ── LISTA VEICOLI ── */
.mecspe-list { display: flex; flex-direction: column; gap: 14px; }

/* ── CARD ORIZZONTALE ── */
.mecspe-card {
    display: flex;
    background: #fff;
    border: 1px solid #ccc;
    overflow: hidden;
}

/* Colonna sinistra: immagine */
.mecspe-card-left {
    width: 230px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #ddd;
}
.mecspe-card-img-label {
    background: #1a3a5c;
    color: #fff;
    font-size: 11px;
    font-weight: bold;
    padding: 5px 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mecspe-card-img-wrap {
    display: block;
    height: 155px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid transparent;
}
.mecspe-card-img-wrap:hover { border-color: #1a6eb5; }
.mecspe-card-img { width: 100%; height: 100%; object-fit: cover; }
.mecspe-card-no-img {
    font-size: 11px; color: #aaa;
    display: flex; align-items: center; justify-content: center;
    height: 100%; width: 100%;
}
.mecspe-card-badges {
    display: flex; flex-wrap: wrap; gap: 3px;
    padding: 6px;
    background: #f5f5f5;
    border-top: 1px solid #ddd;
}
.mecspe-badge {
    background: #1a6eb5;
    color: #fff;
    font-size: 10.5px;
    font-weight: bold;
    padding: 2px 7px;
}
.mecspe-card-trattativa {
    margin: 4px 6px 6px;
    border: 1.5px solid #c00;
    color: #c00;
    font-size: 11px;
    font-weight: bold;
    padding: 3px 8px;
    text-align: center;
}
.mecspe-card-prezzo {
    margin: 4px 6px 6px;
    border: 1.5px solid #c00;
    color: #c00;
    font-size: 11px;
    padding: 3px 8px;
    text-align: center;
}
.mecspe-card-prezzo strong { font-size: 14px; }

/* Colonna destra: contenuto */
.mecspe-card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 12px 14px;
    min-width: 0;
}
.mecspe-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}
.mecspe-card-title {
    font-size: 17px;
    font-weight: bold;
    line-height: 1.2;
    margin-bottom: 3px;
}
.mecspe-card-title a { color: #1a6eb5; text-decoration: none; }
.mecspe-card-title a:hover { text-decoration: underline; }
.mecspe-usato-badge {
    background: #1a6eb5;
    color: #fff;
    font-size: 10px;
    font-weight: normal;
    padding: 2px 7px;
    margin-left: 6px;
    vertical-align: middle;
}
.mecspe-card-subtitle {
    font-size: 12px;
    color: #666;
    margin-top: 2px;
}
.mecspe-card-price-top {
    font-size: 18px;
    font-weight: bold;
    color: #222;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Specs griglia 2 colonne */
.mecspe-card-specs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px 16px;
    font-size: 12.5px;
    color: #444;
    border-top: 1px solid #eee;
    padding-top: 8px;
    flex: 1;
}
.mecspe-spec { display: flex; align-items: center; gap: 5px; }
.mecspe-spec-icon { color: #666; font-size: 13px; }

/* Footer card */
.mecspe-card-footer {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}
.mecspe-btn-dettagli {
    padding: 9px 28px;
    background: #1a6eb5;
    color: #fff;
    font-size: 13px;
    font-weight: bold;
    text-decoration: none;
    border: none;
    cursor: pointer;
    letter-spacing: .5px;
}
.mecspe-btn-dettagli:hover { background: #155a96; color: #fff; }

/* No results */
.mecspe-no-results { padding: 40px; text-align: center; color: #888; background: #fff; }

/* Skeleton */
@keyframes mp-shimmer { 0%{background-position:200% 0} 100%{background-position:-200% 0} }
.mp-skel {
    background: linear-gradient(90deg,#f0f0f0 25%,#e8e8e8 50%,#f0f0f0 75%);
    background-size: 200% 100%;
    animation: mp-shimmer 1.4s infinite;
}
.mecspe-loading .mecspe-list { opacity: .4; pointer-events: none; }

/* Load more */
.mecspe-pagination { margin-top: 20px; display: flex; justify-content: center; }
.mecspe-load-more {
    padding: 10px 40px; background: #1a6eb5; color: #fff;
    border: none; font-size: 13px; font-weight: bold; cursor: pointer;
}
.mecspe-load-more:hover { background: #155a96; }
.mecspe-load-more:disabled { background: #aaa; cursor: not-allowed; }

/* Overlay mobile */
.mecspe-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 9998; }

/* ── Responsive ── */
@media (max-width: 900px) {
    .mecspe-layout { grid-template-columns: 1fr; }
    .mecspe-sidebar {
        position: fixed; top: 0; left: 0; bottom: 0;
        width: 280px; z-index: 9999;
        transform: translateX(-100%); transition: transform .2s;
        overflow-y: auto;
    }
    .mecspe-sidebar.open { transform: translateX(0); }
    .mecspe-overlay.open { display: block; }
}
@media (max-width: 600px) {
    .mecspe-card { flex-direction: column; }
    .mecspe-card-left { width: 100%; border-right: none; border-bottom: 1px solid #ddd; }
    .mecspe-card-specs { grid-template-columns: 1fr; }
    .mecspe-dd-bar { flex-direction: column; }
    .mecspe-dd { flex: 1 1 100%; }
}
