/* ========================
   Страница 404 
   ======================== */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: #fcfcfc;
    padding-top: 30px;
    padding-bottom: 30px;
}
.header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.error-main {
    margin-top: 190px;
    min-height: calc(100vh - 135px - 300px);
    display: flex;
    align-items: center;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.error-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    width: 100%;
}

.error-content {
    flex: 2;
    text-align: left;
}

.error-code {
    font-size: 120px;
    font-weight: 700;
    color: #D90D26;
    line-height: 1;
    margin-bottom: 40px;
}

.error-title {
    font-size: 32px;
    font-weight: 500;
    margin-bottom: 20px;
    color: #000;
}

.error-message {
    font-size: 18px;
    color: #666;
    margin-bottom: 40px;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 20px;
    align-items: center;
    margin-bottom: 0;
}

.btn--error-home,
.btn--error-back {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
    white-space: nowrap;
}

.btn--error-home {
    background: linear-gradient(-41deg, #D90D26, #E94055, #D90D26);
    color: #fff;
    border: none;
    line-height: 23px;
}

.btn--error-home:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

.btn--error-back {
    background: transparent;
    border: 2px solid #D90D26;
    color: #D90D26;
}

.btn--error-back:hover {
    opacity: 0.8;
    transform: translateY(-2px);
}

/* Анимация колеса (десктоп) */
.error-animation {
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    margin-top: 160px;
}

.rolling-wheel {
    position: relative;
    width: 200px;
    height: 200px;
    animation: rollAndMove 3s infinite alternate ease-in-out;
}

.wheel-big {
    position: relative;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: #fcfcfc;
    border: 30px solid #000000;
    animation: spin 2s linear infinite;
}

.wheel-center {
    position: absolute;
    width: 90%;
    height: 90%;
    top: 5%;
    left: 5%;
    background: #000000;
    border-radius: 50%;
    z-index: 2;
}

.wheel-white {
    position: absolute;
    width: 20%;
    height: 20%;
    top: 40%;
    left: 40%;
    background: #fcfcfc;
    border-radius: 50%;
    z-index: 3;
}

.tooth {
    position: absolute;
    width: 30px;
    height: 30px;
    background: #fcfcfc;
    border-radius: 50% 50% 30% 30%;
    top: 50%;
    left: 50%;
    margin: -20px 0 0 -10px;
    transform-origin: center bottom;
    z-index: 3;
}

.t1 { transform: rotate(0deg) translateY(-65px) translateX(-5px) rotate(180deg); }
.t2 { transform: rotate(60deg) translateY(-55px) translateX(-10px) rotate(-180deg); }
.t3 { transform: rotate(120deg) translateY(-45px) translateX(-5px) rotate(-180deg); }
.t4 { transform: rotate(180deg) translateY(-45px) translateX(5px) rotate(-180deg); }
.t5 { transform: rotate(240deg) translateY(-52px) translateX(10px) rotate(-180deg); }
.t6 { transform: rotate(300deg) translateY(-65px) translateX(5px) rotate(-180deg); }

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes rollAndMove {
    0% { transform: translateX(-300px); }
    100% { transform: translateX(-50px); }
}

/* ========================
   Адаптивность 
   ======================== */
@media (max-width: 768px) {
    body {
        overflow-y: scroll;
        -webkit-overflow-scrolling: touch;
    }
    
    .container {
        max-width: 100%;
        padding: 0 16px;
        margin: 0 auto;
        overflow-x: hidden;
    }
    .header .container {
        padding: 0 16px;
        width: 100%;
    }

    .error-main {
        margin-top: 140px;
        min-height: auto;
        display: block;
        padding: 0 16px;
    }

    .error-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 30px;
        width: 100%;
    }

    .error-content {
        width: 100%;
        padding: 0;
    }

    .error-code {
        font-size: 60px;
        margin-bottom: 15px;
    }

    .error-title {
        font-size: 24px;
        margin-bottom: 10px;
    }

    .error-message {
        font-size: 14px;
        margin-bottom: 25px;
    }

    .error-message br {
        display: none;
    }

    .error-actions {
        justify-content: flex-start;
        gap: 15px;
        margin-bottom: 20px;
    }

    .btn--error-home,
    .btn--error-back {
        padding: 8px 20px;
        font-size: 14px;
        white-space: nowrap;
    }

    .error-animation {
        order: 2;
        margin-top: 0;
        margin-bottom: 40px;
        align-self: flex-start;
        width: auto;
    }

    /* Колесо – анимация качения с уменьшенной амплитудой (безопасно для экрана) */
    .rolling-wheel {
        width: 200px;
        height: 200px;
        transform: scale(0.4);
        transform-origin: left top;
        animation: rollAndMoveMobile 3s infinite alternate ease-in-out;
        margin: 0;
    }

    .wheel-big {
        animation: spin 2s linear infinite;
    }

    @keyframes rollAndMoveMobile {
        0% { transform: scale(0.4) translateX(10px); }
        100% { transform: scale(0.4) translateX(480px); }
    }
}