/* ============================================================
   ADVANTAGES.CSS - БЛОК "ПОЧЕМУ МЫ" (СЕТКА 3 В РЯД)
   ============================================================ */

.advantages-marquee {
    padding: 20px 0 40px;
    background: #1a1a1a;
    border-top: 1px solid #2a2a2a;
    border-bottom: 1px solid #2a2a2a;
    user-select: none;
    -webkit-user-select: none;
}

.advantages-marquee .section-title {
    margin-bottom: 20px;
}

/* ============================================================
   ОБЁРТКА И СЕТКА
   ============================================================ */

.advantages-grid-wrapper {
    max-width: 1450px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.advantages-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    width: 100%;
}

/* ============================================================
   ПЛИТКА ПРЕИМУЩЕСТВА
   ============================================================ */

.advantages-grid-item {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 20px 20px 20px;
    border: 1px solid #3a3a3a;
    transition: all 0.3s ease;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 218px;
}

.advantages-grid-item:hover {
    border-color: #5a5a5a;
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* ===== СТРОКА 1: ИКОНКА + ЗАГОЛОВОК ===== */
.advantages-grid-item__header {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-direction: row;
}

.advantages-grid-item__icon {
    flex: 0 0 28px;
    width: 28px;
    height: 28px;
    background: #3a3a3a;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: #8a8a8a;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.advantages-grid-item:hover .advantages-grid-item__icon {
    background: #4a4a4a;
    color: #c0c0c0;
}

.advantages-grid-item__title {
    font-size: 18px;
    font-weight: 600;
    color: #f0f0f0;
    margin: 0;
    line-height: 1.3;
    flex: 1;
}

/* ===== СТРОКА 2: ОПИСАНИЕ ===== */
.advantages-grid-item__body {
    padding-left: 0;
    width: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.advantages-grid-item__description {
    font-size: 14px;
    color: #b0b0b0;
    line-height: 1.5;
    margin: 0 0 4px 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

/* ===== КНОПКА "ПОДРОБНЕЙ" ПО ЦЕНТРУ ВНИЗУ ===== */
.advantages-grid-item__read-more {
    display: inline-block;
    margin: 8px auto 0 auto;
    padding: 6px 20px;
    font-size: 13px;
    font-weight: 500;
    color: #8a8a8a;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 20px;
    transition: all 0.3s ease;
    text-align: center;
    cursor: pointer;
    flex-shrink: 0;
    width: auto;
    min-width: 100px;
    letter-spacing: 0.3px;
}

.advantages-grid-item:hover .advantages-grid-item__read-more {
    color: #4a90d9;
    background: rgba(74, 144, 217, 0.08);
    border-color: rgba(74, 144, 217, 0.15);
    transform: translateY(-1px);
}

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

@media (max-width: 1024px) {
    .advantages-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }

    .advantages-grid-item__title {
        font-size: 16px;
    }

    .advantages-grid-item__description {
        font-size: 13px;
    }
}

@media (max-width: 768px) {
    .advantages-marquee {
        padding: 30px 0;
    }

    .advantages-grid-wrapper {
        padding: 0 16px;
    }

    .advantages-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .advantages-grid-item {
        padding: 18px;
        min-height: auto;
    }
}

@media (max-width: 480px) {
    .advantages-marquee {
        padding: 20px 0;
    }

    .advantages-grid-wrapper {
        padding: 0 12px;
    }

    .advantages-grid-item__title {
        font-size: 15px;
    }

    .advantages-grid-item__description {
        font-size: 13px;
    }
}

/* ============================================================
   МОДАЛЬНОЕ ОКНО
   ============================================================ */

.advantage-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.advantage-modal__overlay {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 1;
}

.advantage-modal__content {
    position: relative;
    background: #2a2a2a;
    border-radius: 20px;
    max-width: 560px;
    width: 100%;
    padding: 40px 36px;
    border: 1px solid #3a3a3a;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    transform: scale(0.9) translateY(20px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-height: 90vh;
    overflow-y: auto;
    z-index: 2;
}

.advantage-modal__content.active {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.advantage-modal__close {
    position: absolute;
    top: 16px; right: 16px;
    background: rgba(255, 255, 255, 0.06);
    border: none;
    border-radius: 50%;
    width: 40px; height: 40px;
    color: #8a8a8a;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}

.advantage-modal__close:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    transform: rotate(90deg);
}

.advantage-modal__body { 
    text-align: center; 
}

.advantage-modal__icon {
    width: 80px; height: 80px;
    background: #3a3a3a;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    color: #8a8a8a;
    margin: 0 auto 20px;
}

.advantage-modal__icon i { 
    font-size: 36px; 
}

.advantage-modal__body h2 {
    font-size: 24px;
    font-weight: 700;
    color: #f0f0f0;
    margin-bottom: 12px;
}

.advantage-modal__divider {
    width: 60px; height: 3px;
    background: linear-gradient(90deg, #4a4a4a, #8a8a8a);
    border-radius: 3px;
    margin: 0 auto 20px;
}

/* ============================================================
   КАСТОМНЫЙ СКРОЛЛ В МОДАЛЬНОМ ОКНЕ
   Тонкий, тёмный, с синим акцентом при наведении
   ============================================================ */

/* WebKit-браузеры (Chrome, Safari, Edge, Opera) */
.advantage-modal__content::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.advantage-modal__content::-webkit-scrollbar-track {
    background: transparent;
    border-radius: 8px;
    margin: 12px 0;
}

.advantage-modal__content::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    border: 2px solid transparent;
    background-clip: padding-box;
}

.advantage-modal__content::-webkit-scrollbar-thumb:hover {
    background: rgba(74, 144, 217, 0.5);
    background-clip: padding-box;
}

/* Firefox */
.advantage-modal__content {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.08) transparent;
}

.advantage-modal__content:hover {
    scrollbar-color: rgba(74, 144, 217, 0.5) transparent;
}

/* ============================================================
   HTML-КОНТЕНТ В МОДАЛЬНОМ ОКНЕ ПРЕИМУЩЕСТВА
   (единый стиль как на страницах товара/услуги)
   Выравнивание по ширине для абзацев и списков
   ============================================================ */

.advantage-modal__body p {
    font-size: 16px;
    line-height: 1.8;
    color: #c0c0c0;
    text-align: justify;
    text-align-last: left;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    padding: 0 4px;
    margin: 0 0 14px 0;
}

.advantage-modal__body p:last-child {
    margin-bottom: 0;
}

.advantage-modal__body strong {
    color: #f0f0f0;
    font-weight: 600;
}

.advantage-modal__body em {
    color: #d0d0d0;
    font-style: italic;
}

/* ===== Списки ===== */
.advantage-modal__body ul,
.advantage-modal__body ol {
    text-align: left;
    padding-left: 24px;
    margin: 0 0 14px 0;
}

.advantage-modal__body li {
    font-size: 15px;
    line-height: 1.7;
    color: #c0c0c0;
    margin-bottom: 6px;
    padding-left: 4px;
    text-align: justify;
    text-align-last: left;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

.advantage-modal__body li::marker {
    color: #4a90d9;
}

/* ===== Ссылки ===== */
.advantage-modal__body a {
    color: #4a90d9;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.2s ease;
}

.advantage-modal__body a:hover {
    color: #5a9ee9;
}

/* ===== Подзаголовки ===== */
.advantage-modal__body h3,
.advantage-modal__body h4 {
    color: #f0f0f0;
    font-weight: 600;
    text-align: left;
    margin: 20px 0 10px 0;
    padding: 0 4px;
}

.advantage-modal__body h3 { 
    font-size: 18px; 
}

.advantage-modal__body h4 { 
    font-size: 16px; 
}

/* ===== Цитаты ===== */
.advantage-modal__body blockquote {
    border-left: 3px solid #4a90d9;
    padding: 8px 0 8px 16px;
    margin: 16px 0;
    color: #b0b0b0;
    font-style: italic;
    background: rgba(74, 144, 217, 0.05);
    border-radius: 0 8px 8px 0;
    text-align: justify;
    text-align-last: left;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
}

/* Убираем отступ у первого/последнего элемента */
.advantage-modal__body > *:first-child { 
    margin-top: 0; 
}

.advantage-modal__body > *:last-child { 
    margin-bottom: 0; 
}

/* ============================================================
   CTA-БЛОК С КНОПКОЙ-ТЕЛЕФОНОМ В МОДАЛКЕ
   ============================================================ */

.advantage-modal__cta {
    margin-top: 28px;
    padding-top: 24px;
    border-top: 1px solid #3a3a3a;
    text-align: center;
}

.advantage-modal__cta-text {
    font-size: 14px !important;
    color: #8a8a8a !important;
    margin: 0 0 14px 0 !important;
    line-height: 1.5;
    text-align: center !important;
    padding: 0 !important;
    text-align-last: center !important;
    hyphens: none !important;
    -webkit-hyphens: none !important;
    -ms-hyphens: none !important;
}

/* ===== КНОПКА-ТЕЛЕФОН ===== */
.advantage-modal__phone-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 36px;
    background: linear-gradient(135deg, #2e6cb5 0%, #4a90d9 100%);
    color: #ffffff !important;
    border: none;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 20px rgba(74, 144, 217, 0.35);
    width: 100%;
    max-width: 380px;
    margin: 0 auto;
    font-family: inherit;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

.advantage-modal__phone-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
    pointer-events: none;
}

.advantage-modal__phone-btn:hover {
    background: linear-gradient(135deg, #4a8bd9 0%, #5a9ee9 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(74, 144, 217, 0.5);
    color: #ffffff !important;
}

.advantage-modal__phone-btn:hover::before {
    width: 400px;
    height: 400px;
}

.advantage-modal__phone-btn:active {
    transform: translateY(0);
    box-shadow: 0 4px 16px rgba(74, 144, 217, 0.4);
}

.advantage-modal__phone-btn i {
    font-size: 18px;
    transition: transform 0.3s ease;
    position: relative;
    z-index: 1;
}

.advantage-modal__phone-btn:hover i {
    transform: rotate(-15deg) scale(1.1);
}

.advantage-modal__phone-number {
    position: relative;
    z-index: 1;
    white-space: nowrap;
}

/* ===== СОСТОЯНИЕ "СКОПИРОВАНО" ===== */
.advantage-modal__phone-btn.copied {
    background: linear-gradient(135deg, #1a5a2a 0%, #2a7a3a 100%);
    box-shadow: 0 4px 20px rgba(42, 122, 58, 0.4);
}

.advantage-modal__phone-btn.copied i {
    transform: none;
}

/* ===== АНИМАЦИЯ ИКОНКИ ТРУБКИ (пульсация) ===== */
@keyframes phonePulseAdv {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.12); }
}

.advantage-modal__phone-btn i.fa-phone-alt {
    animation: phonePulseAdv 2s ease-in-out infinite;
}

.advantage-modal__phone-btn.copied i.fa-check {
    animation: none;
}

/* ============================================================
   ТОСТ-УВЕДОМЛЕНИЕ (для десктопа)
   ============================================================ */

.advantage-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #2a2a2a;
    color: #f0f0f0;
    padding: 14px 28px;
    border-radius: 30px;
    border: 1px solid #4a4a4a;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    z-index: 100001;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    max-width: 90vw;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.advantage-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================================
   АДАПТИВНОСТЬ МОДАЛКИ, CTA И ТОСТА
   ============================================================ */

@media (max-width: 768px) {
    /* Модалка */
    .advantage-modal__content { 
        padding: 30px 24px; 
    }
    
    .advantage-modal__icon { 
        width: 64px; 
        height: 64px; 
        font-size: 28px; 
    }
    
    .advantage-modal__icon i { 
        font-size: 28px; 
    }
    
    .advantage-modal__body h2 { 
        font-size: 20px; 
    }
    
    /* 
     * На мобильных выравнивание по ширине отключаем —
     * строки короткие, justify создаёт большие "дыры" между словами.
     * Возвращаем обычное выравнивание по левому краю.
     */
    .advantage-modal__body p { 
        font-size: 14px; 
        line-height: 1.7;
        margin-bottom: 12px;
        text-align: left;
        text-align-last: auto;
        hyphens: none;
        -webkit-hyphens: none;
        -ms-hyphens: none;
    }
    
    .advantage-modal__body li {
        font-size: 14px;
        text-align: left;
        text-align-last: auto;
        hyphens: none;
        -webkit-hyphens: none;
        -ms-hyphens: none;
    }
    
    .advantage-modal__body blockquote {
        text-align: left;
        text-align-last: auto;
        hyphens: none;
        -webkit-hyphens: none;
        -ms-hyphens: none;
    }
    
    .advantage-modal__body h3 { 
        font-size: 16px; 
    }
    
    .advantage-modal__body h4 { 
        font-size: 15px; 
    }
    
    /* CTA */
    .advantage-modal__cta {
        margin-top: 22px;
        padding-top: 18px;
    }

    .advantage-modal__cta-text {
        font-size: 13px !important;
        margin-bottom: 12px !important;
    }

    .advantage-modal__phone-btn {
        padding: 14px 24px;
        font-size: 16px;
        gap: 10px;
        max-width: 100%;
    }

    .advantage-modal__phone-btn i {
        font-size: 16px;
    }

    /* Тост */
    .advantage-toast {
        bottom: 80px;
        padding: 12px 22px;
        font-size: 13px;
        max-width: calc(100vw - 32px);
        white-space: normal;
    }
}

@media (max-width: 480px) {
    /* Модалка */
    .advantage-modal {
        padding: 12px;
    }
    
    .advantage-modal__content {
        padding: 24px 18px;
        border-radius: 16px;
        max-height: 92vh;
    }
    
    .advantage-modal__close {
        top: 12px;
        right: 12px;
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    .advantage-modal__icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
        margin-bottom: 16px;
    }
    
    .advantage-modal__icon i {
        font-size: 24px;
    }
    
    .advantage-modal__body h2 {
        font-size: 18px;
    }
    
    .advantage-modal__body p {
        font-size: 13px;
        line-height: 1.65;
        margin-bottom: 10px;
    }
    
    .advantage-modal__body li {
        font-size: 13px;
    }
    
    .advantage-modal__body ul,
    .advantage-modal__body ol {
        padding-left: 20px;
    }
    
    /* CTA */
    .advantage-modal__phone-btn {
        padding: 13px 20px;
        font-size: 15px;
        gap: 8px;
    }

    .advantage-modal__phone-btn i {
        font-size: 14px;
    }

    /* Тост */
    .advantage-toast {
        font-size: 12px;
        padding: 10px 18px;
        bottom: 70px;
    }
}