#basket {
    background-image: url("../img/basket.png");
}
.basket {
    padding: 99px 0;
    display: grid;
    grid-template-columns: 1fr 387px;
    gap: 20px;
    position: relative;
}
.basket-back {
    display: flex;
    align-items: center;
    color: #000;
    gap: 8px;
    font-weight: 400;
    font-size: 13px;
    line-height: 164%;
    letter-spacing: 2%;
    background-color: #fff;
    padding: 8px 12px;
    width: max-content;
    height: max-content;
    border-radius: 8px;
    position: absolute;
    top: 99px;
    left: -126px;
    cursor: pointer;
}
.basket-wrapper {
    background-color: #fff;
    padding: 24px;
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.basket-wrapper-group {
    display: flex;
    align-items: center;
    gap: 12px;
}
.basket-wrapper-group h2 {
    font-family: "RobotoRegular";
    font-weight: 400;
    font-size: 24px;
    line-height: 124%;
    letter-spacing: 2%;
    text-transform: capitalize;
    color: #000;
}
.basket-wrapper-group p {
    font-weight: 300;
    font-size: 13px;
    line-height: 124%;
    letter-spacing: 2%;
    color: #363636;
}
.basket-wrapper-card {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.basket-wrapper-card-items {
    border-radius: 4px;
    border: 1px solid #00000014;
    padding: 12px 20px 12px 12px;
    position: relative;
    transition: 0.5s;
    display: flex;
    gap: 12px;
    background-color: #fff;
}
.basket-wrapper-card-items:hover {
    background-color: #f5f5f5;
}
.basket-wrapper-card-items-img {
    background-color: #fff;
    border-radius: 4px;
    width: 72px;
    min-width: 72px;
    height: 96px;
}
.basket-wrapper-card-items img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.basket-wrapper-card-items-group {
    display: flex;
    width: 100%;
    justify-content: space-between;
}
.basket-wrapper-card-items-group-title p {
    font-weight: 400;
    font-size: 13px;
    line-height: 164%;
    letter-spacing: 2%;
    color: #000;
    max-width: 270px;
}
.basket-wrapper-card-items-group-title span {
    font-weight: 400;
    font-size: 12px;
    line-height: 124%;
    letter-spacing: 2%;
    color: #646464;
}
.basket-wrapper-card-items-group-info {
    display: flex;
    justify-content: space-between;
    min-width: 267px;
}
.basket-wrapper-card-items-group-info-counter {
    display: flex;
    gap: 10px;
    height: max-content;
    align-items: center;
}
.counter-value {
    font-weight: 400;
    font-size: 13px;
    line-height: 96%;
    letter-spacing: 2%;
    text-align: center;
    vertical-align: middle;
    color: #000000;
}
.counter-decrease,
.counter-increase {
    background: #f4f4f4;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: 0.5s;
}
.basket-wrapper-card-items:hover .counter-decrease,
.basket-wrapper-card-items:hover .counter-increase {
    background: #e7e7eb;
}
.basket-wrapper-card-items-group-info-price {
    font-weight: 400;
    font-size: 15px;
    line-height: 104%;
    color: #000;
}

.basket-wrapper-card-items-bottom {
    display: flex;
    justify-content: space-between;
}
.basket-wrapper-card-items-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 100%;
    gap: 25px;
}
.basket-wrapper-card-items-basket {
    /* bottom: 12px; */
    /* right: 20px; */
    width: 16px;
    height: 16px;
    display: block;
    cursor: pointer;
}



.basket-wrapper-card-items-basket img {
    width: 16px;
    height: 16px;
    display: block;
    object-fit: contain;
}
.basket-total-wrapper {
    border-radius: 8px;
    padding: 24px 24px 32px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 24px;
    height: max-content;
}
.basket-total-wrapper-group {
    display: flex;
    flex-direction: column;
    gap: 11px;
}
.basket-total-wrapper-group-row {
    display: flex;
    align-items: center;
    gap: 8px;
}
.basket-total-wrapper-group-row:last-child p {
    color: #000000;
    font-weight: 400;
    font-size: 20px;
    line-height: 124%;
    letter-spacing: 0%;
    text-align: right;
    text-transform: capitalize;
}
.basket-total-wrapper-group-row p {
    font-weight: 400;
    font-size: 13px;
    line-height: 124%;
    letter-spacing: 2%;
    color: #646464;
    white-space: nowrap;
    position: relative;
}

.skeleton {
    position: relative;
    color: transparent;
    overflow: hidden;
    opacity: 0.5;
    transition: opacity 0.2s ease-in-out;
}

.skeleton::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #e0e0e0 25%, #f5f5f5 50%, #e0e0e0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 4px;
}

@keyframes loading {
    from {
        background-position: 200% 0;
    }
    to {
        background-position: -200% 0;
    }
}

.basket-total-wrapper-group-row span {
    width: 100%;
    height: 0px;
    border-bottom: 2px dashed #0000003d;
}
.basket-total-wrapper-group-row p span {
    font-weight: 600;
    font-size: 14px;
    line-height: 124%;
    letter-spacing: 0%;
    text-align: right;
    border-bottom: none;
}
.basket-total-wrapper-group-row:last-child p span {
    font-weight: 400;
    font-size: 20px;
    text-align: right;
    text-transform: capitalize;
}
.basket-total-wrapper button {
    background: #528892;
    color: #ecf7f5;
    font-weight: 500;
    font-size: 15px;
    line-height: 113%;
    letter-spacing: 4%;
    text-align: center;
    padding: 13px;
    border: 1px solid #528892;
    border-radius: 4px;
    transition: 0.5s;
}
.basket-total-wrapper button:hover {
    background: var(--hover-btn);
}

.basket-wrapper-card-items-bottom-info {
    position: relative;
}

.basket-wrapper-card-items-bottom-list-btn {
    padding: 6px 8px 8px;
    display: flex;
    gap: 8px;
    align-items: center;
    background-color: #f5f5f5;
    cursor: pointer;
    border-radius: 4px;
    position: absolute;
    top: 0;
    left: 0;
    width: max-content;
    font-size: 12px;
    line-height: 124%;
    transition: .4s;
}

.basket-wrapper-card-items-bottom-list-btn svg {
    transition: .4s;
}

.basket-wrapper-card-items-bottom-info:has(._open) .basket-wrapper-card-items-bottom-list-btn svg {
    transform: rotate(-180deg);
}

.basket-wrapper-card-items-bottom-list__wrapper {
    border-radius: 4px;
    background-color: #f5f5f5;
    opacity: 0;
    display: grid;
    grid-template-rows: 0fr;
    transition: 0.4s;
    overflow: hidden;
}

.basket-wrapper-card-items-bottom-list__wrapper._open {
    grid-template-rows: 1fr;
    opacity: 1;
}

.basket-wrapper-card-items-bottom-list {
    display: flex;
    padding: 29px 24px 12px 8px;
    min-width: 120px;
    column-gap: 24px;
}

.basket-wrapper-card-items-bottom-list-column {
    display: flex;
    flex-direction: column;
}

.basket-wrapper-card-items-bottom-list-item:not(:hover) {
    color: #646464;
}

.basket-wrapper-card-items-bottom-list-item {
    transition: 0.4s;
    font-size: 12px;
    line-height: 20px;
}

.basket-wrapper-card-items-bottom-info:has(.basket-wrapper-card-items-bottom-list__wrapper) + .basket-wrapper-card-items-basket {
    margin-top: 12px;
}
.basket-wrapper-card-items-bottom-list-btn:hover {
    background-color: #EBEBEB;
}
.basket-wrapper-card-items-bottom-info:has(.basket-wrapper-card-items-bottom-list-btn:hover) .basket-wrapper-card-items-bottom-list__wrapper._open {
    background-color: #EBEBEB;
}
.basket-wrapper-card-items-bottom-info:has(.basket-wrapper-card-items-bottom-list__wrapper._open:hover) .basket-wrapper-card-items-bottom-list-btn {
    background-color: #EBEBEB;
}
.basket-wrapper-card-items-bottom-list__wrapper._open:hover {
    background-color: #EBEBEB;
}

@media screen and (max-width: 1550px) {
    .basket-back {
        top: 99px;
        left: 0px;
    }
    .basket {
        padding: 155px 0 99px;
    }
}
@media screen and (max-width: 1300px) {
    .basket {
        grid-template-columns: 1fr 300px;
    }
    .basket-wrapper-card-items-group {
        gap: 20px;
    }
    .basket-wrapper-card-items-group-info {
        min-width: 200px;
    }
}
@media screen and (max-width: 1210px) {
    .basket {
        padding: 97px 0 99px;
    }
    .basket-back {
        top: 41px;
        left: 0px;
    }
}
@media screen and (max-width: 1200px) {
    .basket-back {
        position: relative;
        top: 0;
        left: 0;
    }
    .basket {
        padding: 29px 0;
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .basket-wrapper-group {
        margin-left: 6px;
    }
    .basket-wrapper {
        padding: 16px 8px 10px;
        gap: 15px;
    }
    .basket-wrapper-card {
        gap: 8px;
    }
    .basket-wrapper-card-items-bottom-list {
        display: flex;
        flex-direction: column;
    }
    .basket-wrapper-card-items-bottom-list-item {
        font-size: 10px;
        line-height: 136%;
    }
}
@media screen and (max-width: 650px) {
    .basket-wrapper-card-items {
        padding: 12px 12px 12px 14px;
    }
    .basket-wrapper-card-items-img {
        width: 90px;
        min-width: 90px;
        height: 110px;
    }
    .basket-wrapper-card-items-group {
        flex-direction: column;
        justify-content: flex-start;
        gap: 6px;
    }
    .basket-wrapper-card-items-group-title p {
        max-width: 164px;
        line-height: 124%;
    }
    .basket-wrapper-card-items-group-title span {
        display: none;
    }
    .basket-wrapper-card-items-group-info {
        flex-direction: column-reverse;
        justify-content: flex-start;
        min-width: 100%;
        gap: 8px;
    }
    .basket-wrapper-card-items-basket {
        position: absolute;
        top: 12px;
        right: 12px;
        bottom: 100%;
    }
    .basket-wrapper-card-items-bottom-info:has(.basket-wrapper-card-items-bottom-list__wrapper) + .basket-wrapper-card-items-basket {
        margin-top: 0px;
    }
    .basket-total-wrapper {
        padding: 24px;
    }
    .basket-wrapper-card-items-content { 
        gap: 11px;
    }
}



/* v13: точечные правки без изменения логики корзины */
#basket .basket-wrapper-card-items .basket-wrapper-card-items-img {
    background-color: #fff !important;
}

.basket-back {
    text-decoration: none;
}

.basket-back svg {
    display: block;
    flex: none;
}

.basket-wrapper-card-items-basket {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    outline: none;
    box-shadow: none !important;
    appearance: none;
}

.basket-wrapper-card-items-basket:hover,
.basket-wrapper-card-items-basket:focus,
.basket-wrapper-card-items-basket:focus-visible {
    border: 0 !important;
    background: transparent !important;
    outline: none;
    box-shadow: none !important;
}


/* v15: точечные правки корзины */
#basket .basket-back svg {
    width: 9px;
    height: 15px;
}

#basket .basket-wrapper-card-items {
    position: relative;
}

#basket .basket-wrapper-card-items-basket {
    position: absolute;
    right: 20px;
    bottom: 12px;
    top: auto;
    left: auto;
    width: 16px;
    height: 16px;
    display: block;
    cursor: pointer;
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    margin: 0 !important;
    outline: none !important;
    box-shadow: none !important;
    appearance: none;
}

#basket .basket-wrapper-card-items-basket:hover,
#basket .basket-wrapper-card-items-basket:focus,
#basket .basket-wrapper-card-items-basket:focus-visible,
#basket .basket-wrapper-card-items-basket:active {
    border: 0 !important;
    background: transparent !important;
    padding: 0 !important;
    outline: none !important;
    box-shadow: none !important;
}

#basket .basket-wrapper-card-items-basket img {
    width: 16px;
    height: 16px;
    display: block;
    object-fit: contain;
}

#basket .basket-wrapper-card-items-bottom-info:has(.basket-wrapper-card-items-bottom-list__wrapper) + .basket-wrapper-card-items-basket {
    margin-top: 0;
}

@media screen and (max-width: 650px) {
    #basket .basket-wrapper-card-items-basket {
        top: auto;
        right: 12px;
        bottom: 12px;
    }
}

/* v25: ограничения количества без мигания кнопок */
.counter-increase.is-limit,
.counter-increase.is-limit:hover,
.counter-increase.is-limit:focus-visible {
    color: #C9D2CF;
    cursor: default;
}

/* v35: на /basket/ в мобильной версии убрать верхний отступ main */
@media screen and (max-width: 1210px) {
    body.basket-page.repaint main {
        padding-top: 0 !important;
    }
}


/* v39: мобильный /basket/ — вернуть header-top, но не выводить в нем кнопку корзины.
   Нижний пункт mobile-menu-footer-basket-btn остается со штатными стилями из basket-header.css.
   На самой странице корзины его модалка отключена без изменения внешнего вида. */
@media screen and (max-width: 1210px) {
    body.basket-page header > .header-top,
    body.basket-page.repaint header > .header-top {
        display: flex !important;
    }

    body.basket-page header > .header-top .basket-btn-container,
    body.basket-page.repaint header > .header-top .basket-btn-container {
        display: none !important;
    }

    body.basket-page .mobile-menu-footer-basket-btn {
        display: flex !important;
    }

    body.basket-page .mobile-menu-footer-basket-btn .basket-btn-container-js.btn-modal-form-open {
        pointer-events: none !important;
    }

    body.basket-page #modal-basket {
        display: none !important;
        pointer-events: none !important;
    }
}

/* v40: мобильные отступы самой корзины. */
@media screen and (max-width: 1200px) {
    .basket {
        padding: 89px 0;
        grid-template-columns: 1fr;
        gap: 8px;
    }
}


/* v57: на мобильной странице /basket/ отдельная строка корзины скрыта.
   Правило расположено после старого v39, чтобы исключить мигание до загрузки JS. */
@media screen and (max-width: 1210px) {
    body.basket-page .mobile-menu-footer-basket-btn {
        display: none !important;
    }
}
