.slider-container {
    width: 100%;
    max-width: 1920px;
    margin: 0 auto;
    overflow: hidden;
    position: relative;
    /* UX: Запрещаем выделение текста и показываем курсор-руку */
    user-select: none;
    cursor: grab;
    /* UX: Разрешаем скроллить страницу вниз, касаясь слайдера, но перехватываем горизонталь */
    touch-action: pan-y;
    -webkit-tap-highlight-color: transparent;
}

/* Класс добавляется скриптом при нажатии */
.slider-container.grabbing {
    cursor: grabbing;
}

.slider {
    display: flex;
    width: 100%;
    /* Плавность для автоматического перелистывания и "доводки" */
    transition: transform 0.3s ease-out;
    /* Оптимизация: выносим анимацию на GPU */
    will-change: transform;
}

/* ВАЖНО: Отключаем анимацию во время перетаскивания пальцем */
.slider-container.grabbing .slider {
    transition: none !important;
}

.slider a {
    flex: 0 0 100%;
    width: 100%;
    display: block;
    position: relative;
    /* Отключаем нативное перетаскивание ссылок браузером */
    -webkit-user-drag: none;
}

.slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* Чтобы картинка не перехватывала события мыши */
}

/* Кнопки навигации */
.slider-container button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    background: none; /* Можно добавить легкий фон: rgba(0,0,0,0.3) */
    border: none;
    width: 70px;
    height: 100px;
    cursor: pointer;
    transition: color 0.2s, background 0.2s;
}

.slider-container .prev {
    cursor: w-resize;
    background: url("/uploads/icons/gallery-prev.svg") center/30px no-repeat;
    left: 0;
}
.slider-container .next {
    cursor: e-resize;
    background: url("/uploads/icons/gallery-next.svg") center/30px no-repeat;
    right: 0;
}

/* Точки */
.dots {
    position: absolute;
    bottom: 20px;
    width: 100%;
    display: flex;
    justify-content: center;
    gap: 12px;
    pointer-events: none; /* Пропускаем клики сквозь контейнер точек */
}

.dot {
    width: 10px;
    height: 10px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.3s, transform 0.3s;
    pointer-events: auto; /* Сами точки кликабельны */
}

.dot.active {
    background: white;
    transform: scale(1.2);
}

/* Текстовый блок */
.slide-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    text-align: center;
    width: 90%; /* Ограничиваем ширину, чтобы текст не прилипал к краям */
    pointer-events: none; /* Текст пропускает клики (чтобы свайп работал по тексту) */
}

.slide-title {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 15px;
    text-shadow: 2px 2px 15px rgba(0, 0, 0, 0.6);
    line-height: 1.1;
}

.slide-subtitle {
    font-size: 1.4rem;
    margin-bottom: 30px;
    text-shadow: 1px 1px 10px rgba(0, 0, 0, 0.6);
    font-weight: 400;
}

.slide-button {
    display: inline-block;
    background: #28a745;
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1rem;
    cursor: pointer;
    border-radius: 50px;
    transition: background 0.3s, transform 0.2s;
    pointer-events: auto; /* Кнопка должна нажиматься */
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    text-decoration: none; /* Если это span внутри ссылки, это не нужно, но на всякий случай */
}

.slide-button:hover {
    background: #218838;
    transform: translateY(-2px);
}

/* Responsive (Media Queries) */
/* Mobile */
@media (max-width: 767px) {
    .slider-container, .slider a { aspect-ratio: 768 / 1024; }
    .slider-container button { padding: 15px; font-size: 1.5rem; }
    .slide-title { font-size: 1.8rem; margin-bottom: 10px; }
    .slide-subtitle { font-size: 1.1rem; margin-bottom: 20px; }
    .slide-button { padding: 12px 24px; font-size: 0.9rem; }
    .slider-container .prev, .slider-container .next { display: none; }
}

/* Tablet */
@media (min-width: 768px) and (max-width: 1023px) {
    .slider-container, .slider a { aspect-ratio: 1024 / 800; }
    .slide-title { font-size: 2.2rem; }
    .slider-container .prev, .slider-container .next { display: none; }
}

/* Desktop */
@media (min-width: 1024px) {
    .slider-container, .slider a { aspect-ratio: 1920 / 600; }
}

/* Добавьте этот класс в конец файла */
.slider.no-transition {
    transition: none !important;
}

/* Напоминаю, это тоже должно быть для корректной работы drag */
.slider-container.grabbing .slider {
    transition: none !important;
}