/*
 * Services listing (/projects/all). Builds on the tokens in al-samples.css (.al-scope).
 * Everything is prefixed with "al-".
 */
.al-svc-head { margin-bottom: 20px; }
.al-svc-head .al-subtitle { max-width: 640px; }
.al-svc-head .al-search { margin: 20px 0 0; max-width: 640px; }

/* ---------- filter bar ---------- */
.al-filters { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 24px 0 0; }
.al-filters__main { display: flex; flex-wrap: wrap; gap: 12px; flex: 1 1 auto; }
.al-filters__side { display: flex; align-items: center; gap: 20px; margin-left: auto; }
.al-dd { position: relative; }
.al-dd__btn {
    display: inline-flex; align-items: center; gap: 10px; height: 48px; padding: 0 18px; border-radius: 12px;
    border: 1px solid var(--al-border); background: var(--al-surface); color: var(--al-text);
    font: inherit; font-weight: 600; font-size: 15px; cursor: pointer; transition: border-color .15s, box-shadow .15s, background .15s;
}
.al-dd__btn:hover { border-color: #cbd5e1; background: var(--al-bg); }
.al-dd__btn:focus-visible { outline: 3px solid var(--al-accent-soft); box-shadow: 0 0 0 1px var(--al-accent); }
.al-dd__btn .al-icon { width: 16px; height: 16px; transition: transform .15s; }
.al-dd.is-open .al-dd__btn { border-color: var(--al-accent); box-shadow: 0 0 0 4px var(--al-accent-soft); }
.al-dd.is-open .al-dd__btn .al-icon { transform: rotate(180deg); }
.al-dd.is-active .al-dd__btn { border-color: var(--al-accent); background: var(--al-accent-soft); color: var(--al-accent-strong); }
.al-dd__count {
    display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px;
    background: var(--al-accent); color: #fff; font-size: 12px; font-weight: 700;
}
.al-dd__panel {
    position: absolute; z-index: 30; top: calc(100% + 8px); left: 0; width: 300px; max-width: calc(100vw - 40px);
    background: var(--al-surface); border: 1px solid var(--al-border); border-radius: var(--al-radius);
    box-shadow: 0 4px 6px rgba(15, 23, 42, .05), 0 16px 40px rgba(15, 23, 42, .12); padding: 8px;
}
.al-dd__panel[hidden] { display: none; }
.al-dd__panel--pad { padding: 16px; }
.al-dd__list { max-height: 280px; overflow-y: auto; margin: 0; padding: 0; list-style: none; }
.al-opt {
    display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; cursor: pointer;
    font-size: 15px; color: var(--al-text); user-select: none;
}
.al-opt:hover { background: var(--al-chip); }
.al-opt input { width: 18px; height: 18px; margin: 0; accent-color: var(--al-accent); flex: none; }
.al-opt__stars { color: #f59e0b; letter-spacing: 1px; }
.al-opt__stars i { font-style: normal; color: var(--al-wave); }
.al-field-label { display: block; margin: 0 0 6px; font-size: 13px; font-weight: 600; color: var(--al-muted); }
.al-field-label:not(:first-child) { margin-top: 14px; }
.al-select, .al-input {
    width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--al-border); border-radius: 10px; background: var(--al-surface);
    color: var(--al-text); font: inherit; font-size: 15px; outline: none;
}
.al-select:focus, .al-input:focus { border-color: var(--al-accent); box-shadow: 0 0 0 4px var(--al-accent-soft); }
.al-range { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 8px; color: var(--al-muted); }
.al-dd__foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 16px; }
.al-btn--sm { height: 36px; padding: 0 14px; font-size: 14px; border-radius: 10px; }
.al-link { background: none; border: 0; padding: 0; color: var(--al-muted); font: inherit; font-size: 14px; cursor: pointer; text-decoration: underline; }
.al-link:hover { color: var(--al-accent); }

/* toggle */
.al-switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; color: var(--al-muted); font-size: 15px; font-weight: 500; user-select: none; }
.al-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.al-switch__track { position: relative; width: 36px; height: 20px; border-radius: 999px; background: #cbd5e1; transition: background .15s; flex: none; }
.al-switch__track::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(15, 23, 42, .3); transition: transform .15s; }
.al-switch input:checked + .al-switch__track { background: var(--al-accent); }
.al-switch input:checked + .al-switch__track::after { transform: translateX(16px); }
.al-switch input:focus-visible + .al-switch__track { outline: 3px solid var(--al-accent-soft); outline-offset: 2px; }

/* ---------- results ---------- */
.al-resbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 32px 0 20px; color: var(--al-muted); font-size: 15px; min-height: 24px; }
.al-svc-grid { display: grid; gap: 28px 24px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.al-svc { position: relative; min-width: 0; display: flex; flex-direction: column; }
.al-svc__thumb { position: relative; display: block; aspect-ratio: 5 / 3; border-radius: 12px; overflow: hidden; background: var(--al-chip); }
.al-svc__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.al-svc:hover .al-svc__thumb img { transform: scale(1.03); }
.al-svc__fav {
    position: absolute; top: 10px; right: 10px; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center;
    background: rgba(15, 23, 42, .35); color: #fff; backdrop-filter: blur(4px); cursor: pointer; text-decoration: none; transition: background .15s, color .15s;
}
.al-svc__fav:hover { background: rgba(15, 23, 42, .6); color: #fff; }
.al-svc__fav.is-on { background: #fff; color: #e11d48; }
.al-svc__fav svg { width: 20px; height: 20px; }
.al-svc__fav:focus-visible { outline: 3px solid var(--al-accent-soft); box-shadow: 0 0 0 2px var(--al-accent); }
.al-badge { position: absolute; left: 10px; top: 10px; padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700; background: #fff; color: var(--al-text); }
.al-badge--pro { background: #faf5ff; color: #7e22ce; }
.al-svc__seller { display: flex; align-items: center; gap: 8px; margin-top: 12px; font-size: 14px; min-width: 0; }
.al-svc__avatar { width: 24px; height: 24px; border-radius: 50%; object-fit: cover; background: var(--al-chip); flex: none; }
.al-svc__seller a { color: var(--al-text); font-weight: 600; text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.al-svc__seller a:hover { color: var(--al-accent); }
.al-svc__title {
    margin: 6px 0 0; font-size: 16px; line-height: 1.4; font-weight: 500; color: var(--al-text);
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.al-svc__title a { color: inherit; text-decoration: none; }
.al-svc__title a::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 12px; }
.al-svc__fav, .al-svc__seller a { position: relative; z-index: 2; }
.al-svc__title a:hover { text-decoration: underline; }
.al-svc__title a:focus-visible { outline: 3px solid var(--al-accent-soft); outline-offset: 4px; }
.al-svc__rating { display: flex; align-items: center; gap: 4px; margin-top: 8px; font-size: 14px; color: var(--al-muted); }
.al-svc__rating svg { width: 14px; height: 14px; color: #0f172a; }
.al-svc__rating strong { color: var(--al-text); }
.al-svc__foot { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-top: auto; padding-top: 10px; }
.al-svc__price { font-weight: 700; font-size: 16px; color: var(--al-text); }
.al-svc__price s { margin-left: 6px; font-weight: 400; font-size: 13px; color: var(--al-muted); }
.al-svc__days { font-size: 13px; color: var(--al-muted); }
.al-results.is-loading .al-svc-grid { opacity: .5; }

@media (max-width: 1199px) { .al-svc-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 767px) {
    .al-svc-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 16px; }
    .al-filters__side { margin-left: 0; width: 100%; }
    .al-dd__btn { height: 44px; padding: 0 14px; font-size: 14px; }
    .al-dd { position: static; }
    .al-dd__panel { left: 20px; right: 20px; width: auto; max-width: none; }
}
@media (max-width: 479px) { .al-svc-grid { grid-template-columns: 1fr; } }
