/* =========================================
   THANKS PAGE
   Подключается после style.css
   ========================================= */

.thanks-page {
    padding: 0 0 100px;
    min-height: calc(100vh - var(--header-height));
    background: var(--white);
    display: flex;
    flex-direction: column;
}

/* =========================================
   STEPS — завершённые
   ========================================= */

.thanks-steps {
    padding: 32px 0 0;
    margin-bottom: 60px;
}

/* Линии тоже закрашиваем */
.cart-step__line--done {
    background: var(--sage);
}

/* Галочка вместо номера */
.cart-step--done .cart-step__num {
    background: var(--sage);
    border-color: var(--sage);
    color: var(--white);
}

.cart-step--done .cart-step__label {
    color: var(--sage);
}

/* =========================================
   ОСНОВНАЯ КАРТОЧКА
   ========================================= */

.thanks-card {
    max-width: 560px;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    animation: fadeInUp 0.6s ease both;
}

/* =========================================
   ИКОНКА-ГАЛОЧКА
   ========================================= */

.thanks-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--sage);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--white);
    margin-bottom: 32px;
    position: relative;
    flex-shrink: 0;

    /* Пульсирующий ореол */
    animation: thanksIconIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.thanks-icon::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 1.5px solid var(--sage);
    opacity: 0;
    animation: thanksPulse 2s ease 0.6s infinite;
}

.thanks-icon::after {
    content: '';
    position: absolute;
    inset: -18px;
    border-radius: 50%;
    border: 1px solid var(--sage);
    opacity: 0;
    animation: thanksPulse 2s ease 0.9s infinite;
}

@keyframes thanksIconIn {
    from {
        transform: scale(0.4);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@keyframes thanksPulse {
    0%   { transform: scale(1);    opacity: 0.5; }
    60%  { transform: scale(1.4);  opacity: 0;   }
    100% { transform: scale(1.4);  opacity: 0;   }
}

/* =========================================
   ЗАГОЛОВОК
   ========================================= */

.thanks-title {
    font-size: clamp(32px, 4vw, 48px);
    font-weight: 300;
    letter-spacing: -1.5px;
    line-height: 1.05;
    color: var(--black);
    margin: 0 0 14px;
}

.thanks-subtitle {
    font-size: 16px;
    color: var(--gray-text);
    line-height: 1.6;
    margin: 0 0 36px;
}

/* =========================================
   БЛОК НОМЕРА ЗАКАЗА
   ========================================= */

.thanks-order {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--gray-bg);
    border: 1px solid var(--gray-line);
    border-radius: var(--radius-lg);
    padding: 20px 28px;
    margin-bottom: 28px;
    width: 100%;
    justify-content: center;
}

.thanks-order__label {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--gray-text);
}

.thanks-order__num {
    font-size: 22px;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: var(--black);
}

/* =========================================
   УВЕДОМЛЕНИЕ МЕНЕДЖЕРА
   ========================================= */

.thanks-notice {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(148, 154, 144, 0.10);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    margin-bottom: 40px;
    width: 100%;
    text-align: left;
}

.thanks-notice__icon {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--sage);
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

.thanks-notice__text {
    font-size: 14px;
    line-height: 1.65;
    color: var(--gray-text);
    margin: 0;
    padding-top: 8px;
}

/* =========================================
   КНОПКИ
   ========================================= */

.thanks-actions {
    display: flex;
    gap: 12px;
    width: 100%;
    justify-content: center;
}

.thanks-btn-home {
    height: 52px;
    padding: 0 32px;
    font-size: 14px;
    letter-spacing: 0.8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
}

.thanks-btn-home::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--yellow);
    transform: translateX(-101%);
    transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
}

.thanks-btn-home:hover::after {
    transform: translateX(0);
    z-index: -1;
}

.thanks-btn-home span,
.thanks-btn-home svg {
    position: relative;
    z-index: 1;
}

.thanks-btn-home:hover {
    color: var(--black);
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(0,0,0,0.15);
}

.thanks-btn-catalog {
    height: 52px;
    padding: 0 28px;
    font-size: 13px;
    color: var(--gray-text);
    border-color: var(--gray-line);
}

.thanks-btn-catalog:hover {
    color: var(--black);
    border-color: var(--black);
    background: transparent;
}

/* =========================================
   RESPONSIVE — 640px
   ========================================= */

@media (max-width: 640px) {
    .thanks-steps {
        padding-top: 24px;
        margin-bottom: 40px;


    }
    .thanks-page {
        padding: 60px 0 100px;
    }
    .cart-steps {
        display: flex;
        gap: 0px;
        margin-bottom: 32px;
    }

    .thanks-card {
        max-width: 100%;
    }

    .thanks-icon {
        width: 68px;
        height: 68px;
        margin-bottom: 24px;
    }

    .thanks-title {
        font-size: 28px;
        letter-spacing: -1px;
        margin-bottom: 10px;
    }

    .thanks-subtitle {
        font-size: 15px;
        margin-bottom: 28px;
    }

    .thanks-order {
        padding: 18px 20px;
        flex-direction: column;
        gap: 6px;
        margin-bottom: 20px;
    }

    .thanks-order__num {
        font-size: 20px;
    }

    .thanks-notice {
        padding: 16px;
        gap: 12px;
        margin-bottom: 32px;
    }

    .thanks-notice__text {
        font-size: 13px;
        padding-top: 6px;
    }

    .thanks-actions {
        flex-direction: column;
    }

    .thanks-btn-home,
    .thanks-btn-catalog {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================
   RESPONSIVE — 400px
   ========================================= */

@media (max-width: 400px) {
    .thanks-icon {
        width: 60px;
        height: 60px;
    }

    .thanks-title {
        font-size: 24px;
    }

    .thanks-order {
        padding: 16px;
    }

    .thanks-order__num {
        font-size: 18px;
    }

    .thanks-btn-home,
    .thanks-btn-catalog {
        height: 48px;
        font-size: 13px;
    }
}

/* =========================================
   PREFERS REDUCED MOTION
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    .thanks-card {
        animation: none;
    }

    .thanks-icon {
        animation: none;
    }

    .thanks-icon::before,
    .thanks-icon::after {
        display: none;
    }

    .thanks-btn-home::after {
        transition: none;
    }
}

/* =========================================
   FIX: текст и иконка поверх жёлтой заливки
   ========================================= */

.thanks-btn-home {
    isolation: isolate;
}

.thanks-btn-home svg,
.thanks-btn-home::before {
    position: relative;
    z-index: 1;
}

/* Весь текстовый контент кнопки поверх ::after */
.thanks-btn-home > * {
    position: relative;
    z-index: 1;
}

/* Явно форсируем цвет текста при ховере */
.thanks-btn-home:hover,
.thanks-btn-home:hover svg {
    color: var(--black) !important;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

.thanks-page {
    max-width: 100%;
    overflow-x: hidden;
}

.thanks-steps {
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

/* Степпер — принудительно вписываем в ширину */
.cart-steps {
    flex-wrap: nowrap;
    width: 100%;
    box-sizing: border-box;
}

@media (max-width: 640px) {
    .cart-steps {
        padding: 0 16px;
        gap: 0;
    }

    .cart-step__line {
        flex: 1 1 0;
        min-width: 0;
        max-width: none;
        margin: 0 4px;
    }

    .cart-step__label {
        font-size: 11px;
        white-space: nowrap;
    }

    .cart-step__num {
        flex-shrink: 0;
    }

    .thanks-card {
        width: 100%;
        box-sizing: border-box;
        padding: 0 16px;
    }

    .thanks-order,
    .thanks-notice,
    .thanks-actions {
        width: 100%;
        box-sizing: border-box;
    }
}