/* ==========================================================================
   factory.css — слайдер на главной (hero) и блоки «О фабрике».
   Подключается отдельным файлом, чтобы не трогать существующие стили
   user_style.css. Все классы здесь префиксуются: hero-sl*, factory-*, tour-*.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Слайдер в шапке главной страницы.
   Слайды — абсолютные слои во всю ширину .hero-banner. Затемнение и текстовый
   блок лежат отдельно и показываются только на слайде, указанном в
   атрибуте data-slider-show. Поэтому баннер фабрики выводится целиком:
   без обрезки, без текста и без затемнения.
   -------------------------------------------------------------------------- */
.hero-slides {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    z-index: 1;
    overflow: hidden;
    border-radius: inherit;
}
.hero-slide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s ease;
}
.hero-slide.is-active {
    opacity: 1;
    visibility: visible;
}

/* Слайд с картинкой-фоном (прежний баннер) */
.hero-slide-img {
    position: absolute;
    top: 0; right: 0;
    width: 60%;
    height: 100%;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center top;
}

/* Баннер фабрики: показываем картинку целиком, как есть — contain,
   без затемнения и без текста поверх */
.hero-slide--plain {
    background-color: #f4f7fa;
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
}

/* Затемнение и текст, привязанные к конкретному слайду */
.hero-layer {
    transition: opacity 0.7s ease;
}
.hero-layer.is-off {
    opacity: 0;
    visibility: hidden;
}

/* Стрелки */
.hero-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 46px;
    height: 46px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.55);
    background: rgba(26,26,46,0.35);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.25s ease, background 0.2s ease;
}
.hero-nav:hover { background: rgba(26,26,46,0.55); }
.hero-nav:focus-visible { outline: 2px solid #fff; outline-offset: 2px; opacity: 1; }
.hero-slider:hover .hero-nav,
.hero-slider:focus-within .hero-nav { opacity: 1; }
.hero-nav--prev { left: 16px; }
.hero-nav--next { right: 16px; }

/* Точки-переключатели — под баннером, чтобы не закрывать картинку */
.hero-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 14px 0 0;
}
.hero-dot {
    width: 10px;
    height: 10px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #bdbdc9;
    background: #dcdce6;
    cursor: pointer;
    transition: width 0.25s ease, background 0.25s ease, border-color 0.25s ease;
}
.hero-dot:hover { border-color: #ad1457; }
.hero-dot.is-active {
    width: 28px;
    background: #ad1457;
    border-color: #ad1457;
}

/* Высота баннера. Текстовый блок находится внутри абсолютного слайда,
   поэтому задаём высоту явно — иначе .hero-banner схлопнется. */
.hero-banner { min-height: 460px; }

@media (max-width: 1024px) {
    .hero-banner { min-height: 420px; }
}

@media (max-width: 768px) {
    .hero-banner { min-height: 360px; }
    .hero-slide-img { width: 100%; }
    .hero-nav { display: none; }
}
@media (hover: none) {
    .hero-nav { display: none; }
}

/* --------------------------------------------------------------------------
   2. Блок «О фабрике» (главная страница и страница фабрики)
   -------------------------------------------------------------------------- */
.factory {
    max-width: 1400px;
    margin: 40px auto;
    padding: 0 20px;
}
.factory-card {
    background: #fff;
    border-radius: 20px;
    padding: 34px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.06);
}
/* Страница «О фабрике». Ширина и центрирование задаём длинной записью,
   вертикальные отступы — свои (иначе .factory-card--wide обнуляет их
   правилом margin: 0 auto, а соседние margin'ы схлопываются по max()). */
.factory-card--wide {
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    margin-top: 32px;
    margin-bottom: 32px;
}

/* Первый блок сразу под шапкой — отступ компактный, как у .hero */
.header + .factory { margin-top: 20px; }
/* Последний блок: низ отдаёт подвал, у которого свой margin-top */
.factory-card--wide:last-of-type { margin-bottom: 0; }

/* Блок «О фабрике» на главной стоит сразу под баннером */
.hero + .factory { margin-top: 24px; }

/* Баннер фабрики на странице «О фабрике» — целиком, без обрезки */
.factory-banner {
    margin: 0 0 26px;
    border-radius: 18px;
    overflow: hidden;
    background: #f4f7fa;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12);
}
.factory-banner img {
    display: block;
    width: 100%;
    height: auto;
}

.factory-eyebrow {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ad1457, #e91e63);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-bottom: 14px;
}
.factory-title {
    font-size: 30px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 14px;
    line-height: 1.2;
}
.factory-lead {
    font-size: 16px;
    line-height: 1.75;
    color: #555;
    max-width: 900px;
}

/* Плитки с фотографиями */
.factory-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
    margin-top: 24px;
}
.factory-tile {
    position: relative;
    display: block;
    border-radius: 14px;
    overflow: hidden;
    min-height: 190px;
    background-color: #6a1b9a;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.factory-tile:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.18);
}
.factory-tile--big {
    grid-column: span 2;
    grid-row: span 2;
    min-height: 394px;
}
.factory-tile--full {
    grid-column: 1 / -1;
    min-height: 270px;
}
.factory-tile-cap {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 40px 16px 14px;
    background: linear-gradient(180deg, rgba(26, 26, 46, 0) 0%, rgba(26, 26, 46, 0.88) 100%);
    color: #fff;
}
.factory-tile-cap b { display: block; font-size: 15px; font-weight: 700; }
.factory-tile-cap i {
    display: block;
    font-style: normal;
    font-size: 12px;
    opacity: 0.85;
    margin-top: 3px;
}

/* Кнопки */
.factory-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}
.factory-btn {
    display: inline-block;
    padding: 13px 26px;
    border-radius: 12px;
    background: linear-gradient(135deg, #ad1457, #e91e63);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.factory-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(173, 20, 87, 0.3);
}
.factory-btn--ghost {
    background: #fff;
    color: #ad1457;
    box-shadow: inset 0 0 0 2px #ad1457;
}
.factory-btn--ghost:hover { box-shadow: inset 0 0 0 2px #e91e63, 0 10px 24px rgba(173, 20, 87, 0.18); }
.factory-btn[disabled] { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }

/* Цифры о производстве */
.factory-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 16px;
    margin-top: 26px;
}
.factory-stat {
    background: linear-gradient(135deg, #f3e5f5, #fce4ec);
    border-radius: 16px;
    padding: 22px 16px;
    text-align: center;
}
.factory-stat b { display: block; font-size: 32px; font-weight: 800; color: #ad1457; }
.factory-stat span { display: block; margin-top: 6px; color: #666; font-size: 13px; }

/* Список достоинств прямых поставок */
.factory-list {
    list-style: none;
    padding: 0;
    margin: 0;
    columns: 2;
    column-gap: 30px;
}
.factory-list li {
    padding: 9px 0 9px 28px;
    position: relative;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    break-inside: avoid;
}
.factory-list li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #ad1457;
    font-weight: 700;
}

/* --------------------------------------------------------------------------
   3. Виртуальная экскурсия по фабрике (страница «О фабрике»)
   -------------------------------------------------------------------------- */
.tour { margin-top: 40px; }
.tour-stage {
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    background: #1a1a2e;
    aspect-ratio: 16 / 9;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.16);
}
.tour-slide {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.55s ease;
}
.tour-slide.is-active { opacity: 1; visibility: visible; }

/* Номер шага поверх фото */
.tour-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 3;
    padding: 7px 15px;
    border-radius: 20px;
    background: linear-gradient(135deg, #ad1457, #e91e63);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
}

/* Подпись-призыв поверх фото */
.tour-hint {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 3;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(26, 26, 46, 0.5);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
}

.tour-body {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 26px;
    margin-top: 22px;
    align-items: start;
}
/* Текстовый блок шага: в разметке присутствуют все шаги, показывается активный */
.tour-step { display: none; }
.tour-step.is-active { display: block; }
.tour-title {
    font-size: 22px;
    font-weight: 800;
    color: #1a1a2e;
    margin-bottom: 10px;
}
.tour-text {
    color: #555;
    font-size: 15px;
    line-height: 1.75;
}
.tour-points {
    list-style: none;
    padding: 0;
    margin: 16px 0 0;
}
.tour-points li {
    padding: 9px 0 9px 28px;
    position: relative;
    color: #555;
    font-size: 14px;
    line-height: 1.6;
    border-bottom: 1px solid #f2f2f2;
}
.tour-points li:last-child { border-bottom: none; }
.tour-points li::before {
    content: "\25B8";
    position: absolute;
    left: 6px;
    color: #ad1457;
    font-weight: 700;
}

/* Боковая колонка экскурсии */
.tour-side {
    background: linear-gradient(135deg, #f3e5f5, #fce4ec);
    border-radius: 16px;
    padding: 22px;
}
.tour-side h4 { font-size: 16px; font-weight: 700; color: #6a1b9a; margin-bottom: 10px; }
.tour-side p { color: #555; font-size: 14px; line-height: 1.65; }
.tour-side .factory-actions .factory-btn { flex: 1 1 auto; text-align: center; }

/* Навигация экскурсии */
.tour-nav {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}
.tour-counter {
    color: #888;
    font-size: 13px;
    font-weight: 600;
    margin: 0 4px;
}
.tour-dots {
    display: flex;
    gap: 8px;
    margin-left: auto;
    flex-wrap: wrap;
}
.tour-dot {
    width: 30px;
    height: 5px;
    padding: 0;
    border: none;
    border-radius: 3px;
    background: #e3e3e3;
    cursor: pointer;
    transition: background 0.2s ease;
}
.tour-dot.is-active { background: #ad1457; }

/* --------------------------------------------------------------------------
   4. Адаптив
   -------------------------------------------------------------------------- */
@media (max-width: 1024px) {
    .factory-grid { grid-template-columns: repeat(2, 1fr); }
    .factory-tile--big { grid-column: span 2; grid-row: auto; min-height: 280px; }
    .factory-tile--full { grid-column: 1 / -1; }
    .tour-body { grid-template-columns: 1fr; }
    .tour-dots { margin-left: 0; width: 100%; }
}
@media (max-width: 768px) {
    .factory-card { padding: 22px 18px; border-radius: 16px; }
    .factory-title { font-size: 24px; }
    .factory-lead { font-size: 15px; }
    .factory-grid { grid-template-columns: 1fr; }
    .factory-tile { min-height: 200px; }
    .factory-tile--big { grid-column: 1 / -1; min-height: 220px; }
    .factory-list { columns: 1; }
    .factory-actions .factory-btn { flex: 1 1 100%; text-align: center; }
    .tour-stage { aspect-ratio: 4 / 3; border-radius: 16px; }
    .tour-badge { top: 10px; left: 10px; padding: 5px 12px; font-size: 12px; }
    .tour-hint { display: none; }
    .tour-title { font-size: 19px; }
    .tour-dots { display: none; }
}

/* --------------------------------------------------------------------------
   5. Уважение к системным настройкам движения
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    .hero-slide,
    .tour-slide { transition: none; }
    .factory-tile,
    .factory-btn,
    .hero-dot { transition: none; }
    .factory-tile:hover,
    .factory-btn:hover { transform: none; }
}
