/**
 * TECHNOPROEKT — Header Styles
 *
 * Top bar, navigation, logo, transparent effect, mobile toggle
 *
 * @package Technoproekt
 */

/* ==========================================================================
   Header
   ========================================================================== */

.tp-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--tp-dark);
    border-bottom: 3px solid var(--tp-yellow);
    transition: background var(--tp-transition), border-color var(--tp-transition);
}

.tp-header.is-transparent {
    background: transparent;
    border-bottom-color: transparent;
}

/* On 404 pages, header is always solid dark */
body.error404 .tp-header,
body.error404 .tp-header.is-transparent {
    background: var(--tp-dark);
    border-bottom-color: var(--tp-yellow);
}

body.error404 .tp-header__top,
body.error404 .tp-header.is-transparent .tp-header__top {
    background: var(--tp-green-dark);
}

/* ==========================================================================
   Top Bar
   ========================================================================== */

.tp-header__top {
    display: none;
    background: var(--tp-green-dark);
    padding: 10px 0;
    transition: background var(--tp-transition);
}

.tp-header.is-transparent .tp-header__top {
    background: transparent;
}

.tp-header__top-inner {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    justify-content: space-between;
    align-items: center;
}

.tp-header__contacts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    align-items: center;
}

.tp-header__contact {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--tp-white-90);
    font-size: 14px;
}

.tp-header__contact svg {
    width: 16px;
    height: 16px;
    color: var(--tp-yellow);
    flex-shrink: 0;
}

.tp-header__contact a {
    color: inherit;
    text-decoration: none;
}

.tp-header__contact a:hover {
    color: var(--tp-yellow);
}

.tp-header__region {
    color: var(--tp-white-50);
    font-size: 12px;
}

/* ==========================================================================
   Main Navigation Bar
   ========================================================================== */

.tp-header__main {
    padding: 0 20px;
}

.tp-header__main-inner {
    max-width: 1400px;
    margin: 0 auto;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ==========================================================================
   Logo
   ========================================================================== */

.tp-logo {
    display: flex;
    align-items: center;
    gap: 16px;
    text-decoration: none;
}

.tp-logo__mark {
    width: 50px;
    height: 50px;
    background: var(--tp-yellow);
    display: flex;
    align-items: center;
    justify-content: center;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 70% 100%, 0 100%);
    flex-shrink: 0;
}

.tp-logo__mark span {
    font-family: 'Unbounded', sans-serif;
    font-weight: 800;
    font-size: 18px;
    color: var(--tp-dark);
}

.tp-logo__text {
    font-family: 'Unbounded', sans-serif;
    font-weight: 700;
    font-size: 18px;
    color: var(--tp-white);
    letter-spacing: 2px;
}

.tp-logo__text--dark {
    color: var(--tp-text);
}

.tp-logo__tagline {
    font-size: 11px;
    color: var(--tp-white-60);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 2px;
}

/* ==========================================================================
   Desktop Navigation
   ========================================================================== */

.tp-nav {
    display: none;
    align-items: center;
    gap: 0;
}

.tp-nav__item {
    position: relative;
}

.tp-nav__link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 24px 28px;
    color: var(--tp-white-85);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all var(--tp-transition);
    position: relative;
}

.tp-nav__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--tp-yellow);
    transform: scaleX(0);
    transition: transform var(--tp-transition);
}

.tp-nav__link:hover {
    color: var(--tp-white);
    background: var(--tp-white-05);
}

.tp-nav__link:hover::after,
.tp-nav__link.is-active::after {
    transform: scaleX(1);
}

.tp-nav__link.is-active {
    color: var(--tp-white);
}

.tp-nav__link svg {
    width: 12px;
    height: 12px;
    transition: transform var(--tp-transition);
}

.tp-nav__item:hover .tp-nav__link svg {
    transform: rotate(180deg);
}

/* ==========================================================================
   Dropdown
   ========================================================================== */

.tp-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 300px;
    background: var(--tp-dark);
    border: 1px solid var(--tp-white-10);
    padding: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all var(--tp-transition);
    z-index: 100;
}

.tp-nav__item:hover .tp-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.tp-dropdown__link {
    display: block;
    padding: 14px 18px;
    color: var(--tp-white-80);
    text-decoration: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}

.tp-dropdown__link:hover {
    background: var(--tp-white-05);
    color: var(--tp-yellow);
    border-left-color: var(--tp-yellow);
    padding-left: 24px;
}

/* Scoped to .tp-dropdown to avoid leaking into mobile menu / footer */
.tp-dropdown .tp-dropdown__link--all {
    background: var(--tp-green-main);
    color: var(--tp-white);
    font-weight: 600;
    margin-top: 8px;
}

.tp-dropdown .tp-dropdown__link--all:hover {
    background: var(--tp-green-dark);
    color: var(--tp-white);
    border-left-color: var(--tp-yellow);
}

/* ==========================================================================
   Header CTA Button
   ========================================================================== */

.tp-header__cta {
    background: var(--tp-yellow);
    color: var(--tp-dark);
    padding: 14px 28px;
    font-weight: 600;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 1px;
    text-decoration: none;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 90% 100%, 0 100%);
    transition: all var(--tp-transition);
    margin-left: 20px;
}

.tp-header__cta:hover {
    background: var(--tp-yellow-bright);
}

/* ==========================================================================
   Mobile Toggle
   ========================================================================== */

.tp-mobile-toggle {
    display: flex;
    width: 48px;
    height: 48px;
    background: var(--tp-green-main);
    border: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.tp-mobile-toggle span {
    width: 22px;
    height: 2px;
    background: var(--tp-white);
    transition: all var(--tp-transition);
}

/* ==========================================================================
   Mobile Menu Overlay
   ========================================================================== */

.tp-mobile-menu {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--tp-white);
    z-index: 2000;
    padding: 20px;
    overflow-y: auto;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.tp-mobile-menu.is-active {
    transform: translateY(0);
}

.tp-mobile-menu__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--tp-border-light);
}

.tp-mobile-menu__close {
    width: 44px;
    height: 44px;
    background: var(--tp-cream);
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--tp-green-dark);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Kill default blue tap highlight on all mobile menu interactive elements */
.tp-mobile-menu a,
.tp-mobile-menu button,
.tp-mobile-dropdown__title,
.tp-mobile-sub__title,
.tp-mobile-nav__link {
    -webkit-tap-highlight-color: rgba(45, 90, 39, 0.15);
}

/* Mobile nav links */
.tp-mobile-nav__link {
    display: block;
    padding: 14px 0;
    color: var(--tp-text);
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid var(--tp-border-light);
}

.tp-mobile-nav__link.is-active {
    color: var(--tp-green-main);
    font-weight: 600;
    border-left: 3px solid var(--tp-green-main);
    padding-left: 12px;
}

/* Mobile dropdown — L1 */
.tp-mobile-dropdown__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 0;
    color: var(--tp-text);
    font-size: 16px;
    font-weight: 500;
    border-bottom: 1px solid var(--tp-border-light);
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    width: 100%;
    text-align: left;
}

.tp-mobile-dropdown__title.is-active-section {
    color: var(--tp-green-main);
    font-weight: 600;
}

/* L1 content — max-height transition instead of display:none */
.tp-mobile-dropdown__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding: 0 0 0 20px;
}

.tp-mobile-dropdown__content.is-active {
    max-height: 4000px;
    padding: 4px 0 4px 20px;
}

.tp-mobile-dropdown__content a {
    display: block;
    padding: 8px 0;
    color: var(--tp-text-light);
    text-decoration: none;
    font-size: 14px;
}

.tp-mobile-dropdown__content a:hover {
    color: var(--tp-green-main);
}

.tp-mobile-dropdown__content a.is-active {
    color: var(--tp-green-main);
    font-weight: 600;
    border-left: 3px solid var(--tp-green-main);
    padding-left: 12px;
}

/* Hide "Все услуги →" in mobile menu — services are shown directly */
.tp-mobile-dropdown__link--all,
.tp-mobile-dropdown__content .tp-dropdown__link--all {
    display: none;
}

/* Sub-accordion — L2 */
.tp-mobile-sub__title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    color: var(--tp-text-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
}

.tp-mobile-sub__title.is-active-section {
    color: var(--tp-green-main);
    font-weight: 600;
}

.tp-mobile-sub__arrow {
    transition: transform 0.3s;
    font-size: 18px;
}

.tp-mobile-sub__title.is-open .tp-mobile-sub__arrow {
    transform: rotate(90deg);
}

.tp-mobile-sub__content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    padding-left: 16px;
}

.tp-mobile-sub__content.is-open {
    max-height: 2000px;
}

.tp-mobile-sub__link {
    display: block;
    padding: 6px 0;
    color: var(--tp-text-light);
    text-decoration: none;
    font-size: 13px;
}

.tp-mobile-sub__link:hover {
    color: var(--tp-green-main);
}

.tp-mobile-sub__link.is-active {
    color: var(--tp-green-main);
    font-weight: 600;
    border-left: 3px solid var(--tp-green-main);
    padding-left: 12px;
}

/* Mobile CTA */
.tp-mobile-menu__cta {
    margin-top: 30px;
}

.tp-mobile-menu__cta-btn {
    width: 100%;
    padding: 16px 24px;
    background: var(--tp-yellow);
    color: var(--tp-dark);
    border: none;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* Mobile contacts */
.tp-mobile-contacts {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--tp-border-light);
}

.tp-mobile-contacts__title {
    font-size: 12px;
    font-weight: 600;
    color: var(--tp-text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
}

.tp-mobile-contacts__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    text-decoration: none;
    color: var(--tp-text);
    font-size: 15px;
    transition: color 0.2s;
}

.tp-mobile-contacts__item:hover {
    color: var(--tp-green-main);
}

.tp-mobile-contacts__item svg {
    width: 18px;
    height: 18px;
    color: var(--tp-green-main);
    flex-shrink: 0;
}

.tp-mobile-contacts__label {
    color: var(--tp-text-hint);
    font-size: 11px;
    margin-left: auto;
}

/* ==========================================================================
   Body lock when mobile menu is open
   ========================================================================== */

body.tp-menu-open {
    overflow: hidden;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (min-width: 769px) {
    .tp-header__main {
        padding: 0 40px;
    }

    .tp-header__top-inner {
        flex-direction: row;
        gap: 0;
    }

    .tp-header__contacts {
        flex-wrap: nowrap;
        justify-content: flex-start;
        gap: 24px;
    }
}

@media (min-width: 1025px) {
    .tp-header__top {
        display: block;
    }

    .tp-nav {
        display: flex;
    }

    .tp-mobile-toggle {
        display: none;
    }

    .tp-mobile-menu {
        display: none;
    }
}
