/*
 * Дополнения к all-style.css: страницы корзины и оформления заказа,
 * всплывашка «добавлено в корзину» и анимации сайта.
 *
 * Цвета и скругления — те же, что в вёрстке: синий #4873d2, тёмный #142d9f /
 * #091c71, светлый #e8f2fb, серый #f6f6f6, карточки 20px, кнопки и поля 10px.
 */

:root {
    --bz-blue: #4873d2;
    --bz-blue-dark: #142d9f;
    --bz-navy: #091c71;
    --bz-light: #e8f2fb;
    --bz-gray: #f6f6f6;
    --bz-muted: #8a8f99;
    --bz-line: #e3e8f2;
    --bz-red: #e53935;
    --bz-green: #2e9e5b;
    --bz-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* ------------------------------------------------------------ шаги заказа */

.shop-steps {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 15px 0 40px;
    flex-wrap: wrap;
}

.shop-steps__item {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--bz-muted);
    font-size: 16px;
}

.shop-steps__item a {
    display: flex;
    align-items: center;
    gap: 10px;
    color: inherit;
}

.shop-steps__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--bz-gray);
    font-weight: 600;
    transition: 300ms;
}

.shop-steps__item.is-done {
    color: var(--bz-blue);
}

.shop-steps__item.is-done .shop-steps__num {
    background: var(--bz-light);
    color: var(--bz-blue);
}

.shop-steps__item.is-current {
    color: #191919;
    font-weight: 500;
}

.shop-steps__item.is-current .shop-steps__num {
    background: var(--bz-blue);
    color: #fff;
    box-shadow: 0 0 0 6px rgba(72, 115, 210, 0.15);
}

.shop-steps__line {
    width: 48px;
    height: 2px;
    border-radius: 2px;
    background: var(--bz-line);
}

.shop-steps__line.is-done {
    background: var(--bz-blue);
}

/* ------------------------------------------------------------ раскладка */

.shop-page {
    margin-bottom: 120px;
}

.shop-page__inner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 440px;
    gap: 30px;
    align-items: start;
}

.shop-page__aside {
    position: sticky;
    top: 30px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.shop-box {
    border-radius: 20px;
    background: var(--bz-gray);
    padding: 30px;
}

.shop-box--white {
    background: #fff;
    border: 1px solid var(--bz-line);
}

.shop-box + .shop-box {
    margin-top: 20px;
}

.shop-box__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: 25px;
}

.shop-box__title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 24px;
    font-weight: 600;
    color: #191919;
}

.shop-box__title span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bz-blue);
    color: #fff;
    font-size: 16px;
}

.shop-box__note {
    font-size: 14px;
    color: var(--bz-muted);
}

.shop-link {
    color: var(--bz-blue);
    background: none;
    border: 0;
    font: inherit;
    font-size: 16px;
    cursor: pointer;
    transition: 300ms;
}

.shop-link:hover {
    color: var(--bz-blue-dark);
}

.shop-link--muted {
    color: var(--bz-muted);
}

.shop-link--muted:hover {
    color: var(--bz-red);
}

.shop-error {
    margin-top: 10px;
    color: var(--bz-red);
    font-size: 14px;
}

/* ------------------------------------------------------------ строки корзины */

.cart-line {
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr) auto;
    gap: 20px;
    align-items: center;
    padding: 20px;
    border-radius: 20px;
    background: #fff;
    transition: box-shadow 300ms, transform 300ms var(--bz-ease), opacity 300ms;
}

.cart-line + .cart-line {
    margin-top: 15px;
}

.cart-line:hover {
    box-shadow: 0 10px 30px rgba(9, 28, 113, 0.08);
}

.cart-line.has-problem {
    box-shadow: inset 0 0 0 1px rgba(229, 57, 53, 0.4);
}

.cart-line__img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 120px;
    height: 120px;
    border-radius: 15px;
    background: var(--bz-gray);
    overflow: hidden;
}

.cart-line__img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 500ms var(--bz-ease);
}

.cart-line:hover .cart-line__img img {
    transform: scale(1.06);
}

.cart-line__name {
    display: block;
    font-size: 18px;
    font-weight: 500;
    line-height: 130%;
    color: #191919;
    margin-bottom: 8px;
    transition: 300ms;
}

a.cart-line__name:hover {
    color: var(--bz-blue);
}

.cart-line__meta {
    font-size: 14px;
    color: var(--bz-muted);
    line-height: 140%;
}

.cart-line__meta s {
    margin-left: 6px;
}

.cart-line__problem {
    font-size: 14px;
    color: var(--bz-red);
}

.cart-line__side {
    display: flex;
    align-items: center;
    gap: 25px;
}

.cart-line__sum {
    min-width: 120px;
    text-align: right;
    font-size: 20px;
    font-weight: 600;
    color: var(--bz-navy);
    white-space: nowrap;
}

.cart-line__discount {
    display: block;
    margin-top: 4px;
    font-size: 13px;
    font-weight: 400;
    color: var(--bz-green);
}

/* Счётчик — как в выезжающей корзине вёрстки. */
.cart-qty {
    display: flex;
    align-items: center;
    height: 44px;
    border-radius: 10px;
    background: var(--bz-light);
    padding: 0 6px;
}

.cart-qty button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: none;
    cursor: pointer;
    transition: 300ms;
}

.cart-qty button:hover:not(:disabled) {
    background: #fff;
}

.cart-qty button:disabled {
    opacity: 0.35;
    cursor: default;
}

.cart-qty span {
    min-width: 40px;
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: var(--bz-blue);
}

.cart-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 10px;
    background: var(--bz-gray);
    cursor: pointer;
    transition: 300ms;
}

.cart-remove:hover {
    background: var(--bz-blue);
}

.cart-remove:hover path {
    stroke: #fff;
}

.cart-lines {
    border-radius: 20px;
    background: var(--bz-gray);
    padding: 20px;
}

/* Пока Livewire пересчитывает строку — она чуть гаснет (wire:loading.class). */
.cart-line.is-busy {
    opacity: 0.55;
}

/* ------------------------------------------------------------ итоги */

.shop-totals {
    display: flex;
    flex-direction: column;
    gap: 14px;
    font-size: 16px;
}

.shop-totals__row {
    display: flex;
    justify-content: space-between;
    gap: 15px;
}

.shop-totals__row dt {
    color: var(--bz-muted);
}

.shop-totals__row dd {
    color: #191919;
    text-align: right;
    white-space: nowrap;
}

.shop-totals__row--discount dd {
    color: var(--bz-green);
}

.shop-totals__total {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
    padding-top: 18px;
    margin-top: 4px;
    border-top: 1px solid var(--bz-line);
}

.shop-totals__total dt {
    font-size: 20px;
    font-weight: 500;
}

.shop-totals__total dd {
    font-size: 32px;
    font-weight: 600;
    color: var(--bz-navy);
}

.shop-btn {
    width: 100%;
    height: 56px;
    margin-top: 25px;
    gap: 10px;
    transition: background 300ms, transform 200ms;
}

.shop-btn:active:not(:disabled) {
    transform: scale(0.98);
}

.shop-btn:disabled,
.shop-btn.is-disabled {
    opacity: 0.5;
    pointer-events: none;
}

.shop-btn svg {
    transition: transform 300ms var(--bz-ease);
}

.shop-btn:hover svg {
    transform: translateX(4px);
}

.shop-back {
    display: block;
    margin-top: 15px;
    text-align: center;
    font-size: 16px;
    color: var(--bz-blue);
}

.shop-back:hover {
    color: var(--bz-blue-dark);
}

/* ------------------------------------------------------------ промокод */

.shop-promo {
    display: flex;
    gap: 10px;
}

.shop-promo .field {
    flex: 1;
    min-width: 0;
}

.shop-promo .field input {
    background: #fff;
    border-radius: 10px;
    text-transform: uppercase;
}

.shop-promo .btn {
    flex-shrink: 0;
}

.shop-promo__applied {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 15px;
    border-radius: 10px;
    background: #e7f5ec;
    color: var(--bz-green);
    font-weight: 500;
}

.shop-promo__ok {
    margin-top: 10px;
    color: var(--bz-green);
    font-size: 14px;
}

/* Преимущества под итогом. */
.shop-perks {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.shop-perks li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 15px;
    line-height: 140%;
}

.shop-perks svg {
    flex-shrink: 0;
    margin-top: 1px;
}

/* ------------------------------------------------------------ оформление */

.shop-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px 20px;
}

.shop-fields__wide {
    grid-column: 1 / -1;
}

.shop-fields .field input,
.shop-fields .field textarea {
    background: #fff;
    border-radius: 10px;
    transition: box-shadow 300ms;
}

.shop-fields .field textarea {
    height: 110px;
    padding: 15px;
    resize: vertical;
}

.shop-fields .field input:focus,
.shop-fields .field textarea:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--bz-blue);
}

.shop-fields .field.is-invalid input,
.shop-fields .field.is-invalid textarea {
    box-shadow: 0 0 0 1px var(--bz-red);
}

.shop-fields .shop-error {
    margin-top: 6px;
}

/* Варианты доставки и оплаты — карточки-переключатели. */
.shop-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.shop-option {
    position: relative;
    display: flex;
    gap: 15px;
    padding: 20px;
    border-radius: 15px;
    background: #fff;
    cursor: pointer;
    box-shadow: inset 0 0 0 1px transparent;
    transition: box-shadow 300ms, transform 300ms var(--bz-ease);
}

.shop-option:hover {
    transform: translateY(-2px);
    box-shadow: inset 0 0 0 1px #b0c2e8, 0 10px 25px rgba(9, 28, 113, 0.06);
}

.shop-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.shop-option__radio {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    margin-top: 2px;
    border-radius: 50%;
    border: 2px solid #b0c2e8;
    position: relative;
    transition: 300ms;
}

.shop-option__radio::after {
    content: "";
    position: absolute;
    inset: 4px;
    border-radius: 50%;
    background: var(--bz-blue);
    transform: scale(0);
    transition: transform 300ms var(--bz-ease);
}

.shop-option:has(input:checked) {
    box-shadow: inset 0 0 0 2px var(--bz-blue);
}

.shop-option:has(input:checked) .shop-option__radio {
    border-color: var(--bz-blue);
}

.shop-option:has(input:checked) .shop-option__radio::after {
    transform: scale(1);
}

.shop-option__body {
    flex: 1;
    min-width: 0;
}

.shop-option__top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 17px;
    font-weight: 500;
    line-height: 130%;
}

.shop-option__price {
    white-space: nowrap;
    color: var(--bz-blue);
}

.shop-option__text {
    margin-top: 8px;
    font-size: 14px;
    line-height: 140%;
    color: var(--bz-muted);
}

.shop-option__free {
    display: inline-block;
    margin-top: 10px;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--bz-light);
    color: var(--bz-blue);
    font-size: 13px;
}

/* Согласие на сером фоне — подписи тёмные. */
.shop-agree.checkbox {
    margin-top: 20px;
}

.shop-agree .checkbox__inner span {
    background: #fff;
    border: 1px solid #b0c2e8;
}

.shop-agree .checkbox__inner input:checked + span {
    background: var(--bz-blue);
    border-color: var(--bz-blue);
}

.shop-agree .checkbox__inner span::before {
    background: url("/images/checked-white.svg") no-repeat;
    background-size: cover;
}

.shop-agree .checkbox__text {
    color: #66686b;
}

.shop-agree .checkbox__text a {
    color: var(--bz-blue);
}

/* Состав заказа в итогах оформления. */
.shop-mini {
    display: flex;
    flex-direction: column;
    gap: 15px;
    max-height: 330px;
    overflow: auto;
    margin-bottom: 25px;
    padding-right: 6px;
}

.shop-mini__item {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    gap: 12px;
    align-items: center;
}

.shop-mini__img {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 10px;
    background: #fff;
    overflow: hidden;
}

.shop-mini__img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.shop-mini__name {
    font-size: 14px;
    line-height: 130%;
}

.shop-mini__qty {
    font-size: 13px;
    color: var(--bz-muted);
}

.shop-mini__sum {
    font-size: 15px;
    font-weight: 500;
    white-space: nowrap;
}

/* ------------------------------------------------------------ пустая корзина и успех */

.shop-empty,
.shop-done {
    max-width: 760px;
    margin: 0 auto;
    padding: 70px 40px;
    border-radius: 30px;
    background: var(--bz-gray);
    text-align: center;
}

.shop-empty__icon,
.shop-done__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 110px;
    height: 110px;
    margin: 0 auto 30px;
    border-radius: 50%;
    background: #fff;
}

.shop-done__icon {
    background: var(--bz-blue);
    animation: bz-pop 700ms var(--bz-ease) both;
}

.shop-done__icon path {
    stroke-dasharray: 40;
    stroke-dashoffset: 40;
    animation: bz-draw 600ms 350ms var(--bz-ease) forwards;
}

.shop-empty__title,
.shop-done__title {
    font-size: 32px;
    font-weight: 600;
    line-height: 120%;
    margin-bottom: 15px;
}

.shop-done__title span {
    color: var(--bz-blue);
}

.shop-empty__text,
.shop-done__text {
    max-width: 520px;
    margin: 0 auto;
    color: #66686b;
    line-height: 140%;
}

.shop-empty__btns,
.shop-done__btns {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 35px;
}

/* ------------------------------------------------------------ всплывашка «добавлено» */

.bz-toast {
    position: fixed;
    right: 30px;
    bottom: 30px;
    z-index: 120;
    display: flex;
    align-items: center;
    gap: 15px;
    max-width: 420px;
    padding: 18px 20px;
    border-radius: 20px;
    background: #fff;
    box-shadow: 0 20px 50px rgba(9, 28, 113, 0.18);
}

.bz-toast__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bz-blue);
}

.bz-toast__title {
    font-weight: 500;
    line-height: 130%;
}

.bz-toast__text {
    margin-top: 3px;
    font-size: 14px;
    color: var(--bz-muted);
    line-height: 130%;
}

.bz-toast__link {
    display: inline-block;
    margin-top: 6px;
    font-size: 15px;
    color: var(--bz-blue);
}

.bz-toast__close {
    align-self: flex-start;
    border: 0;
    background: none;
    color: var(--bz-muted);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

/* ------------------------------------------------------------ анимации */

@keyframes bz-pop {
    0% { transform: scale(0.4); opacity: 0; }
    70% { transform: scale(1.08); opacity: 1; }
    100% { transform: scale(1); }
}

@keyframes bz-draw {
    to { stroke-dashoffset: 0; }
}

@keyframes bz-bump {
    0%, 100% { transform: scale(1); }
    40% { transform: scale(1.35); }
}

@keyframes bz-fade-up {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

/*
 * Появление при прокрутке. Класс .bz-anim ставит скрипт только на <html>, где
 * он работает, — без JavaScript всё видно сразу. Элементы внутри Livewire
 * скрипт не трогает: перерисовка стёрла бы класс и элемент бы мигнул.
 */
.bz-anim [data-reveal] {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 700ms var(--bz-ease), transform 700ms var(--bz-ease);
    transition-delay: var(--reveal-delay, 0ms);
}

.bz-anim [data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

/* Наведение на карточки — лёгкий подъём. */
.card,
.main-usl__item,
.blog__card,
.actions__item,
.main-offer__item,
.projects__item,
.payment__item,
.page-order__item,
.catalog-why__item,
.catalog-price__item {
    transition: transform 400ms var(--bz-ease), box-shadow 400ms var(--bz-ease), background 300ms;
}

.card:hover,
.main-usl__item:hover,
.blog__card:hover,
.actions__item:hover,
.catalog-why__item:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 40px rgba(9, 28, 113, 0.1);
}

.card__img img,
.main-usl__img img,
.blog__img img {
    transition: transform 700ms var(--bz-ease);
}

.card:hover .card__img img,
.main-usl__item:hover .main-usl__img img,
.blog__card:hover .blog__img img {
    transform: scale(1.05);
}

.btn {
    transition: background 300ms, color 300ms, transform 200ms, box-shadow 300ms;
}

.btn-blue:hover {
    box-shadow: 0 10px 24px rgba(72, 115, 210, 0.3);
}

.btn:active {
    transform: scale(0.97);
}

/* Счётчик корзины в шапке подпрыгивает, когда число меняется. */
.header__basket span.is-bump {
    animation: bz-bump 500ms var(--bz-ease);
}

/* Шапка при прокрутке получает тень. */
.header {
    transition: box-shadow 300ms;
}

.header-black.is-scrolled {
    box-shadow: 0 8px 30px rgba(9, 28, 113, 0.08);
}

.shop-page .shop-box,
.shop-page .cart-lines {
    animation: bz-fade-up 600ms var(--bz-ease) both;
}

.shop-page__aside .shop-box {
    animation-delay: 120ms;
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 1ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 1ms !important;
    }

    .bz-anim [data-reveal] {
        opacity: 1;
        transform: none;
    }
}

/* ------------------------------------------------------------ адаптив */

@media only screen and (max-width: 1300px) {
    .shop-page__inner {
        grid-template-columns: minmax(0, 1fr) 380px;
    }

    .shop-options {
        grid-template-columns: 1fr;
    }
}

@media only screen and (max-width: 991px) {
    .shop-page {
        margin-bottom: 60px;
    }

    .shop-page__inner {
        grid-template-columns: 1fr;
    }

    .shop-page__aside {
        position: static;
    }

    .shop-box {
        padding: 20px;
    }

    .shop-box__title {
        font-size: 20px;
    }

    .shop-steps {
        margin-bottom: 25px;
    }

    .shop-steps__line {
        width: 20px;
    }

    .shop-steps__label {
        display: none;
    }

    .shop-steps__item.is-current .shop-steps__label {
        display: inline;
    }

    .cart-line {
        grid-template-columns: 80px minmax(0, 1fr);
        gap: 15px;
        padding: 15px;
    }

    .cart-line__img {
        width: 80px;
        height: 80px;
    }

    .cart-line__side {
        grid-column: 1 / -1;
        justify-content: space-between;
        gap: 15px;
    }

    .cart-line__sum {
        min-width: 0;
        margin-left: auto;
        font-size: 18px;
        white-space: normal;
    }

    .cart-line__discount {
        font-size: 12px;
    }

    .cart-lines {
        padding: 10px;
    }

    .shop-fields {
        grid-template-columns: 1fr;
    }

    .shop-totals__total dd {
        font-size: 26px;
    }

    .shop-empty,
    .shop-done {
        padding: 45px 20px;
        border-radius: 20px;
    }

    .shop-empty__title,
    .shop-done__title {
        font-size: 24px;
    }

    .bz-toast {
        left: 15px;
        right: 15px;
        bottom: 15px;
        max-width: none;
    }
}
