/* =====================================================================
   HAMMAM-STANDARDS.CSS
   Технический справочник по хаммамам
   Стиль: CAD Interface + Minimal Technical
   ===================================================================== */

/* ---- ПЕРЕМЕННЫЕ ---- */
:root {
    --color-white: #FFFFFF;
    --color-bg: #F7F8FA;
    --color-bg-alt: #EEF0F4;
    --color-border: #D1D5DB;
    --color-border-light: #E5E7EB;
    --color-text: #1F2937;
    --color-text-secondary: #6B7280;
    --color-text-muted: #9CA3AF;
    --color-blue-dark: #1E3A5F;
    --color-blue-primary: #2563EB;
    --color-blue-light: #3B82F6;
    --color-blue-bg: #EFF6FF;
    --color-cyan: #06B6D4;
    --color-cyan-bg: #ECFEFF;
    --color-green: #059669;
    --color-green-bg: #ECFDF5;
    --color-orange: #D97706;
    --color-orange-bg: #FFFBEB;
    --color-red: #DC2626;
    --color-red-bg: #FEF2F2;
    --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-mono: 'Roboto Mono', 'Consolas', 'Monaco', monospace;
    --nav-height: 48px;
    --topbar-height: 32px;
    --sidebar-width: 280px;
}

/* ---- СБРОС И БАЗОВЫЕ СТИЛИ ---- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    font-size: 15px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-primary);
    color: var(--color-text);
    background-color: var(--color-bg);
    line-height: 1.65;
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--color-blue-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

a:hover {
    color: var(--color-blue-dark);
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    color: var(--color-blue-dark);
    margin-top: 0;
    margin-bottom: 0.75em;
}

h1 { font-size: 2.1rem; }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.3rem; }
h4 { font-size: 1.1rem; }

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

ul, ol {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.4rem;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---- МОНОШИРНЫЙ ШРИФТ ДЛЯ ТЕХНИЧЕСКИХ ДАННЫХ ---- */
.mono, .spec-block code, .spec-block, .calc-result, .data-table td {
    font-family: var(--font-mono);
}

/* ---- ВЕРХНЯЯ ПАНЕЛЬ ---- */
.top-bar {
    background: var(--color-blue-dark);
    color: var(--color-white);
    height: var(--topbar-height);
    display: flex;
    align-items: center;
    font-size: 0.75rem;
    letter-spacing: 0.03em;
}

.top-bar-inner {
    display: flex;
    align-items: center;
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
}

.top-bar-label {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.7rem;
}

.top-bar-date, .top-bar-tag {
    color: rgba(255,255,255,0.7);
    font-size: 0.7rem;
}

.top-bar-divider {
    color: rgba(255,255,255,0.3);
}

/* ---- ОСНОВНАЯ НАВИГАЦИЯ ---- */
.main-nav-wrapper {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.main-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--nav-height);
    padding: 0 1.5rem;
}

.nav-left {
    flex-shrink: 0;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-blue-dark);
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: -0.02em;
}

.nav-logo:hover {
    color: var(--color-blue-primary);
    text-decoration: none;
}

.nav-logo-icon {
    width: 24px;
    height: 24px;
    stroke: var(--color-blue-primary);
}

.nav-center {
    flex: 1;
    display: flex;
    justify-content: center;
    padding: 0 1rem;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 0;
}

.nav-links > li {
    position: relative;
}

.nav-links > li > a {
    display: block;
    padding: 0.6rem 1rem;
    color: var(--color-text-secondary);
    font-size: 0.82rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    border-bottom: 2px solid transparent;
}

.nav-links > li > a:hover,
.nav-links > li.active > a,
.nav-links > li.has-sub.active > a {
    color: var(--color-blue-dark);
    border-bottom-color: var(--color-blue-primary);
    text-decoration: none;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-top: 2px solid var(--color-blue-primary);
    list-style: none;
    margin: 0;
    padding: 0.5rem 0;
    min-width: 220px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 1001;
}

/* СТАЛО (исправленный вариант): */
.dropdown:hover .dropdown-menu,
.dropdown.has-sub:hover .dropdown-menu {
    display: block;
}

.dropdown-menu li a {
    display: block;
    padding: 0.45rem 1.2rem;
    color: var(--color-text-secondary);
    font-size: 0.8rem;
    border-bottom: none;
}

.dropdown-menu li a:hover,
.dropdown-menu li.active a {
    color: var(--color-blue-primary);
    background: var(--color-blue-bg);
}

.nav-right {
    flex-shrink: 0;
}

.nav-version {
    font-family: var(--font-mono);
    font-size: 0.7rem;
    color: var(--color-text-muted);
}

/* ---- ОСНОВНОЙ LAYOUT ---- */
.page-wrapper {
    display: flex;
    min-height: calc(100vh - var(--topbar-height) - var(--nav-height));
}

/* ---- БОКОВАЯ ПАНЕЛЬ ---- */
.sidebar {
    width: var(--sidebar-width);
    flex-shrink: 0;
    background: var(--color-white);
    border-right: 1px solid var(--color-border-light);
    padding: 1.5rem 0;
    position: sticky;
    top: calc(var(--topbar-height) + var(--nav-height));
    height: calc(100vh - var(--topbar-height) - var(--nav-height));
    overflow-y: auto;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--color-border);
}

.sidebar-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    padding: 0 1.25rem;
    margin-bottom: 0.75rem;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 1.25rem;
    font-size: 0.82rem;
    color: var(--color-text-secondary);
    border-left: 2px solid transparent;
    transition: all 0.15s ease;
}

.sidebar-nav li a:hover {
    color: var(--color-blue-dark);
    background: var(--color-bg);
    border-left-color: var(--color-border);
    text-decoration: none;
}

.sidebar-nav li.active a {
    color: var(--color-blue-primary);
    border-left-color: var(--color-blue-primary);
    background: var(--color-blue-bg);
    font-weight: 500;
}

.sidebar-nav li a svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    opacity: 0.5;
}

.sidebar-section {
    margin-bottom: 0.5rem;
}

.sidebar-section-title {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-muted);
    padding: 0.75rem 1.25rem 0.3rem;
}

/* ---- КОНТЕНТНАЯ ОБЛАСТЬ ---- */
.content-area {
    flex: 1;
    min-width: 0;
    padding: 2rem 3rem 3rem;
    max-width: 100%;
}

/* ---- ПРАВАЯ ПАНЕЛЬ (PARAMETERS) ---- */
.params-panel {
    width: 240px;
    flex-shrink: 0;
    padding: 1.5rem 0 0 0;
    border-left: 1px solid var(--color-border-light);
}

.params-panel .spec-block {
    margin-bottom: 1.5rem;
}

/* ---- СПЕЦИФИКАЦИОННЫЕ БЛОКИ ---- */
.spec-block {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.spec-block-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-muted);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border-light);
}

.spec-block code {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--color-blue-dark);
    background: transparent;
    padding: 0;
}

.spec-grid {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.3rem 1rem;
}

.spec-grid dt {
    font-size: 0.78rem;
    color: var(--color-text-secondary);
    font-family: var(--font-mono);
}

.spec-grid dd {
    font-size: 0.85rem;
    color: var(--color-text);
    font-weight: 500;
}

/* ---- ТАБЛИЦЫ ---- */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

.data-table thead th {
    background: var(--color-blue-dark);
    color: var(--color-white);
    padding: 0.65rem 1rem;
    font-weight: 600;
    font-size: 0.78rem;
    text-align: left;
    letter-spacing: 0.02em;
    border: none;
}

.data-table tbody td {
    padding: 0.55rem 1rem;
    border-bottom: 1px solid var(--color-border-light);
    vertical-align: top;
}

.data-table tbody tr:hover {
    background: var(--color-bg-alt);
}

.data-table .mono {
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.table-responsive-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border-light);
}

.table-responsive-wrapper::-webkit-scrollbar {
    height: 4px;
}

.table-responsive-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-border);
}

/* ---- ТЕХНИЧЕСКИЕ КАРТОЧКИ ---- */
.tech-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.tech-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-blue-dark);
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--color-blue-primary);
}

/* ---- ИНФО-БЛОКИ ---- */
.info-block {
    border-left: 3px solid var(--color-blue-primary);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--color-blue-bg);
}

.info-block.warning {
    border-left-color: var(--color-orange);
    background: var(--color-orange-bg);
}

.info-block.danger {
    border-left-color: var(--color-red);
    background: var(--color-red-bg);
}

.info-block.success {
    border-left-color: var(--color-green);
    background: var(--color-green-bg);
}

.info-block-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
}

.info-block.warning .info-block-title { color: var(--color-orange); }
.info-block.danger .info-block-title { color: var(--color-red); }
.info-block.success .info-block-title { color: var(--color-green); }
.info-block .info-block-title { color: var(--color-blue-primary); }

/* ---- ЧЕРТЕЖНЫЕ СХЕМЫ (CSS-PLACEHOLDER) ---- */
.drawing-placeholder {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    min-height: 180px;
}

.drawing-placeholder::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image:
        linear-gradient(rgba(30,58,95,0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(30,58,95,0.04) 1px, transparent 1px);
    background-size: 20px 20px;
    pointer-events: none;
}

.drawing-caption {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ---- ФОРМУЛЫ ---- */
.formula-block {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border-light);
    padding: 1.25rem 1.5rem;
    margin: 1.5rem 0;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-align: center;
    color: var(--color-blue-dark);
    overflow-x: auto;
}

/* ---- СПИСОК ПРОВЕРОК ---- */
.checklist {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0;
}

.checklist li {
    padding: 0.5rem 0 0.5rem 2rem;
    position: relative;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border-light);
}

.checklist li::before {
    content: '☐';
    position: absolute;
    left: 0;
    top: 0.5rem;
    font-size: 1rem;
    color: var(--color-blue-primary);
}

/* ---- РАЗДЕЛИТЕЛИ ---- */
.tech-divider {
    height: 1px;
    background: var(--color-border);
    margin: 2rem 0;
    border: none;
}

/* ---- КАРТОЧКИ-ПРЕДСТАВЛЕНИЯ (ГЛАВНАЯ) ---- */
.section-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s ease;
}

.section-card:hover {
    border-color: var(--color-blue-primary);
}

.section-card-icon {
    width: 32px;
    height: 32px;
    color: var(--color-blue-primary);
    margin-bottom: 1rem;
}

.section-card h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.section-card p {
    font-size: 0.85rem;
    color: var(--color-text-secondary);
    margin-bottom: 0;
}

.section-card-link {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-blue-primary);
    margin-top: 0.75rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

/* ---- ХЛЕБНЫЕ КРОШКИ ---- */
.breadcrumbs {
    font-size: 0.78rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    padding: 0;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    align-items: center;
}

.breadcrumbs li::after {
    content: '›';
    margin-left: 0.5rem;
    color: var(--color-border);
}

.breadcrumbs li:last-child::after {
    content: '';
}

.breadcrumbs li a {
    color: var(--color-text-secondary);
}

.breadcrumbs li a:hover {
    color: var(--color-blue-primary);
}

.breadcrumbs li:last-child {
    color: var(--color-text);
    font-weight: 500;
}

/* ---- ПОДВАЛ ---- */
.site-footer {
    background: var(--color-blue-dark);
    color: rgba(255,255,255,0.7);
    padding: 2.5rem 0 1.5rem;
    font-size: 0.85rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-white);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.footer-desc {
    font-size: 0.82rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-version {
    font-family: var(--font-mono);
    font-size: 0.72rem;
    color: rgba(255,255,255,0.4);
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-links li {
    margin-bottom: 0.4rem;
}

.footer-links a {
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
}

.footer-links a:hover {
    color: var(--color-white);
    text-decoration: none;
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.25rem;
    text-align: center;
    font-size: 0.78rem;
    color: rgba(255,255,255,0.4);
}

/* ---- АДАПТИВНОСТЬ ---- */
@media (max-width: 1200px) {
    .params-panel {
        display: none;
    }
}

@media (max-width: 992px) {
    .sidebar {
        display: none;
    }

    .content-area {
        padding: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 1.5rem;
    }

    .nav-center {
        display: none;
    }
}

@media (max-width: 768px) {
    html {
        font-size: 14px;
    }

    .top-bar-inner {
        flex-wrap: wrap;
        gap: 0.2rem;
    }

    .content-area {
        padding: 1rem;
    }

    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .spec-grid {
        grid-template-columns: 1fr;
        gap: 0.2rem 0;
    }

    .spec-grid dt {
        margin-top: 0.5rem;
    }
}

@media (max-width: 480px) {
    .data-table {
        font-size: 0.78rem;
    }

    .data-table thead th,
    .data-table tbody td {
        padding: 0.4rem 0.6rem;
    }
}

/* ---- ПЕЧАТЬ ---- */
@media print {
    .top-bar, .main-nav-wrapper, .sidebar, .params-panel, .site-footer {
        display: none !important;
    }

    .content-area {
        padding: 0;
        max-width: none;
    }

    body {
        color: #000;
        background: #fff;
    }

    .spec-block, .tech-card, .info-block {
        border: 1px solid #ccc;
        break-inside: avoid;
    }
}




/* =====================================================================
   МОБИЛЬНОЕ МЕНЮ И АДАПТИВНОСТЬ
   ===================================================================== */

/* Стили для кнопки "Гамбургер" */
.mobile-toggle {
    display: none; /* Скрыта на десктопе */
    background: none;
    border: 1px solid var(--color-border);
    width: 36px;
    height: 36px;
    cursor: pointer;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    padding: 0;
    margin-right: 10px;
}

.mobile-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background-color: var(--color-blue-dark);
    transition: all 0.3s ease;
}

/* Оверлей мобильного меню */
.mobile-menu-overlay {
    position: fixed;
    top: var(--topbar-height);
    left: 0;
    width: 100%;
    background-color: var(--color-white);
    border-bottom: 2px solid var(--color-blue-primary);
    z-index: 999;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease-in-out;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.mobile-menu-overlay.is-open {
    max-height: 500px; /* Достаточно для списка */
	padding-top: 33px;
}

.mobile-menu-content {
    display: flex;
    flex-direction: column;
    padding: 1rem 0;
}

.mobile-link {
    display: block;
    padding: 1rem 1.5rem;
    font-family: var(--font-primary);
    font-size: 1rem;
    color: var(--color-text);
    text-decoration: none;
    border-bottom: 1px solid var(--color-border-light);
}

.mobile-link:last-child {
    border-bottom: none;
}

.mobile-link.active {
    background-color: var(--color-blue-bg);
    color: var(--color-blue-primary);
    font-weight: 600;
    padding-left: 2rem; /* Сдвиг для активного */
    border-left: 3px solid var(--color-blue-primary);
}

/* Анимация гамбургера при открытии */
.mobile-toggle.is-active span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.mobile-toggle.is-active span:nth-child(2) {
    opacity: 0;
}
.mobile-toggle.is-active span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* =====================================================================
   MEDIA QUERIES
   ===================================================================== */

@media (max-width: 992px) {
    /* Скрываем десктопное меню */
    .nav-center {
        display: none;
    }

    /* Показываем кнопку гамбургера */
    .mobile-toggle {
        display: flex;
    }

    /* Адаптация футера */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 576px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }
    
    .top-bar-inner {
        justify-content: center;
    }
    .top-bar-label {
        font-size: 0.65rem;
    }
}
