/* Общая шапка сайта (UGen_Site_Nav): панель — из темы (.panel-header), меню, выпадающие списки и мобильное меню — здесь.
   Все скругления — 12px. */
.ugh { --ugh-ink: #0B2D87; --ugh-ink2: #0C1D4C; --ugh-muted: rgba(11,45,135,.55); --ugh-tint: rgba(11,45,135,.06); --ugh-line: #E3E8F4; --ugh-r: 12px; font-family: Montserrat, Arial, sans-serif; }
.ugh *, .ugh *::before, .ugh *::after { box-sizing: border-box; }
.ugh .ugh-panel { z-index: 100; }
.ugh-top { display: flex; align-items: center; gap: 20px; }
.ugh-logo { flex-shrink: 0; }
.ugh-logo img { display: block; width: 139px; height: auto; }

/* меню */
.ugh-nav { flex: 1; display: flex; justify-content: center; }
.ugh-nav > ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.ugh-item { position: relative; }
.ugh-item--mega { position: static; }
.ugh-link { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border: 0; border-radius: var(--ugh-r); background: transparent; color: var(--ugh-muted);
    font: 600 16px/1.2 Montserrat, Arial, sans-serif; text-decoration: none !important; cursor: pointer; white-space: nowrap; transition: color .2s, background .2s; }
.ugh-link:hover, .ugh-link:focus-visible, .ugh-item.is-open > .ugh-link, .ugh-link.is-on { color: var(--ugh-ink); }
.ugh-link:hover, .ugh-item.is-open > .ugh-link { background: var(--ugh-tint); }
.ugh-caret { width: 7px; height: 7px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform .2s; }
.ugh-item.is-open .ugh-caret { transform: translateY(1px) rotate(-135deg); }

/* выпадающие списки */
.ugh-drop { position: absolute; top: calc(100% + 10px); left: 0; z-index: 110; background: #fff; border-radius: var(--ugh-r); padding: 14px;
    box-shadow: 0 24px 60px rgba(11,45,135,.18), 0 2px 6px rgba(11,45,135,.06); opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, visibility .2s; }
/* мостик через зазор под кнопкой — не выше зазора: иначе широкий список перекрывает соседние пункты меню и они не открываются при наведении */
.ugh-drop::before { content: ''; position: absolute; left: 0; right: 0; top: -12px; height: 12px; }
.ugh-item.is-open > .ugh-drop { opacity: 1; visibility: visible; transform: none; }
@media (hover: hover) and (min-width: 961px) {
    .ugh-item:hover > .ugh-drop { opacity: 1; visibility: visible; transform: none; }
    .ugh-item:hover > .ugh-link { color: var(--ugh-ink); background: var(--ugh-tint); }
    .ugh-item:hover .ugh-caret { transform: translateY(1px) rotate(-135deg); }
}
/* «Платформы» — компактно, чтобы помещалось на ноутбуке с масштабом 120–125 %: 5 колонок, SEO — в две */
.ugh-drop--mega { left: 0; right: 0; top: calc(100% + 8px); padding: 18px 20px; }
.ugh-mega { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-areas: "mp an seo seo crm" "ad so seo seo crm"; align-items: start; gap: 14px 20px; }
.ugh-mega > .ugh-group:nth-child(1) { grid-area: mp; } .ugh-mega > .ugh-group:nth-child(2) { grid-area: ad; }
.ugh-mega > .ugh-group:nth-child(3) { grid-area: an; } .ugh-mega > .ugh-group:nth-child(4) { grid-area: seo; }
.ugh-mega > .ugh-group:nth-child(5) { grid-area: so; } .ugh-mega > .ugh-group:nth-child(6) { grid-area: crm; }
.ugh-mega > .ugh-group:nth-child(4) { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; align-content: start; }
.ugh-mega > .ugh-group:nth-child(4) .ugh-group__t { grid-column: 1 / -1; }
.ugh-group__t { margin: 0 0 4px 8px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .6px; color: var(--ugh-muted); }
.ugh-pl { display: flex; align-items: center; gap: 9px; padding: 4px 8px; border-radius: var(--ugh-r); color: var(--ugh-ink2) !important; font-size: 14px; font-weight: 600; line-height: 1.25; text-decoration: none !important; transition: background .15s; }
a.ugh-pl:hover, .ugh-pl.is-on { background: var(--ugh-tint); }
.ugh-ico { flex-shrink: 0; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center; font-style: normal; font-size: 10px; font-weight: 800; letter-spacing: -.2px; }
.ugh-ico.is-logo { background: transparent; }
.ugh-ico img { display: block; width: 24px; height: 24px; object-fit: contain; }
.ugh-pl.is-soon { cursor: default; }
.ugh-pl.is-soon > span, .ugh-pl.is-soon .ugh-ico { opacity: .55; }
.ugh-pl em, .ugh-sol em { margin-left: auto; padding: 2px 8px; border-radius: var(--ugh-r); background: #EEF1F8; color: var(--ugh-muted); font-style: normal; font-size: 11px; font-weight: 600; white-space: nowrap; }
.ugh-all { display: inline-block; margin: 6px 0 0 8px; font-size: 13px; font-weight: 700; color: #0036E9 !important; text-decoration: none !important; }
.ugh-all:hover { text-decoration: underline !important; }
.ugh-drop--sol { width: 360px; display: flex; flex-direction: column; gap: 2px; }
.ugh-drop--roles { width: 640px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px 6px; }
@media (max-width: 1180px) { .ugh-drop--roles { left: auto; right: -120px; } }
.ugh-sol { position: relative; display: flex; flex-wrap: wrap; align-items: center; gap: 2px 8px; padding: 10px 12px; border-radius: var(--ugh-r); text-decoration: none !important; }
.ugh-sol b { font-size: 15px; color: var(--ugh-ink2); }
.ugh-sol small { flex-basis: 100%; order: 3; font-size: 13px; color: var(--ugh-muted); }
a.ugh-sol:hover, .ugh-sol.is-on { background: var(--ugh-tint); }
.ugh-sol.is-soon b { opacity: .6; }

/* кнопки справа */
.ugh-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.ugh-user { display: inline-flex; align-items: center; justify-content: center; gap: 14px; height: 48px; padding: 0 14px; border-radius: var(--ugh-r); background: #fff; border: 1px solid #E3E8F4;
    color: var(--ugh-ink) !important; font-size: 15px; font-weight: 500; text-decoration: none !important; white-space: nowrap; transition: border-color .2s; }
.ugh-user:hover { border-color: var(--ugh-ink); }
.ugh-user i { width: 18px; height: 20px; background: url(/wp-content/themes/api/assets/images/user.svg) 50% 50% / 18px 20px no-repeat; }
.ugh-cta { display: inline-flex; align-items: center; justify-content: center; height: 48px; padding: 0 20px; border-radius: var(--ugh-r); background: linear-gradient(180deg, #3963EF, #0036E9);
    color: #fff !important; font-size: 15px; font-weight: 700; text-decoration: none !important; white-space: nowrap; box-shadow: 0 8px 18px rgba(0,54,233,.25); transition: transform .2s, box-shadow .2s; }
.ugh-cta:hover { transform: translateY(-1px); box-shadow: 0 12px 24px rgba(0,54,233,.32); }

/* мобильное меню */
.ugh-burger { display: none; flex-direction: column; justify-content: center; align-items: center; gap: 5px; width: 44px; height: 44px; margin-left: auto; padding: 0; border: 0; border-radius: var(--ugh-r); background: var(--ugh-tint); cursor: pointer; }
.ugh-burger span { display: block; width: 20px; height: 2px; border-radius: var(--ugh-r); background: var(--ugh-ink); transition: transform .25s, opacity .25s; }
.ugh.is-open .ugh-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ugh.is-open .ugh-burger span:nth-child(2) { opacity: 0; }
.ugh.is-open .ugh-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.ugh-mobile { display: none; }

@media (max-width: 1180px) {
    .ugh-mega { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-areas: "mp an crm" "ad so crm" "seo seo seo"; }
    .ugh-mega > .ugh-group:nth-child(4) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .ugh-actions .ugh-cta { display: none; }
    .ugh-link { padding: 10px; font-size: 15px; }
}
@media (max-width: 960px) {
    .ugh-nav, .ugh-actions { display: none; }
    .ugh-burger { display: flex; }
    .ugh.is-open .ugh-mobile { display: block; max-height: calc(100vh - 120px); overflow-y: auto; overscroll-behavior: contain; padding: 10px 0 4px; }
    .ugh-acc { border-bottom: 1px solid var(--ugh-line); }
    .ugh-acc summary, .ugh-mlink { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; list-style: none; cursor: pointer;
        font-size: 17px; font-weight: 700; color: var(--ugh-ink) !important; text-decoration: none !important; }
    .ugh-mlink { border-bottom: 1px solid var(--ugh-line); }
    .ugh-acc summary::-webkit-details-marker { display: none; }
    .ugh-acc summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
    .ugh-acc[open] summary::after { transform: rotate(-135deg); }
    .ugh-acc__body { padding: 0 0 12px; }
    .ugh-acc__body .ugh-group { margin-top: 10px; }
    .ugh-acc__body .ugh-group__t { margin-left: 4px; }
    .ugh-acc__body .ugh-pl { padding: 7px 4px; font-size: 15px; }
    .ugh-acc__body .ugh-sol { padding: 10px 4px; }
    .ugh-mobile__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 18px; }
    .ugh-mobile__actions a { width: 100%; }
    .ugh-socials { display: flex; justify-content: center; gap: 10px; margin: 16px 0 6px; }
    .ugh-soc { width: 48px; height: 48px; border-radius: var(--ugh-r); background: var(--ugh-tint) 50% 50% no-repeat; }
    .ugh-soc--tg { background-image: url(/wp-content/themes/api/assets/images/telegram-icon-mobile.svg); }
    .ugh-soc--max { background-image: url(/wp-content/themes/api/assets/images/max-icon-mobile.svg); background-size: 25px; }
    .ugh-soc--mail { background-image: url(/wp-content/themes/api/assets/images/email-icon-mobile.svg); }
}
@media (max-width: 768px) {
    .ugh-logo img { width: 128px; }
}
@media (prefers-reduced-motion: reduce) {
    .ugh-drop, .ugh-burger span, .ugh-caret { transition: none; }
}

/* Подвал: колонки ссылок над формой связи (UGen_Site_Nav::footerLinks); на телефоне колонки сворачиваются */
.ugf { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 28px; margin: 28px 0 32px; padding: 26px 0; border-top: 1px solid rgba(11,45,135,.12); border-bottom: 1px solid rgba(11,45,135,.12); font-family: Montserrat, Arial, sans-serif; }
.ugf summary { list-style: none; margin-bottom: 12px; font-size: 15px; font-weight: 800; color: #0B2D87; cursor: default; }
.ugf summary::-webkit-details-marker { display: none; }
.ugf ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.ugf-col--wide ul { display: block; columns: 2; column-gap: 24px; }
.ugf-col--wide li { break-inside: avoid; margin-bottom: 8px; }
.ugf a { color: rgba(11,45,135,.7); font-size: 14px; line-height: 1.35; text-decoration: none; transition: color .15s; }
.ugf a:hover { color: #0036E9; text-decoration: underline; }
@media (max-width: 1000px) { .ugf { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
    .ugf { grid-template-columns: 1fr; gap: 0; padding: 8px 0; margin: 20px 0 24px; }
    .ugf-col { border-bottom: 1px solid rgba(11,45,135,.08); }
    .ugf-col:last-child { border-bottom: 0; }
    .ugf summary { display: flex; justify-content: space-between; align-items: center; margin: 0; padding: 14px 0; cursor: pointer; }
    .ugf summary::after { content: ''; width: 8px; height: 8px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg); transition: transform .2s; }
    .ugf-col[open] summary::after { transform: rotate(-135deg); }
    .ugf ul { padding-bottom: 14px; }
}
