/* --- 1. SETTINGS & THEME --- */
@font-face {
    font-family: 'Mustica Pro';
    src: url('../fonts/MusticaPro-SemiBold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
}

:root {
    --header-h: 90px;
    --font-ui: 'Manrope', sans-serif;
    --font-display: 'Mustica Pro', sans-serif;
}

[data-theme="dark"] {
    --bg-body: #050505;
    --bg-surface: #111111;
    --bg-glass: rgba(5, 5, 5, 0.85);
    --text-main: #ffffff;
    --text-secondary: #888888;
    --border: rgba(255, 255, 255, 0.12);
    --accent: #ffffff;
    --accent-inv: #000000;
    --bg-code: #0f0f0f;
    --border-code: #333;
    --text-code: #e0e0e0;
    --bg-badge: rgba(255, 255, 255, 0.08);
    --bg-badge-hover: rgba(255, 255, 255, 0.15);
}

[data-theme="light"] {
    --bg-body: #F4F4F4;
    --bg-surface: #ffffff;
    --bg-glass: rgba(244, 244, 244, 0.9);
    --text-main: #111111;
    --text-secondary: #666666;
    --border: rgba(0, 0, 0, 0.1);
    --accent: #000000;
    --accent-inv: #ffffff;
    --bg-code: #f1f1f1;
    --border-code: #dcdcdc;
    --text-code: #333;
    --bg-badge: rgba(0, 0, 0, 0.06);
    --bg-badge-hover: rgba(0, 0, 0, 0.12);
}

/* --- 2. RESET & BASE --- */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    -webkit-tap-highlight-color: transparent; 
}

body {
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-ui);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.3s, color 0.3s;
}

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

.container { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 40px; 
}

/* --- 3. TYPOGRAPHY --- */
h1, h2, h3, h4 { 
    font-family: var(--font-display); 
    line-height: 1.1; 
    font-weight: 500; 
}

.section-title {
    font-size: 2.2rem; 
    margin-bottom: 40px; 
    display: flex; 
    align-items: center; 
    gap: 20px;
}

.section-title::after { 
    content: ''; 
    height: 1px; 
    flex-grow: 1; 
    background: var(--border); 
}

.view-link { 
    font-size: 0.9rem; 
    border-bottom: 1px solid var(--border); 
    padding-bottom: 2px; 
    white-space: nowrap; 
}

/* --- 4. HEADER (общий для всех страниц) --- */
.header {
    position: fixed; 
    top: 0; 
    left: 0; 
    width: 100%; 
    height: var(--header-h);
    display: flex; 
    align-items: center; 
    z-index: 1000;
    backdrop-filter: blur(12px); 
    -webkit-backdrop-filter: blur(12px);
    background: var(--bg-glass); 
    border-bottom: 1px solid var(--border);
}

.header-inner { 
    display: flex; 
    justify-content: space-between; 
    align-items: center; 
    width: 100%; 
}

.logo { 
    font-family: 'Space Grotesk', sans-serif !important; 
    font-size: 1.5rem; 
    font-weight: 600; 
    letter-spacing: -0.02em; 
}

/* Desktop Menu */
.nav-menu {
    display: flex; 
    gap: 4px;
    background: var(--bg-surface); 
    padding: 5px;
    border-radius: 100px; 
    border: 1px solid var(--border);
}

.nav-link {
    padding: 10px 24px; 
    font-size: 0.9rem; 
    color: var(--text-secondary); 
    border-radius: 50px; 
    transition: 0.2s;
}

.nav-link:hover { 
    color: var(--text-main); 
}

.nav-link.active {
    background: var(--bg-body); 
    color: var(--text-main);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08); 
    font-weight: 500;
}

/* Controls */
.header-actions { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}

.icon-btn {
    width: 44px; 
    height: 44px; 
    border-radius: 50%;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    color: var(--text-main);
    display: flex; 
    align-items: center; 
    justify-content: center;
    cursor: pointer; 
    transition: 0.2s;
}

.icon-btn:hover { 
    border-color: var(--text-secondary); 
    transform: scale(1.05); 
}

.auth-btn {
    padding: 10px 24px; 
    background: var(--accent); 
    color: var(--accent-inv);
    border-radius: 50px; 
    font-weight: 600; 
    font-size: 0.9rem; 
    border: none; 
    cursor: pointer;
}

/* Скрываем кнопку входа на мобильном (она будет в бургере) */
.desktop-auth { 
    display: block; 
}

.burger-btn { 
    display: none; 
    font-size: 1.5rem; 
    background: none; 
    border: none; 
    color: var(--text-main); 
    cursor: pointer; 
}

/* --- 5. MOBILE MENU --- */
.mobile-menu {
    position: fixed;
    top: var(--header-h);
    left: 0;
    width: 100%;
    height: calc(100dvh - var(--header-h));
    min-height: calc(100vh - var(--header-h));
    background: var(--bg-body);
    z-index: 990;
    padding: 40px 24px 100px 24px;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 20px;
    overflow-y: auto;
}

.mobile-menu.open { 
    transform: translateX(0); 
}

.mobile-link {
    font-family: var(--font-display);
    font-size: 2rem;
    border-bottom: 1px solid var(--border);
    padding-bottom: 15px;
    color: var(--text-main);
}

.mobile-auth-btn {
    margin-top: auto;
    width: 100%;
    text-align: center;
    padding: 16px;
    background: var(--accent);
    color: var(--accent-inv);
    border-radius: 50px;
    font-weight: 600;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    flex-shrink: 0;
}

/* --- 6. HERO (главная страница) --- */
.hero { 
    padding: 200px 0 120px; 
    max-width: 1100px; 
}

.hero-label {
    font-family: var(--font-ui); 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    letter-spacing: 0.1em; 
    color: var(--text-secondary); 
    margin-bottom: 24px; 
    display: block;
}

.hero h1 {
    font-size: clamp(3rem, 6vw, 5.5rem); 
    margin-bottom: 30px; 
    letter-spacing: -0.03em;
}

.hero p {
    font-size: 1.3rem; 
    color: var(--text-secondary); 
    max-width: 750px; 
    line-height: 1.6; 
    margin-bottom: 50px;
}

/* Stats Block */
.hero-stats {
    display: flex; 
    gap: 60px; 
    border-top: 1px solid var(--border); 
    padding-top: 40px;
}

.stat-item span { 
    display: block; 
    font-size: 2.5rem; 
    font-family: var(--font-display); 
    font-weight: 500; 
    margin-bottom: 4px; 
}

.stat-item small { 
    color: var(--text-secondary); 
    font-size: 0.85rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
}

/* --- 7. GRIDS & CARDS (универсальные) --- */
.grid-2 { 
    display: grid; 
    grid-template-columns: 1fr 1fr; 
    gap: 30px; 
    margin-bottom: 120px; 
}

.card {
    background: var(--bg-surface); 
    border: 1px solid var(--border);
    border-radius: 24px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column;
    transition: transform 0.3s, border-color 0.3s; 
    cursor: pointer;
}

.card:hover { 
    transform: translateY(-6px); 
    border-color: var(--text-secondary); 
}

.card-img {
    height: 320px; 
    background: #161616; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    border-bottom: 1px solid var(--border);
}

.card-img i { 
    font-size: 4rem; 
    color: rgba(255,255,255,0.1); 
}

.card-body { 
    padding: 32px; 
    flex-grow: 1; 
    display: flex; 
    flex-direction: column; 
    justify-content: space-between; 
}

.card-tag { 
    font-size: 0.75rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em; 
    color: var(--text-secondary); 
    margin-bottom: 12px; 
}

.card h3 { 
    font-size: 1.8rem; 
    margin-bottom: 12px; 
}

.card p { 
    color: var(--text-secondary); 
    font-size: 1rem; 
    margin-bottom: 24px; 
}

/* Репозиторий (сетка карточек) */
.repo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 80px;
}

.repo-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex; 
    flex-direction: column;
    height: 100%;
    position: relative;
    transition: transform 0.2s, border-color 0.2s;
}

.repo-card:hover {
    transform: translateY(-4px);
    border-color: var(--text-secondary);
}

.repo-card-top { 
    display: flex; 
    justify-content: space-between; 
    align-items: flex-start; 
    margin-bottom: 16px; 
}

.repo-icon-box {
    width: 44px; 
    height: 44px;
    background: rgba(255,255,255,0.05);
    border-radius: 10px;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.4rem; 
    color: var(--text-main);
}

/* Кейсы (сетка) */
.cases-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 24px;
    margin-bottom: 60px;
}

.case-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.case-card:hover {
    transform: translateY(-4px);
    border-color: var(--text-secondary);
}

.case-card-img {
    height: 200px;
    background: #000;
    overflow: hidden;
    position: relative;
}

.case-card-img img {
    width: 100%; 
    height: 100%; 
    object-fit: cover;
    transition: transform 0.5s ease;
}

.case-card:hover .case-card-img img { 
    transform: scale(1.05); 
}

.case-card-body {
    padding: 24px;
    flex-grow: 1;
    display: flex; 
    flex-direction: column;
}

.case-tags {
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    margin-bottom: 12px;
}

.case-tag {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 4px;
    background: rgba(125,125,125,0.1);
    color: var(--text-secondary);
    font-weight: 500;
}

.case-card h3 {
    font-size: 1.4rem; 
    margin-bottom: 12px;
    color: var(--text-main); 
    line-height: 1.3;
}

.case-card p {
    color: var(--text-secondary); 
    font-size: 0.95rem; 
    line-height: 1.6;
    margin-bottom: 20px; 
    flex-grow: 1;
}

.case-link {
    display: inline-flex; 
    align-items: center; 
    gap: 6px;
    color: var(--text-main); 
    font-weight: 600; 
    text-decoration: none;
    margin-top: auto;
}

.case-link:hover { 
    text-decoration: underline; 
}

/* Универсальная растянутая ссылка для карточек */
.stretched-link::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    cursor: pointer;
}

/* --- 8. FOOTER --- */
.footer { 
    padding: 80px 0 40px; 
    border-top: 1px solid var(--border); 
    background: var(--bg-surface); 
}

.footer-grid { 
    display: grid; 
    grid-template-columns: 1fr 2fr; 
    gap: 60px; 
    margin-bottom: 60px; 
}

.footer-links { 
    display: flex; 
    gap: 80px; 
    flex-wrap: wrap; 
}

.footer-col h4 { 
    font-size: 1rem; 
    margin-bottom: 24px; 
    color: var(--text-main); 
}

.footer-col a { 
    display: block; 
    color: var(--text-secondary); 
    margin-bottom: 14px; 
    font-size: 0.95rem; 
}

.footer-col a:hover { 
    color: var(--text-main); 
}

.footer-bottom {
    display: flex; 
    justify-content: space-between; 
    color: var(--text-secondary); 
    font-size: 0.9rem;
    border-top: 1px solid var(--border); 
    padding-top: 30px;
}

/* --- 9. PAGE HEADER & FILTERS (внутренние страницы) --- */
.page-header {
    padding: 150px 0 50px;
    max-width: 900px;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    line-height: 1.2;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.page-header p {
    font-size: 1.1rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 650px;
}

.filter-section {
    margin-bottom: 60px;
}

.search-input {
    width: 100%;
    max-width: 400px;
    padding: 16px 24px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    color: var(--text-main);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s, background 0.2s;
}

.search-input:hover {
    border-color: var(--text-secondary);
}

.search-input:focus {
    border-color: var(--text-main);
    outline: none;
}

/* --- 10. UPDATES / BLOG LIST STYLES --- */
/* Updates Section (главная страница) */
.updates-section { 
    margin-bottom: 100px; 
}

.update-row {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    padding: 24px 0; 
    border-bottom: 1px solid var(--border);
    transition: padding 0.2s;
}

.update-row:hover { 
    padding-left: 10px; 
    padding-right: 10px; 
    background: var(--bg-surface); 
    border-radius: 8px; 
    border-color: transparent; 
}

.update-info h4 { 
    font-size: 1.2rem; 
    margin-bottom: 6px; 
    font-weight: 500; 
}

.update-meta { 
    color: var(--text-secondary); 
    font-size: 0.9rem; 
}

.btn-arrow { 
    width: 40px; 
    height: 40px; 
    border: 1px solid var(--border); 
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
}

.update-row .btn-arrow {
    flex-shrink: 0;
    
    width: 40px;
    height: 40px;
    
    min-width: 40px; 
    min-height: 40px;
    
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.update-row > div:first-child {
    min-width: 0;
    flex: 1;
    padding-right: 12px;
}

/* Blog List Cards (blog.html) */
.blog-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.blog-date {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
}

/* Контент карточки (использует общие .card-body стили) */
.card-body h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    line-height: 1.2;
}

.card-body p {
    margin-bottom: 24px;
    color: var(--text-secondary);
    line-height: 1.5;
}

.blog-card-footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
}

.view-link-simple {
    font-size: 0.95rem;
    color: var(--text-main);
    border-bottom: 1px solid var(--border);
    padding-bottom: 2px;
    transition: 0.2s;
}

.view-link-simple:hover {
    border-color: var(--text-main);
}

.blog-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tag-hash {
    font-size: 0.75rem;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 10px;
    border-radius: 4px;
    transition: 0.2s;
}

.tag-hash:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-main);
}

/* --- 11. ARTICLE / MARKDOWN BODY (общий для постов, кейсов, продукта) --- */
.article-body {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.article-img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 30px 0;
    border: 1px solid var(--border);
}

.article-body h2, 
.article-body h3 {
    color: var(--text-main);
    margin-top: 40px;
    margin-bottom: 16px;
}

.article-body ul {
    color: var(--text-main);
    list-style: disc;
    margin-left: 20px;
    margin-bottom: 24px;
}

/* Полные markdown-стили */
.markdown-body {
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-size: 1.05rem;
    line-height: 1.75;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
    color: var(--text-main);
    font-family: var(--font-display);
    margin: 40px 0 16px;
}

.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
    color: var(--text-main);
    font-family: var(--font-display);
    margin-top: 32px;
    margin-bottom: 12px;
    font-weight: 600;
    line-height: 1.4;
}

.markdown-body > *:first-child {
    margin-top: 0 !important;
}

.markdown-body p {
    margin-bottom: 24px;
}

.markdown-body ul,
.markdown-body ol {
    margin: 0 0 24px 20px;
    color: var(--text-secondary);
}

.markdown-body li {
    color: var(--text-secondary);
}

.markdown-body li::marker {
    color: color-mix(in srgb, var(--text-secondary) 70%, transparent);
}

.markdown-body blockquote {
    margin: 32px 0;
    padding-left: 16px;
    border-left: 3px solid var(--accent);
    color: var(--accent);
    opacity: 0.95;
}

.markdown-body blockquote strong {
    color: var(--text-main);
}

.markdown-body table {
    width: 100%;
    margin: 32px 0;
    border-collapse: separate;
    border-spacing: 0;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
}

.markdown-body th,
.markdown-body td {
    padding: 12px 16px;
    text-align: left;
    border: none;
    box-shadow:
        inset -1px 0 0 var(--border),
        inset 0 -1px 0 var(--border);
}

.markdown-body th:last-child,
.markdown-body td:last-child {
    box-shadow: inset 0 -1px 0 var(--border);
}

.markdown-body tr:last-child td {
    box-shadow: inset -1px 0 0 var(--border);
}

.markdown-body tr:last-child td:last-child {
    box-shadow: none;
}

.markdown-body th {
    background: color-mix(in srgb, var(--bg-surface) 85%, var(--bg-body));
    color: var(--text-main);
    font-weight: 600;
}

.markdown-body tbody tr:hover {
    background: var(--bg-badge);
}

.markdown-body pre {
    background: var(--bg-code);
    border: 1px solid var(--border-code);
    border-radius: 12px;
    padding: 16px;
    margin: 32px 0;
    overflow-x: auto;
}

.markdown-body pre code {
    background: none !important;
    border: none;
    padding: 0;
    color: var(--text-code);
    font-size: 0.9rem;
    line-height: 1.6;
    display: block;
    white-space: pre;
}

.markdown-body :not(pre) > code {
    background: var(--bg-code);
    border: 1px solid var(--border-code);
    color: var(--text-code);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

.markdown-body hr {
    border: none;
    height: 1px;
    margin: 48px 0;
    background: linear-gradient(to right, transparent, var(--border), transparent);
}

/* Гиперссылки */
.article-body a,
.markdown-body a {
    color: var(--text-main);
    text-decoration: underline;
    text-decoration-color: rgba(255, 255, 255, 0.3);
    text-underline-offset: 4px;
    text-decoration-thickness: 1px;
    transition: all 0.2s ease;
    font-weight: 500;
}

[data-theme="light"] .article-body a,
[data-theme="light"] .markdown-body a {
    text-decoration-color: rgba(0, 0, 0, 0.3);
}

.article-body a:hover,
.markdown-body a:hover {
    text-decoration-color: var(--text-main); 
    opacity: 0.8;
}

/* Спойлеры */
details {
    margin-top: 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--bg-surface);
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
}

summary {
    padding: 16px 20px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    list-style: none;
    user-select: none;
}

summary::-webkit-details-marker { 
    display: none; 
}

summary i {
    font-size: 1.3rem;
    font-weight: normal !important;
    color: var(--text-main);
    flex-shrink: 0;
    width: 32px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

summary::after {
    content: '\EA4E';
    font-family: 'remixicon';
    font-size: 1.2rem;
    color: var(--text-secondary);
    transition: transform 0.2s;
    margin-left: auto;
    flex-shrink: 0;
}

details[open] summary::after { 
    transform: rotate(180deg); 
}

.spoiler-content {
    padding: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-secondary);
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Блоки кода (универсальные) */
.code-block {
    background: var(--bg-code);
    border: 1px solid var(--border-code);
    border-radius: 8px;
    margin: 16px 0;
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 16px;
    background: rgba(125, 125, 125, 0.08);
    border-bottom: 1px solid var(--border-code);
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 600;
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 8px;
    border-radius: 4px;
    transition: 0.2s;
    font-family: var(--font-ui);
}

.copy-btn:hover {
    color: var(--text-main);
    background: rgba(125,125,125, 0.1);
}

.code-content {
    display: block;
    padding: 16px;
    margin: 0;
    overflow-x: auto;
    width: 100%;
    color: var(--text-code);
    font-family: 'Menlo', 'Consolas', monospace;
    font-size: 0.85rem;
    line-height: 1.5;
    white-space: pre;
}

code {
    font-family: 'Menlo', 'Consolas', monospace;
    background: var(--bg-code);
    border: 1px solid var(--border-code);
    color: var(--text-main);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    word-break: break-all;
}

/* =========================================
   FIX: MARKDOWN IMAGES
   ========================================= */

.markdown-body img,
.article-body img,
.case-content-body img {
    max-width: 100%;
    height: auto;
    display: block;
    
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 30px 0;
    
    cursor: zoom-in;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

@media (max-width: 768px) {
    .markdown-body img {
        margin: 20px 0;
    }
}

@media (max-width: 1024px) {
    .settings-grid {
        padding-top: 20px !important;
    }
}

/* =========================================
 * FIX: PADDING FOR MOBILE CONTENT
 * ========================================= */
@media (max-width: 768px) {
    .article-body, 
    .markdown-body,
    #prod-instructions,
    #case-content,
    #post-content {
        padding-left: 16px;
        padding-right: 16px;
        box-sizing: border-box; 
    }

    .article-body table,
    .markdown-body table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* =========================================
 * MOBILE TABS FIX (FINAL)
 * ========================================= */
@media (max-width: 768px) {
    .product-grid-layout {
        display: block !important;
        width: 100% !important;
        gap: 0 !important;
    }

    #tab-docs, 
    #tab-about, 
    #tab-download,
    .product-content.tab-content {
        box-sizing: border-box !important;
        width: 100% !important;
    }

    #prod-instructions,
    #prod-desc,
    .article-body {
        padding-left: 0 !important;
        padding-right: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }

    #tab-docs h2,
    #tab-about header h1 {
        margin-left: 0 !important;
    }
    
    pre, code {
        max-width: 100%;
        overflow-x: auto;
        white-space: pre-wrap;
        word-wrap: break-word;
    }
}

/* =========================================
 * CUSTOM TEXT SELECTION
 * ========================================= */

::selection {
    background-color: var(--text-main);
    color: var(--bg-body);
    text-shadow: none;
}

::-moz-selection {
    background-color: var(--text-main);
    color: var(--bg-body);
}

input::selection, 
textarea::selection {
    background-color: var(--text-main);
    color: var(--bg-body);
}

/* =========================================
 * CODEMIRROR (ADMIN) SELECTION FIX — V2
 * ========================================= */

.CodeMirror-selectedtext {
    color: inherit !important;
    background: none !important;
}

.CodeMirror-selected {
    background-color: rgba(255, 255, 255, 0.2) !important;
}

[data-theme="light"] .CodeMirror-selected {
    background-color: rgba(0, 0, 0, 0.1) !important;
}

.CodeMirror-cursor {
    border-left: 2px solid var(--text-main) !important;
}

.CodeMirror-line ::selection {
    background-color: rgba(255, 255, 255, 0.2);
}
[data-theme="light"] .CodeMirror-line ::selection {
    background-color: rgba(0, 0, 0, 0.1);
}

.CodeMirror-line ::selection {
    background-color: var(--text-main) !important;
    color: var(--bg-body) !important;
}

/* =========================================
 * 11. ARTICLE & DOCUMENTATION TYPOGRAPHY 
 * ========================================= */

.article-body, 
.markdown-body {
    font-family: var(--font-ui);
    font-size: 1.05rem;
    line-height: 1.75;
    color: var(--text-secondary);
}

.article-body p,
.markdown-body p {
    margin-bottom: 24px;
}

.article-body h2, .markdown-body h2,
.article-body h3, .markdown-body h3,
.article-body h4, .markdown-body h4 {
    color: var(--text-main);
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.3;
    
    margin-top: 48px;
    margin-bottom: 16px;
}

.article-body > *:first-child,
.markdown-body > *:first-child {
    margin-top: 0 !important;
}

.article-body ul, .markdown-body ul,
.article-body ol, .markdown-body ol {
    margin-top: 0;
    margin-bottom: 24px;
    padding-left: 5px;
    list-style-position: outside; 
}

.article-body li, .markdown-body li {
    margin-bottom: 8px;
    padding-left: 4px;
}

.article-body li ul, .markdown-body li ul,
.article-body li ol, .markdown-body li ol {
    margin-top: 8px;
    margin-bottom: 8px;
}

.article-body hr, 
.markdown-body hr {
    border: 0;
    height: 1px;
    background: var(--border);
    margin: 40px 0;
    display: block;
}

/* .article-body pre, 
.markdown-body pre {
    margin: 24px 0;
    border-radius: 12px;
    border: 1px solid var(--border-code);
    background: var(--bg-code);
} */

/* --- 12. SOCIAL ACTIONS & COMMENTS --- */
.post-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}

.action-btn,
.like-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border);
    height: 40px;
    padding: 0 16px;
    border-radius: 50px;
    color: var(--text-main);
    cursor: pointer;
    transition: 0.2s;
    font-family: var(--font-ui);
}

.action-btn {
    width: 40px;
    padding: 0;
}

.like-btn:hover,
.action-btn:hover {
    background: rgba(255,255,255,0.1);
    border-color: var(--text-main);
}

.like-btn.active i {
    color: #ff0055;
}

.comments-section {
    margin-top: 60px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

/* Форма комментария */
.comment-form {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 40px;
}

.comment-input {
    flex-grow: 1;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    padding: 14px;
    border-radius: 12px;
    color: var(--text-main);
    font-family: var(--font-ui);
    font-size: 0.95rem;
    line-height: 1.5;
    height: 48px;
    min-height: 48px;
    max-height: 35vh;
    resize: none;
    overflow-y: hidden;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.comment-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(255, 85, 85, 0.15);
}

.comment-form .auth-btn {
    height: 48px;
    flex-shrink: 0;
    align-self: flex-start;
}

/* Скроллбар внутри textarea */
.comment-input::-webkit-scrollbar {
    width: 6px;
}

.comment-input::-webkit-scrollbar-track {
    background: transparent;
}

.comment-input::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
    border-radius: 6px;
}

.comment-input::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* Карточка комментария */
.comment-item {
    position: relative;
    margin-bottom: 15px;
    width: 100%;
    box-sizing: border-box;
}

.comment-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    transition: background 0.2s;
}

.comment-card:hover {
    background: var(--bg-badge);
}

/* Заголовок комментария */
.comment-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.comment-date {
    font-size: 0.75rem;
    opacity: 0.5;
    color: var(--text-secondary);
}

.comment-text {
    line-height: 1.5;
    font-size: 0.95rem;
    color: var(--text-main);
    white-space: pre-wrap;
}

/* Вложенные комментарии (ветка) */
.comment-children {
    margin-left: 20px;
    padding-left: 15px;
    margin-top: 10px;
    border-left: 2px solid var(--border);
    transition: border-color 0.2s ease;
}

.comment-children:hover {
    border-left-color: var(--text-secondary);
}

/* Кнопка ответа */
.btn-reply {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    padding: 4px 8px;
    border-radius: 4px;
    opacity: 0.7;
    transition: 0.2s;
}

.btn-reply:hover {
    opacity: 1;
    background: rgba(255,255,255,0.1);
}

/* Бокс ответа */
.reply-box {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed rgba(255,255,255,0.1);
}

.reply-box .comment-input {
    width: 100%;
    box-sizing: border-box;
    margin-bottom: 12px;
}

.cancel-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
    transition: color 0.2s;
}

.cancel-btn:hover {
    color: #ff5555;
}

/* Мобильная адаптация вложенности */
@media (max-width: 768px) {
    .comment-children {
        margin-left: 10px;
        padding-left: 10px;
    }
}

/* --- 13. REPOSITORY SPECIFIC (табличный вид) --- */
.repo-header-row {
    display: flex;
    padding: 0 24px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.repo-item {
    display: flex;
    align-items: center;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 20px 24px;
    margin-bottom: 12px;
    transition: transform 0.2s, border-color 0.2s;
}

.repo-item:hover {
    transform: translateY(-2px);
    border-color: var(--text-secondary);
}

.repo-main {
    flex: 2;
    padding-right: 20px;
}

.repo-name {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 4px;
    color: var(--text-main);
    display: block;
}

.repo-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.repo-meta {
    flex: 1;
    font-size: 0.9rem;
    color: var(--text-main);
}

.repo-meta span {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 2px;
}

.repo-action {
    width: 120px;
    text-align: right;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: var(--bg-body);
    border: 1px solid var(--border);
    border-radius: 50px;
    color: var(--text-main);
    font-size: 0.85rem;
    transition: 0.2s;
}

.download-btn:hover {
    background: var(--text-main);
    color: var(--bg-body);
}

/* --- 14. PRODUCT PAGE --- */
.product-grid-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 40px;
    margin-bottom: 100px;
}

.steam-gallery { 
    margin-bottom: 40px; 
    background: transparent; 
}

.gallery-hero {
    width: 100%;
    max-height: 500px;
    margin-bottom: 12px;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    display: flex; 
    align-items: center; 
    justify-content: center;
}

.gallery-hero img {
    width: 100%; 
    height: 100%; 
    object-fit: contain;
    display: block; 
    transition: opacity 0.3s;
}

.gallery-thumbs {
    display: flex; 
    gap: 10px; 
    overflow-x: auto; 
    padding-bottom: 4px;
}

.thumb-item {
    width: 90px; 
    height: 50px; 
    flex-shrink: 0;
    border-radius: 6px; 
    overflow: hidden; 
    cursor: pointer;
    opacity: 0.6; 
    transition: 0.2s;
    border: 2px solid transparent; 
    background: var(--bg-surface);
}

.thumb-item img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.thumb-item:hover { 
    opacity: 0.9; 
}

.thumb-item.active { 
    opacity: 1; 
    border-color: var(--text-main); 
}

.product-sidebar { 
    position: relative; 
}

.sidebar-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    position: sticky; 
    top: 110px;
    overflow: hidden;
}

.download-group { 
    margin-bottom: 16px; 
}

.download-group-title {
    font-size: 0.7rem; 
    font-weight: 700; 
    text-transform: uppercase;
    color: var(--text-secondary); 
    margin-bottom: 8px; 
    letter-spacing: 0.05em;
}

.platform-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    width: 100%;
}

.platform-btn {
    display: flex;
    align-items: center;
    text-decoration: none;
    width: 100%;
    min-height: 56px;
    padding: 0 14px;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    box-sizing: border-box;
    overflow: hidden;
}

.platform-info {
    display: grid;
    grid-template-columns: 24px 1fr;
    align-items: center;
    gap: 12px;
    width: 100%;
}

.platform-info i {
    text-align: center;
    display: flex; 
    justify-content: center;
    font-size: 1.2rem;
    color: var(--text-main);
}

.platform-info > div {
    display: flex; 
    flex-direction: column;
    overflow: hidden;
}

.os-name {
    font-weight: 600; 
    font-size: 0.85rem; 
    color: var(--text-main); 
    line-height: 1.2;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.os-arch {
    font-size: 0.7rem; 
    opacity: 0.6;
    white-space: nowrap; 
    overflow: hidden; 
    text-overflow: ellipsis;
}

.platform-btn:hover {
    background: var(--bg-badge-hover) !important;
    border-color: var(--text-main);
    transform: translateY(-2px);
}

.platform-btn:hover * {
    color: var(--text-main) !important;
}

.sidebar-h4 {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 20px 0 10px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.check-list { 
    list-style: none; 
    padding: 0; 
    margin: 0; 
}

.check-list li {
    position: relative;
    padding-left: 18px;
    margin-bottom: 6px;
    font-size: 0.85rem;
    line-height: 1.4;
    color: var(--text-main);
    word-wrap: break-word;
}

.check-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 7px;
    width: 5px;
    height: 5px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    opacity: 0.7;
}

.mobile-tabs-container {
    display: flex;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 30px;
    position: sticky;
    top: var(--header-h);
    z-index: 90;
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
}

.mobile-tab-btn {
    padding: 10px 24px;
    border-radius: 50px;
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
    cursor: pointer;
    transition: 0.2s;
}

.mobile-tab-btn:hover { 
    border-color: var(--text-main); 
    color: var(--text-main); 
}

.mobile-tab-btn.active {
    background: var(--text-main);
    color: var(--bg-body);
    border-color: var(--text-main);
}

.tab-content {
    display: block; /* По умолчанию всё видно на десктопе */
}

/* --- 15. GALLERY & LIGHTBOX --- */
.masonry-grid {
    column-count: 3;
    column-gap: 20px;
    padding-bottom: 60px;
}

.gallery-item {
    break-inside: avoid;
    margin-bottom: 20px;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    background: var(--bg-surface);
}

.gallery-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}

.gallery-item:hover img {
    transform: scale(1.03);
}

.gallery-overlay {
    position: absolute;
    bottom: 0; 
    left: 0; 
    width: 100%;
    padding: 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.gallery-item:hover .gallery-overlay {
    opacity: 1;
}

.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    backdrop-filter: blur(5px);
    z-index: 9999;
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0; 
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.lightbox.active { 
    opacity: 1; 
    pointer-events: all; 
}

.lightbox-wrapper {
    display: inline-flex;
    height: 85vh;
    max-width: 95vw;
    background: var(--bg-surface);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    transform: scale(0.95); 
    transition: transform 0.3s ease;
}

.lightbox.active .lightbox-wrapper { 
    transform: scale(1); 
}

.lightbox-visual {
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
    width: auto;
    flex-shrink: 1;
    min-width: 0;
}

.lightbox-visual img {
    height: 100%;
    width: auto;
    object-fit: contain;
    display: block;
    user-select: none;
}

.lightbox-sidebar {
    width: 320px;
    flex-shrink: 0;
    padding: 24px;
    background: var(--bg-surface);
    display: flex; 
    flex-direction: column;
    border-left: 1px solid var(--border);
}

.lb-header { 
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 16px; 
}

.lb-header h3 { 
    font-size: 1.2rem; 
    margin: 0; 
    color: var(--text-main); 
    line-height: 1.3; 
}

.lightbox-close-btn {
    background: none; 
    border: none; 
    font-size: 1.5rem;
    color: var(--text-secondary); 
    cursor: pointer; 
    padding: 0;
    height: fit-content; 
    transition: 0.2s;
}

.lightbox-close-btn:hover { 
    color: var(--text-main); 
    transform: rotate(90deg); 
}

.lb-desc {
    color: var(--text-secondary); 
    font-size: 0.9rem; 
    line-height: 1.6;
    flex-grow: 1; 
    overflow-y: auto; 
    margin-bottom: 20px;
}

.lb-footer {
    padding-top: 16px; 
    border-top: 1px solid var(--border);
    display: flex; 
    justify-content: space-between; 
    align-items: center;
}

.lb-actions {
    display: flex;
    gap: 10px;
}

.nav-btn {
    position: absolute;
    top: 50%; 
    transform: translateY(-50%);
    width: 48px; 
    height: 48px;
    border-radius: 50%; 
    border: none;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    color: white; 
    cursor: pointer; 
    z-index: 10;
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 1.5rem; 
    transition: 0.2s;
    border: 1px solid rgba(255,255,255,0.1);
}

.nav-btn:hover { 
    background: white; 
    color: black; 
    transform: translateY(-50%) scale(1.1); 
}

.nav-btn.prev { 
    left: 20px; 
}

.nav-btn.next {
    right: calc(320px + 20px);
}

/* --- 16. CASE DETAIL SPECIFIC --- */
.back-link {
    display: inline-flex; 
    align-items: center; 
    gap: 8px;
    color: var(--text-secondary); 
    text-decoration: none;
    margin: 20px 0 40px; 
    font-weight: 500; 
    transition: 0.2s;
}

.back-link:hover { 
    color: var(--text-main); 
    transform: translateX(-4px); 
}

.case-header-block { 
    margin-bottom: 40px; 
}

.case-big-title {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.1; 
    margin: 16px 0;
}

.case-subtitle {
    font-size: 1.2rem; 
    color: var(--text-secondary);
    font-family: 'Space Grotesk', sans-serif;
}

.case-cover {
    width: 100%; 
    height: auto; 
    max-height: 500px;
    border-radius: 16px; 
    overflow: hidden;
    margin-bottom: 60px;
    border: 1px solid var(--border);
}

.case-cover img { 
    width: 100%; 
    height: 100%; 
    object-fit: cover; 
}

.case-detail-layout {
    max-width: 800px;
    margin: 0 auto;
}

.case-post-header {
    text-align: left;
    margin-bottom: 40px;
}

.case-post-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    line-height: 1.2;
    margin-top: 16px;
    margin-bottom: 24px;
}

.case-hero-image {
    width: 100%;
    height: auto;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
    border: 1px solid var(--border);
}

.case-hero-image img {
    width: 100%;
    display: block;
}

/* --- 17. LOGIN PAGE (THEMED & FIXED) --- */
/* Локальные переменные для страницы входа */
:root {
    --login-bg: var(--bg-body);
    --login-card-bg: var(--bg-surface);
    --login-text: var(--text-main);
    --login-text-sec: var(--text-secondary);
    --login-border: var(--border);
    --login-input-bg: rgba(0,0,0,0.05);
    --login-btn-bg: #000;
    --login-btn-text: #fff;
    --login-glow: rgba(0,0,0,0.1);
    --login-logo-color: #000;
}

[data-theme="dark"] {
    --login-card-bg: rgba(20, 20, 20, 0.6); /* Полупрозрачный в тёмной теме */
    --login-input-bg: rgba(255,255,255,0.03);
    --login-btn-bg: #fff;
    --login-btn-text: #000;
    --login-glow: rgba(255,255,255,0.03);
    --login-logo-color: #fff;
}

.login-page {
    background: var(--login-bg);
    height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Manrope', sans-serif;
    position: relative;
    overflow: hidden;
    transition: background 0.3s ease;
}

/* Фоновое свечение */
.login-bg-overlay {
    position: absolute;
    width: 80vw; 
    height: 80vw;
    max-width: 600px; 
    max-height: 600px;
    background: radial-gradient(circle, var(--login-glow) 0%, rgba(0,0,0,0) 70%);
    top: 50%; 
    left: 50%;
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 0;
}

.login-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
    display: flex; 
    flex-direction: column; 
    align-items: center;
    max-height: 100dvh;
    overflow-y: auto;
}

.login-logo {
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    gap: 12px;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    color: var(--login-logo-color);
    text-decoration: none;
    margin-bottom: 30px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    transition: color 0.3s ease;
}

.logo-circle {
    width: 12px; 
    height: 12px;
    background: var(--login-logo-color);
    border-radius: 50%;
    box-shadow: 0 0 20px var(--login-glow);
    transition: background 0.3s ease;
}

/* Карточка входа */
.login-card {
    width: 100%;
    background: var(--login-card-bg);
    backdrop-filter: blur(20px); 
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--login-border);
    border-radius: 24px;
    padding: 40px 30px;
    min-height: 580px;
    display: flex; 
    flex-direction: column;
    transition: all 0.3s ease;
    box-shadow: 0 20px 60px rgba(0,0,0,0.2); 
}

.forms-container {
    flex-grow: 1;
}

/* Табы */
.auth-tabs {
    display: flex;
    margin-bottom: 30px;
    border-bottom: 2px solid var(--login-border);
    position: relative;
}

.auth-tab {
    flex: 1;
    background: none; 
    border: none;
    color: var(--login-text-sec);
    padding: 12px 0;
    font-size: 0.9rem; 
    font-weight: 600;
    cursor: pointer; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
    transition: 0.3s;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
}

.auth-tab:hover { 
    color: var(--login-text); 
}

.auth-tab.active {
    color: var(--login-text);
    border-bottom-color: var(--login-text);
}

/* Поля ввода */
.input-group { 
    margin-bottom: 20px; 
}

.input-group label {
    display: block; 
    font-size: 0.7rem; 
    text-transform: uppercase;
    color: var(--login-text-sec); 
    margin-bottom: 8px; 
    letter-spacing: 0.05em;
}

.input-group input {
    width: 100%;
    background: var(--login-input-bg);
    border: 1px solid var(--login-border);
    color: var(--login-text);
    padding: 14px 16px; 
    border-radius: 8px;
    font-size: 0.95rem; 
    font-family: 'Manrope', sans-serif;
    transition: 0.3s;
}

.input-group input:focus {
    border-color: var(--login-text);
    background: transparent;
    outline: none;
}

.password-wrapper { 
    position: relative; 
}

.toggle-pass {
    position: absolute; 
    right: 12px; 
    top: 50%; 
    transform: translateY(-50%);
    background: none; 
    border: none; 
    color: var(--login-text-sec);
    cursor: pointer; 
    opacity: 0.7;
}

.toggle-pass:hover { 
    opacity: 1; 
    color: var(--login-text); 
}

/* Действия под формой */
.form-actions {
    display: flex; 
    justify-content: space-between; 
    align-items: center;
    margin-bottom: 30px; 
    font-size: 0.85rem; 
    color: var(--login-text-sec);
}

.checkbox-container {
    display: flex; 
    align-items: center; 
    gap: 8px; 
    cursor: pointer;
}

.checkbox-container input { 
    display: none; 
}

.checkmark {
    width: 16px; 
    height: 16px;
    border: 1px solid var(--login-border);
    border-radius: 4px; 
    display: inline-block; 
    position: relative;
}

.checkbox-container input:checked ~ .checkmark {
    background: var(--login-text);
    border-color: var(--login-text);
}

.forgot-link { 
    color: var(--login-text-sec); 
    text-decoration: none; 
    transition: 0.2s; 
}

.forgot-link:hover { 
    color: var(--login-text); 
}

.btn-submit-auth {
    width: 100%;
    background: var(--login-btn-bg);
    color: var(--login-btn-text);
    border: none; 
    padding: 16px; 
    border-radius: 8px;
    font-weight: 700; 
    font-size: 0.9rem; 
    text-transform: uppercase; 
    letter-spacing: 0.05em;
    cursor: pointer; 
    transition: 0.3s; 
    margin-bottom: 20px;
}

.btn-submit-auth:hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 5px 15px var(--login-glow);
}

/* Футер формы (социальные сети) */
.auth-footer {
    border-top: 1px solid var(--login-border);
    padding-top: 20px;
    text-align: center;
    margin-top: auto;
}

.auth-footer span {
    display: block; 
    font-size: 0.75rem; 
    color: var(--login-text-sec);
    margin-bottom: 15px; 
    text-transform: uppercase;
}

.social-auth { 
    display: flex; 
    gap: 10px; 
}

.social-auth button {
    flex: 1;
    background: var(--login-input-bg);
    border: 1px solid var(--login-border);
    color: var(--login-text-sec);
    padding: 10px; 
    border-radius: 8px;
    cursor: not-allowed; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    font-size: 0.85rem; 
    opacity: 0.6; 
    transition: 0.3s;
}

/* Заглушка регистрации */
.signup-placeholder {
    text-align: center; 
    padding: 40px 0; 
    color: var(--login-text);
}

.signup-placeholder i { 
    font-size: 3rem; 
    color: var(--login-border); 
    margin-bottom: 15px; 
    display: block; 
}

.signup-placeholder h3 { 
    margin-bottom: 10px; 
}

.signup-placeholder p { 
    font-size: 0.9rem; 
    color: var(--login-text-sec); 
    line-height: 1.5; 
    margin-bottom: 30px; 
}

.btn-outline-auth {
    background: transparent;
    border: 1px solid var(--login-border);
    color: var(--login-text); 
    padding: 10px 20px; 
    border-radius: 6px; 
    cursor: pointer;
    transition: 0.2s;
}

.btn-outline-auth:hover { 
    border-color: var(--login-text); 
    background: var(--login-input-bg); 
}

.login-footer-text {
    margin-top: 20px; 
    color: var(--login-text-sec); 
    font-size: 0.75rem; 
    opacity: 0.7;
}

.error-msg {
    display: none;
    text-align: center;
    color: #ff5555;
    font-size: 0.85rem;
    margin-top: 10px;
    margin-bottom: 20px;
    animation: fadeIn 0.3s ease;
}

/* Адаптация для низких экранов */
@media (max-height: 700px) {
    .login-card {
        min-height: auto;
        padding: 30px 20px;
    }
    
    .login-logo { 
        margin-bottom: 20px; 
    }
}

@keyframes fadeIn { 
    from { opacity: 0; } 
    to { opacity: 1; } 
}

/* --- 404 PAGE (GRADIENT STYLE) --- */
.error-container {
    height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    padding: 20px;
}

.error-content {
    position: relative;
    z-index: 2;
    max-width: 550px;
}

.error-code {
    font-family: var(--font-display);
    font-size: clamp(6rem, 15vw, 10rem);
    line-height: 1;
    margin-bottom: 20px;
    background: linear-gradient(135deg, var(--text-main) 0%, var(--text-secondary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    user-select: none;
    cursor: default;
}

.error-message {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 30px;
}

.error-ghost-message {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 30px;
    min-height: 24px;
    opacity: 0;
    transition: opacity 1s ease;
    font-family: 'Courier New', monospace;
}

.error-ghost-message.visible {
    opacity: 0.7;
}

.error-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

.error-glow {
    position: absolute;
    width: 600px;
    height: 600px;
    background: var(--text-main);
    opacity: 0.03;
    filter: blur(100px);
    border-radius: 50%;
    z-index: 1;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: opacity 0.5s ease, background 0.5s ease;
}

.error-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 28px;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    font-family: var(--font-ui);
}

.error-btn.secondary {
    background: transparent;
    border: 1px solid var(--border);
    color: var(--text-secondary);
}

.error-btn.secondary:hover {
    border-color: var(--text-main);
    color: var(--text-main);
    background: rgba(255,255,255,0.05);
}

.error-btn.primary {
    background: var(--text-main);
    color: var(--bg-body);
    border: 1px solid var(--text-main);
}

.error-btn.primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* --- 23. SKELETON LOADING --- */
@keyframes skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.skeleton {
    background: var(--bg-surface);
    background-image: linear-gradient(
        90deg,
        var(--bg-surface) 25%,
        rgba(255, 255, 255, 0.05) 37%,
        var(--bg-surface) 63%
    );
    background-size: 400% 100%;
    animation: skeleton-loading 1.4s ease infinite;
    border-radius: 4px;
}

.skeleton-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    height: 100%;
}

.sk-img {
    width: 100%;
    height: 200px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.sk-icon {
    width: 44px; 
    height: 44px;
    border-radius: 10px;
}

.sk-title {
    height: 24px;
    width: 70%;
    border-radius: 4px;
}

.sk-text {
    height: 16px;
    width: 100%;
    border-radius: 4px;
}

.sk-text-short { 
    width: 60%; 
}

.sk-tag {
    height: 20px;
    width: 80px;
    border-radius: 50px;
}

.sk-footer {
    margin-top: auto;
    height: 20px;
    width: 100px;
}

/* Теги и кнопки (обновления для скелетонов) */
.case-tag, 
.card-tag, 
.tag-hash {
    background: var(--bg-badge) !important;
    color: var(--text-secondary);
    font-weight: 600;
    border: 1px solid transparent;
    transition: 0.2s;
}

.like-btn, 
.action-btn, 
.platform-btn {
    background: var(--bg-badge) !important;
    border-color: var(--border);
    color: var(--text-main);
}

.like-btn:hover, 
.action-btn:hover, 
.platform-btn:hover {
    background: var(--bg-badge-hover) !important;
    border-color: var(--text-main);
}

.tech-badge {
    background: var(--bg-badge);
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-ui);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-block;
}

/* --- 24. GLOBAL UTILITIES --- */
/* Растянутая ссылка (для кликабельных карточек) */
.stretched-link::after {
    content: '';
    position: absolute;
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    z-index: 1;
    cursor: pointer;
}

/* Кастомные скроллбары */
* {
    scrollbar-width: thin;
    scrollbar-color: var(--border) var(--bg-body);
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background-color: var(--border);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: var(--text-secondary);
}

::-webkit-scrollbar-corner {
    background: transparent;
}

/* Глобальные transition */
body, 
.header, 
.footer, 
.mobile-menu, 
.nav-menu, 
.nav-link,
.card, 
.repo-card, 
.case-card, 
.sidebar-card, 
.gallery-item, 
.update-row, 
.comment-item,
.product-sidebar, 
.mobile-tabs-container, 
.mobile-tab-btn, 
.platform-btn, 
.search-input, 
.comment-input,
.code-block, 
.code-header, 
.code-content, 
code, 
details, 
summary, 
.spoiler-content,
input, 
button, 
a, 
i, 
span, 
p, 
li, 
h1, h2, h3, h4, h5, h6,
.admin-card, 
.admin-sidebar, 
.admin-header, 
.settings-card, 
.upload-zone, 
.tag-chip,
.markdown-body, 
blockquote, 
table, 
pre {
    transition: background-color 0.3s ease, 
                background 0.3s ease,
                border-color 0.3s ease, 
                color 0.3s ease,
                box-shadow 0.3s ease, 
                fill 0.3s ease, 
                stroke 0.3s ease;
}

/* --- 25. MEDIA QUERIES & ADAPTIVE --- */
@media (max-width: 1024px) {
    .container { 
        padding: 0 24px; 
    }
    
    .nav-menu { 
        display: none; 
    }
    
    .desktop-auth { 
        display: none; 
    }
    
    .burger-btn { 
        display: block; 
    }
    
    .grid-2 { 
        grid-template-columns: 1fr; 
    }
    
    .hero h1 { 
        font-size: 3rem; 
    }
    
    .hero-stats { 
        flex-wrap: wrap; 
        gap: 30px; 
    }
    
    .footer-grid { 
        grid-template-columns: 1fr; 
        gap: 40px; 
    }
    
    .footer-links { 
        gap: 40px; 
    }
    
    .footer-bottom { 
        flex-direction: column; 
        gap: 10px; 
    }
    
    /* Product Page */
    .product-grid-layout { 
        grid-template-columns: 1fr; 
    }
    
    .platform-list { 
        grid-template-columns: 1fr; 
    }
    
    .repo-grid { 
        grid-template-columns: 1fr; 
    }
    
    .sidebar-card { 
        position: static; 
        margin-top: 40px; 
    }
    
    /* Gallery & Lightbox */
    .lightbox { 
        padding: 0; 
    }
    
    .lightbox-wrapper {
        flex-direction: column;
        display: flex;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        max-width: none; 
        border-radius: 0; 
        border: none;
        overflow: hidden;
    }
    
    .lightbox-visual {
        flex: 1 1 auto;
        min-height: 0;
        width: 100%;
        background: black;
        position: relative;
    }
    
    .lightbox-visual img {
        width: 100%;
        height: 100%;
        object-fit: contain;
    }
    
    .lightbox-sidebar {
        width: 100%;
        height: auto;
        max-height: 35vh;
        flex-shrink: 0;
        border-left: none; 
        border-top: 1px solid var(--border);
        padding: 16px 20px;
        background: var(--bg-surface);
        z-index: 20;
        overflow-y: auto;
    }
    
    .lightbox-sidebar::-webkit-scrollbar { 
        width: 0; 
        height: 0; 
    }
    
    .nav-btn {
        display: flex;
        top: 50%;
        margin-top: -20px;
        width: 40px; 
        height: 40px;
        background: rgba(255,255,255,0.15);
    }
    
    .nav-btn.prev { 
        left: 10px; 
    }
    
    .nav-btn.next { 
        right: 10px; 
    }
    
    /* Admin Panel */
    .admin-layout { 
        grid-template-columns: 80px 1fr; 
    }
    
    .admin-logo { 
        display: none; 
    }
    
    .admin-nav button span { 
        display: none; 
    }
    
    .admin-nav button { 
        justify-content: center; 
        padding: 20px 0; 
    }
    
    .view-container { 
        padding: 20px; 
    }
    
    .admin-grid { 
        grid-template-columns: 1fr; 
    }
    
    /* Mobile Admin Navigation */
    .admin-sidebar { 
        display: none !important; 
    }
    
    .admin-main { 
        margin-left: 0 !important; 
        width: 100% !important; 
        padding: 20px !important; 
        padding-bottom: 100px !important; 
    }
    
    .admin-header .logo-area { 
        display: none !important; 
    }
    
    .admin-header {
        height: 60px;
        padding: 0 16px;
        background: var(--bg-glass) !important;
    }
    
    .admin-main { 
        padding-top: 80px !important; 
    }
    
    /* Bento Grid */
    .bento-grid { 
        grid-template-columns: 1fr; 
    }
    
    .span-2, 
    .span-4 { 
        grid-column: auto; 
    }
}

/* Средние брейкпоинты (max-width: 900px и ниже) */
@media (max-width: 900px) {
    .masonry-grid { 
        column-count: 2; 
    }
    
    .code-block {
        max-width: 78vw;
    }
    
    .product-grid-layout { 
        grid-template-columns: 1fr; 
    }
    
    .platform-list { 
        grid-template-columns: 1fr; 
    }
    
    .repo-grid { 
        grid-template-columns: 1fr; 
    }
    
    .bento-grid {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
    
    .bento-card {
        width: 100% !important;
        min-height: auto;
    }
    
    .span-4 { 
        flex: none; 
        width: 100%; 
    }
    
    .admin-grid {
        grid-template-columns: 1fr;
    }
    
    .admin-card {
        display: grid;
        grid-template-columns: 120px 1fr;
        gap: 12px;
        height: auto;
    }
    
    .admin-card img {
        height: 100%;
        object-fit: cover;
        border-radius: 12px;
    }
    
    .admin-header .desktop-only {
        display: none !important;
    }
    
    .admin-main {
        padding-top: 0 !important;
    }
    
    .editor-container {
        padding-top: 0 !important;
    }
    
    .theme-popup__list-container,
    .custom-modal-card,
    .glass-panel {
        width: calc(100vw - 24px);
        max-width: 100%;
        margin: 0 auto;
        border-radius: 16px;
    }
}

/* Меньшие брейкпоинты (max-width: 768px и ниже) */
@media (max-width: 768px) {
    .repo-header-row { 
        display: none; 
    }
    
    .repo-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    
    .repo-meta {
        width: 100%;
        display: flex;
        justify-content: space-between;
        border-bottom: 1px solid var(--border);
        padding-bottom: 12px;
    }
    
    .repo-action {
        width: 100%;
        text-align: left;
    }
    
    .download-btn { 
        width: 100%; 
        justify-content: center; 
    }
    
    .dashboard-container {
        padding: 0 16px;
    }
    
    .bento-val { 
        font-size: 3rem; 
    }
}

/* Маленькие экраны (max-width: 600px и ниже) */
@media (max-width: 600px) {
    .masonry-grid {
        column-count: 2;
        column-gap: 10px;
    }
    
    .gallery-item { 
        margin-bottom: 10px; 
        border-radius: 8px; 
    }
    
    .gallery-overlay { 
        padding: 10px; 
    }
    
    .gallery-overlay span { 
        font-size: 0.8rem !important; 
    }
    
    .cases-grid { 
        grid-template-columns: 1fr; 
    }
    
    .case-card-img { 
        height: 180px; 
    }
}

@media (min-width: 901px) {
    .product-grid-layout {
        grid-template-columns: minmax(0, 1fr) 420px;
        grid-template-rows: auto auto;
        align-items: start;
    }
    
    #tab-about { 
        grid-column: 1; 
        grid-row: 1; 
    }
    
    #tab-docs {
        grid-column: 1;
        grid-row: 2;
        margin-top: 60px; 
        padding-top: 60px;
        border-top: 1px solid var(--border);
    }
    
    .product-sidebar {
        grid-column: 2;
        grid-row: 1 / span 2;
        position: sticky; 
        top: 150px; 
        height: fit-content;
        width: 420px;
    }
}

@media (max-width: 900px) {
    .tab-content { 
        display: none; 
    }
    
    .tab-content.active { 
        display: block; 
        animation: fadeIn 0.3s; 
    }
    
    .product-sidebar { 
        position: static; 
    }
    
    .sidebar-card {
        margin-top: 0;
        background: transparent;
        border: none;
        padding: 0 0 80px 0;
        overflow: visible;
    }
    
    .sidebar-card h3 { 
        margin-top: 0; 
        margin-bottom: 20px; 
    }
}

@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* --- PROFILE PAGE FIXES --- */

.profile-wrapper {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    align-items: start;
    margin-bottom: 60px;
}

/* Карточка слева */
.profile-card {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    position: sticky;
    top: 120px;
}

/* Аватар */
.profile-avatar-placeholder {
    width: 100px;
    height: 100px;
    background: var(--bg-badge); /* Адаптивный фон */
    border: 1px solid var(--border);
    border-radius: 50%;
    margin: 0 auto 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    color: var(--text-secondary);
}

.profile-info h1 {
    font-size: 1.5rem;
    margin-bottom: 4px;
    font-family: var(--font-display);
    color: var(--text-main);
}

/* Бейдж роли (Исправлен для светлой темы) */
.user-role-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--bg-badge); 
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: var(--text-main);
    border: 1px solid var(--border);
}

.user-meta {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: 25px;
}

/* Кнопка выхода (красная) */
.action-btn-outline {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--border);
    color: #ff5555;
    border-radius: 12px;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 500;
}

.action-btn-outline:hover {
    background: rgba(255, 85, 85, 0.1);
    border-color: #ff5555;
}

/* Правая часть */
.profile-content {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 30px;
    min-height: 400px;
}

/* === АДАПТИВ (Исправления для мобильных) === */
@media (max-width: 900px) {
    .profile-wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .profile-card {
        position: static;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 24px;
    }
    
    .profile-avatar-placeholder {
        margin: 0 auto 15px;
        width: 80px;
        height: 80px;
        font-size: 2.5rem;
    }

    .profile-actions {
        width: 100%;
        margin-top: 10px;
        display: block; 
    }
}

/* --- СТИЛИ ДЛЯ МОДАЛКИ  --- */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.6); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    z-index: 1000; opacity: 0; visibility: hidden; transition: 0.3s;
}
.modal-overlay.active { opacity: 1; visibility: visible; }

.modal-card {
    background: var(--bg-surface); border: 1px solid var(--border);
    padding: 30px; border-radius: 16px; width: 100%; max-width: 400px;
    text-align: center; transform: translateY(20px); transition: 0.3s;
    box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}
.modal-overlay.active .modal-card { transform: translateY(0); }

.modal-card h3 { margin-bottom: 10px; font-size: 1.2rem; color: var(--text-main); }
.modal-card p { color: var(--text-secondary); margin-bottom: 25px; font-size: 0.9rem; }

.modal-actions { display: flex; gap: 10px; justify-content: center; }
.modal-actions button {
    padding: 10px 20px; border-radius: 8px; border: none; cursor: pointer; font-weight: 500;
}
.btn-cancel { background: transparent; border: 1px solid var(--border) !important; color: var(--text-secondary); }
.btn-confirm { background: #ff5555; color: white; }
.btn-confirm:hover { background: #ff3333; }

/* --- ФИКС ШРИФТОВ --- */

.custom-modal-card,
#custom-modal {
    font-family: var(--font-ui);
}

#modal-title {
    font-family: var(--font-display);
    font-weight: 500; 
}

.custom-modal-card button,
#modal-confirm-btn {
    font-family: var(--font-ui);
    font-size: 0.95rem; 
}

#modal-desc {
    font-family: var(--font-ui);
    color: var(--text-secondary);
}

/* =========================================
 * COOKIE BANNER
 * ========================================= */
.cookie-banner {
    position: fixed;
    bottom: -150px;
    right: 20px;
    width: 340px;
    max-width: calc(100% - 40px);
    
    background: var(--bg-glass); 
    
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    
    border: 1px solid var(--border);
    
    border-radius: 16px;
    padding: 20px;
    z-index: 9999;
    
    box-shadow: 0 10px 30px rgba(0,0,0,0.15); 
    
    transition: bottom 0.5s cubic-bezier(0.19, 1, 0.22, 1);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cookie-banner.active {
    bottom: 20px; 
}

.cookie-title {
    font-family: var(--font-display);
    display: flex;
    align-items: center;
    gap: 8px; 
    font-weight: 600;
    font-size: 1rem;
    color: var(--text-main);
}

.cookie-text {
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.cookie-actions {
    font-family: var(--font-ui);
    display: flex;
    gap: 10px;
    margin-top: 4px;
}

.cookie-btn-accept {
    flex: 1;
    background: var(--text-main);
    color: var(--bg-body);
    border: none;
    padding: 8px 0;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: opacity 0.2s;
}

.cookie-btn-accept:hover {
    opacity: 0.9;
}

@media (max-width: 600px) {
    .cookie-banner {
        width: auto;
        left: 10px;
        right: 10px;
        bottom: -200px;
    }
    .cookie-banner.active {
        bottom: 15px;
    }
}
/* =========================================
 * FIX: PRODUCT LIGHTBOX (SIMPLE VERSION)
 * ========================================= */

/* 1. Картинка внутри лайтбокса */
.lightbox-img {
    max-width: 95vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.5);
    transition: transform 0.3s;
}

/* 2. Кнопка закрытия */
.lightbox-close {
    position: absolute;
    top: 30px;
    right: 30px;
    
    width: 40px;
    height: 40px;
    
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    
    color: white;
    font-size: 1.6rem;
    line-height: 1;
    
    display: flex;
    align-items: center;
    justify-content: center;
    
    cursor: pointer;
    z-index: 10001; 
    backdrop-filter: blur(4px);
    transition: all 0.2s ease;
}

.lightbox-close:hover {
    background: white;
    color: black;
    transform: scale(1.1);
}

/* Адаптив для мобильных */
@media (max-width: 768px) {
    .lightbox-close {
        top: 20px;
        right: 20px;
        width: 40px;
        height: 40px;
        font-size: 1.5rem;
        padding-bottom: 2px;
    }
    
    .lightbox-img {
        max-width: 100vw;
        max-height: 85vh;
        border-radius: 0;
    }
}