/* Магазин журналів на /nv_print: кнопка кошика під .archive-btn, плаваючий кошик, форма логіну */

.shop-item {
    display: flex;
    justify-content: center;
    margin: -18px auto 30px;
    min-height: 48px;
}

.shop-item__sold-out {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    color: #fff;
    opacity: .6;
    font-family: 'Noto', sans-serif;
    font-size: 14px;
}

.shop-item__sold-out[hidden] {
    display: none;
}

.shop-item__add,
.shop-item__counter button {
    font-family: 'Noto', sans-serif;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, opacity .2s ease;
}

.shop-item__add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 48px;
    border: 1.5px solid #fff;
    border-radius: 15px;
    background: transparent;
    color: #fff;
    padding: 0;
}

.shop-item__add svg {
    width: 24px;
    height: 24px;
    fill: currentColor;
}

.shop-item__add:hover {
    background: #fff;
    color: #000;
}

.shop-item__counter {
    display: inline-flex;
    align-items: center;
    height: 48px;
    border: 1.5px solid #fff;
    border-radius: 15px;
    overflow: hidden;
    color: #fff;
}

.shop-item__counter[hidden],
.shop-item__add[hidden] {
    display: none;
}

.shop-item__counter button {
    width: 48px;
    height: 100%;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 24px;
    line-height: 1;
}

.shop-item__counter button:hover:not(:disabled) {
    background: #fff;
    color: #000;
}

.shop-item__counter button:disabled {
    opacity: .35;
    cursor: default;
}

.shop-item__count {
    min-width: 40px;
    text-align: center;
    font-size: 18px;
    font-family: 'NotoSemiBold', 'Noto', sans-serif;
}

/* ---------- плаваючий кошик ---------- */

.shop-basket {
    position: fixed;
    top: 90px;
    right: 20px;
    z-index: 1000;
    font-family: 'Noto', sans-serif;
}

.shop-basket[hidden] {
    display: none;
}

.shop-basket__toggle {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    margin-left: auto;
    border: 0;
    border-radius: 50%;
    background: #e5001c;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
}

.shop-basket__toggle svg {
    width: 28px;
    height: 28px;
    fill: currentColor;
}

.shop-basket__badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 24px;
    height: 24px;
    padding: 0 6px;
    border-radius: 12px;
    background: #fff;
    color: #000;
    font-size: 13px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
}

.shop-basket__panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 340px;
    max-width: calc(100vw - 32px);
    padding: 20px;
    margin-top: 12px;
    border-radius: 15px;
    background: #fff;
    color: #000;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .35);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
}

/* «місток», щоб панель не зникала, поки курсор переходить з кнопки на панель */
.shop-basket__panel::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -12px;
    height: 12px;
}

.shop-basket.is-open .shop-basket__panel {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition: opacity .2s ease, transform .2s ease;
}

@media (hover: hover) {
    .shop-basket:hover .shop-basket__panel {
        opacity: 1;
        visibility: visible;
        transform: none;
        transition: opacity .2s ease, transform .2s ease;
    }
}

.shop-basket__title {
    margin-bottom: 12px;
    font-family: 'NotoSemiBold', 'Noto', sans-serif;
    font-size: 18px;
}

.shop-basket__list {
    max-height: 50vh;
    overflow-y: auto;
}

.shop-basket__row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 12px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    font-size: 14px;
}

.shop-basket__row-title {
    font-weight: 600;
}

.shop-basket__row-meta {
    color: #707485;
}

.shop-basket__row-amount {
    text-align: right;
    white-space: nowrap;
}

.shop-basket__row-remove {
    width: 24px;
    height: 24px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #707485;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
}

.shop-basket__row-remove:hover {
    color: #e5001c;
}

.shop-basket__total {
    display: flex;
    justify-content: space-between;
    padding: 14px 0;
    font-family: 'NotoSemiBold', 'Noto', sans-serif;
    font-size: 18px;
}

.shop-basket__error {
    margin-bottom: 12px;
    color: #e5001c;
    font-size: 14px;
}

.shop-basket__error[hidden] {
    display: none;
}

.shop-basket__buy {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 52px;
    border: 0;
    border-radius: 15px;
    background: #e5001c;
    color: #fff;
    font-family: 'Noto', sans-serif;
    font-size: 17px;
    text-decoration: none;
    cursor: pointer;
    transition: opacity .2s ease;
}

.shop-basket__buy:hover {
    opacity: .9;
}

.shop-basket__buy.is-busy {
    opacity: .5;
    cursor: default;
}

@media (max-width: 600px) {
    .shop-basket {
        top: auto;
        bottom: 90px;
        right: 16px;
    }

    .shop-basket__panel {
        top: auto;
        bottom: 100%;
        margin-top: 0;
        margin-bottom: 12px;
        transform: translateY(6px);
    }

    .shop-basket__panel::before {
        top: auto;
        bottom: -12px;
    }
}
