/* Локальный Material Symbols (сабсет из используемых иконок) —
   вместо Google Fonts, чтобы данные пользователей не передавались
   на зарубежные CDN. См. @font-face ниже. */
@font-face {
    font-family: 'Material Symbols Outlined';
    font-style: normal;
    font-weight: 100 700;
    font-display: swap;
    src: url('../fonts/MaterialSymbolsOutlined-subset.woff2') format('woff2');
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined';
    font-weight: normal;
    font-style: normal;
    font-size: 24px;
    line-height: 1;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
}

/* =========================================================
   ТЁМНАЯ ТЕМА — ГЛОБАЛЬНЫЕ ИСПРАВЛЕНИЯ КОНТРАСТА
   Перекрывают захардкоженные цвета в инлайн-стилях шаблонов,
   чтобы текст был читаем при включённой тёмной теме.
   ========================================================= */
html.dark input,
html.dark select,
html.dark textarea {
    background: var(--bg-section) !important;
    color: var(--text-light) !important;
    border-color: var(--border-color) !important;
}

html.dark input::placeholder,
html.dark textarea::placeholder {
    color: var(--text-muted) !important;
}

/* Карточки записей в профиле (appointment-card) — переключаем на тему */
html.dark .appointment-card {
    background: var(--bg-card) !important;
    border-color: var(--border-color) !important;
    box-shadow: var(--shadow) !important;
}

/* Жёсткие тёмные подписи на тёмном фоне — делаем светлыми */
html.dark .cat-title {
    color: var(--text-light) !important;
    background: var(--bg-section) !important;
}

html.dark .group-name {
    color: var(--text-muted) !important;
}

html.dark .service-name {
    color: var(--text-light) !important;
}

html.dark .service-meta {
    color: var(--text-muted) !important;
}

html.dark .services-grid {
    border-color: var(--border-color) !important;
}

html.dark .service-item:hover {
    background: rgba(212, 175, 55, 0.1) !important;
}

/* Захардкоженный светлый фон подложек в профиле */
html.dark .profile-highlight {
    background: var(--bg-section) !important;
}

/* Сводка цен в формах */
html.dark #priceInfo {
    background: var(--bg-section) !important;
}

html.dark #servicesSummary {
    background: var(--bg-section) !important;
}

/* Цвета текста в формах записи и профиле */
html.dark label {
    color: var(--text-light) !important;
}

html.dark h2,
html.dark h3,
html.dark h4 {
    color: var(--text-light) !important;
}

/* =========================================================
   ТЁМНАЯ ТЕМА — КАЛЕНДАРЬ ГРАФИКА / ТАБЛИЦЫ
   ========================================================= */
/* Серые заголовки и подписи (#888 и т.п.) на тёмном фоне */
html.dark table th {
    color: var(--text-muted) !important;
}

html.dark table td {
    color: var(--text-light) !important;
}

/* Ячейки календаря графика — светлые фоны делаем тёмными, но с сохранением смысла через цвет */
html.dark td[style*="background: #e8f4fd"],
html.dark td[style*="background:#e8f4fd"] {
    background: rgba(41, 128, 185, 0.25) !important;
}

html.dark td[style*="background: #d4edda"],
html.dark td[style*="background:#d4edda"] {
    background: rgba(39, 174, 96, 0.25) !important;
}

html.dark td[style*="background: #f8d7da"],
html.dark td[style*="background:#f8d7da"] {
    background: rgba(231, 76, 60, 0.25) !important;
}

html.dark td[style*="background: #fff3cd"],
html.dark td[style*="background:#fff3cd"] {
    background: rgba(243, 156, 18, 0.25) !important;
}

/* Ячейки календаря графика — остальные цвета филиалов (палитра schedule):
   оранжевый, голубой, фиолетовый, розовый */
html.dark td[style*="background: #ffe1b3"],
html.dark td[style*="background:#ffe1b3"],
html.dark .cal-day[style*="background: #ffe1b3"],
html.dark .cal-day[style*="background:#ffe1b3"] {
    background: rgba(230, 126, 34, 0.25) !important;
}

html.dark td[style*="background: #cfe2ff"],
html.dark td[style*="background:#cfe2ff"],
html.dark .cal-day[style*="background: #cfe2ff"],
html.dark .cal-day[style*="background:#cfe2ff"] {
    background: rgba(52, 152, 219, 0.25) !important;
}

html.dark td[style*="background: #e9d4ff"],
html.dark td[style*="background:#e9d4ff"],
html.dark .cal-day[style*="background: #e9d4ff"],
html.dark .cal-day[style*="background:#e9d4ff"] {
    background: rgba(155, 89, 182, 0.25) !important;
}

html.dark td[style*="background: #ffd6d6"],
html.dark td[style*="background:#ffd6d6"],
html.dark .cal-day[style*="background: #ffd6d6"],
html.dark .cal-day[style*="background:#ffd6d6"] {
    background: rgba(231, 76, 60, 0.25) !important;
}

/* Зелёный филиал и «сегодня» — тоже в мобильном списке (div.cal-list-item) */
html.dark .cal-day[style*="background: #d4edda"],
html.dark .cal-day[style*="background:#d4edda"] {
    background: rgba(39, 174, 96, 0.25) !important;
}

html.dark .cal-day[style*="background: #e8f4fd"],
html.dark .cal-day[style*="background:#e8f4fd"] {
    background: rgba(41, 128, 185, 0.25) !important;
}

/* Две смены в один день в разных филиалах — градиент 50/50 двух цветов.
   В тёмной теме заменяем на нейтральный тёмный градиент (текст остаётся белым). */
html.dark td.cal-day[style*="linear-gradient"],
html.dark div.cal-day[style*="linear-gradient"] {
    background: linear-gradient(135deg, rgba(255,255,255,.07) 50%, rgba(255,255,255,.16) 50%) !important;
}

html.dark td[style*="background: #f9f9f9"],
html.dark td[style*="background:#f9f9f9"] {
    background: var(--bg-card) !important;
}

html.dark td[style*="border: 1px solid #eee"],
html.dark td[style*="border:1px solid #eee"] {
    border-color: var(--border-color) !important;
}

/* Текст внутри календарных ячеек */
html.dark div[style*="color: #155724"] {
    color: #7ee0a0 !important;
}
html.dark span[style*="color: #155724"] {
    color: #7ee0a0 !important;
}
html.dark div[style*="color: #721c24"] {
    color: #f0a0a0 !important;
}
html.dark span[style*="color: #721c24"] {
    color: #f0a0a0 !important;
}
html.dark div[style*="color: #856404"] {
    color: #e8d48a !important;
}
html.dark span[style*="color: #856404"] {
    color: #e8d48a !important;
}
html.dark div[style*="color: #888"] {
    color: var(--text-muted) !important;
}

/* Разделители */
html.dark hr {
    border-color: var(--border-color) !important;
}

/* =========================================================
   AFROUFA.RU — Салон красоты АФРО
   Полный файл стилей (восстановлен)
   ========================================================= */

/* ---------- CSS-переменные и темы ---------- */
:root {
    --noir: #0c0c0e;
    --bg-dark: #0c0c0e;
    --bg-section: #141417;
    --bg-card: #1a1a1f;
    --border-color: #2a2a31;
    --gold: #d4af37;
    --gold-light: #e8c860;
    --champagne: #e9dcc3;
    --champagne-dim: #a89874;
    --text-light: #f5f1e8;
    --text-muted: #a89f8f;
    --radius: 12px;
    --shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    --font-body: 'Noto Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --font-serif: 'Noto Serif', Georgia, serif;
}

html.dark {
    --noir: #0c0c0e;
    --bg-dark: #0c0c0e;
    --bg-section: #141417;
    --bg-card: #1a1a1f;
    --border-color: #2a2a31;
    --gold: #d4af37;
    --gold-light: #e8c860;
    --champagne: #e9dcc3;
    --champagne-dim: #a89874;
    --text-light: #f5f1e8;
    --text-muted: #a89f8f;
}

html:not(.dark) {
    --noir: #f7f5f0;
    --bg-dark: #f7f5f0;
    --bg-section: #efede6;
    --bg-card: #ffffff;
    --border-color: #e3ddd0;
    --gold: #b8942e;
    --gold-light: #d4b25a;
    --champagne: #3a2f1d;
    --champagne-dim: #7a6b4d;
    --text-light: #2b2620;
    --text-muted: #6f6757;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--bg-dark);
    color: var(--text-light);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.35s ease, color 0.25s ease;
}

/* Блокировка прокрутки при открытом мобильном меню */
body.menu-open {
    overflow: hidden;
}

/* Затемнение фона за открытым мобильным меню: клик по нему закрывает меню */
#navOverlay {
    position: fixed;
    inset: 0;
    /* Ниже .navbar (1000): сама панель меню — дочерний элемент шапки,
       её z-index 1002 действует только внутри контекста шапки */
    z-index: 999;
    background: rgba(0, 0, 0, 0.45);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}
#navOverlay.visible {
    opacity: 1;
    pointer-events: auto;
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: inherit;
    text-decoration: none;
}

h1, h2, h3, h4 {
    font-family: var(--font-serif);
    line-height: 1.2;
}

h2 {
    font-size: 2rem;
    color: var(--text-light);
    margin-bottom: 1rem;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.gold {
    color: var(--gold);
}

.font-label {
    font-family: var(--font-body);
}

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0 1.5rem;
    height: 72px;
    background: rgba(12, 12, 14, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border-color);
}

html:not(.dark) .navbar {
    background: rgba(247, 245, 240, 0.9);
}

.navbar .brand {
    font-family: var(--font-serif);
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--champagne);
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.navbar .brand span {
    color: var(--gold);
}

.navbar .brand .brand-icon {
    display: inline-flex;
    align-items: center;
    flex: none;
    margin-right: .45rem;
    vertical-align: -4px;
}

.navbar .brand .brand-icon svg {
    width: 1.15em;
    height: 1.15em;
    max-width: 1.4rem;
    max-height: 1.4rem;
    flex: none;
    display: block;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 1.4rem;
}

.nav-links a {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-light);
    opacity: 0.9;
    transition: opacity 0.2s, color 0.2s;
    white-space: nowrap;
}

.nav-links a:hover {
    color: var(--gold);
    opacity: 1;
}

.nav-links form button {
    background: none;
    border: none;
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    opacity: 0.9;
    transition: opacity 0.2s, color 0.2s;
}

.nav-links form button:hover {
    color: var(--gold);
    opacity: 1;
}

.theme-toggle-btn {
    background: none;
    border: none;
    font-size: 1rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

/* Кнопка мобильного меню — всегда поверх панели */
.nav-toggle {
    display: none;
    position: relative;
    z-index: 1003;
    width: 48px;
    height: 48px;
    padding: 0;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: var(--text-light);
    cursor: pointer;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: color 0.2s, transform 0.2s;
}

.nav-toggle:hover {
    color: var(--gold);
}

.nav-toggle.active {
    color: var(--gold);
    transform: rotate(90deg);
}

.btn-nav {
    display: inline-block;
    padding: 0.55rem 1.2rem;
    background: var(--gold);
    color: var(--noir) !important;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.2s;
}

.btn-nav:hover {
    background: var(--gold-light);
    color: var(--noir) !important;
}

/* =========================================================
   ВЫПАДАЮЩИЕ МЕНЮ (Услуги / филиал)
   ========================================================= */
.dropdown {
    position: relative;
}

.dropdown-trigger {
    background: none;
    border: none;
    color: var(--text-light);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 0.3rem;
    opacity: 0.9;
    transition: opacity 0.2s, color 0.2s;
}

.dropdown-trigger:hover {
    color: var(--gold);
    opacity: 1;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    min-width: 220px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.5rem;
    box-shadow: var(--shadow);
    z-index: 1005;
}

.dropdown-menu.show {
    display: block;
}

.dropdown-menu a {
    display: block;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.85rem;
    color: var(--text-light);
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.dropdown-menu a:hover {
    background: rgba(212, 175, 55, 0.12);
    color: var(--gold);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6rem 1.5rem 4rem;
    background:
        radial-gradient(ellipse at 20% 80%, rgba(212, 175, 55, 0.12), transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(212, 175, 55, 0.08), transparent 50%),
        var(--bg-dark);
}

.hero-content {
    max-width: 720px;
}

.hero .subtitle {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.35em;
    color: var(--champagne-dim);
    margin-bottom: 1.2rem;
}

.hero h1 {
    font-size: 3.2rem;
    color: var(--champagne);
    margin-bottom: 1.2rem;
}

.hero .tagline {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    display: inline-block;
    padding: 0.7rem 1.6rem;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-decoration: none;
    transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.btn-primary {
    background: var(--gold);
    color: var(--noir);
}

.btn-primary:hover {
    background: var(--gold-light);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gold);
    color: var(--gold);
}

.btn-outline:hover {
    background: rgba(212, 175, 55, 0.12);
}

.btn-success {
    background: #27ae60;
    color: #fff;
}

.btn-success:hover {
    background: #2ecc71;
}

.btn-danger {
    background: #e74c3c;
    color: #fff;
}

.btn-sm {
    padding: 0.3rem 0.7rem;
    font-size: 0.8rem;
}

/* =========================================================
   СЕКЦИИ
   ========================================================= */
.section {
    padding: 4.5rem 0;
}

.section-alt {
    background: var(--bg-section);
}

/* =========================================================
   АККОРДЕОН УСЛУГ
   ========================================================= */
.service-accordion-item {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 0.75rem;
    background: var(--bg-card);
    overflow: hidden;
    transition: border-color 0.2s;
}

.service-accordion-item.active {
    border-color: rgba(212, 175, 55, 0.4);
}

.service-accordion-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.2rem;
    cursor: pointer;
    user-select: none;
}

.service-accordion-trigger h3 {
    font-size: 1.15rem;
    color: var(--text-light);
    font-family: var(--font-body);
    font-weight: 600;
}

.accordion-icon {
    color: var(--gold);
    transition: transform 0.2s;
}

.service-accordion-content {
    display: none;
    padding: 0 1.2rem 1.2rem;
}

.service-accordion-item.active .service-accordion-content {
    display: block;
    animation: accordionIn 0.25s ease;
}

@keyframes accordionIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Переключатель длины волос */
.length-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.length-toggle-btn {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.length-toggle-btn:hover {
    border-color: var(--gold);
    color: var(--gold);
}

.length-toggle-btn.active {
    background: var(--gold);
    border-color: var(--gold);
    color: var(--noir);
    font-weight: 600;
}

/* Таблицы цен */
.pricing-table-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.responsive-pricing-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.responsive-pricing-table th,
.responsive-pricing-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
}

.responsive-pricing-table th {
    color: var(--champagne-dim);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.responsive-pricing-table td {
    color: var(--text-light);
    white-space: normal;
}

.responsive-pricing-table tr:last-child td {
    border-bottom: none;
}

/* Фиксированные ширины столбцов для выравнивания по всем категориям */
.responsive-pricing-table th:nth-child(1),
.responsive-pricing-table td:nth-child(1) {
    width: auto;
}
.responsive-pricing-table th:nth-child(2),
.responsive-pricing-table td:nth-child(2) {
    width: 90px;
    text-align: center;
}
.responsive-pricing-table th:nth-child(3),
.responsive-pricing-table td:nth-child(3) {
    width: 160px;
    text-align: right;
}

/* =========================================================
   LOOKBOOK СЛАЙДЕР
   ========================================================= */
.lookbook-slider-wrapper {
    position: relative;
}

.lookbook-slider {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    padding: 0.25rem;
    padding-bottom: 0.75rem;
    scrollbar-width: thin;
    scrollbar-color: var(--gold) var(--border-color);
}

/* Кастомный скроллбар слайдера (Chrome/Edge/Safari) */
.lookbook-slider::-webkit-scrollbar {
    height: 6px;
}

.lookbook-slider::-webkit-scrollbar-track {
    background: var(--border-color);
    border-radius: 3px;
}

.lookbook-slider::-webkit-scrollbar-thumb {
    background: linear-gradient(90deg, var(--gold), var(--gold-light));
    border-radius: 3px;
}

.lookbook-slider::-webkit-scrollbar-thumb:hover {
    background: var(--gold-light);
}

.lookbook-item {
    flex: 0 0 auto;
    width: 300px;
    scroll-snap-align: start;
    position: relative;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 3 / 4;
}

.lookbook-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s;
}

.lookbook-item:hover img {
    transform: scale(1.04);
}

.lookbook-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 1.2rem;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
}

.lookbook-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    background: var(--bg-card);
    color: var(--gold);
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.lookbook-btn:hover {
    background: var(--gold);
    color: var(--noir);
}

.lookbook-btn-prev {
    left: -0.75rem;
}

.lookbook-btn-next {
    right: -0.75rem;
}

/* =========================================================
   ФИЛОСОФИЯ
   ========================================================= */
.philosophy-section {
    padding: 4.5rem 0;
    background: var(--bg-dark);
}

.philosophy-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.philosophy-image {
    position: relative;
}

.philosophy-image .frame {
    position: absolute;
    inset: 1rem -1rem -1rem 1rem;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 4px;
    z-index: 0;
}

.philosophy-image img {
    position: relative;
    z-index: 1;
    border-radius: 4px;
    width: 100%;
    object-fit: cover;
    aspect-ratio: 4 / 5;
}

.philosophy-text .label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    color: var(--champagne-dim);
    display: block;
    margin-bottom: 1rem;
}

.philosophy-text h2 {
    font-size: 2rem;
    color: var(--champagne);
    margin-bottom: 1.2rem;
}

.philosophy-text p {
    color: var(--text-muted);
    margin-bottom: 1rem;
}

/* =========================================================
   МАСТЕРА
   ========================================================= */
.masters-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem;
}

.master-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s;
}

.master-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.4);
}

.master-card .avatar {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--noir);
    font-size: 1.6rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
}

.master-card h3 {
    font-size: 1.1rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
    font-family: var(--font-body);
}

.master-card .master-desc {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* =========================================================
   АДРЕСА
   ========================================================= */
.addresses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.address-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.5rem;
    transition: transform 0.2s, border-color 0.2s;
}

.address-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, 0.4);
}

.address-card.active {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold);
}

.address-card.active h3 {
    color: var(--gold);
}

.address-card.active p,
.address-card.active a {
    color: var(--text-light);
}

.address-card h3 {
    font-size: 1.05rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
}

.address-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.map-container {
    position: relative;
    height: 400px;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Виджет Яндекс.Карт вставляется прямо в .map-container (как на афро.рф) */
.map-container > div[style*="relative"],
.map-container iframe,
.map-container ymaps {
    width: 100% !important;
}
.map-container iframe { height: 400px; }
@media (max-width: 768px) {
    .map-container iframe { height: 300px; }
}

.map-overlay {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.map-pulse {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: var(--gold);
    animation: pulse 1.6s infinite;
}

@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0.6); }
    70%  { box-shadow: 0 0 0 18px rgba(212, 175, 55, 0); }
    100% { box-shadow: 0 0 0 0 rgba(212, 175, 55, 0); }
}

.map-label {
    color: var(--text-muted);
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* =========================================================
   CTA
   ========================================================= */
.cta-section {
    padding: 5rem 1.5rem;
    text-align: center;
    background:
        linear-gradient(rgba(12, 12, 14, 0.82), rgba(12, 12, 14, 0.82)),
        url('../images/cta-bg.jpg') center/cover no-repeat;
}

.cta-section h2 {
    color: #f5f1e8 !important;
    margin-bottom: 0.8rem;
}

.cta-section p {
    color: #e9dcc3 !important;
    margin-bottom: 1.6rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.cta-section .btn {
    background: var(--gold);
    color: var(--noir) !important;
}

.cta-section .btn:hover {
    background: var(--gold-light);
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
    padding: 3rem 1.5rem;
    text-align: center;
    background: var(--bg-section);
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 0.85rem;
}

.footer-brand {
    font-family: var(--font-serif);
    font-size: 1.2rem;
    color: var(--champagne);
    margin-bottom: 0.5rem;
    letter-spacing: 0.08em;
}

.footer-links {
    margin-top: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: wrap;
}

.footer-link {
    color: var(--gold);
}

.footer-link:hover {
    color: var(--gold-light);
}

.footer-sep {
    color: var(--border-color);
}

/* Футер: бренд и реквизиты по центру, ссылки «Информация» справа */
.footer-columns {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 2.5rem;
    max-width: 1100px;
    margin: 0 auto 1.25rem;
}
.footer-col-brand {
    grid-column: 2;
    text-align: center;
}
.footer-col-brand p {
    margin: .25rem 0;
}
.footer-col-links {
    grid-column: 3;
    justify-self: end;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    text-align: right;
}
.footer-col-title {
    font-weight: 600;
    color: var(--text-light);
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    margin-bottom: .4rem;
}
.footer-col-links .footer-link {
    display: block;
    text-decoration: underline;
    text-underline-offset: 2px;
    font-size: .85rem;
}
.footer-col-links .footer-link:hover {
    color: var(--gold-light);
}
.footer-bottom {
    display: flex;
    justify-content: center;
    max-width: 1000px;
    margin: .5rem auto 0;
}
/* Кнопка переключения темы — аккуратная круглая кнопка */
.footer-bottom .theme-toggle-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    background: var(--card-bg, transparent);
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.footer-bottom .theme-toggle-btn:hover {
    transform: rotate(25deg) scale(1.08);
    border-color: var(--gold);
}
@media (max-width: 640px) {
    .footer {
        padding: 1.4rem .75rem;
        font-size: .72rem;
    }
    .footer-brand {
        font-size: .95rem;
        margin-bottom: .3rem;
        letter-spacing: .04em;
    }
    .footer-columns {
        grid-template-columns: 1fr;
        gap: .9rem;
        text-align: center;
        margin-bottom: .75rem;
    }
    .footer-col-brand { grid-column: 1; }
    .footer-col-brand p { margin: .15rem 0; line-height: 1.45; }
    .footer-requisites {
        font-size: .62rem !important;
        overflow-wrap: anywhere;
        line-height: 1.4;
    }
    .footer-col-links {
        grid-column: 1;
        justify-self: center;
        text-align: center;
        gap: .3rem;
    }
    .footer-col-title {
        font-size: .7rem;
        margin-bottom: .25rem;
    }
    .footer-col-links .footer-link { font-size: .72rem; }
    .footer-bottom { margin-top: .25rem; }
    .footer-bottom .theme-toggle-btn {
        width: 32px;
        height: 32px;
        font-size: .85rem;
    }
}

@media (min-width: 641px) and (max-width: 975px) {
    .footer {
        padding: 2rem 1rem;
        font-size: .78rem;
    }
    .footer-brand {
        font-size: 1rem;
        margin-bottom: .35rem;
        letter-spacing: .05em;
    }
    .footer-columns {
        gap: 1.25rem;
        margin-bottom: .9rem;
    }
    .footer-col-brand p {
        margin: .15rem 0;
        line-height: 1.45;
    }
    .footer-requisites {
        font-size: .66rem !important;
    }
    .footer-col-links {
        gap: .35rem;
    }
    .footer-col-title {
        font-size: .74rem;
        margin-bottom: .3rem;
    }
    .footer-col-links .footer-link {
        font-size: .75rem;
    }
}

/* =========================================================
   COOKIE CONSENT
   ========================================================= */
/* Баннер согласия на cookie: разметка и стили — в includes/metrika_gated.html
   (самодостаточный блок, цвета через CSS-переменные темы). */

#cookie-consent.hidden {
    display: none;
}

/* Отдельный баннер с вопросом об уведомлениях о записях — минималистичный,
   в актуальной палитре сайта (переключается темой через CSS-переменные) */
#notif-banner {
    position: fixed;
    left: 50%;
    bottom: 1.5rem;
    transform: translateX(-50%);
    z-index: 2001;
    max-width: 460px;
    width: calc(100% - 2rem);
    /* На тёмной теме чуть светлее фона + золотая кайма, чтобы не сливался */
    background: var(--bg-section, var(--bg-card));
    border: 1px solid rgba(212, 175, 55, .45);
    border-radius: 16px;
    padding: 1rem 1.25rem;
    box-shadow: 0 14px 40px rgba(0, 0, 0, .55), 0 0 0 1px rgba(212, 175, 55, .08);
    text-align: left;
    font-family: 'Noto Sans', system-ui, -apple-system, sans-serif;
}
[data-theme="light"] #notif-banner,
html.light #notif-banner {
    background: var(--bg-card);
    box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
}
#notif-banner .notif-text {
    margin: 0 0 .8rem;
    font-size: .92rem;
    line-height: 1.45;
    color: var(--text-light);
}
#notif-banner .notif-actions {
    display: flex;
    gap: .5rem;
    flex-wrap: wrap;
    align-items: center;
}
#notif-banner .notif-btn {
    padding: .5rem 1rem;
    border-radius: 10px;
    border: 1px solid transparent;
    font-family: inherit;
    font-size: .82rem;
    font-weight: 700;
    cursor: pointer;
    transition: filter .2s, border-color .2s, color .2s;
}
#notif-banner .notif-btn-primary {
    background: var(--gold);
    color: #ffffff;
}
#notif-banner .notif-btn-primary:hover { filter: brightness(1.08); }
#notif-banner .notif-btn-ghost {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-light);
}
#notif-banner .notif-btn-ghost:hover { border-color: var(--gold); }
#notif-banner .notif-btn-link {
    background: none;
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    text-decoration: underline;
    padding: .5rem .4rem;
}
#notif-banner .notif-btn-link:hover { color: var(--text-light); }

#notif-banner.hidden {
    display: none;
}

/* Ссылка-предложение привязать MAX внутри баннера напоминаний */
#notif-banner .notif-max-link {
    display: flex; align-items: center; gap: .5rem;
    margin-top: .7rem; padding: .55rem .7rem;
    border-radius: 10px; text-decoration: none;
    font-size: .82rem; font-weight: 600; color: #fff;
    background: radial-gradient(136% 140% at 100% 100%, #8d28c8 0%, #7c42fa 20%, #007aff 80%, #609ceb 100%);
    box-shadow: 0 3px 12px rgba(0, 122, 255, .3);
}
#notif-banner .notif-max-link:hover { filter: brightness(1.07); }
#notif-banner .notif-max-link img { width: 20px; height: 20px; flex: none; }

/* Если виден и cookie-баннер — уведомления показываем выше него */
#cookie-consent:not(.hidden) + #notif-banner {
    bottom: 12.5rem;
}

.cookie-link {
    color: var(--gold);
    text-decoration: underline;
}

/* =========================================================
   SIDE NAVIGATION
   ========================================================= */
#side-navigation {
    position: fixed;
    right: 1.5rem;
    bottom: 1.5rem;
    z-index: 1500;
    display: none;
}

.side-nav-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.side-nav-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-align: center;
}

.side-nav-btn .line {
    width: 1px;
    height: 48px;
    background: var(--border-color);
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

.side-nav-btn .line-fill {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: var(--gold);
}

.side-nav-btn:hover .line-fill {
    height: 100%;
    transition: height 0.4s;
}

.side-nav-btn .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--champagne-dim);
    writing-mode: vertical-rl;
    margin-top: 0.5rem;
}

.side-nav-icons {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.side-nav-icons button,
.side-nav-icons a {
    width: 40px;
    height: 40px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--bg-card);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.side-nav-icons button:hover,
.side-nav-icons a:hover {
    background: var(--gold);
    color: var(--noir);
}

.side-nav-divider {
    width: 1px;
    height: 32px;
    background: var(--border-color);
}

.side-nav-rotate {
    writing-mode: vertical-rl;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.25em;
    color: var(--champagne-dim);
}

/* =========================================================
   МОДАЛКА ВЫБОРА ФИЛИАЛА
   ========================================================= */
#branch-modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 1rem;
}

#branch-modal-overlay.hidden {
    display: none;
}

.branch-modal-card {
    max-width: 600px;
    width: 100%;
    padding: 2.25rem 2rem 1.75rem;
    text-align: center;
    position: relative;
    background: var(--bg-card);
    border: 1px solid rgba(212, 175, 55, 0.35);
    border-radius: var(--radius);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
    font-family: var(--font-body);
    animation: branch-modal-in 0.4s ease-out;
}

@keyframes branch-modal-in {
    from { opacity: 0; transform: translateY(18px) scale(.97); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.branch-modal-label {
    display: block;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .3em;
    color: var(--gold);
    margin-bottom: .9rem;
}

.branch-modal-title {
    font-family: var(--font-serif);
    font-size: 1.9rem;
    font-style: italic;
    color: var(--text-light);
    margin: 0 0 .5rem;
}

.branch-modal-sub {
    color: var(--text-muted);
    font-size: .88rem;
    margin: 0 0 1.5rem;
}

.branch-modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.branch-modal-option {
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    padding: 1.4rem 1.2rem;
    cursor: pointer;
    font-family: inherit;
    text-align: center;
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.branch-modal-text {
    display: block;
}

.branch-modal-option:hover {
    transform: translateY(-4px);
    border-color: var(--gold);
    box-shadow: 0 8px 22px rgba(212, 175, 55, 0.18);
}

.branch-modal-option h3 {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    color: var(--text-light);
    margin: 0 0 .4rem;
}

.branch-modal-option p {
    color: var(--text-muted);
    font-size: .85rem;
    margin: 0 0 1rem;
}

.branch-modal-cta {
    font-size: .7rem;
    text-transform: uppercase;
    letter-spacing: .2em;
    color: var(--gold);
}

.branch-modal-note {
    color: var(--text-muted);
    font-size: .75rem;
    margin: 1.5rem 0 0;
}

@media (prefers-reduced-motion: reduce) {
    #cookie-consent, .branch-modal-card { animation: none; }
    .branch-modal-option { transition: none; }
    .branch-modal-option:hover { transform: none; }
}

/* =========================================================
   ОБЩИЕ КОМПОНЕНТЫ (карточки, алиасы)
   ========================================================= */
.card {
    background: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
    transition: background 0.3s;
}

.text-muted {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.flex {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
}

.mb-2 { margin-bottom: 1rem; }
.mt-2 { margin-top: 1rem; }

/* =========================================================
   PRIVACY PAGE (Политика конфиденциальности)
   ========================================================= */
.privacy-page {
    padding-top: 72px;
}

.privacy-page .navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
}

.privacy-container {
    max-width: 820px;
    margin: 0 auto;
    padding: 3rem 1.5rem 2rem;
}

.privacy-container h1 {
    font-family: var(--font-serif);
    font-size: 2.2rem;
    color: var(--text-light);
    margin-bottom: 0.4rem;
}

.privacy-date {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-bottom: 2.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.privacy-container section {
    margin-bottom: 2.5rem;
}

.privacy-container section h2 {
    font-family: var(--font-serif);
    font-size: 1.3rem;
    color: var(--gold);
    margin-bottom: 0.8rem;
    line-height: 1.3;
}

.privacy-container p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0.8rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.privacy-container ul {
    margin: 0.5rem 0 1rem;
    padding-left: 1.4rem;
    list-style: disc;
}

.privacy-container li {
    color: var(--text-light);
    font-size: 0.98rem;
    line-height: 1.7;
    margin-bottom: 0.4rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.privacy-container strong {
    color: var(--gold);
    font-weight: 600;
}

.privacy-back {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

/* =========================================================
   ПРАЙС-ЛИСТ (/price/) — адаптивные таблицы как на главной
   ========================================================= */
.price-category {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    overflow: hidden;
}

.price-category summary {
    cursor: pointer;
    font-family: var(--font-serif);
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-light);
    padding: 1rem 1.2rem;
    list-style: none;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.price-category summary::-webkit-details-marker {
    display: none;
}

.price-category summary::after {
    content: '+';
    font-size: 1.4rem;
    color: var(--gold);
    line-height: 1;
    transition: transform 0.2s;
}

.price-category[open] summary::after {
    transform: rotate(45deg);
}

.price-group {
    padding: 0 1.2rem 1rem;
}

.price-group-name {
    font-family: var(--font-serif);
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 1rem 0 0.5rem;
}

/* Стилизация таблиц прайса как на главной */
.price-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.price-table th,
.price-table td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-color);
    text-align: left;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.price-table th {
    color: var(--champagne-dim);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.price-table td {
    color: var(--text-light);
    white-space: normal;
    vertical-align: top;
}

.price-table tr:last-child td {
    border-bottom: none;
}

/* =========================================================
   МОБИЛЬНОЕ МЕНЮ (адаптивность)
   ========================================================= */
@media (max-width: 1150px) {
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        height: 100vh;
        height: 100dvh;
        z-index: 1002;
        flex-direction: column;
        align-items: stretch;
        justify-content: flex-start;
        gap: 0.25rem;
        width: min(320px, 85vw);
        max-width: 320px;
        padding: 96px 1.5rem 2rem;
        background: var(--bg-card);
        border-left: 1px solid var(--border-color);
        box-shadow: var(--shadow);
        transform: translateX(100%);
        transition: transform 0.3s ease;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-links a,
    .nav-links form button {
        display: block;
        width: 100%;
        text-align: left;
        padding: 0.75rem 0.5rem;
        font-size: 1rem;
        border-radius: 6px;
        white-space: normal;
    }

    .nav-links a:hover,
    .nav-links form button:hover {
        background: rgba(212, 175, 55, 0.1);
    }

    .nav-links form {
        width: 100%;
        display: block;
    }

    /* Дропдауны внутри мобильного меню — статичные списки */
    .nav-links .dropdown {
        width: 100%;
    }

    .nav-links .dropdown-trigger {
        width: 100%;
        justify-content: space-between;
        padding: 0.75rem 0.5rem;
        font-size: 1rem;
    }

    .nav-links .dropdown-menu {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        box-shadow: none;
        border: none;
        border-left: 2px solid rgba(212, 175, 55, 0.3);
        margin-left: 0.5rem;
        padding: 0.25rem 0;
    }

    .nav-links .dropdown-menu.show {
        display: block;
    }

    .nav-links .dropdown-menu a {
        white-space: normal;
        font-size: 0.9rem;
    }

    .btn-nav {
        margin-top: 0.5rem;
        text-align: center !important;
    }

    .hero h1 {
        font-size: 2.4rem;
    }

    .philosophy-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    #side-navigation {
        display: none;
    }

    /* Privacy на планшетах */
    .privacy-page {
        padding-top: 64px;
    }

    .privacy-container h1 {
        font-size: 1.8rem;
    }

    /* Модалка на планшетах */
    .branch-modal-card {
        padding: 1.5rem;
    }
}

/* =========================================================
   АВТО-СВОРАЧИВАНИЕ ШАПКИ (JS)
   Класс .nav-collapsed добавляется автоматически, когда
   пункты навигации не помещаются по ширине шапки.
   ========================================================= */
body.nav-collapsed .navbar .nav-toggle {
    display: flex;
}

body.nav-collapsed .navbar .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 1002;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 0.25rem;
    width: min(320px, 85vw);
    max-width: 320px;
    padding: 96px 1.5rem 2rem;
    background: var(--bg-card);
    border-left: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

body.nav-collapsed .navbar .nav-links.open {
    transform: translateX(0);
}

body.nav-collapsed .navbar .nav-links a,
body.nav-collapsed .navbar .nav-links form button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
    border-radius: 6px;
    white-space: normal;
}

body.nav-collapsed .navbar .nav-links a:hover,
body.nav-collapsed .navbar .nav-links form button:hover {
    background: rgba(212, 175, 55, 0.1);
}

body.nav-collapsed .navbar .nav-links form {
    width: 100%;
    display: block;
}

body.nav-collapsed .navbar .nav-links .dropdown {
    width: 100%;
}

body.nav-collapsed .navbar .nav-links .dropdown-trigger {
    width: 100%;
    justify-content: space-between;
    padding: 0.75rem 0.5rem;
    font-size: 1rem;
}

body.nav-collapsed .navbar .nav-links .dropdown-menu {
    position: static;
    display: none;
    width: 100%;
    min-width: 0;
    box-shadow: none;
    border: none;
    border-left: 2px solid rgba(212, 175, 55, 0.3);
    margin-left: 0.5rem;
    padding: 0.25rem 0;
}

body.nav-collapsed .navbar .nav-links .dropdown-menu.show {
    display: block;
}

body.nav-collapsed .navbar .nav-links .dropdown-menu a {
    white-space: normal;
    font-size: 0.9rem;
}

body.nav-collapsed .btn-nav {
    margin-top: 0.5rem;
    text-align: center !important;
}

/* Для обычных пользователей и мастеров мобильное меню включается раньше — на 992px */
@media (min-width: 993px) and (max-width: 1150px) {
    body:not(.has-admin-nav) .nav-toggle {
        display: none;
    }

    body:not(.has-admin-nav) .nav-links {
        position: static;
        top: auto;
        right: auto;
        height: auto;
        width: auto;
        max-width: none;
        padding: 0;
        background: transparent;
        border: none;
        box-shadow: none;
        transform: none;
        transition: none;
        overflow-y: visible;
        flex-direction: row;
        align-items: center;
        justify-content: flex-end;
        gap: 0.5rem;
        z-index: auto;
    }

    body:not(.has-admin-nav) .nav-links.open {
        transform: none;
    }

    body:not(.has-admin-nav) .nav-links a,
    body:not(.has-admin-nav) .nav-links form button {
        display: inline-flex;
        width: auto;
        text-align: center;
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    body:not(.has-admin-nav) .nav-links form {
        width: auto;
        display: inline-block;
    }

    body:not(.has-admin-nav) .nav-links .dropdown {
        width: auto;
        position: relative;
    }

    body:not(.has-admin-nav) .nav-links .dropdown-trigger {
        width: auto;
        justify-content: center;
        padding: 0.5rem 0.75rem;
    }

    body:not(.has-admin-nav) .nav-links .dropdown-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: auto;
        min-width: 180px;
        display: none;
        background: var(--bg-card);
        border: 1px solid var(--border-color);
        box-shadow: var(--shadow);
        border-left: none;
        margin-left: 0;
    }

    body:not(.has-admin-nav) .nav-links .dropdown-menu.show {
        display: block;
    }

    body:not(.has-admin-nav) .nav-links .dropdown-menu a {
        white-space: nowrap;
        font-size: 0.9rem;
    }

    body:not(.has-admin-nav) .btn-nav {
        margin-top: 0;
    }
}

/* Планшеты и компактные экраны */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }

    .navbar {
        padding: 0 1rem;
        height: 64px;
    }

    main {
        padding-top: 64px;
    }

    .section {
        padding: 3rem 0;
    }

    h2 {
        font-size: 1.6rem;
    }

    .hero {
        min-height: 100vh;
        padding: 5rem 1rem 3rem;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero .tagline {
        font-size: 1rem;
    }

    .lookbook-item {
        width: 240px;
    }

    .map-container {
        height: 300px;
    }

    /* Адаптивность таблиц в карточках: горизонтальная прокрутка */
    .card table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .card {
        overflow: hidden;
    }

    /* Прайс: таблицы в карточках сохраняют читаемость */
    .price-table th,
    .price-table td {
        padding: 0.5rem 0.6rem;
        font-size: 0.85rem;
        white-space: normal;
    }

    /* Privacy на мобильных */
    .privacy-container {
        padding: 2rem 1rem 1.5rem;
    }

    .privacy-container h1 {
        font-size: 1.5rem;
    }

    .privacy-container section h2 {
        font-size: 1.1rem;
    }

    .privacy-container p,
    .privacy-container li {
        font-size: 0.95rem;
    }

    /* Модалка: в одну колонку */
    .branch-modal-grid {
        grid-template-columns: 1fr;
    }

    .branch-modal-title {
        font-size: 1.4rem;
    }
}

/* Компактные телефоны */
@media (max-width: 480px) {
    .navbar .brand {
        font-size: 1.2rem;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .hero-buttons {
        flex-direction: column;
        width: 100%;
    }

    .hero-buttons .btn {
        width: 100%;
        text-align: center;
    }

    .lookbook-item {
        width: 200px;
    }

    .cta-section h2 {
        font-size: 1.5rem;
    }

    .addresses-grid,
    .masters-grid {
        grid-template-columns: 1fr;
    }

    .philosophy-text h2 {
        font-size: 1.5rem;
    }

    .card {
        padding: 1rem;
    }

    /* Профиль: карточки в одну колонку на всю ширину */
    .flex > div {
        min-width: 100% !important;
    }

    /* Прайс на маленьких телефонах */
    .price-category summary {
        font-size: 1rem;
        padding: 0.85rem 1rem;
    }

    .price-group {
        padding: 0 0.9rem 0.9rem;
    }

    /* Модалка на компактных телефонах: три филиала влезают даже на 360×480 */
    #branch-modal-overlay {
        padding: .75rem;
        align-items: flex-start;
        overflow-y: auto;
    }

    .branch-modal-card {
        padding: 1.1rem 1rem;
        width: 100%;
        margin: 2vh auto;
    }

    .branch-modal-label {
        font-size: .62rem;
        letter-spacing: .22em;
        margin-bottom: .5rem;
    }

    .branch-modal-title {
        font-size: 1.15rem;
        margin-bottom: .3rem;
    }

    .branch-modal-sub {
        font-size: .78rem;
        margin-bottom: .8rem;
    }

    .branch-modal-grid {
        gap: .6rem;
    }

    /* Филиалы — компактными строками: текст слева, стрелка справа */
    .branch-modal-option {
        padding: .7rem .85rem;
        display: flex;
        align-items: center;
        gap: .75rem;
        text-align: left;
    }

    .branch-modal-option h3 {
        font-size: .92rem;
        margin: 0 0 .1rem;
    }

    .branch-modal-option p {
        font-size: .76rem;
        margin: 0;
    }

    .branch-modal-option .branch-modal-text {
        flex: 1;
        min-width: 0;
    }

    .branch-modal-cta {
        flex-shrink: 0;
        font-size: .6rem;
        letter-spacing: .12em;
        white-space: nowrap;
    }

    .branch-modal-note {
        font-size: .68rem;
        margin-top: .8rem;
    }
}

/* ---------- Форма записи (book_appointment) — адаптивность ---------- */
.services-grid {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 0.5rem;
    width: 100%;
}

.service-category {
    margin-bottom: 1rem;
}

.cat-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2c3e50;
    padding: 0.3rem 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    margin-bottom: 0.3rem;
    word-wrap: break-word;
}

.service-group {
    margin-left: 0.5rem;
    margin-bottom: 0.3rem;
}

.group-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: #666;
    display: block;
    padding: 0.2rem 0.5rem;
    word-wrap: break-word;
}

.service-item {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem;
    cursor: pointer;
    border-radius: 4px;
    transition: background 0.15s;
}

.service-item:hover {
    background: #f0f7ff;
}

.service-item input[type="checkbox"] {
    width: auto;
    flex-shrink: 0;
    margin-top: 0.15rem;
}

.service-name {
    flex: 1;
    font-size: 0.9rem;
    min-width: 0;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.service-meta {
    font-size: 0.8rem;
    color: #888;
    white-space: normal;
    text-align: right;
    flex-shrink: 0;
}

/* Адаптивность таблиц: на маленьких экранах — горизонтальная прокрутка */
@media (max-width: 768px) {
    .card table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .card {
        overflow: hidden;
    }
}

/* Компактные телефоны: услуги в форме записи */
@media (max-width: 480px) {
    .service-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .service-meta {
        text-align: left;
        margin-top: 0.15rem;
    }

    .service-group {
        margin-left: 0;
    }

    .card {
        padding: 1rem;
    }

    /* Профиль: карточки в одну колонку на всю ширину */
    .flex > div {
        min-width: 100% !important;
    }
}

/* =========================================================
   МАСТЕРА — ФОТО ПО URL
   ========================================================= */
.master-card .avatar {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    margin: 0 auto 1rem;
    overflow: hidden;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    color: var(--noir);
    font-size: 2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}
.master-card .master-photo {
    padding: 0;
    background: transparent;
}
.master-card .master-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

/* =========================================================
   АДРЕСА — ЯНДЕКС.КАРТЫ
   ========================================================= */
.address-map {
    margin-top: 1rem;
    border-radius: var(--radius);
    overflow: hidden;
    min-height: 200px;
    background: var(--bg-section);
}
.address-map iframe,
.address-map ymaps {
    display: block;
    width: 100% !important;
    border: none !important;
}

/* =========================================================
   РЕДАКТИРОВАНИЕ ПОЛИТИКИ КОНФИДЕНЦИАЛЬНОСТИ
   ========================================================= */
.privacy-edit-form {
    margin-top: 2.5rem;
    padding: 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.privacy-edit-form h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
    color: var(--text-light);
}
.privacy-edit-form textarea {
    width: 100%;
    min-height: 300px;
    padding: 1rem;
    background: var(--bg-section);
    color: var(--text-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
}
.privacy-edit-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1rem;
}
.privacy-edit-actions .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.privacy-section-editor {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: var(--bg-section);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}
.privacy-section-editor label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.privacy-section-editor input[type="text"],
.privacy-section-editor input[type="number"],
.privacy-section-editor textarea {
    width: 100%;
    margin-bottom: 1rem;
    min-height: auto;
}
.privacy-section-editor textarea {
    min-height: 120px;
}
.privacy-section-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1.5rem;
}
.privacy-section-meta label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 0;
}
.privacy-section-meta input[type="number"] {
    width: 70px;
    margin-bottom: 0;
}
.privacy-section-new {
    border-style: dashed;
    background: transparent;
}
.privacy-section-new h3 {
    margin-top: 0;
    font-size: 1rem;
    color: var(--gold);
}

/* =========================================================
   БОКОВОЕ МЕНЮ ДЛЯ АДМИНИСТРАТОРОВ / МАСТЕРОВ (>=1100px)
   ========================================================= */
@media (min-width: 1100px) {
    body.has-side-nav .navbar .nav-links,
    body.has-side-nav .navbar .nav-toggle {
        display: none;
    }

}

/* =========================================================
   АНИМАЦИЯ ПЕРЕКЛЮЧЕНИЯ ТЕМЫ (круговая вспышка + вращение кнопки)
   ========================================================= */
.theme-burst {
    position: fixed;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
    margin-left: 0;
    margin-top: 0;
    border-radius: 50%;
    pointer-events: none;
    z-index: 100000;
    opacity: 0.55;
    transform: translate(-50%, -50%) scale(0);
    will-change: transform, opacity, width, height;
    transition:
        transform 0.75s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        opacity 0.55s ease-out 0.25s;
}

.theme-burst.expand {
    width: 240vmax;
    height: 240vmax;
    transform: translate(-50%, -50%) scale(1);
    opacity: 0;
}

.theme-toggle-btn,
#themeToggle {
    transition: transform 0.35s ease, background-color 0.25s ease;
}

.theme-toggle-anim {
    animation: theme-toggle-spin 0.45s ease-in-out;
}

@keyframes theme-toggle-spin {
    0% { transform: rotate(0deg) scale(1); }
    50% { transform: rotate(180deg) scale(1.15); }
    100% { transform: rotate(360deg) scale(1); }
}
