/* =====================================================
   HEADER & FOOTER STYLES
   Файл: /wp-content/themes/ksm-theme/assets/css/header-footer.css
   ===================================================== */

/* ===== CSS Variables - БАЗОВАЯ ТЕМА ===== */
:root {
    /* Accent - розово-фиолетовый (по умолчанию) */
    --accent-gradient: linear-gradient(135deg, #ff6b9d 0%, #c44ecf 50%, #6b5ce7 100%);
    --accent-glow: rgba(196, 78, 207, 0.4);
    --accent-primary: #c44ecf;
    --accent-hover: #ff6b9d;
    
    /* Glass */
    --glass-bg: rgba(255, 255, 255, 0.08);
    --glass-border: rgba(255, 255, 255, 0.15);
    --glass-shadow: rgba(0, 0, 0, 0.3);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: rgba(255, 255, 255, 0.6);
    --text-muted: rgba(255, 255, 255, 0.4);
    
    /* Background */
    --bg-footer: #050508;
    
    /* Spacing */
    --header-height: 80px;
    --header-height-mobile: 70px;
    --content-max-width: 1200px;
}

/* ===== КРАСНАЯ ТЕМА (для страницы травмы) ===== */
body.theme-red {
    --accent-gradient: linear-gradient(135deg, #ff0000 0%, #d70000 50%, #aa0000 100%);
    --accent-glow: rgba(215, 0, 0, 0.4);
    --accent-primary: #d70000;
    --accent-hover: #ff0000;
}

/* ===== ОРАНЖЕВАЯ ТЕМА (для главной) ===== */
body.theme-orange {
    --accent-gradient: linear-gradient(216deg, #FEEA26 0%, #FD360A 100%);
    --accent-glow: rgba(253, 54, 10, 0.4);
    --accent-primary: #FD360A;
    --accent-hover: #FEEA26;
}

/* ===== HEADER ===== */
.ksm-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 0 24px;
}

/* Отступ для админ-бара WordPress */
.admin-bar .ksm-header {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .ksm-header {
        top: 46px;
    }
}

.ksm-header__wrapper {
    position: relative;
    width: 100%;
    max-width: var(--content-max-width);
    height: 100%;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
}

.ksm-header__glass {
    position: absolute;
    top: 0;
    left: -40px;
    right: -40px;
    bottom: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 30px var(--glass-shadow);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.ksm-header.scrolled .ksm-header__glass {
    opacity: 1;
}

/* ===== LOGO ===== */
.ksm-logo {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: transform 0.3s ease;
    justify-self: start;
}

.ksm-logo:hover {
    transform: scale(1.03);
}

.ksm-logo__icon {
    width: 50px;
    height: 50px;
    transition: filter 0.3s ease;
}

.ksm-logo:hover .ksm-logo__icon {
    filter: drop-shadow(0 0 8px var(--accent-glow));
}

.ksm-logo__text {
    display: flex;
    flex-direction: column;
}

.ksm-logo__name {
    font-family: 'Jost', sans-serif;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text-primary);
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.ksm-logo__subtitle {
    font-family: 'Jost', sans-serif;
    font-size: 0.8rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

/* ===== DESKTOP NAV ===== */
.ksm-nav-desktop {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
}

.ksm-nav-desktop__list {
    display: flex;
    list-style: none;
    gap: 40px;
    margin: 0;
    padding: 0;
}

.ksm-nav-desktop__link {
    position: relative;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Jost', sans-serif;
    font-size: 1.1rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    transition: color 0.3s ease;
    padding: 8px 0;
}

.ksm-nav-desktop__link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--accent-gradient);
    transition: width 0.3s ease;
}

.ksm-nav-desktop__link:hover {
    color: var(--text-primary);
}

.ksm-nav-desktop__link:hover::after {
    width: 100%;
}

/* ===== CTA BUTTON ===== */
.ksm-header__cta {
    position: relative;
    z-index: 1;
    justify-self: end;
}

.ksm-btn-cta {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 28px;
    font-family: 'Jost', sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--text-primary) !important;
    text-decoration: none !important;
    background: transparent;
    border: none;
    cursor: pointer;
    overflow: hidden;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.ksm-btn-cta::before {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--accent-gradient);
    border-radius: 50px;
    z-index: -2;
}

.ksm-btn-cta::after {
    content: '';
    position: absolute;
    inset: 2px;
    background: rgba(10, 10, 15, 0.85);
    border-radius: 50px;
    z-index: -1;
    transition: opacity 0.3s ease;
}

.ksm-btn-cta:hover::after {
    opacity: 0;
}

.ksm-btn-cta:hover {
    color: var(--text-primary) !important;
    box-shadow: 0 0 30px var(--accent-glow);
    transform: translateY(-2px);
}

/* ===== BURGER ===== */
.ksm-burger {
    display: none;
    position: relative;
    z-index: 1001;
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    width: 32px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    justify-self: end;
}

.ksm-burger__line {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
}

.ksm-burger.active .ksm-burger__line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 6px);
}

.ksm-burger.active .ksm-burger__line:nth-child(2) {
    opacity: 0;
}

.ksm-burger.active .ksm-burger__line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -6px);
}

/* ===== MOBILE NAV ===== */
.ksm-nav-mobile {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%;
    max-width: 400px;
    height: 100vh;
    height: 100dvh;
    background: rgba(10, 10, 15, 0.98);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
    display: flex;
    flex-direction: column;
    padding: 100px 40px 40px;
    padding-bottom: env(safe-area-inset-bottom, 40px);
    box-sizing: border-box;
    overflow: hidden;
}

/* Отступ для админ-бара */
.admin-bar .ksm-nav-mobile {
    top: 32px;
    height: calc(100vh - 32px);
    height: calc(100dvh - 32px);
}

@media screen and (max-width: 782px) {
    .admin-bar .ksm-nav-mobile {
        top: 46px;
        height: calc(100vh - 46px);
        height: calc(100dvh - 46px);
    }
}

.ksm-nav-mobile.active {
    transform: translateX(0);
}

.ksm-nav-mobile__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.admin-bar .ksm-nav-mobile__overlay {
    top: 32px;
}

@media screen and (max-width: 782px) {
    .admin-bar .ksm-nav-mobile__overlay {
        top: 46px;
    }
}

.ksm-nav-mobile__overlay.active {
    opacity: 1;
    visibility: visible;
}

.ksm-nav-mobile__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.ksm-nav-mobile__link {
    display: block;
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Jost', sans-serif;
    font-size: 1.4rem;
    font-weight: 400;
    padding: 16px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
}

.ksm-nav-mobile__link:hover {
    color: var(--text-primary);
    padding-left: 12px;
}

.ksm-nav-mobile__cta {
    margin-top: auto;
    text-align: center;
    padding-bottom: 20px;
}

.ksm-nav-mobile__cta .ksm-btn-cta {
    width: 100%;
    padding: 14px 24px;
    font-size: 0.85rem;
}

/* ===== BODY PADDING ===== */
/* Меню накладывается на контент, отступ не нужен */
body.has-ksm-header {
    padding-top: 0;
}

/* ===== FOOTER ===== */
.ksm-footer {
    background: var(--bg-footer);
    border-top: 1px solid var(--glass-border);
    padding: 60px 24px 30px;
    position: relative;
    overflow: hidden;
}

.ksm-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--accent-gradient);
    opacity: 0.5;
}

.ksm-footer__container {
    max-width: var(--content-max-width);
    margin: 0 auto;
}

.ksm-footer__main {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 60px;
    margin-bottom: 50px;
}

.ksm-footer__brand {
    max-width: 320px;
}

.ksm-footer__logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--text-primary);
    margin-bottom: 20px;
}

.ksm-footer__logo-icon {
    width: 50px;
    height: 50px;
}

.ksm-footer__logo-text {
    display: flex;
    flex-direction: column;
}

.ksm-footer__logo-name {
    font-family: 'Jost', sans-serif;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.ksm-footer__logo-subtitle {
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
}

.ksm-footer__description {
    color: var(--text-secondary);
    font-family: 'Jost', sans-serif;
    font-size: 0.95rem;
    line-height: 1.7;
    font-weight: 300;
}

.ksm-footer__title {
    font-family: 'Jost', sans-serif;
    font-size: 0.8rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.ksm-footer__nav {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
}

.ksm-footer__link {
    color: var(--text-secondary);
    text-decoration: none;
    font-family: 'Jost', sans-serif;
    font-size: 0.95rem;
    font-weight: 400;
    transition: all 0.3s ease;
    display: inline-block;
}

.ksm-footer__link:hover {
    color: var(--text-primary);
    transform: translateX(4px);
}

.ksm-footer__social {
    display: flex;
    gap: 16px;
}

.ksm-footer__social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.3s ease;
}

.ksm-footer__social-link:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent-primary);
    color: var(--text-primary);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px var(--accent-glow);
}

.ksm-footer__social-link svg {
    width: 22px;
    height: 22px;
    fill: currentColor;
}

.ksm-footer__bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 30px;
    border-top: 1px solid var(--glass-border);
    flex-wrap: wrap;
    gap: 16px;
}

.ksm-footer__copyright {
    color: var(--text-muted);
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
}

.ksm-footer__legal {
    display: flex;
    gap: 24px;
    flex-wrap: wrap;
}

.ksm-footer__legal-link {
    color: var(--text-muted);
    text-decoration: none;
    font-family: 'Jost', sans-serif;
    font-size: 0.85rem;
    font-weight: 300;
    transition: color 0.3s ease;
}

.ksm-footer__legal-link:hover {
    color: var(--text-secondary);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .ksm-nav-desktop__list {
        gap: 28px;
    }
}

@media (max-width: 900px) {
    .ksm-nav-desktop,
    .ksm-header__cta {
        display: none;
    }
    
    .ksm-burger {
        display: flex;
    }
    
    .ksm-header {
        height: var(--header-height-mobile);
        padding: 0;
        background: var(--glass-bg);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        border-bottom: 1px solid var(--glass-border);
    }
    
    .ksm-header__wrapper {
        grid-template-columns: 1fr auto;
        padding: 0 16px;
        max-width: 100%;
    }
    
    .ksm-header__glass {
        display: none;
    }
    
    body.has-ksm-header {
        padding-top: 0;
    }
    
    .ksm-footer__main {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }
    
    .ksm-footer__brand {
        grid-column: 1 / -1;
        max-width: 100%;
        text-align: center;
    }
    
    .ksm-footer__logo {
        justify-content: center;
    }
    
    .ksm-footer__description {
        max-width: 400px;
        margin: 0 auto;
    }
}

@media (max-width: 600px) {
    .ksm-header {
        padding: 0 16px;
    }
    
    .ksm-logo__text {
        display: none;
    }
    
    .ksm-footer {
        padding: 50px 20px 24px;
    }
    
    .ksm-footer__main {
        grid-template-columns: 1fr;
        gap: 36px;
        text-align: center;
    }
    
    .ksm-footer__social {
        justify-content: center;
    }
    
    .ksm-footer__bottom {
        flex-direction: column;
        text-align: center;
        gap: 12px;
    }
    
    .ksm-footer__legal {
        justify-content: center;
        gap: 16px;
    }
}

@media (max-width: 480px) {
    .ksm-logo__icon {
        width: 42px;
        height: 42px;
    }
    
    .ksm-nav-mobile {
        max-width: 100%;
        padding: 80px 24px 30px;
        padding-bottom: calc(env(safe-area-inset-bottom, 20px) + 20px);
    }
    
    .ksm-nav-mobile__link {
        font-size: 1.2rem;
        padding: 14px 0;
    }
    
    .ksm-nav-mobile__cta {
        padding-bottom: 10px;
    }
    
    .ksm-nav-mobile__cta .ksm-btn-cta {
        padding: 12px 20px;
        font-size: 0.8rem;
    }
}