/* ===== VezemZerno — Listing Pages ===== */

/* Badges — request-item.css is not loaded on listing pages, so the card
   badges need their base styles here (values match request-item.css). */
.vz-badge { display: inline-flex; align-items: center; padding: 4px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; white-space: nowrap; }
.vz-badge--auto { background: #e8f5e9; color: #2e7d32; }
.vz-badge--rail { background: #e3f2fd; color: #1565c0; }
.vz-badge--type { background: var(--vz-gold-bg); color: var(--vz-gold); }

/* Filters (legacy horizontal — kept for backward compatibility, unused) */
.vz-listing-filters { margin: 0; }
.vz-listing-filters__row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.vz-listing-filters__select { padding: 8px 12px; border: 1px solid var(--vz-border); border-radius: var(--vz-radius-xs); font-size: 13px; color: var(--vz-text); background: #fff; min-width: 140px; }
.vz-listing-filters__select:focus { outline: none; border-color: var(--vz-green); }

/* Cards */
.vz-listing-cards { display: flex; flex-direction: column; gap: 8px; }
.vz-listing-card { display: block; background: #fff; border: 1px solid var(--vz-border-light); border-radius: var(--vz-radius-sm); padding: 16px 20px; text-decoration: none; color: inherit; transition: all 0.2s; }
.vz-listing-card:hover { border-color: var(--vz-green); box-shadow: var(--vz-shadow-sm); }
.vz-listing-card__top { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.vz-listing-card__rate { margin-left: auto; font-size: 16px; font-weight: 700; color: var(--vz-green); white-space: nowrap; }
.vz-listing-card__route { display: flex; align-items: center; gap: 8px; font-size: 16px; font-weight: 600; color: var(--vz-text); margin-bottom: 8px; flex-wrap: wrap; }
.vz-listing-card__arrow { color: var(--vz-green); font-size: 18px; flex-shrink: 0; }
.vz-listing-card__meta { display: flex; gap: 12px; font-size: 13px; color: var(--vz-text-secondary); flex-wrap: wrap; align-items: center; }

/* Pagination */
.vz-pagination { display: flex; gap: 4px; justify-content: center; padding: 24px 0 8px; flex-wrap: wrap; }
.vz-pagination__btn { display: inline-flex; align-items: center; padding: 8px 14px; border: 1px solid var(--vz-border); border-radius: var(--vz-radius-xs); font-size: 14px; color: var(--vz-text-secondary); text-decoration: none; transition: all 0.2s; }
.vz-pagination__btn:hover { border-color: var(--vz-green); color: var(--vz-green); }
.vz-pagination__btn--active { background: var(--vz-green); color: #fff; border-color: var(--vz-green); }
.vz-pagination__btn--active:hover { background: var(--vz-green-dark); color: #fff; }

/* Card responsive */
@media (max-width: 768px) {
    .vz-listing-card { padding: 12px 14px; }
    .vz-listing-card__route { font-size: 14px; }
    .vz-listing-card__rate { font-size: 14px; }
}
@media (max-width: 390px) {
    .vz-listing-card__top { gap: 4px; }
    .vz-listing-card__meta { gap: 6px; }
}

/* ===================================================================
   MARKETPLACE LAYOUT — filters sidebar (left) + results (right).
   Fresh .vz-market-* namespace: zero collision with any legacy filter
   CSS. Shared by /requests, /gruz, /transport. Mobile disclosure is
   pure CSS (checkbox + label), no JS. GET filtering is unchanged.
   =================================================================== */
.vz-market-layout {
    position: relative;
    display: grid;
    grid-template-columns: 300px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
    padding: 22px 0 48px;
}

/* Checkbox driving the mobile disclosure (visually hidden but focusable) */
.vz-market-cb {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    opacity: 0;
}

/* Mobile toggle button — hidden on desktop */
.vz-market-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 48px;
    margin-bottom: 16px;
    border: 1px solid var(--vz-green);
    border-radius: 12px;
    background: #fff;
    color: var(--vz-green-dark);
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    user-select: none;
}
.vz-market-toggle .vz-icon { color: var(--vz-green); }
.vz-market-cb:focus-visible ~ .vz-market-toggle {
    outline: 2px solid var(--vz-green);
    outline-offset: 2px;
}
.vz-market-toggle__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--vz-green);
    color: #fff;
    font-size: 12px;
    font-weight: 800;
}

/* Left sidebar column (sticky on desktop) */
.vz-market-sidebar {
    min-width: 0;
    position: sticky;
    top: 88px;
}

/* White filter card */
.vz-market-filter-card {
    background: #fff;
    border: 1px solid var(--vz-border-light);
    border-radius: 16px;
    box-shadow: 0 4px 18px rgba(31, 45, 34, 0.06);
    padding: 20px;
}
.vz-market-filter-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--vz-border-light);
}
.vz-market-filter-card__title {
    margin: 0;
    font-size: 17px;
    font-weight: 800;
    color: var(--vz-text);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.vz-market-filter-card__title .vz-icon { color: var(--vz-green); }
.vz-market-filter-card__reset {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 13px;
    font-weight: 600;
    color: var(--vz-text-secondary);
    white-space: nowrap;
    text-decoration: none;
}
.vz-market-filter-card__reset:hover { color: var(--vz-green); text-decoration: underline; }
.vz-market-filter-card__reset .vz-icon { stroke: currentColor; }

/* Field group: label + control */
.vz-market-filter-field { margin-bottom: 14px; }
.vz-market-filter-field:last-of-type { margin-bottom: 18px; }
.vz-market-filter-field__label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--vz-text);
    margin-bottom: 6px;
}
.vz-market-select,
.vz-market-input {
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 10px 40px 10px 12px;
    border: 1px solid #dfe7dc;
    border-radius: 12px;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235f6368' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.3;
    color: var(--vz-text);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color var(--vz-transition), box-shadow var(--vz-transition);
}
.vz-market-input {
    background-image: none;
    padding: 10px 12px;
    cursor: text;
}
.vz-market-select:focus,
.vz-market-input:focus {
    outline: none;
    border-color: var(--vz-green);
    box-shadow: 0 0 0 3px rgba(45, 138, 78, 0.14);
}

/* Submit button */
.vz-market-submit {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    margin-top: 4px;
}

/* Right results column */
.vz-market-results { min-width: 0; }
.vz-market-results__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 12px;
}

/* Active filter chips */
.vz-market-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.vz-market-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 8px 6px 13px;
    border: 1px solid var(--vz-green-light);
    border-radius: 20px;
    background: var(--vz-green-bg);
    color: var(--vz-green-dark);
    font-size: 13px;
    font-weight: 600;
    line-height: 1.3;
    text-decoration: none;
}
.vz-market-chip:hover { background: #dcefe3; color: var(--vz-green-dark); }
.vz-market-chip__x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(45, 138, 78, 0.16);
    font-size: 15px;
    line-height: 1;
}
.vz-market-chip:hover .vz-market-chip__x { background: rgba(45, 138, 78, 0.30); }

/* Tablet / mobile: single column; filters collapse behind the toggle */
@media (max-width: 980px) {
    .vz-market-layout {
        grid-template-columns: 1fr;
        gap: 0;
        padding: 14px 0 40px;
    }
    .vz-market-toggle { display: inline-flex; }
    .vz-market-sidebar {
        position: static;
        top: auto;
        display: none;
        margin-bottom: 18px;
    }
    .vz-market-cb:checked ~ .vz-market-sidebar { display: block; }
}
