:root {
    --barish-cart-primary: #008EFA;
    --barish-cart-radius: 13px;
    --barish-cart-height: 54px;
}

.barish-smart-cart {
    width: 100%;
    direction: rtl;
    font-family: inherit;
}

.barish-smart-cart *,
.barish-cart-toast * {
    box-sizing: border-box;
}

.barish-smart-cart button,
.barish-smart-cart a,
.barish-cart-toast button {
    font-family: inherit;
}

.barish-smart-cart__add,
.barish-smart-cart__fallback {
    width: 100%;
    min-height: var(--barish-cart-height);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: var(--barish-cart-radius);
    background: var(--barish-cart-primary);
    color: #fff !important;
    text-decoration: none !important;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
    cursor: pointer;
    transition: opacity .18s ease, transform .18s ease, box-shadow .18s ease;
    box-shadow: 0 7px 18px rgba(0, 142, 250, .16);
}

.barish-smart-cart__add:hover,
.barish-smart-cart__fallback:hover {
    opacity: .92;
}

.barish-smart-cart__add:active,
.barish-smart-cart__fallback:active {
    transform: translateY(1px);
}

.barish-smart-cart__add.is-disabled,
.barish-smart-cart__add:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}

/* In-cart state: stepper on the right, text/link immediately next to it. */
.barish-smart-cart__in-cart {
    width: 100%;
    display: flex;
    direction: rtl;
    align-items: center;
    justify-content: flex-start;
    gap: 16px;
}

.barish-smart-cart__in-cart[hidden],
.barish-smart-cart__add[hidden],
.barish-smart-cart__trash[hidden],
.barish-smart-cart__minus[hidden],
.barish-smart-cart__max-label[hidden],
.barish-cart-toast__remove[hidden] {
    display: none !important;
}

.barish-smart-cart__stepper {
    width: 140px;
    min-width: 140px;
    min-height: var(--barish-cart-height);
    direction: ltr;
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: stretch;
    overflow: hidden;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .07);
    border-radius: var(--barish-cart-radius);
    box-shadow: 0 5px 18px rgba(15, 23, 42, .14);
}

.barish-smart-cart__cart-info {
    min-width: 105px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    direction: rtl;
    text-align: center;
    line-height: 1.4;
}

.barish-smart-cart__cart-title {
    color: #475569;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.barish-smart-cart__cart-link {
    color: var(--barish-cart-primary) !important;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.5;
    text-decoration: none !important;
    white-space: nowrap;
}

.barish-smart-cart__cart-link:hover {
    text-decoration: underline !important;
    text-underline-offset: 3px;
}

.barish-smart-cart__icon-btn {
    appearance: none;
    -webkit-appearance: none;
    border: 0;
    background: transparent;
    color: var(--barish-cart-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    min-width: 44px;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    transition: opacity .18s ease, background-color .18s ease;
}

.barish-smart-cart__icon-btn:hover:not(:disabled) {
    background: rgba(0, 142, 250, .06);
}

.barish-smart-cart__icon-btn:disabled {
    opacity: .28;
    cursor: not-allowed;
}

.barish-smart-cart__quantity-wrap {
    direction: rtl;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    padding: 5px 2px;
}

.barish-smart-cart__quantity {
    color: #111827;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.05;
}

.barish-smart-cart__max-label {
    margin-top: 4px;
    color: #9CA3AF;
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
}

.barish-smart-cart__trash,
.barish-smart-cart__minus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.barish-smart-cart__minus {
    font-size: 27px;
    transform: translateY(-1px);
}

/* AJAX sync does not block +/- clicks. This is important for rapid changes. */
.barish-smart-cart.is-syncing .barish-smart-cart__quantity {
    opacity: .72;
}

/* Top notification */
.barish-cart-toast {
    position: fixed !important;
    z-index: 2147483647 !important;
    top: 22px !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    width: min(430px, calc(100vw - 30px));
    min-height: 56px;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 14px;
    direction: rtl;
    padding: 12px 16px;
    margin: 0 !important;
    border: 1px solid rgba(0, 142, 250, .20);
    border-right: 4px solid var(--barish-cart-primary);
    border-radius: 13px;
    background: #fff;
    color: #111827;
    box-shadow: 0 12px 35px rgba(15, 23, 42, .22);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, -14px);
    transition: opacity .22s ease, transform .22s ease, visibility .22s ease;
}

.barish-cart-toast.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
}

.barish-cart-toast__message {
    flex: 1;
    font-size: 14px;
    font-weight: 650;
    line-height: 1.7;
}

.barish-cart-toast__remove {
    appearance: none;
    -webkit-appearance: none;
    border: 0 !important;
    background: transparent !important;
    color: var(--barish-cart-primary) !important;
    padding: 4px 2px !important;
    margin: 0 !important;
    font: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: none !important;
}

@media (max-width: 767px) {
    .barish-smart-cart__in-cart {
        gap: 10px;
    }

    .barish-smart-cart__stepper {
        width: 132px;
        min-width: 132px;
        grid-template-columns: 42px 1fr 42px;
    }

    .barish-smart-cart__cart-info {
        min-width: 98px;
    }

    .barish-cart-toast {
        top: 12px !important;
    }
}
