.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: 360px;
    height: 100%;
    z-index: 10000;
    overflow-y: scroll;
    background-color: #fff;
    -webkit-transform: translateX(100%);
    -ms-transform: translateX(100%);
    transform: translateX(100%);
    -webkit-transition: all .5s;
    -o-transition: all .5s;
    transition: all .5s;
    box-shadow: -6px 0 24px rgba(0,0,0,0.15);
    border-left: 1px solid #e9ecef;
}
.sb-open .sb-menu-right {
    -webkit-transform: translateX(0);
    -ms-transform: translateX(0);
    transform: translateX(0);
}
.sb-close-btn {
    position: absolute;
    top: -3px;
    left: 7px;
    cursor: pointer;
}
.sb-close-btn i { 
    font-size: 14px;
    color: #7b7b7b;
}
.cart-preview .cart-title {
    padding: 22px 20px 18px 20px;
    margin-bottom: 10px;
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 2;
    background: #fff;
    border-bottom: 1px solid #f2f2f2;
}
.cart-preview .cart-title .h4 {
    margin-bottom: 0;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: .5px;
    color: #2c3e50;
    position: relative;
}
.cart-preview .cart-title .h4:after {
    content: "";
    display: block;
    width: 70px;
    height: 4px;
    background: linear-gradient(135deg, #5ba718 0%, #188f00 100%);
    border-radius: 2px;
    margin: 10px auto 0;
}
.cart-preview .cart-product-line {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: -o-flex;
    display: flex;
    -webkit-box-align: start;
    -ms-flex-align: start;
    align-items: flex-start;
    padding: 14px 12px;
    margin: 10px 16px;
    text-align: left;
    border: 2px solid #e9ecef;
    background: #fff;
    border-radius: 12px;
    min-height: 110px;
    transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.cart-preview .cart-product-line:hover { 
    border-color: #5ba718; 
    box-shadow: 0 6px 18px rgba(249,129,37,0.12);
    transform: translateY(-1px);
}
.cart-preview .cart-product-line .product-image {
    width: 30%;
    border: 1px solid #f4f4f4; 
}
.cart-preview .cart-product-line .product-infos {
    width: 59%;
    padding-left: 15px;
}
.cart-preview .cart-product-line .product-remove {
    align-self: flex-start;
    width: 10%;
    text-align: right;
}
.cart-preview .product-image .img-fluid {
    max-width: 100%;
    height: auto;
}
.cart-preview .product-infos .product-name {
    display: block;
    margin-bottom: 10px;
    font-size: 16px;
    font-weight: 600;
    line-height: 20px;
    color: #2c3e50;
}
.cart-preview .product-remove i { 
    width: 20px;
    height: 20px;
    display: inline-block;
    padding: 3px;
    border-radius: 100%;
    -moz-border-radius: 100%;
    -webkit-border-radius: 100%;
    font-size: 12px;
    color: #fff;
    background-color: #b6b5b5;
}
.cart-preview .product-infos .product-line-info { 
    line-height: initial;
    font-size: 12px;
    color: #000;
}
.product-infos .product-line-info .label {
    font-weight: 400;
    font-size: 12px;
    color: #7d7d7d; 
}
.product-infos .product-line-info .value {
    font-size: 12px;
    font-weight: 400;
}
.cart-preview .product-infos .product-price {
    display: inline-block;
    margin-top: 8px;
    clear: left;
    color: #5ba718;
    font-weight: 700;
}
.cart-preview .product-infos .product-quantity {
    display: inline-block;
    margin-left: 3px;
    font-size: 12px;
    font-weight: 400;
    color: #7d7d7d;
}

/* Product quantity input styling */
.cart-preview .product-qty {
    margin: 10px 0;
    clear: both;
}

.cart-preview .product-qty-container {
    display: flex;
    align-items: center;
    max-width: 130px;
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 2px;
}

.cart-preview .quantity-button {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #5ba718;
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    font-weight: 700;
    user-select: none;
    border-radius: 8px;
    transition: background .2s ease, transform .15s ease;
}

.cart-preview .quantity-button:hover { background: #188f00; transform: scale(1.05); }

.cart-preview .product-qty-input {
    width: 58px;
    height: 34px;
    text-align: center;
    border: none;
    font-size: 14px;
    padding: 0;
    margin: 0 6px;
    background: #fafafa;
    border-radius: 6px;
    font-weight: 600;
    color: #2c3e50;
}

.cart-preview .quantity-down {
    border-radius: 3px 0 0 3px;
}

.cart-preview .quantity-up {
    border-radius: 0 3px 3px 0;
}
.cart-preview .cart-bottom {
    padding: 20px 20px 10px 20px;
}
.cart-preview .cart-bottom .total-line {
    display: -webkit-flex;
    display: -moz-flex;
    display: -ms-flex;
    display: -o-flex;
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}
.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 .cart-total .label { text-transform: uppercase; }
.cart-bottom .cart-total .value { font-size: 22px; color: #5ba718; font-weight: 800; }
.cart-preview .cart-action .btn-primary { 
    width: 100%;
    margin-top: 12px;
    background: linear-gradient(135deg, #5ba718 0%, #188f00 100%);
    border: none;
    border-radius: 12px;
    padding: 14px 18px;
    font-weight: 700;
    letter-spacing: .5px;
    box-shadow: 0 6px 20px rgba(249,129,37,.35);
}
.cart-preview .cart-action .btn-primary:hover { 
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(249,129,37,.45);
}
.cart-preview .no-items { text-align: center; }

/* Availability messages in mini cart */
.cart-preview .product-availability-mini {
    margin-top: 10px;
    font-size: 10px;
    line-height: 1.3;
    clear: both;
    display: block;
    width: 100%;
}

.cart-preview .product-availability-mini .availability-available {
    color: #28a745;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.cart-preview .product-availability-mini .availability-warning {
    color: #5ba718;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.cart-preview .product-availability-mini .availability-unavailable {
    color: #d9534f;
    font-weight: 500;
    display: block;
    margin-top: 2px;
}

.cart-preview .product-availability-mini .availability-error {
    color: #d9534f;
    font-weight: 600;
    background-color: #f2dede;
    padding: 3px 5px;
    border-radius: 3px;
    border: 1px solid #ebccd1;
    display: block;
    margin-top: 5px;
    font-size: 9px;
    line-height: 1.2;
    text-align: left;
    word-wrap: break-word;
}

.cart-preview .product-availability-mini .availability-backorder {
    color: #856404;
    font-weight: 600;
    background-color: #fff3cd;
    padding: 3px 5px;
    border-radius: 3px;
    border: 1px solid #ffeaa7;
    display: block;
    margin-top: 5px;
    font-size: 9px;
    line-height: 1.2;
    text-align: left;
    word-wrap: break-word;
}

/* Remove button styling */
.cart-preview .product-remove i { 
        background-color: #dc3545;
        transition: transform .15s ease, box-shadow .2s ease; 
}
.cart-preview .product-remove i:hover { 
        background-color: #c82333; 
        transform: scale(1.1);
        box-shadow: 0 6px 16px rgba(220,53,69,.35);
}

/* Responsive width for larger screens */
@media (min-width: 1280px) {
    .sb-menu-right { width: 400px; }
}

@media (max-width: 480px) {
    .sb-menu-right { width: 100%; }
    .cart-preview .cart-product-line { margin: 10px; }
}

/* Fallback close button (appears inside cart-title if JS injection fails) */
.sb-close-btn.fallback-close {
    position: absolute;
    top: 20px; /* moved down */
    right: 16px; /* slight right adjustment */
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid #aaa;
    border-radius: 28px;
    box-shadow: 0 0 4px rgba(0,0,0,.15);
    cursor: pointer;
    z-index: 100;
    transition: background .2s ease, transform .15s ease;
}

.sb-close-btn.fallback-close i {
    font-size: 30px; /* increased size */
    line-height: 1;
    color: #7b7b7b;
}
.sb-close-btn i {
    font-size: 30px; /* increased size */
    line-height: 1;
    color: #7b7b7b;
}
.sb-close-btn.fallback-close:hover { background:#f8f8f8; transform: scale(1.05); }
.sb-close-btn.fallback-close:focus { outline: 2px solid #5ba718; outline-offset:2px; }

/* Hide fallback on wide screens (class hidden-md-up handles most; redundancy safe) */
@media (min-width: 768px) { .sb-close-btn.fallback-close { display:none; } }