/* establishment page */

/* =====================================================
   ХЛЕБНЫЕ КРОШКИ
   ===================================================== */
.est-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: -2px; /* компенсируем gap в est-page grid */
}

.est-breadcrumb__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--muted);
    text-decoration: none;
    transition: color 0.15s ease;
    font-weight: 500;
}

.est-breadcrumb__link:hover {
    color: var(--accent);
}

.est-breadcrumb__sep {
    color: var(--faint);
    user-select: none;
}

.est-breadcrumb__current {
    color: var(--ink);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 260px;
}

/* =====================================================
   СТАТУС ОТКРЫТО / ЗАКРЫТО
   ===================================================== */
.est-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.est-title-row h2 { margin: 0; }

.est-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.03em;
    padding: 3px 10px;
    border-radius: 999px;
    flex-shrink: 0;
    text-shadow: none;
}

.est-status-badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex-shrink: 0;
}

.est-status-badge--open {
    background: rgba(22, 163, 74, 0.18);
    color: #bbf7d0;
    border: 1px solid rgba(22, 163, 74, 0.35);
}

.est-status-badge--open::before {
    background: #4ade80;
    box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3);
    animation: statusPulse 2s ease infinite;
}

.est-status-badge--closed {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.28);
}

.est-status-badge--closed::before {
    background: #f87171;
}

.est-occupancy-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 10px;
    border-radius: 999px;
    background: rgba(245,158,11,0.15);
    border: 1px solid rgba(245,158,11,0.3);
    color: #d97706;
    flex-shrink: 0;
}
.est-occupancy-badge svg { color: #f59e0b; }
.est-title-sub {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.est-title-sub .muted { margin: 0; }
.est-rating {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.34);
    border: 1px solid rgba(255, 255, 255, 0.22);
}
.est-rating__star { color: #f59e0b; }
.est-rating__val { font-size: 14px; font-weight: 800; color: #ffffff; }

@keyframes statusPulse {
    0%, 100% { box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.3); }
    50%       { box-shadow: 0 0 0 6px rgba(74, 222, 128, 0); }
}

/* =====================================================
   ТЕЛЕФОН — КНОПКА В CTA ROW (самостоятельный стиль, без btn-ghost)
   ===================================================== */
.est-phone-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.28);
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: rgba(248, 250, 252, 0.92);
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.est-phone-btn:hover {
    background: rgba(255, 255, 255, 0.22);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

/* =====================================================
   CTA ROW — перестройка: флаги отдельно, кнопки отдельно
   ===================================================== */

/* =====================================================
   ЗАГОЛОВОК СЕКЦИИ
   ===================================================== */
.est-section-title {
    margin: 0 0 12px;
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.establishment-hero {
    display: block !important;
    grid-template-columns: 1fr !important;
    gap: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    border-radius: var(--radius-island);
}
.est-page {
    display: grid;
    gap: 14px;
}
.est-hero {
    position: relative;
    overflow: hidden;
    border: none;
    border-radius: 0;
    background: transparent;
    min-height: 0;
}
.est-hero-bg {
    position: absolute;
    inset: 0;
    background-image: var(--cover-image);
    background-size: cover;
    background-position: center;
    opacity: 1;
    filter: saturate(1.08);
    pointer-events: none;
}
.est-hero-bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, transparent 0%, transparent 42%, rgba(0, 0, 0, 0.32) 100%),
        rgba(0, 0, 0, 0.1);
}
.est-hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 12px 4px;
}
.est-main {
    display: grid;
    gap: 10px;
    width: 100%;
    padding: 16px 18px;
}
.est-content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
    gap: 12px;
    align-items: stretch;
    min-height: 240px;
}
.est-content-left,
.est-content-right {
    min-width: 0;
    border: none;
    border-radius: 20px;
    padding: 18px 20px;
    background: rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(16px) saturate(1.15);
    -webkit-backdrop-filter: blur(16px) saturate(1.15);
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.2);
    min-height: 0;
}
.est-content-right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
}
.est-content-right-main {
    display: grid;
    gap: 10px;
}
.est-hero .avatar-photo {
    border: none;
    box-shadow: none;
}
.est-content-right .muted {
    color: rgba(248, 250, 252, 0.88) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.est-main h2 {
    margin: 0;
    font-size: clamp(30px, 4vw, 42px);
    line-height: 1.05;
    letter-spacing: -0.02em;
    color: #f8fafc;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55), 0 0 20px rgba(0, 0, 0, 0.25);
}
.est-hero .est-main .profile-head .muted {
    margin-top: 4px;
    font-size: 15px;
    color: rgba(248, 250, 252, 0.9) !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
.est-meta {
    font-size: 15px;
    line-height: 1.58;
    max-width: none;
    margin: 2px 0 0;
    color: rgba(248, 250, 252, 0.92);
    font-weight: 450;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}
.est-grid {
    display: grid;
    gap: 14px;
}
.est-map-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    align-items: stretch;
}
.est-table-panel {
    min-height: 740px;
}
.est-table-wrap {
    overflow: auto;
    border-radius: 14px;
}
.est-table-wrap .est-table-panel {
    min-width: 620px;
}
/* Гостевая схема: доска всегда заполняет холст */
.est-table-wrap .table-board.est-table-panel {
    width: 100%;
    height: 100%;
    min-height: 0;
    box-sizing: border-box;
}
.est-cta-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.est-cta-flags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.est-cta-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.establishment-hours {
    width: 100%;
    max-width: none;
    margin: 0;
}
.est-meta-facts {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
}
.est-meta-phone {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
}
.est-meta-phone-link {
    color: rgba(248, 250, 252, 0.98);
    text-decoration: underline;
    text-decoration-color: rgba(248, 250, 252, 0.45);
    text-underline-offset: 3px;
    font-variant-numeric: tabular-nums;
}
.est-meta-phone-link:hover {
    text-decoration-color: rgba(248, 250, 252, 0.85);
}
.establishment-hours-block {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 14px;
    border: none;
    background: rgba(255, 255, 255, 0.16);
    color: rgba(248, 250, 252, 0.95);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
    margin: 0;
    width: 100%;
    box-sizing: border-box;
}
.establishment-hours-label {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f8fafc;
    opacity: 0.9;
}
.establishment-hours-value {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.establishment-hours-line {
    font-size: 15px;
    line-height: 1.65;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.est-hero .profile-head {
    margin-bottom: 2px;
}
.est-content-right .place-flags-inline .flag-badge {
    border: none !important;
    background: rgba(255, 255, 255, 0.2) !important;
    color: rgba(248, 250, 252, 0.95) !important;
    font-weight: 600;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.est-page > .panel {
    border-radius: var(--radius-island);
}
.est-page > .panel h3 {
    margin: 0 0 10px;
    font-size: 20px;
    letter-spacing: 0.01em;
}
.est-page .map-frame-wrap {
    min-height: 320px;
    margin-top: 0;
}
.est-page .map-frame {
    height: 320px;
}
.est-page .table-board {
    border-radius: 14px;
}
.est-table-hint {
    margin: 0 0 10px;
    color: var(--muted);
    font-size: 14px;
}
.board-table {
    overflow: visible;
}
.table-hover-preview {
    position: absolute;
    left: 50%;
    bottom: calc(100% + 10px);
    transform: translateX(-50%) translateY(4px);
    width: 220px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: #ffffff;
    box-shadow: var(--shadow-md);
    padding: 8px;
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
    z-index: 6;
}
.board-table:hover .table-hover-preview,
.board-table:focus-visible .table-hover-preview {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}
.table-hover-preview img {
    width: 100%;
    height: 110px;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid var(--line);
    margin-bottom: 6px;
}
.table-hover-title {
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 3px;
    color: var(--text);
}
.table-hover-meta {
    font-size: 12px;
    color: var(--muted);
}
.map-widget .map-frame {
    height: 560px;
}
.reviews-widget .map-frame {
    height: 560px;
}
.book-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    z-index: 100300;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.book-modal.is-open {
    display: flex;
}
.book-modal-dialog {
    width: min(640px, 96vw);
    max-height: 90vh;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: var(--radius-island);
    background: #ffffff;
    box-shadow: var(--shadow-md);
    padding: 20px;
}
.book-modal-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.book-modal-head h3 {
    margin: 0 0 3px;
    font-size: 22px;
    color: var(--text);
}
.book-modal-confirm-note {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin: 0;
    font-size: 12px;
    font-weight: 500;
    color: var(--success, #16a34a);
}
.book-modal-close {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--bg);
    color: var(--text);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}
.book-modal-form {
    display: grid;
    gap: 10px;
}
.book-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.book-field label {
    display: block;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 4px;
}
.book-field {
    position: relative;
}
.book-field input,
.book-field select,
.book-field textarea {
    width: 100%;
    height: 38px;
    border-radius: 12px;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    color: var(--text);
    padding: 7px 10px;
}
.book-field input:focus,
.book-field select:focus,
.book-field textarea:focus {
    outline: none;
    border-color: rgba(0, 102, 255, 0.45);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
/* Чтобы поле "Гостей" выглядело как выбор, а не как ввод */
.book-field input[readonly] {
    cursor: pointer;
}
/* Скрываем спиннеры у input[type="number"], чтобы не было ощущения "ввода" */
.book-field input[type="number"]::-webkit-outer-spin-button,
.book-field input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.book-field input[type="number"] {
    -moz-appearance: textfield;
}
.book-field textarea {
    min-height: 64px;
    height: auto;
}
.book-time-manual {
    margin-top: 6px;
}
.book-guests-suggest {
    margin-top: 0;
    max-height: 140px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-md);
    display: none;
    scrollbar-width: thin;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    z-index: 20;
}
.book-guests-suggest.is-open {
    display: block;
}
.book-guests-option {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
}
.book-guests-option:last-child {
    border-bottom: 0;
}
.book-guests-option:hover {
    background: var(--accent-soft);
}
.book-time-suggest,
.book-date-suggest {
    margin-top: 6px;
    max-height: 140px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    display: none;
    scrollbar-width: thin;
}
.book-time-suggest::-webkit-scrollbar,
.book-date-suggest::-webkit-scrollbar {
    width: 8px;
}
.book-time-suggest::-webkit-scrollbar-thumb,
.book-date-suggest::-webkit-scrollbar-thumb {
    background: rgba(0, 102, 255, 0.35);
    border-radius: 999px;
}
.book-time-suggest.is-open,
.book-date-suggest.is-open {
    display: block;
}
.book-time-option,
.book-date-option {
    width: 100%;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    color: var(--text);
    text-align: left;
    padding: 8px 10px;
    cursor: pointer;
    font-size: 13px;
}
.book-time-option:last-child,
.book-date-option:last-child {
    border-bottom: 0;
}
.book-time-option:hover,
.book-date-option:hover {
    background: var(--accent-soft);
}
/* ——— Новый UI модалки ——— */

/* Быстрые дата-чипы */
.book-date-quick {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    margin-bottom: 7px;
}
.book-dq {
    padding: 5px 11px;
    border-radius: 99px;
    border: 1.5px solid var(--border, #e5ddd0);
    background: var(--surface, #fff);
    font-size: .78rem;
    font-weight: 600;
    color: var(--text-muted, #78716c);
    cursor: pointer;
    transition: border-color .14s, color .14s, background .14s;
    white-space: nowrap;
}
.book-dq:hover { border-color: rgba(217,119,6,.4); color: #b45309; }
.book-dq.is-active { border-color: var(--amber, #d97706); background: rgba(217,119,6,.08); color: #b45309; }
.book-dq--wknd { color: #7c3aed; border-color: rgba(124,58,237,.2); }
.book-dq--wknd:hover { border-color: rgba(124,58,237,.5); }
.book-dq--wknd.is-active { border-color: #7c3aed; background: rgba(124,58,237,.07); }

/* Date input */
.book-date-inp {
    width: 100%;
    height: 40px;
    border: 1.5px solid var(--input-border, #d4c4a8);
    border-radius: 12px;
    background: var(--input-bg, #faf9f6);
    color: var(--text, #1c1007);
    padding: 0 12px;
    font-size: .9rem;
    font-family: inherit;
    box-sizing: border-box;
}
.book-date-inp:focus { outline: none; border-color: rgba(217,119,6,.5); box-shadow: 0 0 0 3px rgba(217,119,6,.1); }

/* Часы работы hint */
.book-hours-hint {
    font-size: .75rem;
    font-weight: 400;
    color: var(--text-muted, #78716c);
    margin-left: auto;
}

/* Slot chips */
.book-time-slots {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    align-items: flex-start;
    max-height: 180px;
    overflow-y: auto;
    padding: 2px 0;
}
.book-slots-empty {
    font-size: .84rem;
    color: var(--text-muted, #78716c);
    margin: 0;
    font-style: italic;
}
.book-slot-group {
    width: 100%;
    font-size: .67rem;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--text-muted, #78716c);
    padding: 3px 0 1px;
    margin-top: 4px;
}
.book-slot-group:first-child { margin-top: 0; }
.book-slot-chip {
    min-width: 56px;
    height: 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border, #e5ddd0);
    border-radius: 10px;
    background: var(--surface, #fff);
    font-size: .85rem;
    font-weight: 600;
    color: var(--text, #1c1007);
    cursor: pointer;
    transition: border-color .14s, background .14s, color .14s;
}
.book-slot-chip:hover:not(:disabled) { border-color: rgba(217,119,6,.45); }
.book-slot-chip.is-active { border-color: var(--amber, #d97706); background: var(--amber, #d97706); color: #fff; }
.book-slot-chip.is-busy { opacity: .38; cursor: not-allowed; text-decoration: line-through; }

/* Гости чипы */
.book-guests-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
    margin-bottom: 2px;
}
.book-gc {
    min-width: 38px;
    height: 34px;
    padding: 0 8px;
    border: 1.5px solid var(--border, #e5ddd0);
    border-radius: 10px;
    background: var(--surface, #fff);
    font-size: .88rem;
    font-weight: 600;
    color: var(--text-muted, #78716c);
    cursor: pointer;
    transition: border-color .14s, background .14s, color .14s;
}
.book-gc:hover { border-color: rgba(217,119,6,.4); }
.book-gc.is-active { border-color: var(--amber, #d97706); background: rgba(217,119,6,.08); color: #b45309; }

.book-selected-table {
    border: 1px solid var(--line);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text);
    background: var(--bg);
}
.book-selected-photo {
    border: 1px solid var(--line);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg);
    min-height: 120px;
}
.book-selected-photo img {
    width: 100%;
    max-height: 190px;
    object-fit: cover;
    display: none;
}
.book-selected-photo img.is-visible {
    display: block;
}
.book-submit {
    height: 40px;
}
@media (max-width: 900px) {
    .est-map-grid {
        grid-template-columns: 1fr;
    }
    .est-content-grid {
        grid-template-columns: 1fr;
        gap: 12px;
        min-height: 0;
    }
    /* Схема на телефоне — шире (меньше паддинга секции = меньше наезда столов) */
    #tables-section {
        padding-left: 12px;
        padding-right: 12px;
    }
    .est-hero-inner {
        max-width: 100%;
        padding: 2px 0;
    }
    .est-main {
        padding: 14px;
    }
    .est-main h2 {
        font-size: clamp(26px, 7vw, 34px);
    }
    .est-page .map-frame-wrap,
    .est-page .map-frame {
        min-height: 240px;
        height: 240px;
    }
    .table-hover-preview {
        display: none;
    }
    .reviews-widget .map-frame {
        height: 420px;
    }
    .book-grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Команда заведения (гость) */
.est-staff-section h3 {
    margin-bottom: 14px;
}
.est-staff-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
}
.est-staff-card {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--line, #e4e4e8);
    background: #fafafa;
    box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, 0.06));
}
.est-staff-name {
    font-weight: 700;
    font-size: 15px;
    color: var(--text, #111);
}
.est-staff-role {
    font-size: 13px;
    line-height: 1.4;
}

/* Меню (профиль заведения) — в том же светлом «card» стиле, что и остальные .panel */
.est-menu-section h3 {
    margin-bottom: 12px;
}
.est-menu-cat-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line, #e4e4e8);
}
.est-menu-cat-tab {
    border: 1px solid var(--line, #e4e4e8);
    background: #fafafa;
    color: var(--text, #111);
    border-radius: 999px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.est-menu-cat-tab:hover {
    border-color: rgba(0, 102, 255, 0.35);
}
.est-menu-cat-tab.is-active {
    border-color: rgba(0, 102, 255, 0.45);
    background: rgba(0, 102, 255, 0.08);
    color: var(--link, #7c3aed);
}
.est-menu-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 6px;
    scrollbar-width: none;
    /* Небольшой отступ чтобы была видна следующая карточка */
    margin-right: -4px;
    padding-right: 4px;
}

.est-menu-grid::-webkit-scrollbar { display: none; }

.est-menu-grid--hidden {
    display: none !important;
}

.est-menu-card {
    flex: 0 0 210px;
    scroll-snap-align: start;
    border-radius: 14px;
    border: 1px solid var(--line, #e4e4e8);
    background: #fafafa;
    display: flex;
    flex-direction: column;
    min-height: 0;
    box-shadow: var(--shadow-sm, 0 1px 4px rgba(0, 0, 0, 0.06));
}
.est-menu-card-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: #ececf0;
    overflow: hidden;  /* для scale-анимации фото */
}
.est-menu-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.est-menu-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 700;
    background: var(--btn-primary-bg, #111);
    color: var(--btn-primary-text, #fff);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}
.est-menu-card-body {
    padding: 12px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 auto;
}
.est-menu-card-title {
    font-weight: 800;
    font-size: 15px;
    color: var(--text, #111);
    line-height: 1.35;
}
.est-menu-card-price {
    display: flex;
    align-items: baseline;
    gap: 8px;
    flex-wrap: wrap;
}
.est-menu-price-old {
    text-decoration: line-through;
    color: var(--muted, #666);
    font-size: 14px;
    font-weight: 600;
}
.est-menu-price-cur {
    font-weight: 800;
    font-size: 17px;
    color: var(--text, #111);
}
.est-menu-card-desc {
    font-size: 13px;
    line-height: 1.45;
    margin: 0;
}

@media (max-width: 600px) {
    .est-meta-facts,
    .est-meta-phone {
        font-size: 15px;
        line-height: 1.6;
    }
    .est-meta-phone {
        margin-top: 2px;
    }
    .establishment-hours-block {
        padding: 16px 14px;
        gap: 12px;
    }
    .establishment-hours-line {
        font-size: 15px;
        line-height: 1.72;
    }
}

/* =====================================================
   ЯНТАРНАЯ КНОПКА БРОНИРОВАНИЯ
   ===================================================== */
.est-btn-book {
    background: var(--accent) !important;
    border-color: var(--accent) !important;
    color: #18130a !important;
    font-weight: 700;
    box-shadow: 0 4px 14px rgba(217, 119, 6, 0.35) !important;
    transition: filter 0.15s ease, box-shadow 0.15s ease !important;
}

.est-btn-book:hover {
    filter: brightness(1.07) !important;
    box-shadow: 0 6px 18px rgba(217, 119, 6, 0.45) !important;
    transform: none !important;
}

/* =====================================================
   HERO БЕЗ ОБЛОЖКИ — тёмный янтарный градиент
   ===================================================== */
.est-hero--no-cover {
    background: linear-gradient(145deg, #1a0e02 0%, #2a1604 50%, #1c1007 100%);
    min-height: 320px;
}

.est-hero--no-cover .est-content-left,
.est-hero--no-cover .est-content-right {
    background: rgba(255, 255, 255, 0.07);
}

/* =====================================================
   КОМАНДА — АККОРДЕОН
   ===================================================== */
.est-staff-details {
    margin: 0;
}

.est-staff-summary {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 2px 0 14px;
    margin-bottom: 0;
    cursor: pointer;
    user-select: none;
    list-style: none;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.est-staff-summary::-webkit-details-marker { display: none; }

.est-staff-summary__label { flex: 1; }

.est-staff-summary__count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 24px;
    height: 24px;
    padding: 0 7px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
}

.est-staff-summary__arrow {
    color: var(--faint);
    flex-shrink: 0;
    transition: transform 0.2s ease;
}

details[open] .est-staff-summary__arrow {
    transform: rotate(180deg);
}

.est-staff-details[open] .est-staff-list {
    animation: staffOpen 0.22s ease-out both;
}

@keyframes staffOpen {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* =====================================================
   СЕКЦИЯ СТОЛОВ — ЗАГОЛОВОК СО СТАТИСТИКОЙ
   ===================================================== */
.est-tables-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.est-tables-head__left {
    display: flex;
    align-items: baseline;
    gap: 10px;
}

.est-tables-head__title {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--ink);
}

.est-tables-head__count {
    font-size: 13px;
    font-weight: 500;
    color: var(--muted);
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--bg-soft);
    border: 1px solid var(--line);
}

/* Зелёный бейдж "X из Y свободно" */
.est-tables-head__count--free {
    background: rgba(22, 163, 74, 0.08);
    border-color: rgba(22, 163, 74, 0.22);
    color: #15803d;
    font-weight: 600;
}

.est-tables-head__scroll-hint { display: none; }

.est-no-tables {
    padding: 24px 0;
    font-size: 15px;
}

.est-table-hint-mobile {
    display: none;
}

@media (max-width: 900px) {
    .est-table-hint-mobile {
        display: inline;
        margin-left: 4px;
        color: var(--faint);
    }
}

/* Янтарный активный таб меню */
.est-menu-cat-tab:hover {
    border-color: var(--accent-border);
}
.est-menu-cat-tab.is-active {
    border-color: var(--accent);
    background: var(--accent-soft);
    color: #18130a;
}

/* Плейсхолдер для карточки меню без фото */
.est-menu-card-img-placeholder {
    height: 100px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-soft);
    border-radius: 10px 10px 0 0;
    color: var(--faint);
}

/* =====================================================
   STICKY MOBILE CTA — "Забронировать стол"
   ===================================================== */
.est-sticky-book {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 150;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(12, 7, 0, 0.94);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid rgba(255, 255, 255, 0.09);
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    /* Анимация появления */
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.34, 1.2, 0.64, 1);
}

.est-sticky-book.is-visible {
    transform: translateY(0);
}

/* Скрыть при прокрутке к схеме */
.est-sticky-book.is-at-tables {
    transform: translateY(100%);
}

.est-sticky-book__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 50px;
    padding: 0 24px;
    background: linear-gradient(145deg, #f59e0b, #d97706);
    color: #18130a;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 16px rgba(217, 119, 6, 0.45);
    transition: filter 0.15s ease;
    flex: 1;
    justify-content: center;
}

.est-sticky-book__btn:hover {
    filter: brightness(1.07);
    color: #18130a;
}

.est-sticky-book__count {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.5);
    white-space: nowrap;
    flex-shrink: 0;
}

/* Только мобиль */
@media (max-width: 900px) {
    .est-sticky-book {
        display: flex;
    }
    /* Отступ снизу на странице заведения чтобы sticky не перекрывал контент */
    .page-establishment main.container {
        padding-bottom: calc(80px + env(safe-area-inset-bottom, 0px));
    }
}

/* =====================================================
   PINCH-ZOOM СХЕМА СТОЛОВ (мобиль)
   ===================================================== */
@media (max-width: 900px) {
    .est-table-panel {
        min-height: 0 !important;
    }
    .est-table-wrap {
        overflow: hidden;
        touch-action: pan-y;
        position: relative;
        aspect-ratio: 16 / 10;
        width: 100%;
        height: auto;
        max-height: min(52vh, 420px);
        border-radius: 16px;
        background: linear-gradient(165deg, #f8f4ee 0%, #efe8dc 100%);
        border: 1px solid var(--line);
        cursor: grab;
        user-select: none;
        -webkit-user-select: none;
        box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
    }
    .est-table-wrap:active { cursor: grabbing; }

    .est-table-wrap .est-table-panel {
        min-width: unset !important;
        min-height: unset !important;
        width: 100%;
        height: 100%;
        transform-origin: 0 0;
        will-change: transform;
        position: absolute;
        inset: 0;
    }
    .est-table-wrap .board-table {
        min-width: 40px;
        min-height: 38px;
    }
    .est-table-wrap .board-table .board-table-title {
        font-size: 8px;
        max-width: 88%;
        padding: 1px 4px;
    }
    .est-table-wrap .board-table small.board-table-seats {
        display: none;
    }

    /* Подсказка о пинч-зуме */
    .est-pinch-hint {
        position: absolute;
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
        background: rgba(0, 0, 0, 0.58);
        backdrop-filter: blur(8px);
        color: rgba(255, 255, 255, 0.9);
        font-size: 12px;
        font-weight: 500;
        padding: 5px 12px;
        border-radius: 999px;
        pointer-events: none;
        white-space: nowrap;
        z-index: 5;
        transition: opacity 0.4s ease;
    }
    .est-pinch-hint.is-hidden { opacity: 0; }

    .est-minimap {
        position: absolute;
        right: 10px;
        top: 10px;
        width: 92px;
        height: 92px;
        border-radius: 12px;
        background: rgba(17, 24, 39, 0.58);
        border: 1px solid rgba(255, 255, 255, 0.22);
        backdrop-filter: blur(6px);
        box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
        opacity: 0;
        transform: scale(0.95);
        transition: opacity 0.22s ease, transform 0.22s ease;
        pointer-events: auto;
        touch-action: none;
        z-index: 6;
        cursor: grab;
    }
    .est-minimap.is-dragging { cursor: grabbing; }
    .est-minimap.is-active {
        opacity: 1;
        transform: scale(1);
    }
    .est-minimap::before {
        content: "";
        position: absolute;
        inset: 6px;
        border-radius: 8px;
        border: 1px dashed rgba(255, 255, 255, 0.32);
    }
    .est-minimap__viewport {
        position: absolute;
        border: 1.5px solid #f59e0b;
        background: rgba(245, 158, 11, 0.16);
        border-radius: 5px;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18) inset;
        transition: transform 0.08s ease;
    }
    .est-minimap.is-dragging .est-minimap__viewport {
        transform: scale(1.02);
    }

    /* Мобильная производительность: убираем тяжёлые бесконечные анимации */
    .board-table[data-busy=""] {
        animation: none !important;
    }

    .est-table-wrap.zoom-flash {
        box-shadow: 0 0 0 2px rgba(245, 158, 11, 0.55), 0 10px 22px rgba(0, 0, 0, 0.22);
    }
}

@media (min-width: 901px) {
    .est-pinch-hint { display: none; }
}

/* =====================================================
   СТАФФ НА СМЕНЕ — бейдж
   ===================================================== */
.est-staff-card {
    position: relative;
}
.est-staff-on-shift {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    color: var(--success, #16a34a);
    margin-top: 4px;
}
.est-staff-on-shift::before {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--success, #16a34a);
    animation: shiftPulse 2s ease infinite;
}
@keyframes shiftPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* =====================================================
   ПУЛЬС НА СВОБОДНЫХ СТОЛАХ
   ===================================================== */
@keyframes freeTablePulse {
    0%   { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0.55); }
    60%  { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0   rgba(34, 197, 94, 0); }
}

/* data-busy="" — нет занятых слотов = стол свободен */
.board-table[data-busy=""] {
    animation: freeTablePulse 2.4s ease-in-out infinite;
}

/* Убираем пульс при наведении, чтобы не мешал hover-превью */
.board-table[data-busy=""]:hover,
.board-table[data-busy=""]:focus-visible {
    animation: none;
}

@media (max-width: 900px) {
    .board-table[data-busy=""],
    .board-table[data-busy=""]:hover,
    .board-table[data-busy=""]:focus-visible {
        animation: none !important;
    }
}

/* =====================================================
   МЕНЮ — HOVER НА КАРТОЧКЕ
   ===================================================== */
.est-menu-card {
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.est-menu-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.10);
}

.est-menu-card-img {
    transition: transform 0.28s ease;
}

.est-menu-card:hover .est-menu-card-img {
    transform: scale(1.04);
}

/* =====================================================
   ОТЗЫВЫ — карточки
   ===================================================== */
.est-reviews-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}
.est-reviews-more {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--amber, #d97706);
    text-decoration: none;
    flex-shrink: 0;
}
.est-reviews-more:hover { color: var(--amber-dark, #b45309); }

.est-reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
}

.est-review-card {
    background: var(--bg-soft, #f3ede0);
    border: 1px solid var(--border, #e5ddd0);
    border-radius: var(--radius-lg, 16px);
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    transition: box-shadow .18s;
}
.est-review-card:hover {
    box-shadow: 0 4px 18px rgba(0,0,0,.07);
}

.est-review-card__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}
.est-review-card__author {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}
.est-review-card__avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}
.est-review-card__avatar-fallback {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--amber, #d97706);
    color: #fff;
    font-weight: 800;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.est-review-card__name {
    font-size: .88rem;
    font-weight: 700;
    color: var(--text, #1c1007);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.est-review-card__date {
    font-size: .75rem;
    color: var(--text-muted, #78716c);
    margin: 2px 0 0;
}
.est-review-card__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    flex-shrink: 0;
}
.est-review-card__stars {
    display: flex;
    gap: 1px;
}
.est-star {
    font-size: .85rem;
    color: #d1c7be;
}
.est-star--filled {
    color: #f59e0b;
}
.est-review-card__source {
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    padding: 2px 7px;
    border-radius: 99px;
    background: var(--border, #e5ddd0);
    color: var(--text-muted, #78716c);
}
.est-review-card__source--yandex { background: rgba(255,204,0,.18); color: #7a5c00; }
.est-review-card__source--google { background: rgba(66,133,244,.12); color: #1a56c4; }
.est-review-card__source--2gis   { background: rgba(39,174,96,.12); color: #166534; }

.est-review-card__text {
    font-size: .88rem;
    line-height: 1.6;
    color: var(--text, #1c1007);
    margin: 0;
    /* Ограничение по высоте — читабельно, без простыни */
    display: -webkit-box;
    -webkit-line-clamp: 6;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.est-review-card__text:hover {
    -webkit-line-clamp: unset;
}

@media (max-width: 600px) {
    .est-reviews-grid {
        grid-template-columns: 1fr;
    }
}

/* =====================================================
   МЕНЮ — премиальный редизайн карточек (v2)
   Единая высота, ровные плейсхолдеры, акцентные цены
   ===================================================== */
.est-menu-section h3 {
    font-size: 22px;
    letter-spacing: 0.01em;
}
.est-menu-cat-tabs {
    gap: 8px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 18px;
    -webkit-overflow-scrolling: touch;
}
.est-menu-cat-tab {
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--text);
    padding: 9px 16px;
    font-weight: 700;
    white-space: nowrap;
}
.est-menu-grid {
    gap: 16px;
    padding-bottom: 10px;
}
.est-menu-card {
    flex: 0 0 230px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.est-menu-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: var(--accent-border);
}
.est-menu-card-img-wrap {
    aspect-ratio: 4 / 3;
    background: var(--bg-soft);
}
/* Плейсхолдер без фото — та же геометрия, премиальный фон */
.est-menu-card-img-placeholder {
    height: auto;
    aspect-ratio: 4 / 3;
    border-radius: 0;
    background:
        radial-gradient(120% 120% at 50% 0%, #fff6e8 0%, var(--bg-soft) 70%);
    color: #c9a36a;
}
.est-menu-badge {
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 12px rgba(217, 119, 6, 0.4);
    letter-spacing: 0.01em;
}
.est-menu-card-body {
    padding: 12px 14px 15px;
    gap: 7px;
}
.est-menu-card-title {
    font-size: 15px;
    font-weight: 800;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.est-menu-price-cur {
    font-size: 17px;
    font-weight: 800;
    color: var(--link);
}
.est-menu-card-desc {
    color: var(--muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-top: auto;
}
@media (max-width: 600px) {
    .est-menu-card { flex-basis: 200px; }
}

/* =====================================================
   ФОРМА БРОНИ — премиальный full-screen sheet на телефоне
   ===================================================== */
/* Прячем пустой бокс фото, если фото стола нет */
.book-selected-photo {
    display: none;
    min-height: 0;
    margin-bottom: 2px;
}
.book-selected-photo:has(img.is-visible) {
    display: block;
    min-height: 120px;
}
.book-modal-dialog {
    border-radius: 18px;
}
.book-selected-table {
    border-radius: 12px;
    font-weight: 600;
}

@media (max-width: 640px) {
    .book-modal {
        padding: 0;
        align-items: stretch;
        justify-content: stretch;
    }
    .book-modal.is-open {
        animation: bookSheetFade 0.2s ease;
    }
    .book-modal-dialog {
        width: 100vw;
        max-width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        border: 0;
        border-radius: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
        animation: bookSheetUp 0.26s cubic-bezier(0.22, 1, 0.36, 1);
    }
    .book-modal-head {
        position: sticky;
        top: 0;
        z-index: 3;
        margin: 0;
        padding: 16px 16px 12px;
        padding-top: calc(16px + env(safe-area-inset-top, 0px));
        background: #fff;
        border-bottom: 1px solid var(--line);
    }
    .book-modal-head h3 { font-size: 20px; }
    .book-modal-close {
        width: 40px;
        height: 40px;
        font-size: 22px;
    }
    .book-modal-form {
        flex: 1 1 auto;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }
    .book-modal-scroll {
        flex: 1 1 auto;
        min-height: 0;
        overflow-x: hidden;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        padding: 14px 16px 20px;
        display: flex;
        flex-direction: column;
        gap: 14px;
        scrollbar-width: none;
        overscroll-behavior: contain;
    }
    .book-modal-scroll::-webkit-scrollbar {
        display: none;
    }
    .book-modal-footer {
        flex: 0 0 auto;
        padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px));
        background: #fff;
        border-top: 1px solid var(--line);
        box-shadow: 0 -8px 24px rgba(28, 16, 7, 0.08);
    }
    /* Крупнее тач-цели */
    .book-field input,
    .book-field select {
        height: 46px;
        font-size: 16px; /* не зумит iOS Safari */
    }
    .book-gc,
    .book-dq {
        min-height: 42px;
        font-size: 0.92rem;
    }
    /* Слоты раскрываются полностью; прокрутка только у .book-modal-scroll */
    .book-time-slots {
        max-height: none;
        overflow: hidden;
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        gap: 8px;
    }
    .book-time-slots button {
        min-height: 46px;
        width: 100%;
    }
    .book-slot-group {
        grid-column: 1 / -1;
    }
    .book-slots-empty {
        grid-column: 1 / -1;
    }
    .book-submit {
        width: 100%;
        height: 52px;
        margin: 0;
        border-radius: 14px;
        font-size: 16px;
        font-weight: 800;
        box-shadow: none;
    }
}
@keyframes bookSheetUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}
@keyframes bookSheetFade {
    from { background: rgba(0, 0, 0, 0); }
    to   { background: rgba(0, 0, 0, 0.45); }
}

/* main.container держит z-index:2 и образует stacking-context,
   из-за чего фиксированное модальное окно бронирования оказывалось
   под шапкой (.topbar, z-index:12). Пока модалка открыта — поднимаем
   контейнер выше шапки, чтобы фуллскрин-шит перекрывал всё. */
body:has(.book-modal.is-open) main.container {
    z-index: 100400;
}
body:has(.book-modal.is-open) .topbar {
    z-index: 1;
}
