/* ============================================
   MOBILE RESPONSIVE STYLES
   Каркас темы - адаптивность
   ============================================ */

/* ============================================
   MOBILE MENU TOGGLE
   ============================================ */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: var(--font-size-xl);
    cursor: pointer;
    padding: var(--spacing-sm);
    margin-right: 0;
    transition: opacity var(--transition-base);
    flex-shrink: 0;
}

.mobile-menu-toggle:hover {
    opacity: 0.8;
}

.mobile-auth-link {
    display: none;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: var(--font-size-xl);
    text-decoration: none;
    padding: var(--spacing-sm);
    margin-left: 0;
    transition: opacity var(--transition-base);
    flex-shrink: 0;
    cursor: pointer;
}

.mobile-auth-link:hover {
    opacity: 0.8;
}

/* ============================================
   MOBILE AUTH MODAL
   ============================================ */
.mobile-auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 10002;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
}

.mobile-auth-overlay.show {
    opacity: 1;
    visibility: visible;
}

.mobile-auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-bg-light);
    z-index: 10003;
    display: none;
    flex-direction: column;
    overflow-y: auto;
}

.mobile-auth-modal.show {
    display: flex;
}

.mobile-auth-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px var(--spacing-xl);
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    color: var(--color-white);
    border-bottom: none;
    position: sticky;
    top: 0;
    z-index: 1;
    min-height: calc(var(--header-height) - 4px);
    box-sizing: border-box;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.mobile-auth-title-wrapper {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    height: 100%;
}

.mobile-auth-icon {
    font-size: 20px;
    color: var(--color-white);
    opacity: 0.95;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.mobile-auth-title {
    font-family: var(--font-family-heading);
    font-size: var(--font-size-lg);
    font-weight: 700;
    color: var(--color-white);
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    height: 100%;
}

.mobile-auth-close {
    background: none;
    border: none;
    color: var(--color-white);
    font-size: var(--font-size-xl);
    cursor: pointer;
    padding: var(--spacing-xs);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity var(--transition-base);
    width: 32px;
    height: 32px;
}

.mobile-auth-close:hover {
    opacity: 0.8;
}

.mobile-auth-content {
    flex: 1;
    padding: var(--spacing-xl);
    overflow-y: auto;
}

/* ============================================
   MOBILE SIDEBAR MENU
   ============================================ */
.mobile-sidebar-menu {
    display: none;
    position: fixed;
    left: 0;
    width: var(--mobile-sidebar-width);
    background: var(--color-bg-light);
    z-index: var(--z-mobile-sidebar);
    overflow-y: auto;
    box-shadow: var(--shadow-md);
    margin: 0;
    padding: 0;
    border: none;
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

@media (max-width: 1024px) {
    .mobile-sidebar-menu {
        display: block !important;
        left: calc(var(--mobile-sidebar-width) * -1);
        transition: left var(--transition-slow);
        top: var(--header-height);
        bottom: 0;
        height: auto;
        margin: 0;
        padding: 0;
        border: none;
        border-top: none;
        margin-top: 0;
        padding-top: 0;
    }

    .mobile-sidebar-menu.mobile-show {
        left: 0;
    }
}

.mobile-sidebar-logo {
    font-family: var(--font-family-heading);
    font-size: 1.2em;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.mobile-sidebar-close {
    background: none;
    border: none;
    font-size: 1.2em;
    color: var(--color-text-muted);
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color var(--transition-base);
}

.mobile-sidebar-close:hover {
    color: var(--color-text-secondary);
}

.mobile-sidebar-nav {
    padding: 0;
    margin: 0;
    border: none;
    border-top: none;
}

.mobile-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px var(--spacing-xl);
    color: var(--color-text-secondary);
    text-decoration: none;
    transition: background-color var(--transition-base);
    border-bottom: 1px solid var(--color-bg-section);
    border-top: none;
    font-size: 0.9em;
    position: relative;
    margin: 0;
}

.mobile-nav-item:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 10px;
}

.mobile-nav-item:hover {
    background: var(--color-bg-section);
    color: #007bff;
}

.mobile-nav-item.active {
    background: var(--color-bg-section);
    color: #007bff;
    border-left: 3px solid var(--color-primary);
    padding-left: 17px;
}

.mobile-nav-icon {
    width: var(--spacing-lg);
    text-align: center;
    color: var(--color-text-muted);
    flex-shrink: 0;
}

.mobile-nav-item:hover .mobile-nav-icon,
.mobile-nav-item.active .mobile-nav-icon {
    color: #007bff;
}

/* ============================================
   MOBILE OVERLAY
   ============================================ */
.mobile-overlay {
    position: fixed;
    left: 0;
    width: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: var(--z-mobile-overlay);
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-slow), visibility var(--transition-slow);
    top: var(--header-height);
    bottom: 0;
    height: auto;
    margin: 0;
    padding: 0;
    border: none;
    margin-top: 0;
    padding-top: 0;
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* ============================================
   TABLET AND MOBILE DEVICES
   ============================================ */
@media (max-width: 1024px) {
    /* Header */
    .header-center {
        display: none !important;
    }

    .header-right .search-container {
        display: none;
    }

    .mobile-menu-toggle {
        display: block;
    }

    .mobile-auth-link {
        display: block;
    }

    .header-left {
        width: auto;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 0;
    }

    .header-right {
        width: auto;
        flex: 0 0 auto;
        display: flex;
        align-items: center;
        gap: 0;
    }

    .header-top {
        justify-content: space-between;
        position: relative;
    }

    .logo-link {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
    }

    /* Main Layout */
    .main-layout {
        flex-direction: column;
        padding: 10px;
        gap: 10px;
        max-width: 100%;
    }

    .sidebar-left {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
        margin: 0;
    }

    .sidebar-right {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
        display: none;
    }

    .sidebar-info-section {
        display: none;
    }

    .content-main {
        width: 100%;
        padding: 0;
        margin: 0;
    }

    /* Footer */
    .footer-row {
        flex-direction: column;
        align-items: center;
        gap: var(--spacing-lg);
        text-align: center;
    }

    .footer-left {
        order: 1;
        width: 100%;
    }

    .footer-copyright {
        justify-content: center;
    }

    .footer-center {
        order: 2;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: var(--spacing-sm);
    }

    .footer-center .footer-link {
        display: inline-block;
        margin: 0 var(--spacing-xs);
        font-size: var(--font-size-sm);
    }

    .footer-right {
        order: 3;
        width: 100%;
        display: flex;
        justify-content: center;
    }
}

/* ============================================
   MOBILE DEVICES
   ============================================ */
@media (max-width: 768px) {
    /* Header */
    .site-header {
        padding: 10px 0;
    }

    .header-top {
        padding: 0 var(--spacing-md);
        gap: 0;
        justify-content: space-between;
    }

    .header-left {
        display: flex;
        align-items: center;
        gap: var(--spacing-sm);
        flex: 0 0 auto;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 0;
        flex: 0 0 auto;
    }

    .mobile-menu-toggle {
        font-size: var(--font-size-lg);
        padding: var(--spacing-xs);
        margin-right: 0;
    }

    .mobile-auth-link {
        font-size: var(--font-size-lg);
        padding: var(--spacing-xs);
        margin-left: 0;
    }

    .logo-text {
        font-size: var(--font-size-base);
    }

    .logo-image {
        height: 18px;
    }

    /* Main Layout */
    .main-layout {
        padding: 10px;
        gap: 10px;
    }

    /* Footer */
    .footer-row {
        padding: 0 var(--spacing-lg);
        gap: var(--spacing-md);
    }

    .footer-copyright {
        font-size: var(--font-size-xs);
        flex-wrap: wrap;
        justify-content: center;
    }

    .footer-center .footer-link {
        font-size: var(--font-size-xs);
        margin: var(--spacing-xs);
        display: inline-block;
    }

    .site-footer {
        padding: var(--spacing-lg) 0 var(--spacing-md);
    }
}

/* ============================================
   SMALL MOBILE DEVICES
   ============================================ */
@media (max-width: 480px) {
    /* Header */
    .site-header {
        padding: 10px 0;
    }

    .header-top {
        padding: 0 var(--spacing-sm);
    }

    .logo-text {
        font-size: var(--font-size-base);
    }

    .logo-image {
        height: 18px;
    }

    /* Footer */
    .footer-row {
        padding: 0 var(--spacing-md);
        gap: 10px;
    }

    .footer-copyright {
        font-size: 10px;
    }

    .footer-center .footer-link {
        font-size: 10px;
        margin: 2px;
    }
}
