﻿/* ============================================
   HOME.CSS - уникальные стили главной страницы
   ============================================ */

/* Баннеры */
.banners-slider {
    position: relative;
    max-width: 1290px;
    margin: 20px auto;
    padding: 0 15px;
}

.banners-container {
    position: relative;
    width: 100%;
    height: 320px;
    overflow: hidden;
    border-radius: 12px;
    background: #f0f0f0;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
}

.banner {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

    .banner.active {
        opacity: 1;
        pointer-events: auto;
        z-index: 2;
    }

    .banner img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: center;
        display: block;
    }

.slider-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: 0.3s;
    color: #333;
}

    .slider-arrow:hover {
        background: #2563eb;
        color: #fff;
    }

    .slider-arrow.prev {
        left: 15px;
    }

    .slider-arrow.next {
        right: 15px;
    }

.slider-nav {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 10;
}

.slider-dot {
    width: 8px;
    height: 8px;
    background: rgba(255,255,255,0.5);
    border-radius: 50%;
    cursor: pointer;
    transition: 0.3s;
}

    .slider-dot.active {
        width: 20px;
        border-radius: 4px;
        background: #fff;
    }

@media (max-width: 1024px) {
    .banners-container {
        height: 260px;
    }
}

@media (max-width: 768px) {
    .banners-slider {
        padding: 0 10px;
    }

    .banners-container {
        height: 220px;
    }

    .slider-arrow {
        width: 36px;
        height: 36px;
    }

        .slider-arrow.prev {
            left: 10px;
        }

        .slider-arrow.next {
            right: 10px;
        }
}

@media (max-width: 480px) {
    .banners-container {
        height: 180px;
    }

    .slider-arrow {
        display: none;
    }

    .slider-nav {
        bottom: 8px;
    }
}

/* Преимущества */
.features-section {
    padding: 4rem 0;
    background: var(--white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

.feature-card {
    text-align: center;
    padding: 1.5rem;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: var(--transition);
}

    .feature-card:hover {
        transform: translateY(-4px);
        box-shadow: var(--shadow-lg);
        border-color: var(--primary-light);
    }

.feature-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 1rem;
    background: linear-gradient(135deg, var(--primary-light), var(--primary));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    color: var(--white);
}

.feature-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.875rem;
    color: var(--gray-600);
}

/* О компании */
.about-section {
    padding: 4rem 0;
    background: var(--gray-100);
}

.about-content {
    max-width: 1000px;
    margin: 0 auto;
    background: var(--white);
    padding: 3rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
}

.about-description {
    margin-bottom: 2rem;
}

    .about-description p {
        font-size: 1rem;
        line-height: 1.6;
        color: var(--gray-700);
        margin-bottom: 1rem;
    }

    .about-description strong {
        color: var(--primary);
        font-weight: 600;
    }

.about-directions,
.about-advantages {
    margin: 2rem 0;
}

    .about-directions h3,
    .about-advantages h3 {
        font-size: 1.25rem;
        font-weight: 600;
        color: var(--gray-900);
        margin-bottom: 1rem;
        padding-bottom: 0.5rem;
        border-bottom: 2px solid var(--primary);
        display: inline-block;
    }

.directions-list,
.advantages-list {
    list-style: none;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

    .directions-list li,
    .advantages-list li {
        padding: 0.5rem 0 0.5rem 1.5rem;
        position: relative;
        color: var(--gray-700);
        font-size: 0.9rem;
        line-height: 1.4;
    }

        .directions-list li::before {
            content: '✓';
            position: absolute;
            left: 0;
            color: var(--primary);
            font-weight: bold;
            font-size: 1rem;
        }

        .advantages-list li::before {
            content: '★';
            position: absolute;
            left: 0;
            color: var(--warning);
            font-weight: bold;
            font-size: 1rem;
        }

.about-footer {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-200);
}

    .about-footer p {
        font-size: 1rem;
        line-height: 1.6;
        color: var(--gray-700);
        font-style: italic;
    }

    .about-footer strong {
        color: var(--primary);
        font-weight: 600;
        font-style: normal;
    }

@media (max-width: 768px) {
    .about-content {
        padding: 1.5rem;
    }

    .about-description p,
    .about-footer p {
        font-size: 0.9rem;
    }

    .about-directions h3,
    .about-advantages h3 {
        font-size: 1.1rem;
    }

    .directions-list,
    .advantages-list {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }

        .directions-list li,
        .advantages-list li {
            font-size: 0.85rem;
            padding: 0.4rem 0 0.4rem 1.5rem;
        }
}

@media (max-width: 480px) {
    .about-content {
        padding: 1rem;
    }

    .about-description p,
    .about-footer p {
        font-size: 0.85rem;
    }

    .about-directions h3,
    .about-advantages h3 {
        font-size: 1rem;
    }

    .directions-list li,
    .advantages-list li {
        font-size: 0.8rem;
    }
}

/* Подписка */
.newsletter-section {
    padding: 4rem 0;
    background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
}

.newsletter-content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

    .newsletter-content h3 {
        font-size: 2rem;
        color: var(--white);
        margin-bottom: 1rem;
    }

    .newsletter-content p {
        color: var(--gray-300);
        margin-bottom: 2rem;
    }

.newsletter-form {
    display: flex;
    gap: 1rem;
}

    .newsletter-form input {
        flex: 1;
        padding: 0.875rem 1rem;
        border: none;
        border-radius: var(--radius);
        font-size: 1rem;
        outline: none;
    }

    .newsletter-form button {
        padding: 0.875rem 2rem;
        background: var(--primary);
        color: var(--white);
        border: none;
        border-radius: var(--radius);
        font-weight: 500;
        cursor: pointer;
        transition: var(--transition);
    }

        .newsletter-form button:hover {
            background: var(--primary-dark);
        }

@media (max-width: 768px) {
    .newsletter-content h3 {
        font-size: 1.5rem;
    }

    .newsletter-form {
        flex-direction: column;
    }
}

/* Адаптивность для преимуществ и других блоков */
@media (max-width: 1024px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }

    .feature-card {
        padding: 1rem;
    }

    .feature-icon {
        width: 48px;
        height: 48px;
        font-size: 1.25rem;
    }

    .feature-card h3 {
        font-size: 0.9rem;
    }

    .feature-card p {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   Мобильная карусель для категорий и товаров
   ============================================ */

@media (max-width: 768px) {
    /* Категории */
    .categories-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 1rem; /* место для скроллбара */
        -webkit-overflow-scrolling: touch; /* плавный скролл на iOS */
    }

        .categories-grid .category-card {
            flex: 0 0 auto;
            width: 260px; /* ширина карточки, можно настроить */
            scroll-snap-align: start;
        }

    /* Товары */
    .products-grid {
        display: flex;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        gap: 1rem;
        padding-bottom: 1rem;
        -webkit-overflow-scrolling: touch;
    }

        .products-grid .product-card {
            flex: 0 0 auto;
            width: 280px; /* ширина карточки товара */
            scroll-snap-align: start;
        }

        /* Скрываем полосу прокрутки (необязательно, но эстетично) */
        .categories-grid::-webkit-scrollbar,
        .products-grid::-webkit-scrollbar {
            height: 4px;
        }

        .categories-grid::-webkit-scrollbar-track,
        .products-grid::-webkit-scrollbar-track {
            background: #f1f1f1;
            border-radius: 4px;
        }

        .categories-grid::-webkit-scrollbar-thumb,
        .products-grid::-webkit-scrollbar-thumb {
            background: #c1c1c1;
            border-radius: 4px;
        }

            .categories-grid::-webkit-scrollbar-thumb:hover,
            .products-grid::-webkit-scrollbar-thumb:hover {
                background: #a8a8a8;
            }
}