/* ============================================
   VARIABLES & RESET
   ============================================ */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-blue: #2563eb;
    --primary-dark-blue: #1d4ed8;
    --text-dark: #333;
    --text-gray: #666;
    --bg-light: #f8f9fa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: #fff;
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
.skip-link {
    position: absolute;
    top: -100px;
    /* Увеличили отступ, чтобы точно не было видно */
    left: 0;
    background: var(--primary-blue);
    color: white;
    padding: 8px 16px;
    text-decoration: none;
    z-index: 10000;
    border-radius: 0 0 4px 0;
    opacity: 0;
    /* ДОБАВИЛИ: полностью прозрачный */
    pointer-events: none;
    /* ДОБАВИЛИ: нельзя кликнуть случайно */
}

.skip-link:focus {
    top: 0;
    opacity: 1;
    /* ДОБАВИЛИ: становится видимым при фокусе */
    pointer-events: auto;
    /* ДОБАВИЛИ: можно кликнуть */
}

.skip-link:focus {
    top: 0;
}

a:focus,
button:focus {
    outline: 3px solid var(--primary-blue);
    outline-offset: 2px;
}

a:focus:not(:focus-visible),
button:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================
   NAVIGATION
   ============================================ */
.navigation {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary-blue);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-img {
    height: 40px;
    width: auto;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    font-size: 0.95rem;
    transition: color 0.3s ease;
}

.nav-menu a:hover {
    color: var(--primary-blue);
}

.nav-btn {
    padding: 0.6rem 1.5rem !important;
    background: var(--primary-blue);
    color: white !important;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: var(--primary-dark-blue);
    transform: translateY(-2px);
}

/* ====== CHANGE: mobile button improvements + helpers ====== */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
}

.burger-icon {
    display: block;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ====== /CHANGE ====== */

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2)),
        url('assets/images/fon.webp') center/cover no-repeat;
    color: white;
    text-align: center;
    padding: 6rem 2rem 4rem;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,') no-repeat bottom;
    background-size: cover;
}

.hero-content {
    max-width: 800px;
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    line-height: 1.2;
    text-shadow: 2px 4px 8px rgba(0, 0, 0, 0.8);
}

.hero p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    opacity: 0.95;
    text-shadow: 1px 2px 6px rgba(0, 0, 0, 0.7);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn-primary,
.btn-secondary {
    padding: 1rem 2.5rem;
    text-decoration: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    display: inline-block;
}

.btn-primary {
    background: white;
    color: #667eea;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: transparent;
    color: white;
    border: 2px solid white;
}

.btn-secondary:hover {
    background: white;
    color: #667eea;
}

/* ============================================
   COMMON SECTION STYLES
   ============================================ */
section {
    padding: 5rem 2rem;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.section-intro {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3rem;
}

.section-title {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.section-heading {
    font-size: 1.1rem;
    color: var(--text-gray);
}

.section-text {
    font-size: 1.1rem;
    color: var(--text-gray);
    line-height: 1.8;
    margin-bottom: 1.5rem;
}

/* ============================================
   ABOUT SECTION
   ============================================ */
.about-content {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 4rem;
    align-items: center;
}

.about-image img {
    width: 100%;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.expertise-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-top: 2rem;
}

.expertise-item {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.expertise-icon {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.expertise-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.expertise-text h4 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.expertise-text p {
    font-size: 0.95rem;
    color: var(--text-gray);
}

/* ============================================
   SERVICES - GRID LAYOUT
   ============================================ */
#services {
    background: linear-gradient(to bottom, var(--bg-light) 0%, #ffffff 100%);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 30px;
    margin-top: 2rem;
    align-items: start;
    /* Карточки не растягиваются при раскрытии соседних */
}

.service-card {
    background: white;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);

    /* Flexbox для выравнивания кнопки внизу */
    display: flex;
    flex-direction: column;

    /* Минимальная высота карточки в закрытом состоянии */
    min-height: 480px;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* Иконка — фиксированный размер */
.service-icon {
    width: 70px;
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    /* Центрируем иконку */
    flex-shrink: 0;
}

.service-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Заголовок — фиксированная высота 2 строки */
.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: #1a1a1a;
    line-height: 1.3;
    /* Строго 2 строки, лишнее обрезается */
    height: calc(1.5rem * 1.3 * 2);
    overflow: hidden;
    flex-shrink: 0;
}

/* Описание — растягивается, но текст может обрезаться */
.service-card>p {
    color: var(--text-gray);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    /* Занимает всё доступное место между заголовком и кнопкой */
    flex-grow: 1;
    /* Скрываем переполнение (прокрутки не будет) */
    overflow: hidden;
}

/* Кнопка "Подробнее" — всегда внизу на одном уровне */
.details-toggle {
    background: var(--primary-blue);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    width: 100%;

    /* Прижимаем кнопку к низу карточки */
    margin-top: auto;
    flex-shrink: 0;
}

.details-toggle:hover {
    background: var(--primary-dark-blue);
    transform: scale(1.02);
}

/* Раскрывающийся контент (аккордеон) */
.details-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
    flex-shrink: 0;
    /* Не сжимается */
}

.details-content.active {
    max-height: 800px;
    /* Увеличено с 500px до 800px для длинных списков */
    margin-top: 1.5rem;
}

/* Блок с преимуществами */
.service-benefits {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 12px;
}

.service-benefits h4 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--primary-blue);
    font-weight: 600;
}

.service-benefits ul {
    list-style: none;
    padding: 0;
}

.service-benefits li {
    padding: 0.4rem 0;
    color: var(--text-gray);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-benefits li:before {
    content: "✓";
    color: var(--primary-blue);
    font-weight: bold;
    font-size: 1.2rem;
}

/* ============================================
   АДАПТИВ ДЛЯ ПЛАНШЕТОВ (768px)
   ============================================ */
@media (max-width: 768px) {
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .service-card {
        padding: 2rem;
        /* На планшетах убираем минимальную высоту */
        min-height: auto;
    }

    .service-card h3 {
        font-size: 1.4rem;
        height: auto;
        /* Заголовок может быть любой высоты */
        overflow: visible;
    }

    .service-card>p {
        overflow: visible;
        /* Показываем весь текст */
    }

    .details-content.active {
        max-height: 1000px;
        /* Больше места на планшетах */
    }
}

/* ============================================
   АДАПТИВ ДЛЯ МОБИЛЬНЫХ (480px)
   ============================================ */
@media (max-width: 480px) {
    .service-card {
        padding: 1.5rem;
        min-height: auto;
    }

    .service-icon {
        width: 60px;
        height: 60px;
        font-size: 1.8rem;
        margin-bottom: 1.2rem;
    }

    .service-card h3 {
        font-size: 1.3rem;
        margin-bottom: 0.8rem;
        height: auto;
        overflow: visible;
    }

    .service-card>p {
        font-size: 0.95rem;
        line-height: 1.6;
        margin-bottom: 1.2rem;
        overflow: visible;
    }

    .details-toggle {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .details-content.active {
        max-height: 1200px;
        /* Ещё больше места на мобильных */
    }

    .service-benefits {
        padding: 1.2rem;
    }

    .service-benefits h4 {
        font-size: 0.95rem;
        margin-bottom: 0.8rem;
    }

    .service-benefits li {
        font-size: 0.9rem;
        padding: 0.3rem 0;
    }

    .service-benefits li:before {
        font-size: 1rem;
    }
}

/* ============================================
   АДАПТИВ ДЛЯ ОЧЕНЬ МАЛЕНЬКИХ ЭКРАНОВ (375px)
   ============================================ */
@media (max-width: 375px) {
    .service-card {
        padding: 1.2rem;
    }

    .service-icon {
        width: 55px;
        height: 55px;
        font-size: 1.6rem;
        margin-bottom: 1rem;
    }

    .service-card h3 {
        font-size: 1.2rem;
    }

    .service-card>p {
        font-size: 0.9rem;
    }

    .details-toggle {
        padding: 9px 18px;
        font-size: 0.85rem;
    }
}

/* ============================================
   RESULTS - SWIPER CAROUSEL
   ============================================ */
.results-carousel {
    max-width: 600px;
    margin: 2.5rem auto 0;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.result-card {
    background: white;
}

.result-image {
    position: relative;
    padding-top: 100%;
    overflow: hidden;
    background: var(--bg-light);
}

.result-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: zoom-in;
}

.result-content {
    padding: 1.5rem;
}

.result-content p {
    color: var(--text-gray);
    font-size: 0.95rem;
    margin: 0;
}

/* Swiper Navigation Buttons */
.swiper-button-next,
.swiper-button-prev {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    color: #667eea;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.swiper-button-next:after,
.swiper-button-prev:after {
    font-size: 20px;
    font-weight: bold;
}

/* Скрыть стрелки карусели на мобильных устройствах */
@media (max-width: 768px) {

    .swiper-button-next,
    .swiper-button-prev {
        display: none !important;
    }
}

.swiper-button-next:hover,
.swiper-button-prev:hover {
    background: #667eea;
    color: white;
}

/* Swiper Pagination */
.swiper-pagination-bullet {
    width: 10px;
    height: 10px;
    background: #cbd5e1;
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    width: 28px;
    border-radius: 5px;
}

/* ============================================
   REVIEWS SECTION
   ============================================ */
#reviews {
    background: linear-gradient(to bottom, var(--bg-light) 0%, #ffffff 100%);
}

#reviews .pd_widget_app {
    margin-left: 25% !important;
    max-width: 800px;
}

/* ============================================
   TELEGRAM SECTION
   ============================================ */
.telegram-section {
    background: linear-gradient(to bottom, var(--bg-light) 0%, #ffffff 100%);
}

.telegram-single {
    max-width: 900px;
    margin: 2.5rem auto 0;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 12px;
}

/* ============================================
   CONTACT SECTION
   ============================================ */
#contact {
    background: linear-gradient(135deg, #14b8a6 0%, #38bdf8 100%);
    color: white;
}

#contact .section-title {
    color: rgba(255, 255, 255, 0.8);
}

#contact .section-heading {
    color: white;
}

.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    margin-top: 3rem;
    align-items: start;
}

.contact-info {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: flex-start;
    gap: 1.5rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    transition: all 0.3s ease;
}

.contact-item:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateX(5px);
}

.contact-icon {
    width: 50px;
    height: 50px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.contact-icon img {
    width: 26px;
    height: 26px;
    object-fit: contain;
}

.contact-details h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.contact-details p,
.contact-details a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 1rem;
    line-height: 1.6;
}

.contact-details a:hover {
    color: white;
    text-decoration: underline;
}

.map-container {
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    height: min(450px, 60vh);
}

#map {
    width: 100%;
    height: 100%;
}

@media (max-width: 480px) {
    .map-container {
        height: 45vh;
    }
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: #1a1a1a;
    color: rgba(255, 255, 255, 0.7);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

/* ============================================
   LIGHTBOX
   ============================================ */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: zoom-out;

    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.lightbox-image {
    max-width: 90%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    /* Сделать кнопку с тёмным фоном */
    background: rgba(0, 0, 0, 0.75);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    font-size: 32px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.lightbox-close:hover {
    background: rgba(0, 0, 0, 0.95);
    color: #667eea;
    border-color: #667eea;
    transform: scale(1.1);
}

.lightbox-close:focus {
    outline: 3px solid #667eea;
    outline-offset: 4px;
}

/* ============================================
   MOBILE RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .mobile-toggle {
        display: inline-flex;
        /* CHANGED: было block */
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hero h1 {
        font-size: 2.5rem;
    }

    .hero p {
        font-size: 1.1rem;
    }

    .about-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .expertise-grid {
        grid-template-columns: 1fr;
    }

    .services-grid {
        grid-template-columns: 1fr;
    }

    .contact-wrapper {
        grid-template-columns: 1fr;
    }

    .section-title {
        font-size: 2rem;
    }

    #reviews .pd_widget_app {
        margin-left: 0 !important;
    }

    .results-carousel {
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
    }

    .swiper-button-next,
    .swiper-button-prev {
        width: 40px;
        height: 40px;
    }

    .swiper-button-next:after,
    .swiper-button-prev:after {
        font-size: 16px;
    }

    /* Уменьшаем отступы у карточек результатов */
    .result-content {
        padding: 1rem;
    }

    .result-content p {
        font-size: 0.85rem;
    }
}

/* Для очень маленьких экранов (320px) */
@media (max-width: 375px) {

    .swiper-button-next,
    .swiper-button-prev {
        width: 36px;
        height: 36px;
    }

    .swiper-button-next:after,
    .swiper-button-prev:after {
        font-size: 14px;
    }
}

@media (max-width: 768px) {
    .logo span {
        font-size: 1.05rem;
        /* было 1.3rem у .logo */
    }
}

@media (max-width: 375px) {
    .logo span {
        font-size: 0.98rem;
    }
}

/* ============================================
   COOKIE BANNER
   ============================================ */

.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 16px 20px;
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    display: none;
    transform: translateY(100%);
    opacity: 0;
    transition: transform 0.4s ease-out, opacity 0.4s ease-out;
}

.cookie-banner.show {
    display: block;
    transform: translateY(0);
    opacity: 1;
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}

.cookie-text {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    flex: 1;
    min-width: 250px;
}

.cookie-btn {
    background: #ffffff;
    color: #667eea;
    border: none;
    padding: 10px 24px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.cookie-btn:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cookie-btn:active {
    transform: translateY(0);
}

@keyframes slideUp {
    from {
        transform: translateY(100%);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Мобильная адаптация */
@media (max-width: 768px) {
    .cookie-banner {
        padding: 14px 16px;
    }

    .cookie-content {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .cookie-text {
        font-size: 13px;
        text-align: center;
    }

    .cookie-btn {
        width: 100%;
    }
}