/* ==========================================================================
   Корзина: иконка «в корзину» в карточке товара, пункты меню, всплывашка.
   Подключается из vendor.php после template.css.
   ========================================================================== */

/* --- Кнопки «Купить» + иконка корзины в карточке товара ------------------- */

.gb-buy-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
}

.gb-buy-row > .btn {
    margin: 0;
}

.gb-addtocart {
    display: flex;
    margin: 0 0 0 12px;
}

.gb-addtocart__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    align-self: stretch;
    width: 60px;
    padding: 0;
    border: 1px solid #2E2E2E;
    border-radius: 6px;
    background: transparent;
    color: #2E2E2E;
    line-height: 1;
    cursor: pointer;
    transition: .3s;
}

.gb-addtocart__icon {
    display: block;
    width: 24px;
    height: 24px;
}

.gb-addtocart__btn:hover,
.gb-addtocart__btn:focus {
    border-color: #2D965D;
    background: #2D965D;
    color: #fff;
    outline: none;
}

.gb-addtocart__btn.is-busy {
    opacity: .55;
    pointer-events: none;
}

@media (max-width: 575px) {
    .gb-buy-row > .btn {
        padding-left: 30px;
        padding-right: 30px;
    }

    .gb-addtocart__btn {
        width: 52px;
    }

    .gb-addtocart__icon {
        width: 22px;
        height: 22px;
    }
}

/* --- Пункты меню «Оформление заказа» и «Корзина» -------------------------- */

a.gb-cart-link,
a.gb-checkout-link {
    position: relative;
    white-space: nowrap;
}

/* Иконки пунктов меню — SVG через mask, чтобы цвет наследовался от текста.
   Font Awesome в шаблоне отключён, поэтому шрифтовые иконки не используем.
   Без поддержки mask пункт остаётся просто текстовым — это нормально. */
@supports ((-webkit-mask-image: none) or (mask-image: none)) {
    a.gb-cart-link::before,
    a.gb-checkout-link::before {
        display: inline-block;
        width: 1.05em;
        height: 1.05em;
        margin-right: .4em;
        background-color: currentColor;
        vertical-align: -.15em;
        content: "";
        -webkit-mask-repeat: no-repeat;
        mask-repeat: no-repeat;
        -webkit-mask-position: center;
        mask-position: center;
        -webkit-mask-size: contain;
        mask-size: contain;
    }

    a.gb-cart-link::before {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9.5' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3Cpath d='M2.5 3.5h3l2.35 11.4a1.6 1.6 0 0 0 1.57 1.28h8.2a1.6 1.6 0 0 0 1.57-1.26L21 7.5H6.2'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9.5' cy='20' r='1.4'/%3E%3Ccircle cx='18' cy='20' r='1.4'/%3E%3Cpath d='M2.5 3.5h3l2.35 11.4a1.6 1.6 0 0 0 1.57 1.28h8.2a1.6 1.6 0 0 0 1.57-1.26L21 7.5H6.2'/%3E%3C/svg%3E");
    }

    a.gb-checkout-link::before {
        -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3.5h6a1 1 0 0 1 1 1v1.2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V4.5a1 1 0 0 1 1-1z'/%3E%3Cpath d='M16 5.2h2.2a1.8 1.8 0 0 1 1.8 1.8v11.7a1.8 1.8 0 0 1-1.8 1.8H5.8A1.8 1.8 0 0 1 4 18.7V7a1.8 1.8 0 0 1 1.8-1.8H8'/%3E%3Cpath d='M8.6 13.4l2.2 2.2 4.6-4.6'/%3E%3C/svg%3E");
        mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 3.5h6a1 1 0 0 1 1 1v1.2a1 1 0 0 1-1 1H9a1 1 0 0 1-1-1V4.5a1 1 0 0 1 1-1z'/%3E%3Cpath d='M16 5.2h2.2a1.8 1.8 0 0 1 1.8 1.8v11.7a1.8 1.8 0 0 1-1.8 1.8H5.8A1.8 1.8 0 0 1 4 18.7V7a1.8 1.8 0 0 1 1.8-1.8H8'/%3E%3Cpath d='M8.6 13.4l2.2 2.2 4.6-4.6'/%3E%3C/svg%3E");
    }
}

.gb-cart-count {
    display: inline-block;
    min-width: 20px;
    margin-left: .45em;
    padding: 0 5px;
    border-radius: 10px;
    background: #2D965D;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    line-height: 20px;
    text-align: center;
    vertical-align: middle;
}

/* --- Всплывающее уведомление «Товар добавлен» ----------------------------- */

.gb-toast {
    position: fixed;
    z-index: 2000;
    right: 20px;
    bottom: 20px;
    left: auto;
    max-width: 360px;
    padding: 18px 44px 18px 20px;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 8px 30px rgba(0, 0, 0, .18);
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .25s, transform .25s;
    pointer-events: none;
}

.gb-toast.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.gb-toast__title {
    margin: 0 0 4px;
    font-size: 16px;
    font-weight: 700;
    color: #212529;
}

.gb-toast__text {
    margin: 0 0 14px;
    font-size: 14px;
    line-height: 1.35;
    color: #6c757d;
}

.gb-toast__actions {
    display: flex;
    flex-wrap: wrap;
    margin: -4px;
}

.gb-toast__actions > * {
    margin: 4px;
}

.gb-toast__btn {
    display: inline-block;
    padding: 9px 18px;
    border: 1px solid #2E2E2E;
    border-radius: 6px;
    background: transparent;
    color: #212529;
    font-size: 14px;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: .3s;
}

.gb-toast__btn:hover,
.gb-toast__btn:focus {
    border-color: #2D965D;
    background: #2D965D;
    color: #fff;
    text-decoration: none;
}

.gb-toast__btn--primary {
    border-color: #00b956;
    background: #00b956;
    color: #fff;
}

.gb-toast__btn--primary:hover,
.gb-toast__btn--primary:focus {
    border-color: #33c778;
    background: #33c778;
}

.gb-toast__close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #adb5bd;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
}

.gb-toast__close:hover {
    color: #212529;
}

.gb-toast--error .gb-toast__title {
    color: #c0392b;
}

@media (max-width: 575px) {
    .gb-toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
        max-width: none;
    }
}

/* --- Страница корзины: минимальный интерфейс ------------------------------ */

.gb-cart {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 0 40px;
}

.gb-cart__title {
    margin: 0 0 28px;
    font-size: 28px;
    font-weight: 800;
    color: #212529;
}

.gb-cart__empty {
    padding: 32px 0 8px;
}

.gb-cart__empty-text {
    margin: 0 0 20px;
    font-size: 16px;
    color: #6c757d;
}

/* позиции */

.gb-cart__items {
    border-top: 1px solid #ececec;
}

.gb-cart__item {
    position: relative;
    display: flex;
    align-items: center;
    padding: 18px 34px 18px 0;
    border-bottom: 1px solid #ececec;
}

.gb-cart__thumb {
    flex: 0 0 64px;
    width: 64px;
    margin-right: 16px;
    text-align: center;
}

.gb-cart__thumb img {
    max-width: 100%;
    height: auto;
}

.gb-cart__info {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 16px;
}

.gb-cart__name {
    display: block;
    color: #212529;
    font-size: 15px;
    line-height: 1.35;
    text-decoration: none;
}

.gb-cart__name:hover {
    color: #2D965D;
}

.gb-cart__unit {
    margin-top: 4px;
    color: #9aa0a6;
    font-size: 13px;
}

.gb-cart__unit .vm-price-value,
.gb-cart__unit .PricesalesPrice,
.gb-cart__unit-label {
    display: inline;
    font-size: 13px;
}

/* VirtueMart печатает пустой span с отступом 12px — убираем его везде в корзине. */
.gb-cart .vm-price-desc {
    display: none;
}

/* количество */

.gb-cart__qty {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    margin-right: 20px;
}

.gb-cart__qty-input {
    width: 52px;
    height: 38px;
    padding: 0 8px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    font-size: 15px;
    text-align: center;
}

.gb-cart__qty-input:focus {
    border-color: #2D965D;
    outline: none;
}

.gb-cart__qty-apply {
    margin-left: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: #9aa0a6;
    font-size: 12px;
    text-decoration: underline;
    cursor: pointer;
}

.gb-cart__qty-apply:hover {
    color: #2D965D;
}

/* сумма по позиции */

.gb-cart__sum {
    flex: 0 0 auto;
    min-width: 110px;
    color: #212529;
    font-size: 16px;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.gb-cart__sum .vm-price-value,
.gb-cart__sum .PricesalesPrice,
.gb-cart__sum div,
.gb-cart__sum span {
    display: inline;
    font-size: 16px;
    font-weight: 700;
}

.gb-cart__sum .vm-price-desc {
    display: none;
}

/* удалить */

.gb-cart__remove {
    position: absolute;
    top: 50%;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-top: -14px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: #c9ced3;
    cursor: pointer;
    transition: .2s;
}

.gb-cart__remove:hover {
    background: #f6f6f6;
    color: #c0392b;
}

/* итог */

.gb-cart__total {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 24px 34px 28px 0;
}

.gb-cart__total-label {
    color: #212529;
    font-size: 17px;
    font-weight: 700;
}

.gb-cart__total-value {
    color: #212529;
    font-size: 24px;
    font-weight: 800;
    white-space: nowrap;
}

.gb-cart__total-value .vm-price-value,
.gb-cart__total-value div,
.gb-cart__total-value span {
    display: inline;
    font-size: 24px;
    font-weight: 800;
}

.gb-cart__total-value .vm-price-desc {
    display: none;
}

/* кнопка «Оформить заказ» во всю ширину */

.gb-cart__actions {
    margin-top: 4px;
}

.gb-cart .gb-cart__actions #checkoutFormSubmit,
.gb-cart .gb-cart__actions .vm-button-correct,
.gb-cart .gb-cart__actions .vm-button {
    display: block;
    width: 100%;
    padding: 18px 24px;
    border: 1px solid #00b956;
    border-radius: 8px;
    background: #00b956;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: .3s;
}

.gb-cart .gb-cart__actions #checkoutFormSubmit:hover,
.gb-cart .gb-cart__actions .vm-button-correct:hover {
    border-color: #33c778;
    background: #33c778;
}

.gb-cart .gb-cart__actions #checkoutFormSubmit[disabled] {
    opacity: .6;
    cursor: default;
}

.gb-cart__back {
    margin-top: 16px;
    text-align: center;
}

.gb-cart__back a {
    color: #9aa0a6;
    font-size: 14px;
    text-decoration: underline;
}

.gb-cart__back a:hover {
    color: #2D965D;
}

/* мобильные */

@media (max-width: 575px) {
    .gb-cart__title {
        font-size: 22px;
        margin-bottom: 20px;
    }

    .gb-cart__item {
        flex-wrap: wrap;
        padding-right: 30px;
    }

    .gb-cart__info {
        flex: 1 1 calc(100% - 80px);
        padding-right: 0;
    }

    .gb-cart__qty {
        margin: 12px 0 0 80px;
    }

    .gb-cart__sum {
        min-width: 0;
        margin: 12px 0 0 auto;
    }

    .gb-cart__total {
        padding-right: 0;
    }

    .gb-cart__total-value,
    .gb-cart__total-value .vm-price-value,
    .gb-cart__total-value div,
    .gb-cart__total-value span {
        font-size: 20px;
    }
}

/* --- Форма контактных данных при оформлении -------------------------------- */

.gb-form {
    max-width: 520px;
    margin: 0 auto;
    padding: 0 0 40px;
}

.gb-form__title {
    margin: 0 0 8px;
    font-size: 28px;
    font-weight: 800;
    color: #212529;
}

.gb-form__hint {
    margin: 0 0 28px;
    color: #9aa0a6;
    font-size: 14px;
    line-height: 1.4;
}

.gb-form__row {
    margin-bottom: 18px;
}

.gb-form__label {
    display: block;
    margin-bottom: 6px;
    color: #6c757d;
    font-size: 13px;
    font-weight: 400;
}

.gb-form__req {
    color: #c0392b;
}

.gb-form__control input[type="text"],
.gb-form__control input[type="email"],
.gb-form__control input[type="tel"],
.gb-form__control input[type="password"],
.gb-form__control select,
.gb-form__control textarea {
    display: block;
    width: 100%;
    max-width: 100%;
    height: 48px;
    padding: 0 14px;
    border: 1px solid #dcdcdc;
    border-radius: 6px;
    background: #fff;
    color: #212529;
    font-size: 15px;
    box-sizing: border-box;
}

.gb-form__control textarea {
    height: auto;
    min-height: 90px;
    padding: 12px 14px;
}

.gb-form__control input:focus,
.gb-form__control select:focus,
.gb-form__control textarea:focus {
    border-color: #2D965D;
    outline: none;
}

.gb-form__control input.invalid,
.gb-form__control select.invalid {
    border-color: #c0392b;
}

.gb-form__captcha {
    margin-bottom: 18px;
}

.gb-form__actions {
    margin-top: 26px;
}

.gb-form__submit {
    display: block;
    width: 100%;
    padding: 18px 24px;
    border: 1px solid #00b956;
    border-radius: 8px;
    background: #00b956;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    cursor: pointer;
    transition: .3s;
}

.gb-form__submit:hover,
.gb-form__submit:focus {
    border-color: #33c778;
    background: #33c778;
    outline: none;
}

.gb-form__back {
    margin-top: 16px;
    text-align: center;
}

.gb-form__back a {
    color: #9aa0a6;
    font-size: 14px;
    text-decoration: underline;
}

.gb-form__back a:hover {
    color: #2D965D;
}

@media (max-width: 575px) {
    .gb-form__title {
        font-size: 22px;
    }
}

/* --- Пропуск страницы подтверждения -------------------------------------- */

/* Сообщение видно только когда заказ дожимается скриптом. */
.gb-cart__placing {
    display: none;
    padding: 48px 0;
    color: #6c757d;
    font-size: 16px;
    text-align: center;
}

.gb-cart.is-autoconfirm .gb-cart__placing {
    display: block;
}

.gb-cart.is-autoconfirm .gb-cart__items,
.gb-cart.is-autoconfirm .gb-cart__total,
.gb-cart.is-autoconfirm .gb-cart__actions,
.gb-cart.is-autoconfirm .gb-cart__back {
    display: none;
}

/* --- Страница «спасибо за заказ» ------------------------------------------ */

.gb-done {
    max-width: 560px;
    margin: 0 auto;
    padding: 20px 0 48px;
    text-align: center;
}

.gb-done__title {
    margin: 0 0 20px;
    font-size: 26px;
    font-weight: 800;
    color: #212529;
}

.gb-done__body {
    color: #212529;
    font-size: 15px;
    line-height: 1.5;
}

.gb-done__body h3,
.gb-done__body h4 {
    margin: 0 0 8px;
    font-size: 16px;
    font-weight: 700;
}

.gb-done__body table {
    width: 100%;
    margin: 0 auto;
}

.gb-done__note {
    margin: 22px 0 0;
    color: #9aa0a6;
    font-size: 14px;
    line-height: 1.4;
}

.gb-done__actions {
    margin-top: 26px;
}

.gb-done__btn {
    display: inline-block;
    padding: 16px 36px;
    border: 1px solid #00b956;
    border-radius: 8px;
    background: #00b956;
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    transition: .3s;
}

.gb-done__btn:hover,
.gb-done__btn:focus {
    border-color: #33c778;
    background: #33c778;
    color: #fff;
    text-decoration: none;
}

/* --- Страница заказа покупателя ------------------------------------------- */

.gb-order {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 0 48px;
}

.gb-order__title {
    margin: 0 0 24px;
    font-size: 26px;
    font-weight: 800;
    color: #212529;
}

.gb-order__subtitle {
    margin: 28px 0 12px;
    color: #212529;
    font-size: 15px;
    font-weight: 700;
}

.gb-order__card {
    padding: 20px 22px;
    border: 1px solid #ececec;
    border-radius: 8px;
    background: #fbfbfb;
}

.gb-order__facts {
    margin: 0;
    overflow: hidden;
}

.gb-order__fact-key {
    float: left;
    clear: left;
    width: 38%;
    padding: 6px 0;
    color: #9aa0a6;
    font-size: 14px;
    font-weight: 400;
}

.gb-order__fact-val {
    margin: 0;
    padding: 6px 0;
    padding-left: 40%;
    color: #212529;
    font-size: 14px;
    line-height: 1.4;
}

.gb-order__fact-val .vmshipment_name,
.gb-order__fact-val .vmpayment_name {
    display: block;
    font-weight: 700;
}

.gb-order__fact-val .vmshipment_description,
.gb-order__fact-val .vmpayment_description {
    display: block;
    margin-top: 2px;
    color: #9aa0a6;
    font-size: 13px;
}

.gb-order__contacts {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid #ececec;
}

.gb-order__contacts .gb-order__subtitle {
    margin: 0 0 8px;
}

/* товары */

.gb-order__items {
    width: 100%;
    border-collapse: collapse;
}

.gb-order__items th {
    padding: 0 8px 10px;
    border-bottom: 1px solid #ececec;
    color: #9aa0a6;
    font-size: 12px;
    font-weight: 400;
    text-align: right;
    text-transform: uppercase;
    letter-spacing: .03em;
}

.gb-order__items th.gb-order__col-name,
.gb-order__items td.gb-order__col-name {
    text-align: left;
}

.gb-order__items td {
    padding: 14px 8px;
    border-bottom: 1px solid #ececec;
    color: #212529;
    font-size: 14px;
    text-align: right;
    vertical-align: top;
}

.gb-order__items td.gb-order__col-name a {
    color: #212529;
    text-decoration: none;
}

.gb-order__items td.gb-order__col-name a:hover {
    color: #2D965D;
}

.gb-order__col-qty {
    width: 70px;
}

.gb-order__col-price,
.gb-order__col-sum {
    width: 120px;
    white-space: nowrap;
}

.gb-order__items tfoot td {
    border-bottom: 0;
}

.gb-order__extra td {
    padding-top: 10px;
    padding-bottom: 0;
    color: #6c757d;
}

.gb-order__grand td {
    padding-top: 14px;
    font-size: 17px;
    font-weight: 800;
}

/* история */

.gb-order__history {
    margin: 0;
    padding: 0;
    list-style: none;
}

.gb-order__history-item {
    padding: 10px 0;
    border-bottom: 1px solid #ececec;
    font-size: 14px;
}

.gb-order__history-date {
    display: inline-block;
    min-width: 140px;
    color: #9aa0a6;
}

.gb-order__history-status {
    color: #212529;
    font-weight: 700;
}

.gb-order__history-note {
    display: block;
    margin-top: 2px;
    padding-left: 140px;
    color: #6c757d;
    font-size: 13px;
}

/* кнопка */

.gb-order__actions {
    margin-top: 30px;
    text-align: center;
}

.gb-order__btn {
    display: inline-block;
    padding: 15px 34px;
    border: 1px solid #2E2E2E;
    border-radius: 8px;
    background: transparent;
    color: #212529;
    font-size: 15px;
    font-weight: 700;
    text-decoration: none;
    transition: .3s;
}

.gb-order__btn:hover,
.gb-order__btn:focus {
    border-color: #2D965D;
    background: #2D965D;
    color: #fff;
    text-decoration: none;
}

@media (max-width: 575px) {
    .gb-order__title {
        font-size: 22px;
    }

    .gb-order__card {
        padding: 16px;
    }

    .gb-order__fact-key {
        float: none;
        width: auto;
        padding-bottom: 0;
    }

    .gb-order__fact-val {
        padding-left: 0;
    }

    .gb-order__items th.gb-order__col-price,
    .gb-order__items td.gb-order__col-price {
        display: none;
    }

    .gb-order__history-date {
        display: block;
        min-width: 0;
    }

    .gb-order__history-note {
        padding-left: 0;
    }
}
