/**
 * New cart page (/checkout/newcart), template frontend/checkout/newcart.phtml.
 * Everything is scoped by .newcart, old cart styles are not touched.
 */

.newcart {
    padding-bottom: 30px;
}

.newcart *,
.newcart *::before,
.newcart *::after {
    box-sizing: border-box;
}

.newcart .amount {
    white-space: nowrap;
}

/* ---------- boxes ---------- */

.newcart .newcart-box-title {
    background: #f4f4f4;
    border: 1px solid #e5e5e5;
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 -1px;
    padding: 15px 20px;
    text-transform: uppercase;
}

.newcart .newcart-list,
.newcart .newcart-line,
.newcart .newcart-coupon-box,
.newcart .newcart-section {
    border: 1px solid #e5e5e5;
}

.newcart .newcart-line + .newcart-line,
.newcart .newcart-list + .newcart-line,
.newcart .newcart-line + .newcart-coupon-box,
.newcart .newcart-section + .newcart-section {
    border-top: none;
}

/* ---------- item list ---------- */

.newcart .newcart-list {
    margin-bottom: 0;
}

.newcart .newcart-list-head,
.newcart .newcart-item {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 15px;
}

.newcart .newcart-list-head {
    background: #f4f4f4;
    font-weight: 700;
    text-transform: uppercase;
}

.newcart .newcart-item + .newcart-item,
.newcart .newcart-list-head + .newcart-item {
    border-top: 1px solid #e5e5e5;
}

.newcart .newcart-item-image {
    flex: 0 0 90px;
    max-width: 90px;
    padding-right: 15px;
}

.newcart .newcart-item-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.newcart .newcart-item-info {
    flex: 1 1 0;
    min-width: 0;
    padding-right: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.newcart .newcart-item-title {
    font-weight: 700;
}

.newcart .newcart-item-options {
    margin-top: 5px;
    font-size: 13px;
}

.newcart .newcart-item-info .alert {
    margin: 5px 0 0;
    padding: 5px 10px;
}

.newcart .newcart-item-price,
.newcart .newcart-item-discount,
.newcart .newcart-item-total {
    flex: 0 0 110px;
    text-align: right;
}

.newcart .newcart-item-qty {
    flex: 0 0 130px;
    padding-left: 15px;
}

/* quantity stepper: - [ 2 ] + */
.newcart .newcart-qty {
    display: inline-flex;
    align-items: stretch;
    height: 36px;
}

.newcart .newcart-qty-btn {
    width: 34px;
    padding: 0;
    font-size: 18px;
    line-height: 1;
    color: #333;
    background: #f4f4f4;
    border: 1px solid #ccc;
}

.newcart .newcart-qty-btn:first-child {
    border-radius: 4px 0 0 4px;
}

.newcart .newcart-qty-btn:last-child {
    border-radius: 0 4px 4px 0;
}

.newcart .newcart-qty-btn:hover,
.newcart .newcart-qty-btn:focus {
    background: #e8e8e8;
    outline: none;
}

.newcart .newcart-qty .newcart-qty-input {
    width: 46px;
    height: 36px;
    padding: 0 2px;
    border-left: 0;
    border-right: 0;
    border-radius: 0;
    box-shadow: none;
    -moz-appearance: textfield;
}

.newcart .newcart-qty .newcart-qty-input::-webkit-outer-spin-button,
.newcart .newcart-qty .newcart-qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

#newcart-items-block {
    transition: opacity .15s;
}

#newcart-items-block.is-loading {
    opacity: .5;
    pointer-events: none;
}

/* with JS the quantity is saved automatically */
.newcart.newcart-js .newcart-update-cart {
    display: none;
}

.newcart .newcart-item-summary {
    flex: 0 0 auto;
    padding-left: 15px;
}

.newcart .newcart-item-actions {
    flex: 1 0 100%;
    padding-left: 90px;
    margin-top: 10px;
}

.newcart .newcart-item-actions .btn {
    margin: 0 5px 5px 0;
}

/* ---------- totals lines, coupons ---------- */

.newcart .newcart-line {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 15px;
}

.newcart .newcart-line-label {
    flex: 1 1 auto;
    min-width: 0;
    padding-right: 15px;
}

.newcart .newcart-line-value {
    flex: 0 0 auto;
    text-align: right;
}

.newcart .newcart-coupon {
    margin-top: 5px;
}

.newcart .newcart-coupon-box {
    padding: 15px;
    margin-bottom: 30px;
}

.newcart .newcart-coupon-row {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    margin: 0 -5px;
}

/* same height and margins for the field and the button (theme styles differ for input and .btn) */
.newcart .newcart-coupon-row .form-control,
.newcart .newcart-coupon-row .btn {
    box-sizing: border-box;
    height: 40px;
    margin: 5px;
    vertical-align: middle;
}

.newcart .newcart-coupon-row .form-control {
    flex: 1 1 180px;
    width: auto;
    min-width: 0;
}

.newcart .newcart-coupon-row .btn {
    flex: 0 0 auto;
}

.newcart .newcart-coupon-row .btn,
.newcart .newcart-update-cart {
    height: 40px;
    padding: 0 20px;
    line-height: 40px;
    color: #fff;
    border: none;
}

.newcart .newcart-update-cart {
    margin-top: 10px;
}

.newcart .newcart-ajax-messages .alert {
    margin: 10px 0 0;
}

.newcart .newcart-update-cart.newcart-attention {
    box-shadow: 0 0 0 3px #f0ad4e;
}

/* ---------- gifts ---------- */

.newcart .newcart-gifts {
    margin-bottom: 30px;
}

.newcart .newcart-gifts-list {
    display: flex;
    flex-wrap: wrap;
    border: 1px solid #e5e5e5;
    padding: 5px;
}

.newcart .newcart-gift {
    display: flex;
    flex: 1 1 300px;
    padding: 10px;
    min-width: 0;
}

.newcart .newcart-gift-image {
    flex: 0 0 120px;
    max-width: 120px;
    padding-right: 15px;
}

.newcart .newcart-gift-image img {
    display: block;
    max-width: 100%;
    height: auto;
}

.newcart .newcart-gift-info {
    flex: 1 1 auto;
    min-width: 0;
}

.newcart .newcart-gift-info .product-title {
    font-size: 16px;
    margin: 0 0 5px;
}

/* ---------- checkout ---------- */

.newcart .newcart-section {
    padding: 15px;
}

.newcart .newcart-section.newcart-line {
    padding: 12px 15px;
}

.newcart .newcart-section > .newcart-line {
    border: none;
    padding: 0 0 10px;
}

.newcart .newcart-methods {
    margin: 5px 0 0;
    padding: 0;
}

.newcart .newcart-methods > li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.newcart .newcart-methods > li:last-child {
    border-bottom: none;
}

.newcart .newcart-methods > li > input[type="radio"] {
    margin: 0 8px 0 0;
    vertical-align: middle;
}

.newcart .newcart-methods > li > label {
    display: inline;
    font-weight: normal;
    white-space: normal;
    cursor: pointer;
}

.newcart .newcart-method-form {
    padding-top: 5px;
}

.newcart .newcart-method-form select,
.newcart .newcart-method-form input[type="text"] {
    max-width: 100%;
}

.newcart .newcart-contact-note {
    margin-left: 5px;
}

.newcart .newcart-contacts .row,
.newcart #newcart-invoice-form {
    margin-top: 10px;
}

.newcart .newcart-section .form-group {
    margin-bottom: 10px;
}

.newcart .newcart-section label {
    font-weight: normal;
}

.newcart .newcart-grand-total {
    font-size: 18px;
}

.newcart .newcart-agreements .checkbox label {
    white-space: normal;
}

.newcart .newcart-agreements .checkout-button {
    color: #fff;
    display: inline-block;
    min-height: 44px;
    margin-top: 15px;
    margin-right: 10px;
    padding: 0 25px;
    border: none;
    text-transform: uppercase;
}

/* ---------- mobile ---------- */

@media (max-width: 767px) {
    .newcart .newcart-box-title {
        font-size: 16px;
        padding: 12px 15px;
    }

    .newcart .newcart-item {
        padding: 12px;
        align-items: flex-start;
    }

    .newcart .newcart-item-image {
        flex-basis: 80px;
        max-width: 80px;
        padding-right: 12px;
    }

    .newcart .newcart-item-info {
        flex: 1 1 calc(100% - 80px);
        padding-right: 0;
    }

    .newcart .newcart-item-price,
    .newcart .newcart-item-discount,
    .newcart .newcart-item-qty,
    .newcart .newcart-item-total {
        flex: 0 0 50%;
        display: flex;
        justify-content: space-between;
        align-items: center;
        text-align: left;
        padding: 8px 0 0;
    }

    .newcart .newcart-item-price,
    .newcart .newcart-item-qty {
        padding-right: 10px;
    }

    .newcart .newcart-item-discount,
    .newcart .newcart-item-total {
        padding-left: 10px;
    }

    .newcart .newcart-item-price::before,
    .newcart .newcart-item-discount::before,
    .newcart .newcart-item-qty::before,
    .newcart .newcart-item-total::before {
        content: attr(data-label);
        color: #888;
        font-size: 12px;
        padding-right: 5px;
    }

    .newcart .newcart-qty {
        height: 40px;
    }

    .newcart .newcart-qty-btn {
        width: 40px;
    }

    .newcart .newcart-qty .newcart-qty-input {
        height: 40px;
        font-size: 16px; /* no zoom on iOS */
    }

    .newcart .newcart-item-total .amount {
        font-weight: 700;
    }

    .newcart .newcart-item-summary {
        flex: 1 0 100%;
        padding: 8px 0 0;
    }

    .newcart .newcart-item-actions {
        padding-left: 0;
    }

    .newcart .newcart-update-cart {
        width: 100%;
    }

    .newcart .newcart-coupon-row .form-control,
    .newcart .newcart-coupon-row .btn {
        flex: 1 1 100%;
        width: auto;
    }

    .newcart .newcart-gift {
        flex-basis: 100%;
    }

    .newcart .newcart-gift-image {
        flex-basis: 90px;
        max-width: 90px;
    }

    .newcart .newcart-section {
        padding: 12px 15px;
    }

    .newcart .newcart-grand-total {
        font-size: 16px;
    }

    .newcart .newcart-agreements .checkout-button {
        display: block;
        width: 100%;
        margin-right: 0;
    }
}

/* ---------- packomat picker (newcart.js) ---------- */

/* original select: hidden but focusable, so the browser can still show "please select" */
.newcart select.newcart-picker-native {
    position: absolute !important;
    left: 15px;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    border: 0 !important;
    opacity: 0;
    pointer-events: none;
}

.newcart .newcart-picker {
    position: relative;
    margin-top: 4px;
}

.newcart .newcart-picker-toggle {
    position: relative;
    display: block;
    width: 100%;
    min-height: 44px;
    padding: 8px 30px 8px 12px;
    text-align: left;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    line-height: 1.35;
    white-space: normal;
}

.newcart .newcart-picker-toggle:hover,
.newcart .newcart-picker-toggle:focus {
    border-color: #66afe9;
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 175, 233, .25);
}

.newcart .newcart-picker-toggle.is-empty {
    border-style: dashed;
    color: #777;
}

.newcart .newcart-picker-toggle::after {
    content: "\25BE";
    position: absolute;
    top: 50%;
    right: 12px;
    margin-top: -10px;
    line-height: 20px;
    color: #999;
}

.newcart .newcart-picker.has-error .newcart-picker-toggle {
    border-color: #a94442;
    box-shadow: 0 0 0 3px rgba(169, 68, 66, .15);
}

.newcart .newcart-picker-name {
    display: block;
    font-weight: 600;
}

.newcart .newcart-picker-address {
    display: block;
    font-size: 12px;
    color: #777;
}

.newcart .newcart-picker-change {
    display: inline-block;
    margin-top: 3px;
    font-size: 12px;
    color: #337ab7;
    text-decoration: underline;
}

.newcart .newcart-picker-panel {
    display: none;
    position: absolute;
    z-index: 1000;
    top: 100%;
    left: 0;
    width: 100%;
    min-width: 320px;
    max-width: 480px;
    margin-top: 4px;
    padding: 8px;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, .15);
}

.newcart .newcart-picker.is-open .newcart-picker-panel {
    display: block;
}

.newcart .newcart-picker-head {
    display: none;
}

.newcart .newcart-picker-search {
    margin-bottom: 6px;
}

.newcart .newcart-picker-list {
    position: relative;
    max-height: 320px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.newcart .newcart-picker-group {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: 5px 8px;
    background: #f4f4f4;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #555;
}

.newcart .newcart-picker-item {
    display: block;
    width: 100%;
    padding: 9px 8px;
    text-align: left;
    white-space: normal;
    background: none;
    border: 0;
    border-bottom: 1px solid #f0f0f0;
    border-left: 3px solid transparent;
}

.newcart .newcart-picker-item:hover,
.newcart .newcart-picker-item:focus {
    background: #f2f7fc;
    outline: none;
}

.newcart .newcart-picker-item.is-selected {
    background: #edf7ed;
    border-left-color: #5cb85c;
}

.newcart .newcart-picker-empty {
    padding: 15px 8px;
    color: #777;
    text-align: center;
}

@media (max-width: 767px) {
    body.newcart-picker-lock {
        overflow: hidden;
    }

    .newcart .newcart-picker-panel {
        position: fixed;
        z-index: 2000;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        min-width: 0;
        max-width: none;
        margin: 0;
        padding: 0 12px 12px;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        flex-direction: column;
    }

    .newcart .newcart-picker.is-open .newcart-picker-panel {
        display: flex;
    }

    .newcart .newcart-picker-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 10px 0;
        font-size: 16px;
        font-weight: 700;
    }

    .newcart .newcart-picker-close {
        width: 44px;
        height: 44px;
        font-size: 28px;
        line-height: 1;
        background: none;
        border: 0;
    }

    .newcart .newcart-picker-search {
        height: 44px;
        font-size: 16px; /* no zoom on iOS */
    }

    .newcart .newcart-picker-list {
        flex: 1 1 auto;
        max-height: none;
    }

    .newcart .newcart-picker-item {
        padding: 12px 8px;
    }
}

/* ---------- checkout layout: steps + sticky summary ---------- */

.newcart .newcart-layout {
    margin-top: 10px;
}

.newcart .newcart-main {
    counter-reset: newcart-step;
}

.newcart .newcart-step {
    padding: 20px 15px;
}

.newcart .newcart-step-title {
    display: flex;
    align-items: center;
    margin: 0 0 12px;
    font-size: 17px;
    font-weight: 700;
}

.newcart .newcart-step-title::before {
    counter-increment: newcart-step;
    content: counter(newcart-step);
    flex: 0 0 26px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    margin-right: 10px;
    border-radius: 50%;
    background: #333;
    color: #fff;
    font-size: 13px;
}

.newcart .newcart-contacts .row {
    margin-top: 0;
}

.newcart .newcart-summary .newcart-section.newcart-line {
    padding: 10px 15px;
}

.newcart .newcart-summary .newcart-grand-total {
    background: #fafafa;
}

.newcart .newcart-summary-actions .checkout-button,
.newcart .newcart-final .checkout-button {
    color: #fff;
    display: block;
    width: 100%;
    min-height: 48px;
    margin: 0;
    padding: 0 25px;
    border: none;
    text-transform: uppercase;
}

.newcart .newcart-final .checkout-button {
    margin-top: 15px;
}

@media (min-width: 768px) {
    .newcart .newcart-final .checkout-button {
        display: inline-block;
        width: auto;
        min-width: 280px;
    }
}

.newcart .newcart-final .newcart-grand-total {
    padding: 0 0 12px;
    margin-bottom: 10px;
    border-bottom: 1px solid #e5e5e5;
    font-size: 18px;
}

/* agreements: the text toggles the checkbox, the document opens by a separate link */
.newcart .newcart-agreement {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    padding: 6px 0;
}

.newcart .newcart-agreement-label {
    display: flex;
    align-items: flex-start;
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    font-weight: normal;
    cursor: pointer;
}

.newcart .newcart-agreement-label input[type="checkbox"] {
    flex: 0 0 auto;
    width: 20px;
    height: 20px;
    margin: 0 10px 0 0;
}

.newcart .newcart-agreement-link {
    flex: 0 0 auto;
    margin-left: 10px;
    font-size: 13px;
    white-space: nowrap;
}

/* the theme's .wrap has overflow: hidden, which breaks position: sticky of the summary.
   newcart.css is loaded only on /checkout/newcart, so this affects this page only. */
body .wrap {
    overflow: visible;
    overflow-x: clip;
}

.newcart .newcart-gifts {
    margin-top: 30px;
}

.newcart .newcart-bar {
    display: none;
}

@media (min-width: 992px) {
    .newcart .newcart-layout {
        display: flex;
        align-items: flex-start;
    }

    .newcart .newcart-main {
        flex: 1 1 auto;
        min-width: 0;
        margin-right: 30px;
    }

    .newcart .newcart-aside {
        flex: 0 0 320px;
        max-width: 320px;
        position: -webkit-sticky;
        position: sticky;
        top: 20px;
    }
}

@media (max-width: 991px) {
    /* the final step and the bottom bar replace the summary here */
    .newcart .newcart-aside {
        display: none;
    }

    .newcart.newcart-js {
        padding-bottom: 90px;
    }

    .newcart.newcart-js .newcart-bar {
        display: flex;
        position: fixed;
        z-index: 900;
        left: 0;
        right: 0;
        bottom: 0;
        align-items: center;
        justify-content: space-between;
        padding: 10px 15px;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        background: #fff;
        box-shadow: 0 -2px 12px rgba(0, 0, 0, .12);
        transition: transform .2s;
    }

    .newcart.newcart-js .newcart-bar.is-hidden {
        transform: translateY(110%);
    }

    .newcart .newcart-bar-label {
        display: block;
        font-size: 12px;
        color: #777;
    }

    .newcart .newcart-bar-total strong {
        font-size: 18px;
    }

    .newcart .newcart-bar-button {
        min-height: 44px;
        margin-left: 15px;
        padding: 0 20px;
        color: #fff;
        border: none;
        text-transform: uppercase;
    }
}

@media (max-width: 767px) {
    /* stepper explains itself, no "Quantity" label on the card */
    .newcart .newcart-item-qty::before {
        display: none;
    }

    .newcart .newcart-step {
        padding: 15px;
    }
}

/* ---------- shipping recipient (newcart.js) ---------- */

.newcart .newcart-same-contacts {
    margin: 10px 0 2px;
}

.newcart .newcart-same-contacts label {
    display: inline-flex;
    align-items: center;
    margin: 0;
    font-weight: 600;
    cursor: pointer;
}

.newcart .newcart-same-contacts input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0 8px 0 0;
}

.newcart .newcart-sms-note p {
    margin: 6px 0 0;
    font-size: 12px;
    color: #777;
}

.newcart .newcart-sms-note .fa {
    margin-right: 4px;
    color: #5bb2fd;
}


/* Подарок: весь блок открывает окно с кнопкой «в корзину» */
.newcart .newcart-gift {
    cursor: pointer;
}

#newcart-gift-modal .newcart-gift-modal-row {
    display: flex;
    gap: 15px;
}

#newcart-gift-modal .newcart-gift-modal-image {
    flex: 0 0 140px;
    max-width: 140px;
    height: auto;
    align-self: flex-start;
}

#newcart-gift-modal .newcart-gift-modal-info {
    flex: 1 1 auto;
    min-width: 0;
}

#newcart-gift-modal .newcart-gift-modal-price {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

#newcart-gift-modal .newcart-gift-modal-error {
    margin-top: 10px;
}

@media (max-width: 480px) {
    #newcart-gift-modal .newcart-gift-modal-row {
        flex-direction: column;
    }

    #newcart-gift-modal .newcart-gift-modal-image {
        flex-basis: auto;
        max-width: 160px;
    }
}
