/* ==========================================================================
   1. ГЛОБАЛЬНЫЕ ПЕРЕМЕННЫЕ, СБРОСЫ И БАЗОВЫЕ НАСТРОЙКИ
   ========================================================================== */
:root {
    --color-green-main: #88B948;
    --color-green-hover: #6E9938;
    --color-purple-main: #3A2C96;
    --color-purple-hover: #2e2378;
    --color-orange-main: #D3A353;
    --color-light-green: #92C452;
    --color-text-dark: #374151;
    --color-text-muted: #4b5563;
    --color-bg-light: #e2e2e2;
    --color-bg-card: #ffffff;
    
    /* Новые супер-плавные анимации для пожилых пользователей */
    --transition-smooth: 0.5s cubic-bezier(0.2, 0, 0, 1);
    --transition-fast: 0.2s ease-in-out;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth !important;
    scroll-padding-top: 80px;
}

#about-anchor,
#directions-anchor,
#news-anchor,
#contacts {
    scroll-margin-top: 80px;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--color-bg-light);
    color: var(--color-text-dark);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

:focus-visible {
    outline: 3px solid var(--color-purple-main);
    outline-offset: 3px;
}

button:focus-visible,
a:focus-visible {
    outline: 3px solid var(--color-purple-main);
    outline-offset: 3px;
}

/* Доступность: Skip-link для навигации с клавиатуры (WCAG 2.2) */
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background-color: var(--color-purple-main);
    color: #ffffff;
    padding: 12px 20px;
    z-index: 9999;
    border-radius: 8px;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: top 0.2s ease-in-out;
}

.skip-link:focus,
.skip-link:focus-visible {
    top: 20px;
    outline: 3px solid var(--color-orange-main);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ==========================================================================
   2. ГЛАВНАЯ НАВИГАЦИОННАЯ ШАПКА САЙТА (HEADER)
   ========================================================================== */
.main-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 50;
    display: flex;
    justify-content: center;
    padding-top: 20px;
    transition: transform var(--transition-smooth);
    transform: translateY(0);
}

.main-header.header-hidden {
    transform: translateY(-120%) !important;
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 41px;
    background-color: var(--color-bg-card);
    padding: 12px 32px;
    border-radius: 11px;
    box-shadow: 0 10px 30px -5px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(243, 244, 246, 0.7);
    width: max-content;
}

.nav-link {
    color: var(--color-green-main);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-link:hover {
    color: var(--color-green-hover);
}

.burger-menu-btn {
    display: none;
}
/* ==========================================================================
   3. ГЛАВНЫЙ ЭКРАН (HERO) И БАЗОВЫЕ АНИМАЦИИ
   ========================================================================== */
.hero {
    position: relative;
    width: 100%;
    height: 55vh;
    background-image: url('images/banner.jpg');
    background-size: cover;
    background-position: center 30%;
    background-repeat: no-repeat;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 600px;
    padding: 0 20px;
}

.logo {
    width: clamp(110px, 11vw, 210px);
    height: clamp(110px, 11vw, 210px);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.hero-logo {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.slogan {
    font-size: clamp(18px, 1.5vw, 24px);
    font-weight: 500;
    color: var(--color-text-dark);
    line-height: 1.4;
    letter-spacing: 0.5px;
    margin-top: -5px;
}

.green-line {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 8px;
    background-color: var(--color-green-main);
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.8s ease-out forwards;
}

/* ==========================================================================
   4. СЕКЦИЯ "О КОМПАНИИ" (ABOUT) - ОСНОВНАЯ СТРУКТУРА
   ========================================================================== */
.about {
    width: 100%;
    min-height: 45vh;
    background-color: var(--color-bg-light);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 5px 20px 40px 20px;
}

.about-container {
    width: 100%;
    max-width: 1200px;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.about-title {
    text-align: center;
    color: var(--color-green-main);
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
}

.about-grid-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    flex-grow: 1;
    align-items: start;
}
/* ==========================================================================
   5. СЕКЦИЯ "О КОМПАНИИ" (ABOUT) - МЕХАНИКА РАСКРЫТИЯ ТЕКСТА
   ========================================================================== */
.card {
    background-color: var(--color-bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
    text-decoration: none;
}

.card.main-text {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: stretch;
    padding: 24px;
    width: 100%;
    min-height: 380px;
    height: auto;
    transition: box-shadow var(--transition-fast);
}

.text-fade-wrapper {
    position: relative;
    width: 100%;
    max-height: 250px;
    overflow: hidden;
    margin-bottom: 24px;
    transition: max-height var(--transition-smooth);
}

.card.main-text.expanded .text-fade-wrapper {
    max-height: 1200px;
}

.text-fade-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 55px;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease-in-out, visibility 0.3s ease-in-out;
}

.card.main-text.expanded .text-fade-wrapper::after {
    opacity: 0;
    visibility: hidden;
}

.left-top-text {
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-dark);
    text-align: left;
}

.left-top-text p {
    margin-bottom: 12px;
}

.more-btn {
    background-color: var(--color-green-main);
    color: #ffffff;
    border: none;
    width: 75%;
    padding: 11px 0;
    font-size: 16px;
    font-weight: bold;
    border-radius: 8px;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    flex-shrink: 0;
    margin-top: auto;
}

.more-btn:hover {
    background-color: var(--color-green-hover);
}
/* ==========================================================================
   6. СЕКЦИЯ "О КОМПАНИИ" (ABOUT) - ПЛИТКА ДОКУМЕНТОВ (ПРАВАЯ СЕТКА)
   ========================================================================== */
.cards-right {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    grid-template-rows: 1fr 1fr;
    gap: 16px;
    height: 380px;
    width: 100%;
}

.svid-card { grid-column: span 1; }
.manager-photo { grid-column: span 2; }
.dogovor-card { grid-column: span 2; }
.diplom-card { grid-column: span 1; }

.img-card {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: 15px;
    cursor: pointer;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.img-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.15);
}

.card-text {
    position: relative;
    z-index: 2;
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
    text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
    padding: 0 10px;
    word-break: keep-all;
    overflow-wrap: break-word;
}

.manager-photo {
    background-image: url('images/rukovoditel.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    cursor: default;
}

.svid-card { background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url('images/svidetelstvo.jpg'); }
.dogovor-card { background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url('images/dogovor.jpg'); }
.diplom-card { background-image: linear-gradient(rgba(0, 0, 0, 0.45), rgba(0, 0, 0, 0.45)), url('images/diplomy.jpg'); }

.dir-mobile-only-btn {
    display: none;
}

.dir-card-btn-purple {
    display: none;
    border: none;
    padding: 10px 32px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 11px;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-smooth);
    position: absolute;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 15;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

#dir-card-1 .dir-card-btn-purple {
    background-color: #ffffff;
    color: var(--color-purple-main);
}

#dir-card-2 .dir-card-btn-purple {
    background-color: #ffffff;
    color: var(--color-orange-main);
}

#dir-card-3 .dir-card-btn-purple {
    background-color: #ffffff;
    color: var(--color-light-green);
}

/* ==========================================================================
   7. ДЕСKТОПНАЯ СЕКЦИЯ НАПРАВЛЕНИЙ (ПК ВЕРСИЯ) - СТРУКТУРА
   ========================================================================== */
.directions-section {
    position: relative;
    width: 100%;
    min-height: 45vh; 
    background-color: var(--color-bg-light); 
    display: flex;
    justify-content: center;
    align-items: flex-start; 
}

.directions-section .orange-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px; 
    background-color: var(--color-orange-main);
}

.directions-section1 {
    position: relative;
    width: 100%;
    min-height: 45vh; 
    background-color: var(--color-bg-light); 
    display: flex;
    justify-content: center;
    align-items: flex-start; 
}

.directions-section1 .orange-line1 {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px; 
    background-color: var(--color-purple-main);
}
.directions-container {
    width: 100%;
    max-width: 1200px; 
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-top: 5px; 
}

.directions-title {
    text-align: center;
    color: var(--color-orange-main);
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.directions-title1 {
    text-align: center;
    color: var(--color-purple-main);
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.dir-card {
    display: flex;
    position: relative;
    width: 100%;
    height: 240px; 
    background-color: transparent;
    margin-bottom: 35px;
    overflow: hidden; 
    border-radius: 11px;
}

.dir-photo-block {
    width: 30%;
    height: 100%;
    background-image: url('images/vash-proekt.jpg'); 
    background-size: cover; 
    background-position: center; 
    background-repeat: no-repeat;
    background-color: #555555; 
    border-radius: 11px;
    position: relative; 
    z-index: 1;
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease-in-out;
}

.dir-purple-base {
    position: absolute;
    top: 0;
    height: 100%;
    border-radius: 11px;
    z-index: 2; 
    overflow: hidden;
    /* Супер-плавный переход для расширения плашки во все стороны без дерганий */
    transition: left 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                right 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                width 0.6s cubic-bezier(0.25, 1, 0.5, 1), 
                padding 0.6s cubic-bezier(0.25, 1, 0.5, 1),
                z-index 0.6s step-end;
}

.dir-arrow-chevron {
    position: absolute;
    top: 50%;
    color: #ffffff;
    font-size: 26px;
    font-weight: bold;
    user-select: none;
    -webkit-user-select: none;
    z-index: 5;
    transition: opacity 0.3s ease-in-out, transform 0.4s ease-in-out;
    cursor: pointer;
}
.dir-purple-text {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 130% !important;
    height: 95% !important;
    overflow: hidden !important;
    font-size: 13px !important; 
    line-height: 1.5 !important;
    text-align: left !important;
    color: #ffffff !important;
    mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%) !important;
    -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%) !important;
    transition: padding 0.6s cubic-bezier(0.25, 1, 0.5, 1), height 0.4s ease-in-out !important;
}

.dir-purple-text p {
    margin-bottom: 10px;
}

.dir-white-content {
    position: absolute;
    top: 0;
    width: 55%; 
    height: 100%;
    background-color: var(--color-bg-card);
    border-radius: 11px;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center; 
    padding: 24px 24px 15px 24px; 
    z-index: 4; 
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.4s ease-in-out, visibility 0.6s;
}

.dir-abyss-gradient {
    position: absolute;
    top: 0;
    width: 60px; 
    height: 100%;
    pointer-events: none;
    z-index: 5; 
    transition: opacity 0.3s ease-in-out;
}

.dir-white-text-container {
    width: 100%;
    height: 145px; 
    overflow: hidden;
    font-size: 14px;
    line-height: 1.4;
    color: var(--color-text-dark);
    text-align: left;
}

.dir-more-btn {
    border: none;
    padding: 10px 32px;
    font-size: 15px;
    font-weight: bold;
    border-radius: 11px;
    cursor: pointer;
    transition: background-color var(--transition-fast), transform var(--transition-smooth);
    flex-shrink: 0;
    margin-top: auto; 
}

/* При развертывании убираем маски и даем тексту занять всю площадь без скролла */
.dir-card.expanded .dir-purple-text,
.dir-card.mobile-expanded .dir-purple-text,
.dir-card.dir-orange-theme.mobile-expanded .dir-purple-text {
    height: auto !important;
    width: 100% !important;
    overflow-y: visible !important;
    mask-image: none !important;
    -webkit-mask-image: none !important;
}

.dir-orange-theme .dir-purple-text {
    color: #000000 !important;
    width: 130% !important; 
    position: relative !important;
    z-index: 1 !important;
}
/* ==========================================================================
   8. СЕКЦИЯ НОВОСТЕЙ (СЛАЙДЕР С КОПИРОВАНИЕМ ШАПКИ НАПРАВЛЕНИЙ)
   ========================================================================== */
.news-exact-section {
    position: relative;
    width: 100%;
    min-height: 45vh; 
    background-color: var(--color-bg-light); 
    display: flex;
    justify-content: center;
    align-items: flex-start; 
    padding-bottom: 40px !important;
}

.news-exact-section .news-exact-line {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 8px; 
    background-color: var(--color-purple-main);
}

.news-exact-container {
    width: 100%;
    max-width: 1200px; 
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-top: 5px; 
}

.news-exact-title-text {
    text-align: center !important; 
    font-size: 24px !important; 
    font-weight: bold !important; 
    color: var(--color-purple-main) !important; 
    margin-top: 35px !important; 
    margin-bottom: 12px !important; 
    width: 100% !important; 
    display: block !important;
}

.news-viewport-wrapper {
    position: relative;
    width: 100%;
    padding: 0 45px;
    margin-top: 15px;
    opacity: 0;
    transform: translateY(40px);
    transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease-in-out;
}

.news-viewport-wrapper.visible {
    opacity: 1;
    transform: translateY(0) !important;
}

.news-slider-viewport {
    width: 100%;
    overflow: hidden;
    border-radius: 10px;
}

.news-slider-track {
    display: flex;
    gap: 24px;
    width: 100%;
    transition: transform 0.5s ease-in-out;
}

.news-slide-card {
    display: flex;
    flex-direction: column;
    position: relative;
    flex: 0 0 calc((100% - (24px * 2)) / 3); 
    height: 440px; 
    background-color: transparent;
    text-decoration: none;
    overflow: visible;
    border-radius: 10px;
}
.news-photo-layer {
    position: relative;
    width: 100%;
    height: 180px;
    background-color: #555555;
    border-radius: 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 24px;
    color: #ffffff;
    z-index: 1;
}

.news-white-layer {
    position: relative;
    width: 100%;
    background-color: var(--color-bg-card);
    border-radius: 10px;
    padding: 30px 20px 75px 20px;
    margin-top: -25px; 
    z-index: 2;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-text-inner {
    width: 100%;
    font-size: 15px;
    line-height: 1.5;
    color: var(--color-text-dark);
    text-align: left;
}

.news-fake-btn {
    position: absolute;
    bottom: 15px;
    left: 20px;
    width: calc(100% - 40px);
    background-color: var(--color-purple-main);
    color: #ffffff;
    border-radius: 10px;
    padding: 12px 0;
    font-size: 15px;
    font-weight: bold;
    text-align: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transition: background-color var(--transition-fast);
}

.news-slide-card:hover .news-fake-btn { 
    background-color: var(--color-purple-hover); 
}

.news-nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) scaleY(1.8);
    background: none;
    border: none;
    color: var(--color-purple-main);
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    z-index: 20;
    opacity: 1;
}
.news-nav-arrow.arrow-left { left: 5px; }
.news-nav-arrow.arrow-right { right: 5px; }

.news-slider-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 18px;
}

.news-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #cbd5e1;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.news-dot.active {
    background-color: var(--color-purple-main);
    transform: scale(1.3);
}

.news-dot:focus-visible {
    outline: 2px solid var(--color-purple-main);
    outline-offset: 2px;
}

/* ==========================================================================
   9. ФИНАЛЬНЫЙ ИСПРАВЛЕННЫЙ ПОДВАЛ (FOOTER)
   ========================================================================== */
.main-footer {
    width: 100%;
    background-color: #9e9e9e; 
    display: flex;
    justify-content: center;
    padding: 40px 20px 40px 20px;
    margin-top: 10px !important;
}

.footer-container {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.footer-title {
    text-align: center;
    color: #ffffff !important; 
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 30px;
}
.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px; 
    width: 100%;
    margin-bottom: 40px;
    align-items: stretch !important;
    padding: 0 45px; 
}

.footer-contacts-left {
    display: flex;
    flex-direction: column;
    gap: 16px;
    justify-content: space-between;
}

.footer-card {
    background-color: var(--color-bg-card);
    border-radius: 10px;
    padding: 24px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    flex-grow: 1;
    display: flex;
    align-items: center;
}

.footer-card-text {
    display: block; 
    width: 100%;
}

.footer-card-text h4 {
    font-size: 16px;
    color: #2c3e50;
    margin-bottom: 4px;
    font-weight: bold;
}

.footer-card-text p, .footer-card-text a {
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.4;
    text-decoration: none;
}

.phone-with-icons {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.footer-phone-link { 
    font-weight: bold; 
    color: #111111 !important; 
}

.messenger-icons-group { 
    display: flex; 
    gap: 6px; 
    align-items: center; 
}

.app-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: bold;
    width: 22px;
    height: 22px;
    border-radius: 4px;
    background-color: #f0f0f0;
    color: #333333;
    cursor: pointer;
}

.footer-map-right {
    width: 100%;
    min-height: 280px;
    height: 100%;
}

.map-container-card {
    width: 100%;
    height: 100%;
    min-height: 280px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #e5e7eb;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    position: relative;
}

.map-embedded-frame {
    width: 100%;
    height: 100%;
    min-height: 230px;
    border: 0;
    flex-grow: 1;
}

.map-action-bar {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    background-color: var(--color-bg-card);
    border-top: 1px solid #e5e7eb;
}

.map-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border-radius: 8px;
    transition: background-color var(--transition-fast), transform var(--transition-fast);
}

.map-btn-2gis {
    background-color: #88B948;
    color: #ffffff;
}

.map-btn-2gis:hover {
    background-color: #6E9938;
}

.map-btn-yandex {
    background-color: var(--color-purple-main);
    color: #ffffff;
}

.map-btn-yandex:hover {
    background-color: var(--color-purple-hover);
}

.footer-nav-wrapper {
    width: 100%;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.footer-nav-menu {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 41px;
    background-color: var(--color-bg-card);
    padding: 12px 32px;
    border-radius: 11px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    width: max-content;
}

/* ==========================================================================
   10. МЕДИА-ЗАПРОСЫ ДЛЯ ПК (ШИРИНА ЭКРАНА ОТ 769px) — БЕЗ ПРЫЖКОВ ВЫСОТЫ
   ========================================================================== */
@media (min-width: 769px) {
    /* --- КАРТОЧКА 1 (ФИОЛЕТОВАЯ) --- */
    #dir-card-1 .dir-purple-base { left: 23%; width: 25%; background-color: var(--color-purple-main); }
    #dir-card-1 .dir-white-content { right: 0; box-shadow: -10px 0 20px rgba(0, 0, 0, 0.05); }
    #dir-card-1 .dir-abyss-gradient { right: 55%; background: linear-gradient(to right, rgba(58, 44, 150, 0) 0%, var(--color-purple-main) 100%); }
    #dir-card-1 .dir-arrow-chevron { left: calc(5% + 12px); transform: translateY(-50%) scaleY(1.8); }
    #dir-card-1 .dir-purple-text { padding: 24px 15px 10px calc(7% + 28px) !important; }
    #dir-card-1 .dir-more-btn { background-color: var(--color-purple-main); color: #ffffff; position: static; width: auto; transform: none; margin-top: auto; box-shadow: none; }
    
    /* ЭФФЕКТ НА ПК: Плашка расширяется СТРОГО в границах карточки, перекрывая картинку и белый блок */
    #dir-card-1.expanded .dir-purple-base { 
        left: 0 !important; 
        width: 100% !important; 
        z-index: 10 !important; 
    }
    #dir-card-1.expanded .dir-card-btn-purple { display: block !important; }
    #dir-card-1.expanded .dir-more-btn { display: none !important; }

    /* --- КАРТОЧКА 2 (ОРАНЖЕВАЯ - ЗЕРКАЛЬНАЯ) --- */
    #dir-card-2 .dir-purple-base { right: 26% !important; left: unset !important; width: 22% !important; background-color: var(--color-orange-main) !important; position: absolute !important; z-index: 3 !important; }
    #dir-card-2 .dir-white-content { left: 0 !important; right: unset !important; box-shadow: 10px 0 20px rgba(0, 0, 0, 0.05) !important; }
    #dir-card-2 .dir-abyss-gradient { display: none !important; }
    #dir-card-2 .dir-arrow-chevron { right: 15px !important; left: unset !important; transform: translateY(-50%) scaleX(1) scaleY(1.8) !important; color: #000000 !important; z-index: 4 !important; }
    #dir-card-2 .dir-purple-text { color: #000000 !important; padding: 24px 20px 10px 45px !important; }

    #dir-card-2 .dir-purple-base::after {
        content: ''; position: absolute; top: 0; right: 0; width: 90px; height: 100%;
        background: linear-gradient(to right, rgba(211, 163, 83, 0) 0%, var(--color-orange-main) 100%);
        pointer-events: none; z-index: 1; border-top-right-radius: 10px; border-bottom-right-radius: 10px;
    }

    #dir-card-2 .dir-more-btn { background-color: var(--color-orange-main) !important; color: #ffffff !important; position: static; width: auto; transform: none; margin-top: auto; box-shadow: none; }
    #dir-card-2 .dir-photo-block { position: absolute !important; right: 0 !important; left: unset !important; top: 0 !important; width: 30% !important; height: 100% !important; z-index: 1 !important; }
    
    /* ОРАНЖЕВАЯ РАСШИРЯЕТСЯ ПОВЕРХ СВОЕЙ КАРТОЧКИ */
    #dir-card-2.expanded .dir-purple-base { left: 0 !important; right: 0 !important; width: 100% !important; z-index: 10 !important; }
    #dir-card-2.expanded .dir-card-btn-purple { display: block !important; }
    #dir-card-2.expanded .dir-more-btn { display: none !important; }
    #dir-card-2.expanded .dir-purple-base::after { opacity: 0 !important; visibility: hidden !important; }

    /* --- КАРТОЧКА 3 (ЗЕЛЕНАЯ) --- */
    #dir-card-3 .dir-purple-base { left: 23% !important; right: auto !important; width: 25% !important; background-color: var(--color-light-green) !important; position: absolute !important; z-index: 2 !important; }
    #dir-card-3 .dir-white-content { right: 0 !important; left: auto !important; box-shadow: -10px 0 20px rgba(0, 0, 0, 0.05) !important; }
    #dir-card-3 .dir-abyss-gradient { right: 55% !important; left: auto !important; background: linear-gradient(to right, rgba(146, 196, 82, 0) 0%, var(--color-light-green) 100%) !important; display: block !important; }
    #dir-card-3 .dir-arrow-chevron { left: calc(5% + 12px) !important; right: auto !important; transform: translateY(-50%) scaleY(1.8) !important; color: #000000 !important; z-index: 5 !important; }
    #dir-card-3 .dir-purple-text { color: #000000 !important; padding: 24px 15px 10px calc(7% + 28px) !important; }
    #dir-card-3 .dir-more-btn { background-color: var(--color-light-green) !important; color: #ffffff !important; position: static; width: auto; transform: none; margin-top: auto; box-shadow: none; }
    #dir-card-3 .dir-photo-block { position: relative !important; left: 0 !important; right: auto !important; top: 0 !important; width: 30% !important; height: 100% !important; z-index: 1 !important; transform: none !important; opacity: 1 !important; display: block !important; }
    
    /* ЗЕЛЕНАЯ РАСШИРЯЕТСЯ ПОВЕРХ СВОЕЙ КАРТОЧКИ */
    #dir-card-3.expanded .dir-purple-base { left: 0 !important; width: 100% !important; z-index: 10 !important; }
    #dir-card-3.expanded .dir-card-btn-purple { display: block !important; }
    #dir-card-3.expanded .dir-more-btn { display: none !important; }
    /* АНИМАЦИЯ ПОЯВЛЕНИЯ ПРИ СКРОЛЛЕ ДЛЯ ПК */
    .dir-card:not(.visible) .dir-white-content { transform: translateX(100px); opacity: 0; }
    .dir-card.dir-reverse:not(.visible) .dir-white-content { transform: translateX(-100px); opacity: 0; }
    .dir-card:not(.visible) .dir-purple-base { transform: translateX(50px); opacity: 0; }
    .dir-card.dir-reverse:not(.visible) .dir-purple-base { transform: translateX(-50px); opacity: 0; }
    .dir-card:not(.visible) .dir-photo-block { transform: translateX(30px); opacity: 0; }
    .dir-card:not(.visible) .dir-abyss-gradient { opacity: 0; }

    .dir-card.visible:not(.expanded) .dir-white-content, 
    .dir-card.visible:not(.expanded) .dir-purple-base { opacity: 1; transform: translateX(0) !important; }
    .dir-card.visible:not(.expanded) .dir-photo-block { opacity: 1; transform: translateX(0) !important; }
    .dir-card.visible:not(.expanded) .dir-abyss-gradient { opacity: 1; }
    
    .dir-card .dir-white-content { transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.8s ease-in-out; }
    .dir-card .dir-purple-base { transition: left 0.6s cubic-bezier(0.25, 1, 0.5, 1), right 0.6s cubic-bezier(0.25, 1, 0.5, 1), width 0.6s cubic-bezier(0.25, 1, 0.5, 1), padding 0.6s cubic-bezier(0.25, 1, 0.5, 1), transform 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.2s, opacity 0.8s ease-in-out 0.2s; }
    .dir-card .dir-photo-block { transition: transform 0.8s cubic-bezier(0.25, 1, 0.5, 1) 0.4s, opacity 0.8s ease-in-out 0.4s; }
    .dir-card .dir-abyss-gradient { transition: opacity 0.6s ease-in-out 0.3s; }

    /* ЖЕСТКИЕ СИММЕТРИЧНЫЕ ОТСТУПЫ ПРИ РАСКРЫТИИ НА ПК */
    #dir-card-1.expanded .dir-purple-base,
    #dir-card-2.expanded .dir-purple-base,
    #dir-card-3.expanded .dir-purple-base {
        padding: 35px 45px 85px 45px !important; box-sizing: border-box !important; overflow: hidden !important;
    }
    #dir-card-1.expanded .dir-purple-text,
    #dir-card-2.expanded .dir-purple-text,
    #dir-card-3.expanded .dir-purple-text {
        padding: 0 !important; margin: 0 !important; top: auto !important; left: auto !important; position: relative !important; width: 100% !important; height: auto !important;
    }
        /* Полностью убираем стрелочки-шевроны во всех темах, когда карточка развернута */
    #dir-card-1.expanded .dir-arrow-chevron,
    #dir-card-2.expanded .dir-arrow-chevron,
    #dir-card-3.expanded .dir-arrow-chevron {
        display: none !important;
        opacity: 0 !important;
        visibility: hidden !important;
    }

}

/* ==========================================================================
   11. МЕДИА-ЗАПРОСЫ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (ШИРИНА ЭКРАНА ДО 768px)
   ========================================================================== */
@media (max-width: 768px) {
    .burger-menu-btn { 
        display: flex; 
        flex-direction: column; 
        justify-content: space-between; 
        width: 28px; 
        height: 20px; 
        background: none; 
        border: none; 
        cursor: pointer; 
        z-index: 100; 
        margin-right: 20px; 
    }
    .burger-menu-btn span { 
        width: 100%; 
        height: 3px; 
        background-color: var(--color-green-main); 
        border-radius: 2px; 
        transition: all 0.3s ease-in-out; 
    }
    .burger-menu-btn.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .burger-menu-btn.active span:nth-child(2) { opacity: 0; }
    .burger-menu-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .main-header { 
        padding-top: 15px; 
        justify-content: flex-end; 
        position: fixed !important; 
        transform: translateY(0) !important; 
    }
    .main-header.header-hidden { 
        transform: translateY(0) !important; 
    }
    
    .nav-menu { 
        position: fixed; 
        top: 0; 
        right: -100%; 
        width: 75%; 
        height: 100vh; 
        background-color: var(--color-bg-card); 
        flex-direction: column; 
        justify-content: center; 
        gap: 35px; 
        padding: 40px; 
        border-radius: 0; 
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1); 
        transition: right 0.4s ease-in-out; 
    }
    .nav-menu.active { right: 0; }
    
    .hero { height: 45vh; background-image: url('images/banner-mobile.jpg'); }
    .hero-content { max-width: 260px; }
    .slogan { font-size: 16px; }
    
    .about { height: auto; padding: 30px 15px; }
    .about-grid-content { grid-template-columns: 1fr; gap: 20px; height: auto; }

    .card.main-text { 
        width: 100%; 
        height: 320px !important; 
        max-height: 320px !important; 
        transition: max-height 0.5s ease-in-out, height 0.5s ease-in-out; 
    }
    .card.main-text.expanded { height: 650px !important; max-height: 650px !important; }
    .text-fade-wrapper { height: 150px; overflow: hidden; }
    .card.main-text.expanded .text-fade-wrapper { height: 520px !important; }
    .text-fade-wrapper::after { 
        content: ''; 
        position: absolute; 
        bottom: 0; 
        left: 0; 
        width: 100%; 
        height: 45px; 
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); 
        pointer-events: none; 
    }

    .more-btn { display: block !important; margin-top: auto; }
    .cards-right { display: flex; flex-direction: column; height: auto; gap: 15px; }
    .svid-card, .manager-photo, .dogovor-card, .diplom-card { grid-column: unset !important; width: 100%; height: 180px; }
    .manager-photo { order: -1; display: none !important; }
    /* ==========================================================================
       11. МЕДИА-ЗАПРОСЫ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (ЧАСТЬ 2 ИЗ 2)
    .dir-card { display: flex !important; flex-direction: column !important; height: 700px !important; width: 100% !important; position: relative !important; background-color: transparent !important; overflow: hidden !important; margin-bottom: 40px !important; }
    .dir-card.mobile-expanded { height: 700px !important; overflow: visible !important; }
    
    .dir-photo-block { position: relative !important; width: 100% !important; height: 200px !important; order: 1 !important; border-radius: 11px !important; transform: none !important; opacity: 1 !important; visibility: visible !important; z-index: 1 !important; }
    
    /* Белая карточка контента лежит ПОВЕРХ цветных плашек */
    .dir-white-content { position: relative !important; width: 100% !important; height: auto !important; left: 0 !important; top: 0 !important; right: 0 !important; margin: -25px 0 -20px 0 !important; padding: 30px 20px 25px 20px !important; order: 2 !important; background-color: var(--color-bg-card) !important; border-radius: 11px !important; display: flex !important; flex-direction: column !important; align-items: center !important; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important; z-index: 4 !important; }
    .dir-white-text-container { width: 100% !important; height: auto !important; font-size: 15px !important; line-height: 1.5 !important; color: var(--color-text-dark) !important; text-align: left !important; }
    .dir-card.mobile-expanded .dir-white-content { position: relative !important; height: auto !important; width: 100% !important; opacity: 1 !important; visibility: visible !important; transform: none !important; z-index: 2 !important; }

    /* Цветная плашка лежит внизу, поджата вверх ВНАХЛЁСТ и уходит ПОД белую карточку */
    .dir-purple-base { position: absolute !important; bottom: 0 !important; top: auto !important; left: 0 !important; width: 100% !important; height: 250px !important; margin: -35px 0 0 0 !important; padding: 35px 20px 20px 20px !important; order: 3 !important; z-index: 3 !important; transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1), padding 0.5s ease-in-out !important; }
    .dir-card.mobile-expanded .dir-purple-base { position: absolute !important; top: 0 !important; bottom: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; margin: 0 !important; padding: 30px 20px 80px 20px !important; z-index: 10 !important; }
    
    .dir-arrow-chevron, .dir-abyss-gradient, .dir-mobile-only-btn { display: none !important; }
    
    .dir-card .dir-more-btn { display: block !important; position: absolute !important; bottom: 15px !important; left: 20px !important; width: calc(100% - 40px) !important; background-color: var(--color-bg-card) !important; border: none !important; border-radius: 11px !important; padding: 12px 0 !important; font-size: 15px !important; font-weight: bold !important; text-align: center !important; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important; z-index: 99 !important; transform: none !important; }
    .dir-card.mobile-expanded .dir-more-btn { position: absolute !important; bottom: 20px !important; left: 20px !important; width: calc(100% - 40px) !important; background-color: var(--color-bg-card) !important; z-index: 99 !important; }
    
    .dir-purple-text { position: relative !important; width: 100% !important; height: 140px !important; overflow: hidden !important; padding: 0 0 45px 0 !important; font-size: 15px !important; line-height: 1.5 !important; text-align: left !important; mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 55%, rgba(0,0,0,0) 100%) !important; -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 55%, rgba(0,0,0,0) 100%) !important; transition: height 0.5s ease-in-out, mask-image 0.3s ease, -webkit-mask-image 0.3s ease !important; }

    /* Настройки цветов по ID — закрытые плашки сидят строго на z-index: 3 */
    #dir-card-1 .dir-purple-base { 
        background-color: var(--color-purple-main) !important; 
        margin-top: -45px !important; /* Увеличили подъем, чтобы убрать дыру */
        bottom: 0 !important;
        z-index: 3 !important;        /* Строго под белую карточку */
    }
    #dir-card-2 .dir-purple-base { 
        background-color: var(--color-orange-main) !important; 
        margin-top: -45px !important; /* Увеличили подъем, чтобы убрать дыру */
        bottom: 0 !important;
        z-index: 3 !important;        /* Строго под белую карточку */
    }
    
    /* Зеленая карточка 3: оставляем идеальные настройки */
    #dir-card-3 .dir-purple-base { 
        background-color: var(--color-light-green) !important; 
        margin-top: -35px !important; 
        z-index: 3 !important; 
    }
    
                            /* ИЗОЛИРОВАННЫЙ ЦВЕТ И ТЕКСТ ПО ID НА МОБИЛКЕ — ФИНАЛЬНЫЙ СИММЕТРИЧНЫЙ ВЫРАВНИВАТЕЛЬ */
    
    /* Фиолетовая карточка 1: подняли еще на 5px выше под белую плашку */
    #dir-card-1 .dir-purple-base { 
        background-color: var(--color-purple-main) !important; 
        transform: translateY(-80px) !important; /* Было -75px, стало -80px */
        z-index: 3 !important;                   
        margin-top: 0 !important;
    }
    
    /* Оранжевая карточка 2: остается в своем идеальном положении */
    #dir-card-2 .dir-purple-base { 
        background-color: var(--color-orange-main) !important; 
        transform: translateY(-65px) !important; /* Оставляем, она стоит идеально */
        z-index: 3 !important;                   
        margin-top: 0 !important;
    }
    
    /* Зеленая карточка 3: опустили совсем на капельку ниже */
    #dir-card-3 .dir-purple-base { 
        background-color: var(--color-light-green) !important; 
        transform: translateY(0px) !important;  /* Сбросили в 0px, опустив на самую малость */
        z-index: 3 !important;                   
        margin-top: 0 !important;
    }
    
    #dir-card-1 .dir-purple-text { color: #ffffff !important; }
    #dir-card-2 .dir-purple-text { color: #000000 !important; }
    #dir-card-3 .dir-purple-text { color: #000000 !important; }
    
    #dir-card-1 .dir-more-btn { color: var(--color-purple-main) !important; background-color: var(--color-bg-card) !important; }
    #dir-card-2 .dir-more-btn { color: var(--color-orange-main) !important; background-color: var(--color-bg-card) !important; }
    #dir-card-3 .dir-more-btn { color: var(--color-light-green) !important; background-color: var(--color-bg-card) !important; }
    
    /* Состояние раскрытия — сбрасываем точечные сдвиги в ноль */
    #dir-card-1.mobile-expanded .dir-purple-base { background-color: var(--color-purple-main) !important; z-index: 10 !important; transform: translateY(0) !important; }
    #dir-card-2.mobile-expanded .dir-purple-base { background-color: var(--color-orange-main) !important; z-index: 10 !important; transform: translateY(0) !important; }
    #dir-card-3.mobile-expanded .dir-purple-base { background-color: var(--color-light-green) !important; z-index: 10 !important; transform: translateY(0) !important; }
    
    #dir-card-1.mobile-expanded .dir-purple-text { color: #ffffff !important; }
    #dir-card-2.mobile-expanded .dir-purple-text { color: #000000 !important; }
    #dir-card-3.mobile-expanded .dir-purple-text { color: #000000 !important; }

    .news-viewport-wrapper { padding: 0 40px !important; }
    .news-slider-track { gap: 0; } 
    .news-slide-card { flex: 0 0 100% !important; height: auto; }
    .news-nav-arrow.arrow-left { left: 10px !important; }
    .news-nav-arrow.arrow-right { right: 10px !important; }

    .footer-grid { grid-template-columns: 1fr; gap: 20px; padding: 0 15px; }
    .footer-map-right { height: 240px; }
    .footer-card { padding: 16px; }
    .footer-nav-menu { gap: 25px; padding: 12px 20px; width: 100%; }
} /* ФИНАЛЬНОЕ ЗАКРЫТИЕ ВСЕГО ФАЙЛА СТИЛЕЙ */
/* ==========================================================================
   11. МЕДИА-ЗАПРОСЫ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (MOBILE-FIRST UI/UX)
@media (max-width: 768px) {
    /* Навигация и бургер-меню (Touch Target 48px) */
    .main-header { 
        padding: 10px 15px; 
        justify-content: flex-end; 
        position: fixed !important; 
        background-color: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
        transform: translateY(0) !important; 
    }

    .burger-menu-btn { 
        display: flex; 
        flex-direction: column; 
        justify-content: center;
        align-items: center;
        gap: 5px;
        width: 48px; 
        height: 48px; 
        background: none; 
        border: none; 
        cursor: pointer; 
        z-index: 100; 
        margin-right: 0;
        border-radius: 8px;
    }
    .burger-menu-btn span { 
        width: 26px; 
        height: 3px; 
        background-color: var(--color-green-main); 
        border-radius: 2px; 
        transition: transform 0.3s ease, opacity 0.3s ease; 
    }
    .burger-menu-btn.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .burger-menu-btn.active span:nth-child(2) { opacity: 0; }
    .burger-menu-btn.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

    .mobile-drawer-backdrop {
        display: block;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 90;
        opacity: 0;
        visibility: hidden;
        transition: opacity var(--transition-fast), visibility var(--transition-fast);
    }
    .mobile-drawer-backdrop.active {
        opacity: 1;
        visibility: visible;
    }
    body.no-scroll {
        overflow: hidden !important;
    }

    .nav-menu { 
        position: fixed; 
        top: 0; 
        right: -100%; 
        width: min(320px, 85vw); 
        height: 100vh; 
        height: 100dvh;
        background-color: var(--color-bg-card); 
        flex-direction: column; 
        justify-content: flex-start;
        align-items: stretch;
        gap: 10px; 
        padding: 85px 24px 30px 24px; 
        border-radius: 0; 
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.15); 
        transition: right 0.35s cubic-bezier(0.2, 0, 0, 1); 
        z-index: 95;
    }
    .nav-menu.active { right: 0; }

    .nav-link {
        min-height: 48px;
        display: flex;
        align-items: center;
        font-size: 18px;
        font-weight: 600;
        border-bottom: 1px solid #f3f4f6;
        padding: 10px 0;
    }
    
    /* Hero Секция */
    .hero { height: 42vh; background-image: url('images/banner.jpg'); }
    .hero-content { max-width: 280px; padding: 0 10px; }
    .slogan { font-size: 16px; margin-top: 5px; }
    
    /* Секция "О компании" */
    .about { height: auto; padding: 25px 15px 35px 15px; }
    .about-title { font-size: 24px; margin-bottom: 20px; }
    .about-grid-content { grid-template-columns: 1fr; gap: 20px; height: auto; }

    .card.main-text { 
        width: 100%; 
        min-height: auto !important;
        height: auto !important; 
        max-height: none !important; 
        padding: 20px;
    }
    .card.main-text.expanded { height: auto !important; max-height: none !important; }
    .text-fade-wrapper { max-height: 170px; overflow: hidden; margin-bottom: 16px; }
    .card.main-text.expanded .text-fade-wrapper { max-height: 1500px !important; }

    .more-btn { 
        width: 100%;
        min-height: 48px; 
        font-size: 16px;
        margin-top: 8px;
    }

    .cards-right { 
        display: flex; 
        flex-direction: column; 
        height: auto; 
        gap: 14px; 
    }
    .svid-card, .dogovor-card, .diplom-card { 
        width: 100%; 
        height: 90px; 
        min-height: 48px;
        border-radius: 10px;
    }
    .manager-photo { display: none !important; }

    /* Секция "Направления" - естественная блочная модель без отрицательных сдвигов */
    .directions-container { margin-top: 0; }
    .directions-title, .directions-title1 { font-size: 24px; margin-bottom: 10px; }
    .dir-title-text { font-size: 20px !important; margin-top: 25px !important; margin-bottom: 10px !important; }

    .dir-card { 
        display: flex !important; 
        flex-direction: column !important; 
        height: auto !important; 
        width: 100% !important; 
        position: relative !important; 
        background-color: var(--color-bg-card) !important; 
        overflow: hidden !important; 
        margin-bottom: 30px !important; 
        border-radius: 12px !important;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06) !important;
    }
    
    .dir-photo-block { 
        position: relative !important; 
        width: 100% !important; 
        height: 190px !important; 
        order: 1 !important; 
        border-radius: 12px 12px 0 0 !important; 
        transform: none !important; 
        opacity: 1 !important; 
        visibility: visible !important; 
        z-index: 1 !important; 
    }
    
    .dir-white-content { 
        position: relative !important; 
        width: 100% !important; 
        height: auto !important; 
        left: 0 !important; 
        top: 0 !important; 
        right: 0 !important; 
        margin: 0 !important; 
        padding: 20px !important; 
        order: 2 !important; 
        background-color: var(--color-bg-card) !important; 
        border-radius: 0 !important; 
        display: flex !important; 
        flex-direction: column !important; 
        align-items: stretch !important; 
        box-shadow: none !important; 
        z-index: 2 !important; 
    }
    .dir-white-text-container { 
        width: 100% !important; 
        height: auto !important; 
        font-size: 15px !important; 
        line-height: 1.55 !important; 
        color: var(--color-text-dark) !important; 
        text-align: left !important; 
    }

    .dir-more-btn { 
        display: flex !important; 
        align-items: center !important;
        justify-content: center !important;
        position: static !important; 
        width: 100% !important; 
        min-height: 48px !important;
        margin-top: 16px !important;
        border: none !important; 
        border-radius: 10px !important; 
        font-size: 16px !important; 
        font-weight: 700 !important; 
        text-align: center !important; 
        cursor: pointer !important;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1) !important;
    }

    #dir-card-1 .dir-more-btn { background-color: var(--color-purple-main) !important; color: #ffffff !important; }
    #dir-card-2 .dir-more-btn { background-color: var(--color-orange-main) !important; color: #ffffff !important; }
    #dir-card-3 .dir-more-btn { background-color: var(--color-light-green) !important; color: #111111 !important; }

    /* Цветная плашка с полным текстом */
    .dir-purple-base { 
        display: none !important;
        position: relative !important; 
        width: 100% !important; 
        height: auto !important; 
        margin: 0 !important; 
        padding: 20px 20px 24px 20px !important; 
        order: 3 !important; 
        border-radius: 0 0 12px 12px !important;
        z-index: 3 !important; 
        box-sizing: border-box !important;
    }
    
    .dir-card.mobile-expanded .dir-purple-base { 
        display: block !important; 
    }

    .dir-card.mobile-expanded .dir-white-content .dir-more-btn {
        display: none !important;
    }

    .dir-purple-text { 
        position: relative !important; 
        width: 100% !important; 
        height: auto !important; 
        overflow: visible !important; 
        padding: 0 !important; 
        font-size: 15px !important; 
        line-height: 1.55 !important; 
        text-align: left !important; 
        mask-image: none !important; 
        -webkit-mask-image: none !important; 
    }

    .dir-card-btn-purple { 
        display: flex !important; 
        align-items: center !important;
        justify-content: center !important;
        position: static !important; 
        width: 100% !important; 
        min-height: 48px !important;
        margin-top: 18px !important;
        transform: none !important;
        border-radius: 10px !important; 
        font-size: 16px !important; 
        font-weight: 700 !important; 
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    }

    #dir-card-1 .dir-purple-base { background-color: var(--color-purple-main) !important; }
    #dir-card-2 .dir-purple-base { background-color: var(--color-orange-main) !important; }
    #dir-card-3 .dir-purple-base { background-color: var(--color-light-green) !important; }

    #dir-card-1 .dir-purple-text { color: #ffffff !important; }
    #dir-card-2 .dir-purple-text { color: #111111 !important; }
    #dir-card-3 .dir-purple-text { color: #111111 !important; }

    #dir-card-1 .dir-card-btn-purple { background-color: #ffffff !important; color: var(--color-purple-main) !important; }
    #dir-card-2 .dir-card-btn-purple { background-color: #111111 !important; color: #ffffff !important; }
    #dir-card-3 .dir-card-btn-purple { background-color: #111111 !important; color: #ffffff !important; }

    .dir-arrow-chevron, 
    .dir-abyss-gradient, 
    .dir-mobile-only-btn { 
        display: none !important; 
    }

    /* Слайдер новостей на мобильных устройствах */
    .news-viewport-wrapper { 
        padding: 0 5px !important; 
    }
    .news-slider-track { 
        gap: 0; 
    } 
    .news-slide-card { 
        flex: 0 0 100% !important; 
        height: auto; 
        padding: 0 10px;
    }
    .news-nav-arrow {
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        background-color: rgba(255, 255, 255, 0.9);
        border-radius: 50%;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    }
    .news-nav-arrow.arrow-left { left: 5px !important; }
    .news-nav-arrow.arrow-right { right: 5px !important; }

    /* Футер на мобильных */
    .footer-grid { grid-template-columns: 1fr; gap: 20px; padding: 0 10px; }
    .footer-map-right { height: auto; min-height: 320px; }
    .map-container-card { min-height: 320px; }
    .map-embedded-frame { min-height: 250px; }
    .map-action-bar { flex-direction: column; gap: 8px; padding: 12px; }
    .map-btn { min-height: 48px; font-size: 15px; }
    .footer-card { padding: 18px 16px; border-radius: 10px; }
    .footer-nav-menu { 
        flex-direction: column;
        gap: 14px; 
        padding: 16px 20px; 
        width: 100%; 
    }
    .footer-nav-menu .nav-link {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    .app-icon {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }
    .footer-phone-link {
        font-size: 16px;
        min-height: 44px;
        display: inline-flex;
        align-items: center;
    }
} /* ФИНАЛЬНОЕ ЗАКРЫТИЕ ВСЕГО ФАЙЛА СТИЛЕЙ */
   ========================================================================== */
@media (max-width: 768px) {
    .burger-menu-btn { 
        display: flex; 
        flex-direction: column; 
        justify-content: space-between; 
        width: 28px; 
        height: 20px; 
        background: none; 
        border: none; 
        cursor: pointer; 
        z-index: 100; 
        margin-right: 20px; 
    }
    .burger-menu-btn span { 
        width: 100%; 
        height: 3px; 
        background-color: var(--color-green-main); 
        border-radius: 2px; 
        transition: all 0.3s ease-in-out; 
    }
    .burger-menu-btn.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .burger-menu-btn.active span:nth-child(2) { opacity: 0; }
    .burger-menu-btn.active span:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .main-header { 
        padding-top: 15px; 
        justify-content: flex-end; 
        position: fixed !important; 
        transform: translateY(0) !important; 
    }
    .main-header.header-hidden { 
        transform: translateY(0) !important; 
    }
    
    .nav-menu { 
        position: fixed; 
        top: 0; 
        right: -100%; 
        width: 75%; 
        height: 100vh; 
        background-color: var(--color-bg-card); 
        flex-direction: column; 
        justify-content: center; 
        gap: 35px; 
        padding: 40px; 
        border-radius: 0; 
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1); 
        transition: right 0.4s ease-in-out; 
    }
    .nav-menu.active { right: 0; }
    
    .hero { height: 45vh; background-image: url('images/banner-mobile.jpg'); }
    .hero-content { max-width: 260px; }
    .slogan { font-size: 16px; }
    
    .about { height: auto; padding: 30px 15px; }
    .about-grid-content { grid-template-columns: 1fr; gap: 20px; height: auto; }

    .card.main-text { 
        width: 100%; 
        height: 320px !important; 
        max-height: 320px !important; 
        transition: max-height 0.5s ease-in-out, height 0.5s ease-in-out; 
    }
    .card.main-text.expanded { height: 650px !important; max-height: 650px !important; }
    .text-fade-wrapper { height: 150px; overflow: hidden; }
    .card.main-text.expanded .text-fade-wrapper { height: 520px !important; }
    .text-fade-wrapper::after { 
        content: ''; 
        position: absolute; 
        bottom: 0; 
        left: 0; 
        width: 100%; 
        height: 45px; 
        background: linear-gradient(to bottom, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%); 
        pointer-events: none; 
    }

    .more-btn { display: block !important; margin-top: auto; }
    .cards-right { display: flex; flex-direction: column; height: auto; gap: 15px; }
    .svid-card, .manager-photo, .dogovor-card, .diplom-card { grid-column: unset !important; width: 100%; height: 180px; }
    .manager-photo { order: -1; display: none !important; }
    /* ==========================================================================
       11. МЕДИА-ЗАПРОСЫ ДЛЯ МОБИЛЬНЫХ УСТРОЙСТВ (ЧАСТЬ 2 ИЗ 2)
       ========================================================================== */
    .dir-card { display: flex !important; flex-direction: column !important; height: 700px !important; width: 100% !important; position: relative !important; background-color: transparent !important; overflow: hidden !important; margin-bottom: 40px !important; }
    .dir-card.mobile-expanded { height: 700px !important; overflow: visible !important; }
    
    .dir-photo-block { position: relative !important; width: 100% !important; height: 200px !important; order: 1 !important; border-radius: 11px !important; transform: none !important; opacity: 1 !important; visibility: visible !important; z-index: 1 !important; }
    
    /* Белая карточка контента лежит ПОВЕРХ цветных плашек */
    .dir-white-content { position: relative !important; width: 100% !important; height: auto !important; left: 0 !important; top: 0 !important; right: 0 !important; margin: -25px 0 -20px 0 !important; padding: 30px 20px 25px 20px !important; order: 2 !important; background-color: var(--color-bg-card) !important; border-radius: 11px !important; display: flex !important; flex-direction: column !important; align-items: center !important; box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08) !important; z-index: 4 !important; }
    .dir-white-text-container { width: 100% !important; height: auto !important; font-size: 15px !important; line-height: 1.5 !important; color: var(--color-text-dark) !important; text-align: left !important; }
    .dir-card.mobile-expanded .dir-white-content { position: relative !important; height: auto !important; width: 100% !important; opacity: 1 !important; visibility: visible !important; transform: none !important; z-index: 2 !important; }

    /* Цветная плашка лежит внизу, поджата вверх ВНАХЛЁСТ и уходит ПОД белую карточку */
    .dir-purple-base { position: absolute !important; bottom: 0 !important; top: auto !important; left: 0 !important; width: 100% !important; height: 250px !important; margin: -35px 0 0 0 !important; padding: 35px 20px 20px 20px !important; order: 3 !important; z-index: 3 !important; transition: height 0.5s cubic-bezier(0.25, 1, 0.5, 1), padding 0.5s ease-in-out !important; }
    .dir-card.mobile-expanded .dir-purple-base { position: absolute !important; top: 0 !important; bottom: 0 !important; left: 0 !important; width: 100% !important; height: 100% !important; margin: 0 !important; padding: 30px 20px 80px 20px !important; z-index: 10 !important; }
    
    .dir-arrow-chevron, .dir-abyss-gradient, .dir-mobile-only-btn { display: none !important; }
    
    .dir-card .dir-more-btn { display: block !important; position: absolute !important; bottom: 15px !important; left: 20px !important; width: calc(100% - 40px) !important; background-color: var(--color-bg-card) !important; border: none !important; border-radius: 11px !important; padding: 12px 0 !important; font-size: 15px !important; font-weight: bold !important; text-align: center !important; box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2) !important; z-index: 99 !important; transform: none !important; }
    .dir-card.mobile-expanded .dir-more-btn { position: absolute !important; bottom: 20px !important; left: 20px !important; width: calc(100% - 40px) !important; background-color: var(--color-bg-card) !important; z-index: 99 !important; }
    
    .dir-purple-text { position: relative !important; width: 100% !important; height: 140px !important; overflow: hidden !important; padding: 0 0 45px 0 !important; font-size: 15px !important; line-height: 1.5 !important; text-align: left !important; mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 55%, rgba(0,0,0,0) 100%) !important; -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 55%, rgba(0,0,0,0) 100%) !important; transition: height 0.5s ease-in-out, mask-image 0.3s ease, -webkit-mask-image 0.3s ease !important; }

    /* Настройки цветов по ID — закрытые плашки сидят строго на z-index: 3 */
    #dir-card-1 .dir-purple-base { 
        background-color: var(--color-purple-main) !important; 
        margin-top: -45px !important; /* Увеличили подъем, чтобы убрать дыру */
        bottom: 0 !important;
        z-index: 3 !important;        /* Строго под белую карточку */
    }
    #dir-card-2 .dir-purple-base { 
        background-color: var(--color-orange-main) !important; 
        margin-top: -45px !important; /* Увеличили подъем, чтобы убрать дыру */
        bottom: 0 !important;
        z-index: 3 !important;        /* Строго под белую карточку */
    }
    
    /* Зеленая карточка 3: оставляем идеальные настройки */
    #dir-card-3 .dir-purple-base { 
        background-color: var(--color-light-green) !important; 
        margin-top: -35px !important; 
        z-index: 3 !important; 
    }
    
                            /* ИЗОЛИРОВАННЫЙ ЦВЕТ И ТЕКСТ ПО ID НА МОБИЛКЕ — ФИНАЛЬНЫЙ СИММЕТРИЧНЫЙ ВЫРАВНИВАТЕЛЬ */
    
    /* Фиолетовая карточка 1: подняли еще на 5px выше под белую плашку */
    #dir-card-1 .dir-purple-base { 
        background-color: var(--color-purple-main) !important; 
        transform: translateY(-80px) !important; /* Было -75px, стало -80px */
        z-index: 3 !important;                   
        margin-top: 0 !important;
    }
    
    /* Оранжевая карточка 2: остается в своем идеальном положении */
    #dir-card-2 .dir-purple-base { 
        background-color: var(--color-orange-main) !important; 
        transform: translateY(-65px) !important; /* Оставляем, она стоит идеально */
        z-index: 3 !important;                   
        margin-top: 0 !important;
    }
    
    /* Зеленая карточка 3: опустили совсем на капельку ниже */
    #dir-card-3 .dir-purple-base { 
        background-color: var(--color-light-green) !important; 
        transform: translateY(0px) !important;  /* Сбросили в 0px, опустив на самую малость */
        z-index: 3 !important;                   
        margin-top: 0 !important;
    }
    
    #dir-card-1 .dir-purple-text { color: #ffffff !important; }
    #dir-card-2 .dir-purple-text { color: #000000 !important; }
    #dir-card-3 .dir-purple-text { color: #000000 !important; }
    
    #dir-card-1 .dir-more-btn { color: var(--color-purple-main) !important; background-color: var(--color-bg-card) !important; }
    #dir-card-2 .dir-more-btn { color: var(--color-orange-main) !important; background-color: var(--color-bg-card) !important; }
    #dir-card-3 .dir-more-btn { color: var(--color-light-green) !important; background-color: var(--color-bg-card) !important; }
    
    /* Состояние раскрытия — сбрасываем точечные сдвиги в ноль */
    #dir-card-1.mobile-expanded .dir-purple-base { background-color: var(--color-purple-main) !important; z-index: 10 !important; transform: translateY(0) !important; }
    #dir-card-2.mobile-expanded .dir-purple-base { background-color: var(--color-orange-main) !important; z-index: 10 !important; transform: translateY(0) !important; }
    #dir-card-3.mobile-expanded .dir-purple-base { background-color: var(--color-light-green) !important; z-index: 10 !important; transform: translateY(0) !important; }





    
    #dir-card-1.mobile-expanded .dir-purple-text { color: #ffffff !important; }
    #dir-card-2.mobile-expanded .dir-purple-text { color: #000000 !important; }
    #dir-card-3.mobile-expanded .dir-purple-text { color: #000000 !important; }

    .news-viewport-wrapper { padding: 0 40px !important; }
    .news-slider-track { gap: 0; } 
    .news-slide-card { flex: 0 0 100% !important; height: auto; }
    .news-nav-arrow.arrow-left { left: 10px !important; }
    .news-nav-arrow.arrow-right { right: 10px !important; }

    .footer-grid { grid-template-columns: 1fr; gap: 20px; padding: 0 15px; }
    .footer-map-right { height: 240px; }
    .footer-card { padding: 16px; }
    .footer-nav-menu { gap: 25px; padding: 12px 20px; width: 100%; }
} /* ФИНАЛЬНОЕ ЗАКРЫТИЕ ВСЕГО ФАЙЛА СТИЛЕЙ */

