/* ==========================================================================
   custom.css — Стили блоков главной страницы и адаптивной шапки
   ========================================================================== */

/* ===== 1. Адаптивная шапка и бургер ===== */
.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: relative;
    height: 70px;
}

.burger-toggle {
    display: none;
    width: 32px;
    height: 24px;
    background: transparent;
    border: none;
    cursor: pointer;
    flex-direction: column;
    justify-content: space-between;
    padding: 0;
    z-index: 1002;
}

.burger-toggle span {
    display: block;
    width: 100%;
    height: 3px;
    background-color: #1d2d47;
    border-radius: 2px;
    transition: transform 0.3s ease, opacity 0.2s ease;
}

.mobile-menu-contacts {
    display: none;
}

/* ===== 2. Логотип с вензелем ===== */
.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--text-light, #2A2A28);
    text-decoration: none;
    background: transparent;
}

.logo-icon-wrap {
    width: 48px;
    height: 48px;
    overflow: hidden;
    background: #f5f2eb;
}

.logo-venzel {
    display: block;
    width: 48px;
    height: 48px;
    object-fit: cover;
}

.logo-text {
    color: inherit;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 28px;
    font-weight: 500;
    line-height: 1;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.logo:hover .logo-venzel,
.logo:focus-visible .logo-venzel {
    transform: rotate(4deg) scale(1.04);
}

.logo:focus-visible {
    outline: 2px solid var(--gold, #c9a552);
    outline-offset: 5px;
}

/* ===== 3. Сетка "Что предоставить" (cases-grid) ===== */
.cases-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 24px;
    max-width: 1200px;
    margin: 0 auto;
}

.cases-card {
    width: calc(33.333% - 16px);
    display: flex;
    flex-direction: column;
    padding: 36px;
    border: 1px solid rgba(201, 165, 82, 0.3);
    background: rgba(255, 255, 255, 0.03);
    border-radius: 4px;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.cases-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold, #c9a552);
}

.cases-label {
    color: var(--gold, #c9a552);
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.cases-card h3 {
    color: #ffffff;
    font-family: 'Cormorant Garamond', serif;
    font-size: 26px;
    font-weight: 500;
    line-height: 1.2;
    margin-bottom: 16px;
}

.cases-card p {
    color: rgba(255, 255, 255, 0.72);
    font-family: 'Manrope', sans-serif;
    font-size: 15px;
    line-height: 1.7;
    margin-bottom: 16px;
}

.cases-card .cases-result {
    margin-top: auto;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.cases-card .cases-result strong {
    color: var(--gold, #c9a552);
}

/* ===== 4. Блок кейсов из практики ===== */
.cases-section {
    background: #1d2d47;
    padding: 84px 0;
}

.cases-section .cards-2x2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
}

.cases-section .card-case-dark {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 30px;
    border: 1px solid rgba(201, 165, 82, 0.28);
    background: rgba(255, 255, 255, 0.03);
    text-align: center;
    border-radius: 0;
}

.cases-section .case-cat {
    color: var(--gold, #c9a552);
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 15px;
}

.cases-section .case-desc {
    color: #ffffff;
    font-family: 'Cormorant Garamond', serif;
    font-size: 29px;
    font-weight: 500;
    line-height: 1.12;
    margin-bottom: 14px;
}

.cases-section .case-result {
    margin-top: auto;
    padding-top: 17px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    color: #ffffff;
    font-family: 'Manrope', sans-serif;
    font-size: 14px;
}

.cases-section .case-result strong {
    color: var(--gold, #c9a552);
    font-weight: 600;
}

/* ===== 5. Кнопка "Наверх" ===== */
#scrollTopBtn {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 99;
    border: none;
    outline: none;
    background: var(--gold, #c9a552);
    color: #fff;
    cursor: pointer;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

#scrollTopBtn.show {
    opacity: 1;
    visibility: visible;
}

#scrollTopBtn:hover {
    background: #b8943e;
}

#scrollTopBtn svg {
    width: 24px;
    height: 24px;
    stroke: #fff;
}

/* ===== 6. Дружественные сайты (партнеры) ===== */
.partners-section {
    padding: 88px 0;
    background: #f5f2eb;
    border-top: 1px solid rgba(29, 45, 71, 0.10);
    border-bottom: 1px solid rgba(29, 45, 71, 0.10);
}

.partners-heading {
    max-width: 760px;
    margin: 0 auto 42px;
    text-align: center;
}

.partners-eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    color: var(--gold, #c9a552);
    font-family: "Manrope", sans-serif;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.partners-section .section-title {
    margin-bottom: 0;
}

.partners-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    max-width: 1180px;
    margin: 0 auto;
}

.partner-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 355px;
    padding: 32px;
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    background: #ffffff;
    border: 1px solid rgba(29, 45, 71, 0.13);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.partner-card::before {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    content: "";
    background: var(--gold, #c9a552);
    transform: scaleX(0);
    transform-origin: left center;
    transition: transform 0.3s ease;
}

.partner-card:hover {
    border-color: rgba(201, 165, 82, 0.8);
    box-shadow: 0 14px 32px rgba(29, 45, 71, 0.10);
    transform: translateY(-6px);
}

.partner-card:hover::before {
    transform: scaleX(1);
}

.partner-card:focus-visible {
    outline: 2px solid var(--gold, #c9a552);
    outline-offset: 4px;
}

.partner-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 132px;
    padding: 18px;
    margin-bottom: 29px;
    background: #1d2d47;
    border: 1px solid rgba(201, 165, 82, 0.28);
}

.partner-logo img {
    display: block;
    max-width: 100%;
    max-height: 92px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.partner-card:hover .partner-logo img {
    transform: scale(1.04);
}

.partner-logo-apro img { max-height: 102px; }
.partner-logo-ag img { width: 100%; max-height: 82px; }
.partner-logo-fparf img { width: 100%; max-height: 86px; }

.partner-content {
    display: flex;
    flex: 1;
    flex-direction: column;
    align-items: flex-start;
}

.partner-type {
    margin-bottom: 12px;
    color: var(--gold, #c9a552);
    font-family: "Manrope", sans-serif;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.12em;
    line-height: 1.3;
    text-transform: uppercase;
}

.partner-card h3 {
    margin: 0 0 12px;
    color: #1d2d47;
    font-family: "Cormorant Garamond", Georgia, serif;
    font-size: 28px;
    font-weight: 600;
    line-height: 1.08;
}

.partner-card p {
    margin: 0 0 18px;
    color: rgba(29, 45, 71, 0.68);
    font-family: "Manrope", sans-serif;
    font-size: 14px;
    line-height: 1.6;
}

.partner-link {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-top: auto;
    color: #1d2d47;
    font-family: "Manrope", sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.partner-link span {
    color: var(--gold, #c9a552);
    font-size: 17px;
    line-height: 1;
    transition: transform 0.25s ease;
}

.partner-card:hover .partner-link span {
    transform: translate(3px, -3px);
}

/* ===== 7. Медиа-запросы (Адаптивность) ===== */
@media (max-width: 1024px) {
    .cases-card { width: calc(50% - 12px); }
    .partners-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .partner-card:last-child { grid-column: 1 / -1; }
    .partner-card:last-child .partner-logo { max-width: 50%; }
}

@media (max-width: 860px) {
    /* Отображение мобильного меню */
    .burger-toggle {
        display: flex;
    }

    .header-phone {
        display: none !important;
    }

    .burger-toggle.active span:nth-child(1) {
        transform: translateY(10.5px) rotate(45deg);
    }
    .burger-toggle.active span:nth-child(2) {
        opacity: 0;
    }
    .burger-toggle.active span:nth-child(3) {
        transform: translateY(-10.5px) rotate(-45deg);
    }

    /* 1. Блокируем горизонтальный скролл страницы */
    html, body {
        overflow-x: hidden;
    }

    /* 2. Мобильная навигация */
    .header .nav {
        position: fixed;
        top: 0;
        right: 0;
        width: 80%;
        max-width: 320px;
        height: 100vh;
        background: #ffffff;
        
        /* Убираем тень в закрытом состоянии, чтобы она не торчала */
        box-shadow: none;
        
        display: flex;
        flex-direction: column;
        padding: 90px 24px 40px;
        box-sizing: border-box;
        z-index: 1001;
        gap: 0;

        /* Полное скрытие за экраном */
        transform: translateX(100%);
        visibility: hidden;
        opacity: 0;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), 
                    visibility 0.3s ease, 
                    opacity 0.3s ease, 
                    box-shadow 0.3s ease;
    }

    /* 3. Открытое меню */
    .header .nav.open {
        transform: translateX(0);
        visibility: visible;
        opacity: 1;
        /* Тень появляется только при открытии */
        box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
    }
}