/* ═══════════════════════════════════════════
   Valroc – Machines Filter & Cards
   ═══════════════════════════════════════════ */

.vm-section {
    --vm-primary:   #e63000;   /* Adjust to brand color */
    --vm-dark:      #1a1a1a;
    --vm-border:    #e0e0e0;
    --vm-bg-light:  #f5f5f5;
    --vm-radius:    6px;
    font-family: inherit;
}

/* ─── Filter Bar ─────────────────────────── */
.vm-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    margin-bottom: 32px;
    padding: 16px 20px;
    background: var(--vm-bg-light);
    border-radius: var(--vm-radius);
    border: 1px solid var(--vm-border);
}

/* ─── Toggle ─────────────────────────────── */
.vm-mode-toggle {
    display: inline-flex;
    border: 1.5px solid var(--vm-border);
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}

.vm-mode-toggle .vm-mode-btn {
    padding: 9px 20px;
    border: none;
    border-radius: 0 !important;
    background-color: transparent;
    color: #aaa;
    box-shadow: none;
    cursor: pointer;
    font-size: 13px;
    transition: background-color .4s ease, color .4s ease;
    white-space: nowrap;
}

.vm-mode-toggle .vm-mode-btn.is-active {
    background-color: var(--vm-dark);
    color: #fff;
}

.vm-filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
    min-width: 180px;
}

.vm-filter-group label {
    font-size: 12px;
    text-transform: uppercase;
    color: #666;
}

.vm-select-wrap {
    position: relative;
}

.vm-select-wrap::after {
    content: '▾';
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #666;
    font-size: 13px;
}

.vm-select-wrap select {
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
    padding: 10px 36px 10px 14px;
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    background: #fff;
    font-size: 15px;
    color: var(--vm-dark);
    cursor: pointer;
    transition: border-color .2s;
}

.vm-select-wrap select:focus {
    outline: none;
    border-color: var(--vm-primary);
    box-shadow: 0 0 0 3px rgba(230,48,0,.12);
}

.vm-select-wrap select:disabled {
    background: #f0f0f0;
    color: #aaa;
    cursor: not-allowed;
}

.vm-reset-btn {
    padding: 10px 18px;
    background: transparent;
    border-width: 1px;
    border-style: solid;
    border-color: var(--vm-border);
    border-radius: var(--vm-radius);
    font-size: 14px;
    color: inherit;
    cursor: pointer;
    white-space: nowrap;
    align-self: flex-end;
    transition: background-color .2s, border-color .2s, color .2s;
}

/* ─── Results Layout ─────────────────────── */
.vm-cards-panel {}

/* ─── Tablet (≤ 1024px) ──────────────────── */
@media (max-width: 1024px) {
    .vm-cards-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ─── Mobile (≤ 768px) ───────────────────── */
@media (max-width: 768px) {
    .vm-filter-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 16px;
        gap: 12px;
    }

    .vm-mode-toggle {
        width: 100%;
    }

    .vm-mode-btn {
        flex: 1;
        text-align: center;
        justify-content: center;
    }

    .vm-filter-group {
        min-width: 100%;
    }

    .vm-reset-btn {
        width: 100%;
        text-align: center;
    }

    .vm-cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .vm-pagination {
        gap: 4px;
    }

    .vm-page-btn,
    .vm-page-num {
        min-width: 34px;
        height: 34px;
        font-size: 13px;
    }
}

/* ─── Petit mobile (≤ 480px) ─────────────── */
@media (max-width: 480px) {
    .vm-cards-grid {
        grid-template-columns: 1fr;
    }

    .vm-card-body {
        padding: 12px 14px 14px;
    }
}

/* ─── Models List (left) ─────────────────── */
.vm-models-panel {
    background: var(--vm-bg-light);
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    overflow: hidden;
    position: sticky;
    top: 80px;
}

.vm-models-title {
    margin: 0;
    padding: 12px 16px;
    font-size: 11px;
    text-transform: uppercase;
    color: #888;
    border-bottom: 1px solid var(--vm-border);
    background: #efefef;
}

.vm-models-list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 520px;
    overflow-y: auto;
}

.vm-model-item {
    padding: 10px 16px;
    font-size: 14px;
    color: var(--vm-dark);
    border-bottom: 1px solid var(--vm-border);
    cursor: pointer;
    transition: background .15s, color .15s;
}

.vm-model-item:last-child { border-bottom: none; }

.vm-model-item:hover {
    background: #ececec;
    color: var(--vm-primary);
}

.vm-model-item.is-active {
    background: var(--vm-primary);
    color: #fff;
}

/* ─── Cards Grid (right) ─────────────────── */
.vm-cards-panel {}

.vm-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
}

/* ─── Single Card ────────────────────────── */
.vm-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid var(--vm-border);
    border-radius: var(--vm-radius);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow .2s, transform .2s;
}

.vm-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,.10);
    transform: translateY(-2px);
}

.vm-card--highlight {
    outline: 3px solid var(--vm-primary);
    outline-offset: 2px;
}

.vm-card-img {
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f0f0;
}

.vm-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s;
}

.vm-card:hover .vm-card-img img {
    transform: scale(1.04);
}

.vm-card-no-img {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #e8e8e8;
    color: #aaa;
    font-size: 42px;
    font-weight: 700;
    text-transform: uppercase;
}

.vm-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.vm-card-title {
    margin: 0;
    font-size: 16px;
    color: var(--vm-dark);
}

.vm-card-desc {
    margin: 0;
    font-size: 13px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.vm-card-cta {
    margin-top: auto;
    padding-top: 10px;
    font-size: 13px;
    color: var(--vm-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.vm-card-cta-icon {
    height: 20px;
    width: auto;
    flex-shrink: 0;
}

/* ─── No results ─────────────────────────── */
.vm-no-results {
    color: #888;
    font-size: 14px;
    padding: 16px;
    font-style: italic;
}

/* ─── Pagination ─────────────────────────── */
.vm-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 32px;
    flex-wrap: nowrap;
}

.vm-page-first,
.vm-page-last {
    display: none;
}

@media (max-width: 767px) {
    .vm-page-first,
    .vm-page-last {
        display: inline-flex;
    }
}

.vm-page-btn,
.vm-page-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    height: 38px;
    padding: 0 10px;
    border-width: 1px;
    border-style: solid;
    border-color: var(--vm-border);
    border-radius: var(--vm-radius);
    background: #fff;
    color: inherit;
    font-size: 14px;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

.vm-page-btn:disabled {
    cursor: not-allowed;
}

.vm-page-numbers {
    display: flex;
    align-items: center;
    gap: 4px;
}

.vm-page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 38px;
    font-size: 14px;
    color: inherit;
    opacity: .5;
    pointer-events: none;
    user-select: none;
}
