/* ============================================================
   WashDesk — публичная витрина (/Public) и её модалка.
   Подключается после site.css и components.css только на витрине.
   Bootstrap здесь не подключён — формы и кнопки описаны ниже.
   Ссылка на файл идёт с asp-append-version, поэтому после деплоя
   браузер, nginx и service worker гарантированно берут новую версию.
   ============================================================ */

/* ---------- Каркас ---------- */
.pub-wrap { max-width: 720px; margin: 0 auto; padding: 24px 16px 48px; min-height: 100vh; color: var(--wd-text); }
.pub-topbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; min-height: 40px; }
.pub-topbar-left, .pub-topbar-right { display: flex; align-items: center; gap: 8px; min-width: 0; }
.pub-topbar-right { flex-shrink: 0; }
.pub-hero { text-align: center; margin-bottom: 24px; }
.pub-hero-icon { font-size: 44px; line-height: 1; }
.pub-hero-title { font-size: 24px; font-weight: 800; margin: 8px 0 4px; color: var(--wd-text); }
.pub-hero-sub { color: var(--wd-text-muted); font-size: 14px; margin: 0; }
.pub-list { display: flex; flex-direction: column; gap: 12px; }
.pub-footer { text-align: center; margin-top: 24px; padding-top: 16px; border-top: 1px solid var(--wd-border); font-size: 12px; color: var(--wd-text-muted); }

/* ---------- Аккаунт в топбаре ---------- */
.pub-account-chip { display: flex; align-items: center; gap: 8px; padding: 4px 12px 4px 4px; border-radius: 999px; background: var(--wd-surface); border: 1px solid var(--wd-border); color: var(--wd-text); text-decoration: none; max-width: 100%; min-width: 0; }
.pub-account-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--wd-primary-light); color: var(--wd-primary-dark); display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; flex-shrink: 0; overflow: hidden; }
.pub-account-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-account-name { font-size: 14px; font-weight: 600; color: var(--wd-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 140px; }
.pub-auth-links { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pub-auth-links a { color: var(--wd-primary); text-decoration: none; font-weight: 600; }
.pub-auth-links a:hover { text-decoration: underline; }
.pub-auth-links .text-muted { color: var(--wd-text-muted); }

/* ---------- Поиск ---------- */
.pub-search { position: relative; margin-bottom: 16px; }
.pub-search-clear { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); width: 24px; height: 24px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--wd-surface-2); color: var(--wd-text-muted); text-decoration: none; font-size: 13px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; }
.pub-search-clear:hover { background: var(--wd-border); color: var(--wd-text); }
.pub-search-spinner { position: absolute; right: 40px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--wd-border); border-top-color: var(--wd-primary); display: none; animation: wd-spin .8s linear infinite; pointer-events: none; }
.pub-search-spinner.active { display: block; }

/* ---------- Карточка мойки ---------- */
.pub-card { position: relative; display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: 16px; background: var(--wd-surface); border: 1px solid var(--wd-border); box-shadow: 0 2px 10px rgba(0,0,0,.05); }
.pub-card-logo { width: 56px; height: 56px; border-radius: 14px; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--wd-surface-2); }
.pub-card-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-logo-fallback { font-size: 30px; line-height: 1; }
.pub-card-body { flex: 1; min-width: 0; }
.pub-card-name { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 16px; margin-bottom: 2px; color: var(--wd-text); }
.pub-card-meta { font-size: 13px; color: var(--wd-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Пункт 7: специализация, избранные услуги, фильтр по сфере */
.pub-card[hidden] { display: none !important; }
.pub-card-spec { font-size: 12px; font-weight: 600; letter-spacing: .03em; color: var(--wd-primary); margin-bottom: 4px; }
.pub-card-featured { display: flex; flex-wrap: wrap; gap: 4px 6px; margin: 2px 0 4px; }
.pub-card-featured span { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: var(--wd-surface-2, rgba(0,0,0,.05)); color: var(--wd-text); white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.pub-spheres { margin: 0 0 12px; flex-wrap: wrap; }
.pub-card-meta.pub-card-addr { white-space: normal; word-break: break-word; overflow: visible; text-overflow: clip; line-height: 1.35; }
.pub-card-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pub-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; line-height: 1.4; }
.pub-badge-staff { background: var(--wd-primary-light); color: var(--wd-primary-dark); border: 1px solid rgba(var(--wd-primary-rgb),.25); }
.pub-badge-client { background: rgba(16,185,129,.12); color: var(--wd-success); border: 1px solid rgba(16,185,129,.2); }
.pub-card-rating { text-align: right; flex-shrink: 0; margin-left: auto; }
.pub-stars { color: var(--wd-star); letter-spacing: 1px; font-size: 15px; line-height: 1.2; }
.pub-rating-num { font-weight: 800; font-size: 18px; color: var(--wd-text); }
.pub-rating-count { font-size: 12px; color: var(--wd-text-muted); }
.pub-card-chevron { flex-shrink: 0; margin-left: 4px; font-size: 22px; line-height: 1; color: var(--wd-text-subtle); transition: transform .15s ease, color .15s ease; }
.pub-card-click { cursor: pointer; -webkit-user-select: none; user-select: none; transition: box-shadow .15s ease, transform .15s ease, border-color .15s ease; }
.pub-card-click:hover { box-shadow: 0 6px 20px rgba(0,0,0,.10); transform: translateY(-1px); border-color: var(--wd-primary); }
.pub-card-click:active { transform: scale(.99); }
.pub-card-click:focus-visible { outline: 2px solid var(--wd-primary); outline-offset: 2px; }
.pub-card-click:hover .pub-card-chevron { transform: translateX(3px); color: var(--wd-primary); }

/* ---------- Пустой список (перекрывает вариант приложения) ---------- */
.pub-wrap .empty-state { padding: 32px 16px; background: transparent; border: none; color: var(--wd-text-muted); }
.pub-wrap .empty-state-icon { font-size: 40px; line-height: 1; margin-bottom: 8px; opacity: .8; }
.pub-wrap .empty-state-text { font-size: 15px; }
.empty-state-hint a { color: var(--wd-primary); text-decoration: none; font-weight: 600; }
.empty-state-hint a:hover { text-decoration: underline; }

/* ---------- Формы и кнопки ---------- */
.pub-wrap .form-control { display: block; width: 100%; padding: 10px 36px 10px 12px; font-size: 15px; line-height: 1.4; color: var(--wd-text); background: var(--wd-surface); border: 1.5px solid var(--wd-border); border-radius: 10px; -webkit-appearance: none; appearance: none; transition: border-color .15s, box-shadow .15s; }
.pub-wrap .form-control:focus { outline: none; border-color: var(--wd-primary); box-shadow: 0 0 0 3px rgba(var(--wd-primary-rgb),.18); }
.pub-wrap .form-control::placeholder { color: var(--wd-text-muted); }
.pub-wrap .form-control::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; }
.pub-wrap .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; font-size: 14px; font-weight: 600; line-height: 1.2; border-radius: 10px; border: 1.5px solid transparent; cursor: pointer; text-decoration: none; background: var(--wd-surface-2); color: var(--wd-text); transition: background .15s, border-color .15s, color .15s; }
.pub-wrap .btn:hover { background: var(--wd-border); }
.pub-wrap .btn-sm { padding: 6px 12px; font-size: 13px; }
.pub-wrap .btn-outline-secondary { background: transparent; border-color: var(--wd-border); color: var(--wd-text); }
.pub-wrap .btn-outline-secondary:hover { background: var(--wd-surface-2); }

/* ============================================================
   Модалка подробностей автомойки
   ============================================================ */
.pub-modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: var(--wd-overlay-bg); -webkit-backdrop-filter: var(--wd-overlay-blur); backdrop-filter: var(--wd-overlay-blur); opacity: 0; visibility: hidden; transition: opacity .2s ease, visibility .2s ease; }
.pub-modal.active { opacity: 1; visibility: visible; }
.pub-modal-card { position: relative; width: 100%; max-width: 440px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--wd-surface); color: var(--wd-text); border: 1px solid var(--wd-border); border-radius: 18px; box-shadow: 0 18px 50px rgba(0,0,0,.30); padding: 20px; transform: translateY(12px) scale(.98); transition: transform .2s ease; }
.pub-modal.active .pub-modal-card { transform: none; }
.pub-modal-close { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 50%; background: var(--wd-surface-2); color: var(--wd-text-muted); font-size: 14px; line-height: 1; cursor: pointer; transition: background .15s, color .15s; z-index: 2; }
.pub-modal-close:hover { background: var(--wd-border); color: var(--wd-text); }
.pub-modal.loading .pub-modal-card { opacity: .45; pointer-events: none; }
.pub-modal.loading::before { content: ""; position: absolute; top: 50%; left: 50%; width: 38px; height: 38px; margin: -19px 0 0 -19px; border-radius: 50%; border: 4px solid rgba(255,255,255,.30); border-top-color: #fff; animation: wd-spin .8s linear infinite; z-index: 3; }

.pm-head { display: flex; align-items: center; gap: 12px; padding-right: 36px; margin-bottom: 14px; }
.pm-logo { width: 64px; height: 64px; border-radius: 16px; flex-shrink: 0; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--wd-surface-2); }
.pm-logo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-logo-fallback { font-size: 34px; line-height: 1; display: flex; align-items: center; justify-content: center; }
.pm-title-wrap { flex: 1; min-width: 0; }
.pm-title { font-size: 18px; font-weight: 800; color: var(--wd-text); line-height: 1.25; word-break: break-word; }
.pm-sub { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }

.pm-rating { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--wd-surface-2); margin-bottom: 12px; }
.pm-rating-num { font-size: 26px; font-weight: 800; line-height: 1; color: var(--wd-text); }
.pm-rating-stars { font-size: 15px; line-height: 1; }
.pm-rating-count { font-size: 12px; color: var(--wd-text-muted); }

.pm-info { margin-bottom: 4px; }
.pm-row { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; font-size: 14px; color: var(--wd-text); border-bottom: 1px dashed var(--wd-border); }
.pm-row:last-child { border-bottom: none; }
.pm-icon { flex-shrink: 0; font-size: 16px; line-height: 1.4; }
.pm-val { flex: 1; min-width: 0; word-break: break-word; line-height: 1.4; }
.pm-val-link { color: var(--wd-primary); text-decoration: none; font-weight: 600; }
.pm-val-link:hover { text-decoration: underline; }

/* 0.11: часы работы — точка-статус «открыто / закрыто» и расписание группами дней */
.pub-hours { display: flex; align-items: center; gap: 7px; }
.pub-hours i { flex-shrink: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--wd-text-muted); }
.pub-hours.is-open { color: #16a34a; font-weight: 600; }
.pub-hours.is-open i { background: #16a34a; box-shadow: 0 0 0 3px rgba(22, 163, 74, .18); }
.pub-hours.is-closed i { background: #ef4444; }
.pub-hours[hidden] { display: none; }
.pm-week { display: grid; gap: 2px; margin-top: 6px; }
.pm-week[hidden] { display: none; }
.pm-week-row { display: flex; justify-content: space-between; gap: 12px; padding: 3px 8px; border-radius: 8px; font-size: 13px; color: var(--wd-text-muted); }
.pm-week-row b { font-weight: 600; color: var(--wd-text); }
.pm-week-row span { font-variant-numeric: tabular-nums; }
.pm-week-row.is-off span { opacity: .7; }
.pm-week-row.is-today { background: color-mix(in srgb, var(--wd-primary) 12%, transparent); color: var(--wd-text); }
body.dark .pub-hours.is-open { color: #4ade80; }
body.dark .pub-hours.is-open i { background: #4ade80; }

/* 0.12 (Н-67): фото по назначению — обложка карточки и окна (здание с вывеской), ряды фото, просмотр на весь экран */
.pub-card.has-cover { flex-wrap: wrap; padding-top: 0; overflow: hidden; }
/* 0.12 (B15): выбор кабинета клиента — те же карточки; ссылка без подчёркивания, текущая — рамкой; ПК — сеткой */
.cp-place { color: inherit; text-decoration: none; }
.cp-place:hover { color: inherit; }
.cp-place.is-current { border-color: var(--wd-primary); }
@media (min-width: 992px) { .pub-list.cp-places { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); align-items: start; } }
.pub-card-cover { flex: 0 0 calc(100% + 32px); margin: 0 -16px 2px; height: 132px; overflow: hidden; }
.pub-card-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-cover { margin: -20px -20px 14px; height: 180px; overflow: hidden; border-radius: 18px 18px 0 0; cursor: zoom-in; }
.pm-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-photos { margin-top: 12px; }
.pm-photo-row { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; padding-bottom: 4px; }
.pm-photo { flex: 0 0 96px; height: 96px; padding: 0; border: 0; border-radius: 12px; overflow: hidden; background: var(--wd-surface-2); cursor: zoom-in; }
.pm-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-photo-view { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(0,0,0,.88); cursor: zoom-out; }
.pm-photo-view img { max-width: 100%; max-height: 100%; border-radius: 12px; }
.pm-reviews { margin-top: 12px; }
.pm-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--wd-text-muted); margin: 0 0 8px; }
.pm-rev { padding: 10px 0; border-bottom: 1px solid var(--wd-border); }
.pm-rev:last-child { border-bottom: none; }
.pm-rev-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.pm-rev-avatar { width: 26px; height: 26px; border-radius: 50%; overflow: hidden; flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--wd-primary-light); color: var(--wd-primary-dark); }
.pm-rev-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pm-rev-ini { font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.pm-rev-name { font-size: 13px; font-weight: 600; color: var(--wd-text); }
.pm-rev-stars { font-size: 13px; color: var(--wd-star); letter-spacing: 1px; }
.pm-rev-date { font-size: 11px; color: var(--wd-text-muted); margin-left: auto; white-space: nowrap; }
.pm-rev-comment { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--wd-text); white-space: pre-wrap; word-break: break-word; background: var(--wd-surface-2); border-radius: 10px; padding: 8px 10px; }

.pm-actions { display: flex; flex-direction: column; gap: 8px; margin-top: 16px; }
.pm-action-btn { display: block; width: 100%; text-align: center; padding: 12px 16px; border-radius: 12px; font-size: 15px; font-weight: 600; text-decoration: none; cursor: pointer; border: 1.5px solid transparent; transition: background .15s, border-color .15s, color .15s; }
.pm-action-primary { background: var(--wd-primary); color: #fff; border-color: var(--wd-primary); }
.pm-action-primary:hover { background: var(--wd-primary-dark); border-color: var(--wd-primary-dark); color: #fff; }
.pm-action-ghost { background: transparent; color: var(--wd-text); border-color: var(--wd-border); }
.pm-action-ghost:hover { background: var(--wd-surface-2); }
.pm-action-hint { text-align: center; font-size: 13px; color: var(--wd-text-muted); padding: 4px 0; }

/* ---------- Тёмная тема: цвета берутся из токенов body.dark, здесь только тени ---------- */
body.dark .pub-card { box-shadow: none; }
body.dark .pub-card-click:hover { box-shadow: 0 6px 20px rgba(0,0,0,.45); }
body.dark .pub-modal-card { box-shadow: 0 18px 50px rgba(0,0,0,.55); }

/* ---------- Узкие экраны ---------- */
@media (max-width: 420px) {
    .pub-modal-card { padding: 16px; border-radius: 16px; }
    .pm-logo { width: 52px; height: 52px; border-radius: 14px; }
    .pm-logo-fallback { font-size: 28px; }
    .pm-title { font-size: 16px; }
    .pm-rating-num { font-size: 22px; }
    .pub-account-name { max-width: 96px; }
    .pm-cover { margin: -16px -16px 12px; border-radius: 16px 16px 0 0; height: 150px; }
}

/* Модалка мойки: подложка — общие токены окон (--wd-overlay-*), карточка — стекло окон (--wd-glass-modal, glass.css) */
/* 0.12 (Н-33): мойка отключила отзывы — блока оценки нет совсем, без пометки */
.pm-rating.is-off { display: none; }