/* Base reset for the basket page */
:root {
    --safe-bottom: env(safe-area-inset-bottom);
    --footer-height: 64px;
}

*,
*::before,
*::after {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
}

/* PWA basket marketplace card */

#basket-item-table {
    display: block;
    width: 100%;
    margin: 0 0 16px;
}

#basket-item-table > * {
    display: block;
}

.pwa-basket-item,
.pwa-basket-item-td {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
}

.pwa-basket-item {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    margin-bottom: 12px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.pwa-basket-item--unavailable {
    opacity: 0.65;
}

.pwa-basket-card {
    display: flex;
    gap: 12px;
    padding: 12px;
}

.pwa-basket-card-media {
    position: relative;
    flex: 0 0 100px;
    width: 100px;
    height: 120px;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e5ea;
}

.pwa-basket-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.pwa-basket-card-check {
    position: absolute;
    top: 6px;
    left: 6px;
    z-index: 2;
    width: 24px;
    height: 24px;
    margin: 0;
}

.pwa-basket-card-check input {
    width: 24px;
    height: 24px;
    accent-color: #5e0937;
    cursor: pointer;
}

.pwa-basket-card-body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pwa-basket-card-prices {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
    font-weight: 700;
}

.pwa-basket-card-current-price {
    font-size: 14px;
    color: #5e0937;
    letter-spacing: -0.3px;
}

.pwa-basket-card-price-list {
    font-size: 14px;
    color: #8e8e93;
    text-decoration: line-through;
    font-weight: 500;
}

.pwa-basket-card-discount {
    font-size: 12px;
    color: #fff;
    background: #5e0937;
    padding: 2px 6px;
    border-radius: 6px;
    font-weight: 600;
    margin-left: auto;
}

.pwa-basket-card-name {
    font-size: 14px;
    line-height: 1.35;
    color: #111;
    margin: 0 0 4px;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-height: 38px;
}

.pwa-basket-card-link {
    color: inherit;
    text-decoration: none;
}

.pwa-basket-card-article {
    font-size: 12px;
    color: #8e8e93;
    margin-bottom: 12px;
}

.pwa-basket-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
}

.pwa-basket-card-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid #e5e5ea;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    height: 36px;
}

.pwa-basket-card-stepper-btn {
    width: 34px;
    height: 100%;
    border: none;
    background: #fff;
    color: #5e0937;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}

.pwa-basket-card-stepper-btn:active {
    background: #f2f2f7;
}

.pwa-basket-card-stepper-trash {
    color: #8e8e93;
}

.pwa-basket-card-stepper-trash:active {
    background: #f2f2f7;
}

.pwa-basket-card-stepper-input {
    width: 42px;
    height: 100%;
    border: none;
    border-left: 1px solid #e5e5ea;
    border-right: 1px solid #e5e5ea;
    text-align: center;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    outline: none;
    padding: 0;
    -moz-appearance: textfield;
    appearance: textfield;
}

.pwa-basket-card-stepper-input::-webkit-outer-spin-button,
.pwa-basket-card-stepper-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.pwa-basket-card-buy {
    flex: 0 0 auto;
    min-width: 90px;
    height: 36px;
    padding: 0 16px;
    border: none;
    border-radius: 10px;
    background: #5e0937;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s;
}

.pwa-basket-card-buy:active {
    background: #4a0730;
}

.pwa-basket-item--unavailable .pwa-basket-card-buy,
.pwa-basket-item--unavailable .pwa-basket-card-stepper-btn,
.pwa-basket-item--unavailable .pwa-basket-card-stepper-input {
    opacity: 0.5;
    pointer-events: none;
}

/* Master select + fixed panel */
.pwa-basket-master-select {
    padding: 12px 15px;
}

.pwa-basket-master-select-label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: #111;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.pwa-basket-master-checkbox {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    margin: 0;
    accent-color: #5e0937;
    cursor: pointer;
}

.pwa-basket-fixed-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: var(--footer-height);
    z-index: 1001;
    background: #fff;
    border-top: 1px solid #e5e5ea;
    padding: 12px 16px 10px;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

.pwa-basket-fixed-panel-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    max-width: 600px;
    margin: 0 auto;
}

.pwa-basket-fixed-panel-info {
    flex: 1;
    min-width: 0;
}

.pwa-basket-fixed-panel-count {
    font-size: 13px;
    color: #8e8e93;
    margin-bottom: 2px;
}

.pwa-basket-fixed-panel-total {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
}

.pwa-basket-fixed-panel-price {
    font-size: 18px;
    color: #5e0937;
}

.pwa-basket-fixed-panel-old {
    font-size: 14px;
    color: #8e8e93;
    text-decoration: line-through;
}

.pwa-basket-fixed-panel-btn {
    flex: 0 0 auto;
    height: 44px;
    padding: 0 24px;
    border: none;
    border-radius: 12px;
    background: #5e0937;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.pwa-basket-fixed-panel-btn:active {
    background: #4a0730;
}

.pwa-basket-fixed-panel-btn.disabled,
.pwa-basket-fixed-panel-btn:disabled {
    background: #8e8e93;
    color: #fff;
    opacity: 0.8;
    pointer-events: none;
}

.pwa-basket-snackbar {
    position: fixed;
    left: 50%;
    bottom: calc(var(--footer-height) + 80px);
    transform: translateX(-50%);
    z-index: 1005;
    background: #2c2c2e;
    color: #fff;
    padding: 10px 16px;
    border-radius: 10px;
    font-size: 13px;
    white-space: nowrap;
}

.pwa-basket-snackbar.warning {
    background: #ff9500;
}

#basket-root {
    padding-bottom: 150px !important;
}

/* Recommendations */
.pwa-recommendations {
    padding: 20px 15px;
}

.pwa-recommendations-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px;
}

@media (min-width: 768px) {
    .pwa-basket-card-media {
        flex-basis: 120px;
        width: 120px;
        height: 144px;
    }
}

/* Basket card internet / RRP price */
.pwa-basket-card-price-list,
.pwa-basket-card-internet-price {
    font-size: 12px;
    color: #8e8e93;
    text-decoration: line-through;
    margin-left: 4px;
}

/* Hide default Bitrix checkout/total blocks */
.basket-checkout-container,
[data-entity="basket-total-block"] {
    display: none !important;
}

/* Viewed products grid inside basket */
.pwa-recommendations .product-grid .product-item {
    background: #fff;
    border: 1px solid #e5e5ea;
    border-radius: 12px;
    padding: 10px;
    color: #111;
}

.pwa-recommendations .product-grid .product-item a {
    color: #111;
    text-decoration: none;
}

.pwa-recommendations .product-grid .product-item .product-title,
.pwa-recommendations .product-grid .product-item .product-title.title-color {
    color: #111;
}

.pwa-recommendations .product-grid .product-item .product-article {
    color: #8e8e93;
}

.pwa-recommendations .product-grid .product-item .price-block .current-price {
    color: #5e0937;
    font-weight: 600;
}

.pwa-recommendations .product-grid .product-item .price-block .old-price {
    color: #8e8e93;
    text-decoration: line-through;
}

.pwa-recommendations .product-grid .product-item .add-to-cart-container .js-add-2-basket {
    background: #5e0937;
    color: #fff;
}

/* Delete/restore overlay */
.pwa-basket-card {
    position: relative;
}

.pwa-basket-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.72);
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    border-radius: 16px;
}

.pwa-basket-card-overlay--loading {
    background: rgba(255, 255, 255, 0.85);
}

.pwa-basket-card-overlay-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 16px;
    text-align: center;
}

.pwa-basket-card-overlay-text {
    font-size: 14px;
    font-weight: 600;
    color: #111;
}

.pwa-basket-card-overlay-restore {
    border: none;
    border-radius: 10px;
    padding: 8px 16px;
    background: #5e0937;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

.pwa-basket-card-overlay-restore:active {
    background: #4a0730;
}

.pwa-basket-card-overlay-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.08);
    color: #333;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Minimal bootstrap classes needed for the basket template */
.form {
    display: block;
}

.form-group {
    margin-bottom: 15px;
}

.has-feedback {
    position: relative;
}

.has-feedback .form-control {
    padding-right: 42.5px;
}

.form-control-feedback {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    display: block;
    width: 34px;
    height: 34px;
    line-height: 34px;
    text-align: center;
    pointer-events: none;
}

.basket-clear {
    cursor: pointer;
    pointer-events: auto;
}

.basket-clear::after,
.basket-clear::before {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 1px;
    background-color: #8f8f8f;
    content: '';
    transition: 300ms background-color ease;
}

.basket-clear::after {
    transform: translate(-50%, -50%) rotate(45deg);
}

.basket-clear::before {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.basket-clear:hover::after,
.basket-clear:hover::before {
    background-color: #333;
}

.col-xs-12 {
    position: relative;
    width: 100%;
    min-height: 1px;
    padding-left: 15px;
    padding-right: 15px;
    box-sizing: border-box;
}

.alert-dismissable {
    padding-right: 35px;
}

.alert-dismissable .close {
    position: relative;
    top: -2px;
    right: -21px;
    color: inherit;
}

.close {
    float: right;
    font-size: 21px;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: 0.2;
    filter: alpha(opacity=20);
}

.close:hover,
.close:focus {
    color: #000;
    text-decoration: none;
    cursor: pointer;
    opacity: 0.5;
    filter: alpha(opacity=50);
}

button.close {
    -webkit-appearance: none;
    appearance: none;
    padding: 0;
    cursor: pointer;
    background: transparent;
    border: 0;
}

.btn-default {
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
    padding: 6px 12px;
    border-radius: 4px;
    display: inline-block;
    text-align: center;
    vertical-align: middle;
    cursor: pointer;
}

.row {
    --bs-gutter-x: 1.5rem;
    --bs-gutter-y: 0;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -ms-flex-wrap: wrap;
    flex-wrap: wrap;
    margin-top: calc(var(--bs-gutter-y) * -1);
    margin-right: -15px;
    margin-left: -15px;
}

.row > * {
    -webkit-box-sizing: border-box;
    box-sizing: border-box;
    -ms-flex-negative: 0;
    flex-shrink: 0;
    width: 100%;
    max-width: 100%;
    padding-right: 15px;
    padding-left: 15px;
    margin-top: var(--bs-gutter-y);
}

.col-12,
.col-xs-12 {
    -webkit-box-flex: 0;
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    width: 100%;
}

.alert {
    position: relative;
    padding: .75rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: .25rem;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.form-control {
    display: block;
    width: 100%;
    padding: .375rem .75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: #212529;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    border-radius: .25rem;
    -webkit-transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
    transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

.form-control:focus {
    color: #212529;
    background-color: #fff;
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}

.mt-2 {
    margin-top: .5rem !important;
}

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

/* Extra bottom clearance on cart page so content isn't hidden behind fixed panel + footer */
.cart-page.mb-xxl {
    margin-bottom: calc(var(--footer-height) + 116px);
}

/* Keep footer sizing consistent with the rest of the site (style-pwa sets border-box on *) */
.footer-wrap,
.footer-wrap * {
    -webkit-box-sizing: content-box;
    box-sizing: content-box;
}
