:root {
    --header-height: 76px;
    --header-radius: 16px;
    --header-bg: var(--header-background, rgba(15, 23, 42, 0.85));
    --header-border: var(--header-border-color, rgba(255, 255, 255, 0.08));
    --header-text: var(--header-text-color, var(--neutral-50, #e2e8f0));
    --header-muted: var(--header-muted-color, var(--neutral-200, #cbd5e1));
    --panel-bg: rgba(12, 17, 30, 0.96);
    --shadow-elevated: 0 20px 50px rgba(0, 0, 0, 0.35);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--background-default, #0f172a);
    color: var(--header-text);
}

.theme-shell {
    min-height: 100vh;
    background: var(--background-default, #0f172a);
    color: var(--header-text);
}

body.nav-open {
    overflow: hidden;
}

.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(12px); background: var(--header-bg); border-bottom: 1px solid var(--header-border); }

.site-header__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px; max-width: 1200px; margin: 0 auto; }

.site-header--with-hero { background-image: linear-gradient(120deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.6)), var(--header-hero-image); background-size: cover; background-position: center; border-color: transparent; }

.site-header--centered:not(.site-header--with-hero) { background: var(--header-bg); border-bottom: 1px solid var(--header-border); }

body[data-header-transparent="true"] .site-header { background: transparent; border: none; background-image: none; }
body[data-header-transparent="true"] .site-header--with-hero { background-image: none; }

.site-header--centered .site-header__bar { background: #fff; color: #0f172a; border-radius: 18px; box-shadow: 0 14px 60px rgba(15, 23, 42, 0.18); padding: 14px 18px; }

.site-header__bar--centered { gap: 12px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; }
.site-header__column--nav { display: flex; align-items: center; gap: 12px; }
.site-header__column--brand { justify-self: center; }
.site-header__column--actions { display: flex; justify-content: flex-end; }

.brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--header-text);
    font-weight: 700;
    letter-spacing: 0.01em;
}
.brand--centered { position: relative; background: #f8fafc; padding: 12px 16px; border-radius: 16px; box-shadow: 0 12px 36px rgba(15, 23, 42, 0.14); border: 1px solid #e2e8f0; }

.brand__logo {
    height: var(--logo-height-desktop, 34px);
    width: auto;
    object-fit: contain;
}
.brand--centered .brand__logo { height: max(var(--logo-height-desktop, 34px), 46px); }

.brand__logo--dark {
    display: none;
}

[data-theme="dark"] .brand__logo--dark {
    display: block;
}

[data-theme="dark"] .brand__logo--light {
    display: none;
}

@media (max-width: 768px) {
  .brand__logo { height: var(--logo-height-mobile, var(--logo-height-desktop, 34px)); }
  .brand--centered .brand__logo { height: var(--logo-height-mobile, max(var(--logo-height-desktop, 34px), 46px)); }
}

.brand__text {
    font-size: 18px;
}

.primary-nav {
    display: none;
    align-items: center;
    margin-left: 24px;
    flex: 1;
}

.nav-list {
    display: flex;
    align-items: center;
    gap: 20px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-list--tight { gap: 14px; }

.nav-item {
    position: relative;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--header-text);
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s ease, color 0.2s ease;
}
.site-header--centered .nav-link { color: #111827; border-radius: 999px; padding: 12px 14px; white-space: nowrap; font-size: clamp(12px, 1vw + 8px, 14px); line-height: 1.1; }

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
}
.site-header--centered .nav-link:hover { background: #f1f5f9; color: #0f172a; }

.nav-submenu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    min-width: 220px;
    padding: 12px;
    margin: 0;
    list-style: none;
    border-radius: 14px;
    background: var(--panel-bg);
    border: 1px solid var(--header-border);
    box-shadow: var(--shadow-elevated);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 20;
}

.nav-item--has-children:hover .nav-submenu,
.nav-item--has-children:focus-within .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.nav-submenu__item + .nav-submenu__item {
    margin-top: 6px;
}

.nav-submenu__link {
    display: block;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: var(--header-text);
    font-weight: 500;
}

.nav-submenu__link:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.header-actions--centered { margin-left: 0; justify-content: flex-end; gap: 12px; align-items: stretch; }

.header-actions__phones { display: inline-flex; align-items: center; gap: 10px; padding-right: 12px; border-right: 1px solid #e2e8f0; }

.header-phone { display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: #f8fafc; color: #0f172a; text-decoration: none; box-shadow: inset 0 0 0 1px #e2e8f0, 0 10px 30px rgba(15, 23, 42, 0.08); font-weight: 700; }

.header-phone__icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 50%; background: #e0f2fe; color: #0ea5e9; }

.header-phone__text { display: grid; gap: 2px; }

.header-phone__label { font-size: 12px; color: #475569; letter-spacing: 0.01em; }

.header-phone__number { font-size: 15px; color: #0f172a; font-weight: 800; }

.header-actions__inline { display: inline-flex; align-items: center; gap: 10px; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 14px;
    border-radius: 12px;
    border: 1px solid transparent;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn--primary {
    background: linear-gradient(120deg, var(--primary, #6366f1), var(--accent, #ec4899));
    color: #fff;
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.25);
}

.btn--primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(99, 102, 241, 0.32);
}

.btn--ghost {
    border-color: var(--header-border);
    color: var(--header-text);
    background: rgba(255, 255, 255, 0.04);
}

.btn--ghost:hover {
    background: rgba(255, 255, 255, 0.08);
}

.language-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    padding: 8px 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--header-border);
    color: var(--header-text);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    font-size: 12px;
}

.burger {
    display: inline-flex;
    flex-direction: column;
    gap: 5px;
    padding: 10px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--header-border);
    cursor: pointer;
}

.burger__line {
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: var(--header-text);
    display: block;
}
@media (max-width: 959px) {
    .header-actions__phones {
        display: none;
    }
    .header-actions--centered {
        gap: 10px;
    }
    .site-header__column--actions {
        align-items: stretch;
    }
}

.primary-nav,
.header-actions .language-chip {
    display: none;
}

.mobile-panel {
    position: fixed;
    inset: 0;
    background: var(--panel-bg);
    transform: translateY(-110%);
    transition: transform 0.25s ease, opacity 0.25s ease;
    z-index: 120;
    padding: 18px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: var(--shadow-elevated, 0 20px 50px rgba(0, 0, 0, 0.35));
    backdrop-filter: blur(10px);
}

.mobile-panel.is-open,
body.nav-open .mobile-panel {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.mobile-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
}

.mobile-panel__meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-close {
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--header-border);
    border-radius: 10px;
    color: var(--header-text);
    padding: 10px 12px;
    cursor: pointer;
}

.mobile-nav,
.mobile-subnav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.mobile-nav__item + .mobile-nav__item {
    margin-top: 6px;
}

.mobile-nav__link { display: flex; align-items: center; gap: 10px; padding: 12px; border-radius: 12px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--header-border); color: var(--header-text); font-weight: 600; text-decoration: none; }

.mobile-nav__link .nav-item__icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: rgba(255, 255, 255, 0.05); flex-shrink: 0; font-size: 18px; }

.mobile-subnav {
    margin-top: 6px;
    padding-left: 12px;
}

.mobile-subnav__item + .mobile-subnav__item {
    margin-top: 4px;
}

.mobile-subnav__link {
    display: block;
    padding: 10px 12px;
    border-radius: 10px;
    color: var(--header-text);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.02);
}

.mobile-ctas {
    display: grid;
    gap: 10px;
    margin-top: 18px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media (min-width: 960px) {
    .site-header__bar {
        padding: 18px 28px;
        gap: 24px;
    }

    .site-header__bar--centered { display: grid; grid-template-columns: 1fr auto 1fr; }

    .site-header__column--nav { justify-self: start; }

    .site-header__column--actions { justify-self: end; }

    .primary-nav {
        display: flex;
    }

    .primary-nav--centered { justify-content: flex-end; }

    .header-actions {
        gap: 14px;
    }

    .header-actions .language-chip {
        display: inline-flex;
    }

.burger {
    display: none;
}

.mobile-panel {
    display: none;
}
}

.cms-debug-widget {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 1200;
}

.cms-debug-toggle {
    align-self: flex-end;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, #0ea5e9, #2563eb);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cms-debug-toggle:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.25);
}

.cms-debug-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.75rem;
    height: 1.75rem;
    padding: 0 0.35rem;
    border-radius: 999px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.85rem;
    line-height: 1;
}

.cms-debug-panel {
    position: fixed;
    bottom: 4.5rem;
    right: 1.5rem;
    width: min(420px, 92vw);
    max-height: 70vh;
    background: #0b1224;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.cms-debug-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    background: rgba(255, 255, 255, 0.02);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    gap: 0.75rem;
}

.cms-debug-panel__title {
    margin: 0;
    font-weight: 700;
    font-size: 1rem;
}

.cms-debug-panel__subtitle {
    margin: 0.15rem 0 0;
    color: #cbd5e1;
    font-size: 0.85rem;
}

.cms-debug-close {
    background: transparent;
    color: #e2e8f0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    cursor: pointer;
}

.cms-debug-panel__body {
    padding: 1rem;
    overflow: auto;
    display: grid;
    gap: 0.75rem;
}

.cms-debug-entry {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    padding: 0.75rem 0.85rem;
    display: grid;
    gap: 0.5rem;
}

.cms-debug-entry__header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.cms-debug-entry__index {
    background: rgba(99, 102, 241, 0.25);
    color: #c7d2fe;
    padding: 0.2rem 0.5rem;
    border-radius: 8px;
    font-weight: 700;
}

.cms-debug-entry__message {
    font-weight: 600;
    color: #e2e8f0;
}

.cms-debug-entry--meta {
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.25);
}

.cms-debug-meta {
    display: grid;
    gap: 0.35rem;
    font-size: 0.95rem;
    color: #cbd5e1;
}

.cms-debug-meta__line {
    margin: 0;
    line-height: 1.4;
}

.cms-debug-entry__time {
    margin-left: auto;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
    font-size: 0.85rem;
    color: #94a3b8;
}

.cms-debug-entry__context {
    margin: 0;
    padding: 0.65rem;
    background: #0f172a;
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #cbd5e1;
    font-size: 0.9rem;
    white-space: pre-wrap;
}

.cms-debug-empty {
    margin: 0;
    color: #cbd5e1;
    text-align: center;
    padding: 1rem 0;
}

@media (max-width: 768px) {
    .cms-debug-panel {
        right: 0.75rem;
        left: 0.75rem;
        width: auto;
    }

    .cms-debug-widget {
        right: 0.75rem;
        bottom: 1rem;
    }
}
