
/* ===== Overlay & sliding panel (mechanika bez zmian) ===== */
.sb-overlay {
    position: fixed;
    top: 0;
    right: 0;
    left: 0;
    bottom: 0;
    z-index: 50;
    background: rgba(0, 0, 0, 0.3);
    display: none;
}
.sb-open { overflow: hidden; }
.sb-menu-right {
    position: fixed;
    top: 0;
    right: 0;
    width: 380px;
    max-width: 100%;
    height: 100%;
    z-index: 10000;
    background-color: #fff;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    overflow: hidden;
    -webkit-transform: translateX(100%);
    -ms-transform: translateX(100%);
    transform: translateX(100%);
    -webkit-transition: all .4s;
    -o-transition: all .4s;
    transition: all .4s;
    -webkit-box-shadow: -6px 0 24px rgba(0, 0, 0, .08);
    box-shadow: -6px 0 24px rgba(0, 0, 0, .08);
}
.sb-open .sb-menu-right {
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
}
.sb-close-btn {
    position: absolute;
    top: 24px;
    right: 18px;
    left: auto;
    cursor: pointer;
    z-index: 2;
}
.sb-close-btn i {
    font-size: 18px;
    color: #7b7b7b;
}

/* ===== Kolumna flex: podsumowanie przyklejone do dołu, lista przewija się ===== */
.cart-preview,
#js-cart-sidebar.cart-preview {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-height: 0;
}
.cart-dropdown-wrapper {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    min-height: 0;
}

/* ===== Nagłówek "Koszyk" ===== */
.cart-preview .cart-title {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 22px 20px;
    margin-bottom: 0;
    border-bottom: 1px solid #eee;
}
.cart-preview .cart-title .h4 {
    margin-bottom: 0;
    text-transform: uppercase;
    font-weight: 600;
    color: #000;
    line-height: normal;
}

/* ===== Przewijalna lista produktów ===== */
.cart-preview .cart-items {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    overflow-y: auto;
    min-height: 0;
    margin: 0;
    padding: 0 8px !important;
    list-style: none;
}

/* ===== Wiersz produktu ===== */
.cart-preview .cart-product-line {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 0;
    margin: 0 !important;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}
.cart-preview .cart-items li:last-child .cart-product-line {
    border-bottom: 0;
}
.cart-preview .cart-product-line .product-image {
    -ms-flex: 0 0 84px !important;
    flex: 0 0 84px !important;
    width: 84px !important;
    padding: 0;
    border: 1px solid #f0f0f0;
    border-radius: 0;
    overflow: hidden;
}
.cart-preview .product-image .img-fluid {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0;
}
.cart-preview .cart-product-line .product-infos {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto !important;
    flex: 1 1 auto !important;
    min-width: 0;
    width: auto !important;
    padding-left: 0 !important;
}
.cart-preview .cart-product-line .product-remove {
    -ms-flex: 0 0 auto !important;
    flex: 0 0 auto !important;
    width: auto !important;
    padding-left: 4px;
    text-align: right;
    -ms-flex-item-align: start;
    align-self: flex-start;
}

/* nazwa produktu (link, niebieska) */
.cart-preview .product-infos .product-name {
    display: block;
    margin-bottom: 6px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    color: #2f6fb0;
}
.cart-preview .product-infos .product-name:hover {
    text-decoration: underline;
}

/* atrybuty inline */
.cart-preview .product-infos .product-attributes {
    margin-bottom: 8px;
    line-height: 1.4;
}
.cart-preview .product-infos .product-line-info,
.product-infos .product-line-info .label,
.product-infos .product-line-info .value {
    font-size: 12px;
    font-weight: 400;
    color: #9b9b9b;
}

/* dolny rząd wiersza: ilość (lewo) + cena (prawo) */
.cart-preview .product-line-bottom {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: justify;
    -ms-flex-pack: justify;
    justify-content: space-between;
    margin-top: 6px;
    gap: 8px;
}
.cart-preview .product-qty { margin: 0; }
.cart-preview .product-qty-container {
    display: -webkit-inline-box;
    display: -ms-inline-flexbox;
    display: inline-flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    background: #f4f4f4 !important;
    border: 0 !important;
    border-radius: 8px;
    padding: 0;
    overflow: hidden;
}
.cart-preview .product-qty-container .quantity-button {
    width: 34px;
    height: 34px;
    line-height: 34px;
    padding: 0;
    margin: 0;
    text-align: center;
    cursor: pointer;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    color: #555 !important;
    background: transparent !important;
    border: 0 !important;
    font-size: 18px;
    font-weight: 400;
}
.cart-preview .product-qty-container .quantity-button:hover { color: #000 !important; }
.cart-preview .product-qty-input {
    width: 34px;
    height: 34px;
    padding: 0;
    margin: 0;
    text-align: center;
    border: 0 !important;
    background: transparent !important;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
    font-size: 14px;
    font-weight: 600;
    color: #000;
    -moz-appearance: textfield;
}
.cart-preview .product-qty-input:focus {
    outline: none;
    -webkit-box-shadow: none !important;
    box-shadow: none !important;
}

.cart-preview .product-price-wrap {
    white-space: nowrap;
    text-align: right;
}
.cart-preview .product-infos .product-quantity {
    display: inline;
    margin: 0 2px 0 0;
    font-size: 12px;
    font-weight: 400;
    color: #9b9b9b;
}
.cart-preview .product-infos .product-price {
    display: inline;
    margin: 0;
    font-size: 14px;
    font-weight: 700;
    color: #000000;
}

/* usuwanie (x) */
.cart-preview .product-remove i {
    width: 20px;
    height: 20px;
    display: inline-block;
    padding: 4px;
    border-radius: 100%;
    -moz-border-radius: 100%;
    -webkit-border-radius: 100%;
    font-size: 12px;
    color: #fff;
    background-color: #cfcfcf;
    -webkit-transition: background-color .2s;
    transition: background-color .2s;
}
.cart-preview .product-remove a:hover i { background-color: #000000; }

/* ===== Dolne podsumowanie przyklejone do dołu ===== */
.cart-preview .cart-bottom {
    -ms-flex: 0 0 auto;
    flex: 0 0 auto;
    padding: 18px 20px 20px;
    border-top: 1px solid #eee;
    background: #fafafa;
}
.cart-preview .cart-bottom .total-line {
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    margin-bottom: 8px;
}
.cart-bottom .total-line span {
    width: 50%;
    font-size: 14px;
    font-weight: 400;
    color: #000;
}
.cart-bottom .total-line .label { text-align: left; }
.cart-bottom .total-line .value { text-align: right; }
.cart-bottom hr { margin: 12px 0; border-color: #eee; }
.cart-bottom .cart-total .label {
    text-transform: uppercase;
    font-weight: 600;
}
.cart-bottom .cart-total .value {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
}
.cart-preview .cart-action .btn-primary {
    width: 100%;
    margin-top: 10px;
    position: static;
}

/* ===== Pusty koszyk ===== */
.cart-preview .no-items {
    -webkit-box-flex: 1;
    -ms-flex: 1 1 auto;
    flex: 1 1 auto;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
    color: #777;
}

@media (max-width: 400px) {
    .sb-menu-right { width: 100%; }
}
