/* =================================================
   SERVICES PAGE – ПОЛНАЯ АДАПТИВНОСТЬ
   ================================================= */

.services-page {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--primary-bg);
    padding: 0 var(--container-padding);
}

/* ЗАГОЛОВОК */
.page-header {
    text-align: center;
    margin: 48px 0 24px;
}

.page-header h1 {
    font-size: clamp(1.8rem, 5vw, 2.2rem);
    font-weight: 600;
    color: var(--text-color);
    margin: 0;
}

.page-header h1::after {
    content: '';
    display: block;
    width: 50px;
    height: 2px;
    background: var(--accent-color);
    margin: 12px auto 0;
}

.services-description {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 48px;
    color: var(--text-secondary);
    font-size: clamp(0.85rem, 2.5vw, 0.95rem);
    line-height: 1.5;
    padding: 0 16px;
}

/* ========== ГЛАВНАЯ СЕТКА ========== */
.services-layout {
    display: flex;
    gap: 48px;
    align-items: flex-start;
    margin-bottom: 64px;
    flex-wrap: wrap;
}

.services-main {
    flex: 1;
    min-width: 0;
}

.services-sidebar {
    position: sticky;
    top: 100px;
    width: 280px;
    flex-shrink: 0;
}

/* ========== ФИЛЬТР ========== */
.services-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
}

.services-filter button {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 16px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: var(--radius-md);
}

.services-filter button:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
}

.services-filter button.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: white;
}

/* ========== КАРТОЧКИ УСЛУГ ========== */
#services-container .services-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

@media (max-width: 1100px) {
    #services-container .services-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

@media (max-width: 768px) {
    #services-container .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

/* ========== САЙДБАР ========== */
.services-sidebar {
    background: var(--secondary-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 24px;
}

.sidebar-widget {
    margin-bottom: 28px;
}

.sidebar-widget:last-child {
    margin-bottom: 0;
}

.sidebar-widget h3 {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--accent-color);
    margin-bottom: 16px;
}

/* список популярных услуг */
.popular-services-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.popular-services-list li {
    margin-bottom: 12px;
}

.popular-services-list a {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.85rem;
    padding: 4px 0;
    transition: color 0.2s;
    border-bottom: 1px solid var(--border-color);
}

.popular-services-list a:hover {
    color: var(--accent-color);
}

.popular-services-list span {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* соцсети */
.social-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.social-links a {
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: color 0.2s;
    text-decoration: none;
}

.social-links a:hover {
    color: var(--accent-color);
}

/* контакты */
.contact-info p {
    margin: 0 0 12px 0;
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.4;
    transition: color 0.2s;
    word-break: break-word;
}

.contact-info p:hover {
    color: var(--accent-color);
}

.contact-info p:last-child {
    margin-bottom: 0;
}

/* ========== АДАПТИВНОСТЬ ========== */

/* Планшеты (до 992px) */
@media (max-width: 992px) {
    .services-layout {
        flex-direction: column;
        gap: 40px;
    }

    .services-sidebar {
        position: static;
        width: 100%;
        max-width: 450px;
        margin: 0 auto;
    }

    .services-main {
        width: 100%;
    }

    .services-filter button {
        padding: 5px 14px;
        font-size: 0.8rem;
    }
}

/* Мобильные (до 768px) */
@media (max-width: 768px) {
    .services-page {
        padding: 0 16px;
    }

    .page-header {
        margin: 32px 0 20px;
    }

    .page-header h1 {
        font-size: 1.6rem;
    }

    .services-description {
        margin-bottom: 32px;
        font-size: 0.9rem;
    }

    .services-filter {
        gap: 6px;
        margin-bottom: 30px;
    }

    .services-filter button {
        padding: 4px 12px;
        font-size: 0.75rem;
    }

    .services-sidebar {
        max-width: 100%;
        padding: 20px;
    }

    .sidebar-widget {
        margin-bottom: 24px;
    }

    .sidebar-widget h3 {
        font-size: 0.7rem;
        margin-bottom: 12px;
    }

    .popular-services-list a {
        font-size: 0.8rem;
    }

    .popular-services-list span {
        font-size: 0.65rem;
    }

    .social-links {
        gap: 16px;
    }

    .social-links a {
        font-size: 1rem;
    }

    .contact-info p {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
}

/* Маленькие телефоны (до 480px) */
@media (max-width: 480px) {
    .services-layout {
        gap: 30px;
    }

    .services-filter {
        gap: 8px;
    }

    .services-filter button {
        flex: 1 0 auto;
        white-space: normal;
        text-align: center;
        min-width: calc(50% - 8px);
    }

    .services-sidebar {
        padding: 16px;
    }

    .sidebar-widget {
        margin-bottom: 20px;
    }

    .popular-services-list li {
        margin-bottom: 10px;
    }

    .popular-services-list a {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        padding: 6px 0;
    }

    .popular-services-list span {
        font-size: 0.6rem;
    }

    .social-links {
        justify-content: center;
        gap: 20px;
    }

    .contact-info p {
        font-size: 0.75rem;
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
    }
}

/* Очень маленькие телефоны (до 360px) */
@media (max-width: 360px) {
    .services-page {
        padding: 0 12px;
    }

    .page-header h1 {
        font-size: 1.4rem;
    }

    .services-filter button {
        min-width: 100%;
        padding: 6px;
        font-size: 0.7rem;
    }

    .services-sidebar {
        padding: 12px;
    }

    .sidebar-widget h3 {
        font-size: 0.65rem;
    }

    .popular-services-list a {
        font-size: 0.75rem;
    }

    .contact-info p {
        font-size: 0.7rem;
    }
}

/* Ландшафтная ориентация на мобильных */
@media (max-width: 768px) and (orientation: landscape) {
    .services-layout {
        gap: 30px;
    }

    .services-sidebar {
        max-width: 100%;
    }

    .popular-services-list a {
        flex-direction: row;
        justify-content: space-between;
        align-items: baseline;
    }

    .social-links {
        justify-content: flex-start;
    }
}

/* Удаляем дублирующиеся стили */
.services-filter {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin-bottom: 40px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {

    .services-grid,
    .services-filter button,
    .service-card {
        animation: none;
        transition: none;
    }

    .services-filter button:hover,
    .service-card:hover {
        transform: none;
    }
}

/* Touch devices optimization */
@media (hover: none) and (pointer: coarse) {

    .services-filter button:hover,
    .service-card:hover,
    .social-links a:hover,
    .contact-info p:hover {
        transform: none;
    }

    .services-filter button:active {
        transform: scale(0.97);
    }
}