/* --- Глобальные стили и шрифты --- */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;700&display=swap');

:root {
    --primary-color: #007bff;
    --text-color: #333;
    --bg-color: #f8f9fa; /* Этот цвет будет виден, если фон не загрузится */
}

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

html, body {
    position: relative;
    height: 100%;
    width: 100%;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif;
    color: var(--text-color);
}

/* --- Стили для Swiper и Слайдов --- */
.swiper {
    width: 100%;
    height: 100%;
}

.swiper-slide {
    position: relative; /* Важно для позиционирования псевдо-элемента */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 40px;
    background-color: var(--bg-color); /* Резервный цвет фона */
}

/* --- Фоны для слайдов --- */
.swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.48; /* ОБЩАЯ ПРОЗРАЧНОСТЬ ДЛЯ ВСЕХ ФОНОВ */
    z-index: -1; /* Помещает фон за контентом */
}

/* Применяем уникальный фон для каждого слайда */
.slide-1::before { background-image: url('img/bg-1.jpeg'); }
.slide-2::before { background-image: url('img/bg-2.jpeg'); }
.slide-3::before { background-image: url('img/bg-3.jpeg'); }
.slide-4::before { background-image: url('img/bg-4.jpeg'); }
.slide-5::before { background-image: url('img/bg-5.jpeg'); }
.slide-6::before { background-image: url('img/bg-6.jpeg'); }
.slide-7::before { background-image: url('img/bg-7.jpeg'); }

/* --- Стилизация элементов навигации Swiper --- */
.swiper-button-next,
.swiper-button-prev {
    color: var(--primary-color);
}

.swiper-pagination-bullet-active {
    background-color: var(--primary-color);
}

/* --- Уникальные стили для каждого слайда (остаются без изменений) --- */

/* Слайд 1: Главный */
.slide-main { flex-direction: column; }
.product-image { max-height: 50vh; margin-bottom: 2rem; }
.main-title { font-size: 4rem; font-weight: 700; color: var(--primary-color); }
.subtitle { font-size: 1.2rem; max-width: 600px; }
.scroll-hint { position: absolute; bottom: 80px; font-size: 0.9rem; opacity: 0.7; }

/* Слайд 2: Ситуации */
.slide-content { max-width: 900px; }
.slide-content h2 { font-size: 2.5rem; margin-bottom: 3rem; }
.features-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2rem; }
.feature-item { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
/* .feature-item img { height: 80px; }  УДАЛЕНО, так как размер теперь контролируется контейнером */

/* Слайд 3: Как работает */
.video-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    padding-top: 56.25%;
    margin: 0 auto 2rem auto;
    border-radius: 8px;
    overflow: hidden;
}

.video-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.description {
    max-width: 700px;
    line-height: 1.6;
	font-size: 1.2rem;
}

/* Слайд 4: Преимущества */
.content-left { text-align: left; }
.advantages-list { list-style: none; padding: 0; }
.advantages-list li { font-size: 1.2rem; margin-bottom: 1.5rem; display: flex; align-items: center; }
.advantages-list img { height: 24px; margin-right: 1rem; }

/* Слайд 5: Шаги */
.steps-container { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3rem; width: 100%; }
.step-item { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
/* .step-item img { height: 120px; } УДАЛЕНО, так как размер теперь контролируется контейнером */
.step-item h3 { font-size: 1.5rem; color: var(--primary-color); }

/* --- НАЧАЛО: НОВЫЕ СТИЛИ ДЛЯ ЭФФЕКТА СМЕНЫ ИКОНОК --- */
.icon-container {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer; /* Показываем, что элемент интерактивный */
}

/* Задаем размеры контейнеров для разных слайдов */
.feature-item .icon-container {
    height: 80px;
    width: 80px;
}
.step-item .icon-container {
    height: 120px;
    width: 120px;
}

/* Стили для обоих изображений внутри контейнера */
.icon-container img {
    position: absolute;
    height: 100%;
    width: 100%;
    transition: opacity 0.3s ease-in-out; /* Плавный переход */
}

/* Изображение для наведения по умолчанию скрыто */
.icon-container .icon-hover {
    opacity: 0;
}

/* При наведении/нажатии на родительский блок (.feature-item или .step-item) */
.feature-item:hover .icon-hover,
.feature-item:active .icon-hover, /* Для мобильных устройств */
.step-item:hover .icon-hover,
.step-item:active .icon-hover { /* Для мобильных устройств */
    opacity: 1; /* Показываем второе изображение */
}

.feature-item:hover .icon-default,
.feature-item:active .icon-default,
.step-item:hover .icon-default,
.step-item:active .icon-default {
    opacity: 0; /* Скрываем первое изображение */
}
/* --- КОНЕЦ: НОВЫЕ СТИЛИ ДЛЯ ЭФФЕКТА СМЕНЫ ИКОНОК --- */


/* Слайд 6: Инфо */
.info-icon { height: 60px; margin-bottom: 1rem; }
.contra-list { margin-left: 20px; margin-bottom: 1.5rem; }
.contra-list li { margin-bottom: 0.5rem; }
.disclaimer { margin-top: 2rem; opacity: 0.8; }

/* Слайд 7: Где купить */
.pharmacy-logos { display: flex; gap: 2rem; justify-content: center; align-items: center; margin-top: 2rem; }
.pharmacy-logos img { max-height: 80px; filter: grayscale(100%); transition: filter 0.3s ease; }
.pharmacy-logos a:hover img { filter: grayscale(0%); }


/* --- Стили для фиксированных иконок и кнопки --- */

.fixed-icons-container {
    position: fixed; /* Фиксированное положение относительно окна браузера */
    bottom: 20px;    /* 20px от нижнего края */
    left: 20px;      /* 20px от левого края */
    z-index: 1000;   /* Высокий z-index, чтобы быть поверх всех элементов */
    display: flex;
    flex-direction: column; /* Располагаем блоки друг под другом */
    gap: 15px;       /* Расстояние между блоком соцсетей и кнопкой */
    align-items: flex-start; /* Выравнивание по левому краю */
}

.social-icons {
    display: flex;
    gap: 12px; /* Расстояние между иконками */
    align-items: center;
}

.social-icons a img {
    height: 32px; /* Размер иконок */
    width: 32px;
    transition: transform 0.2s ease, opacity 0.2s ease; /* Плавные переходы */
    opacity: 0.7; /* Небольшая прозрачность по умолчанию */
}

.social-icons a:hover img {
    transform: scale(1.15); /* Увеличиваем при наведении */
    opacity: 1; /* Полная непрозрачность при наведении */
}

/* Стили для новой кнопки */
.pharmacy-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px; /* Делаем кнопку овальной */
    font-family: 'Montserrat', sans-serif;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.pharmacy-button:hover {
    background-color: #0056b3; /* Более темный оттенок синего при наведении */
    transform: scale(1.05); /* Немного увеличиваем */
}


/* --- Адаптация для мобильных устройств --- */
@media (max-width: 768px) {
    .swiper-slide { 
        padding: 20px; 
        /* Позволяем слайду прокручиваться, если контент не помещается */
        overflow-y: auto;
        -webkit-overflow-scrolling: touch; /* Плавная прокрутка на iOS */
    }

    /* --- НОВОЕ ИСПРАВЛЕНИЕ ДЛЯ СЛАЙДА 5 НА МОБИЛЬНЫХ --- */
    /* Этот код решает проблему с "уезжающим" заголовком */
    .slide-5.swiper-slide {
        align-items: flex-start; /* Выравниваем контент по верху, а не по центру */
    }

    .swiper-button-next, .swiper-button-prev { display: none; }
    .main-title { font-size: 3rem; }
    .subtitle { font-size: 1rem; }
    .product-image { max-height: 40vh; }
    .scroll-hint { bottom: 60px; }
    .slide-content h2 { font-size: 1.8rem; margin-bottom: 2rem; }
    .features-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
    
    /* --- Изменения для слайда с шагами --- */
    .steps-container { 
        display: flex; /* Используем flexbox вместо grid */
        flex-direction: column; /* Элементы в колонку */
        gap: 1.5rem; /* Уменьшаем отступ между шагами */
    }
    
    /* Уменьшаем иконки на мобильных */
    .feature-item .icon-container {
        height: 60px;
        width: 60px;
    }
	
     .pharmacy-logos {
        /* Разрешаем перенос и выравниваем по центру */
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem; /* Отступ между логотипами */
    }

    /* Задаем РАЗМЕР для самих ссылок (flex-элементов) */
    .pharmacy-logos a {
        /* Задаем базовую ширину, чтобы помещалось примерно по 2 в ряд */
        flex-basis: 40%;
        /* Ограничиваем максимальную ширину, чтобы не были слишком большими */
        max-width: 150px;
        /* Важно для правильного сжатия */
        flex-shrink: 1;
    }

    /* Заставляем изображение ПОДСТРАИВАТЬСЯ под размер ссылки-родителя */
    .pharmacy-logos img {
        width: 100%; /* Ширина на 100% от родителя (ссылки <a>) */
        height: auto; /* Высота подстраивается автоматически для сохранения пропорций */
        max-height: none; /* Сбрасываем старое ограничение по высоте, оно больше не нужно */
    }
    
    /* --- НАЧАЛО: Фоны для мобильных устройств --- */
    /* Замените 'img/bg-X-mobile.jpeg' на ваши реальные пути к файлам */
    .slide-1::before { background-image: url('img/bg-1-mobile.jpeg'); }
    .slide-2::before { background-image: url('img/bg-2-mobile.jpeg'); }
    .slide-3::before { background-image: url('img/bg-3-mobile.jpeg'); }
    .slide-4::before { background-image: url('img/bg-4-mobile.jpeg'); }
    .slide-5::before { background-image: url('img/bg-5-mobile.jpeg'); }
    .slide-6::before { background-image: url('img/bg-6-mobile.jpeg'); }
    .slide-7::before { background-image: url('img/bg-7-mobile.jpeg'); }
    /* --- КОНЕЦ: Фоны для мобильных устройств --- */


    /* --- Стили для фиксированных иконок и кнопки (без изменений) --- */
    .fixed-icons-container {
        bottom: 15px;
        left: 15px;
        flex-direction: row; /* На мобильных ставим в ряд */
        width: calc(100% - 30px);
        justify-content: space-between; /* Распределяем по краям */
        align-items: center;
    }
    
    .social-icons a img {
        height: 28px; /* Немного уменьшаем иконки */
        width: 28px;
    }

    /* Адаптируем кнопку для мобильных */
    .pharmacy-button {
        padding: 6px 12px;
        font-size: 12px;
    }
}