/* Force every Elementor wrapper around this shortcode to stay full-width
   so the section can never shrink when the grid is empty or briefly loading. */
.elementor-widget-shortcode:has(.bbiz-cat-products),
.elementor-widget-shortcode:has(.bbiz-cat-products) .elementor-widget-container,
.elementor-widget-shortcode:has(.bbiz-cat-products) .elementor-shortcode {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
}

.bbiz-cat-products {
    display: block !important;
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
    align-self: stretch !important;
    box-sizing: border-box !important;
    /* padding: 40px 0; */
    direction: rtl;
    font-family: 'Heebo', sans-serif;
}

.bbiz-cat-products--single {
    max-width: 1440px !important;
    min-width: 0 !important;
    margin: 0 auto 64px !important;
    padding: 0 24px !important;
}

.bbiz-cat-products--single .bbiz-cat-products__header {
    justify-content: center;
    text-align: center;
    margin-bottom: 40px;
}

.bbiz-cat-products--single .bbiz-cat-products__title-block {
    flex: 0 1 860px;
    text-align: center;
}

.bbiz-cat-products--single .bbiz-cat-products__subtitle {
    margin-bottom: 0;
}

.bbiz-cat-products *,
.bbiz-cat-products *::before,
.bbiz-cat-products *::after {
    box-sizing: border-box;
}

.bbiz-cat-products__header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 24px;
    margin-bottom: 32px;
}

.bbiz-cat-products__title-block {
    flex: 1 1 320px;
    text-align: right;
}

.bbiz-cat-products__title {
    font-size: 40px;
    font-weight: 800;
    color: #0a1c3f;
    margin: 0 0 8px;
    line-height: 1.2;
}

.bbiz-cat-products__subtitle {
    font-size: 15px;
    color: #4a5568;
    margin: 0 0 20px;
    line-height: 1.55;
}

.bbiz-cat-products__controls {
    display: flex;
    flex-direction: column;
    gap: 14px;
    align-items: stretch;
    flex: 0 1 360px;
    min-width: 280px;
}

.bbiz-cat-products__search {
    display: flex;
    align-items: center;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 10px;
    padding: 4px 8px 4px 4px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, .03);
}

.bbiz-cat-products__search input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    padding: 10px 12px;
    font-family: inherit;
    font-size: 14px;
    color: #4a5568;
    direction: rtl;
}

.bbiz-cat-products__search input::placeholder {
    color: #9aa3af;
}

.bbiz-cat-products__filter-btn,
.bbiz-cat-products__filter-btn:hover,
.bbiz-cat-products__filter-btn:focus,
.bbiz-cat-products__filter-btn:focus-visible,
.bbiz-cat-products__filter-btn:active {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.bbiz-cat-products__filter-btn {
    background: transparent;
    cursor: pointer;
    padding: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background-image: none !important;
}

.bbiz-cat-products__filter-btn:hover {
    background-color: #f2f2f2;
}

.bbiz-cat-products__filter-btn:focus,
.bbiz-cat-products__filter-btn:focus-visible,
.bbiz-cat-products__filter-btn:active {
    background-color: transparent !important;
}

.bbiz-cat-products__active-filters {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    direction: rtl;
    justify-content: flex-start;
    width: 100%;
    margin-top: 0.5em;
}

.bbiz-chip {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    background: #f5f5f5;
    padding: 6px 6px 6px 26px;
    border-radius: 999px;
    font-family: inherit;
    font-size: 18px;
    font-weight: 500;
    color: #a0a0a0;
    border: none;
    min-height: 52px;
    line-height: 1;
    direction: ltr;
}

.bbiz-chip__x {
    background: #e5e5e5;
    border: none;
    padding: 0;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #656565;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    flex-shrink: 0;
    transition: background .15s;
}

.bbiz-chip__x:hover {
    background: #d9d9d9;
}

.bbiz-cat-products__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    min-height: 521px;
}

.bbiz-cat-products--single .bbiz-cat-products__grid {
    /* grid-template-columns: repeat(auto-fit, minmax(260px, 343px)); */
    justify-content: center;
    min-height: 0;
}

/* When the grid holds only the empty-state, collapse to a single track so it stretches full-width */
.bbiz-cat-products__grid:has(> .bbiz-cat-products__empty:only-child) {
    grid-template-columns: 1fr;
}

.bbiz-cat-products__empty {
    grid-column: 1 / -1 !important;
    width: 100% !important;
    min-width: 0;
    min-height: 330px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 80px 20px;
    color: #4a5568;
    font-family: 'Heebo', sans-serif;
    font-size: 22px;
    font-weight: 600;
    box-sizing: border-box;
}

@media (max-width: 1200px) {
    .bbiz-cat-products__grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 900px) {
    .bbiz-cat-products__grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .bbiz-cat-products__grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 767px) {
    .bbiz-cat-products--single {
        padding: 0 16px !important;
        margin-bottom: 40px !important;
    }

    .bbiz-cat-products--single .bbiz-cat-products__title {
        font-size: 28px;
    }

    .bbiz-cat-products--single .bbiz-cat-products__subtitle {
        font-size: 14px;
    }
}

.bbiz-product-card {
    background: #fff;
    border: 2px solid #ececec;
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow .2s, transform .2s;
    width: 100%;
    max-width: 343px;
    height: 550px;
    margin: 0 auto;
}

.bbiz-product-card:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, .08);
    transform: translateY(-2px);
}

.bbiz-product-card__img-link {
    display: block;
    background: #fafafa;
    text-decoration: none;
    flex: 0 0 50%;
    height: 50%;
    min-height: 0;
    overflow: hidden;
    pointer-events: none;
}

.bbiz-product-card__img-wrap {
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}

.bbiz-product-card__img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none;
}

.bbiz-product-card__body {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    text-align: right;
}

.bbiz-product-card__title {
    font-family: 'Heebo', sans-serif;
    font-size: 28px;
    font-weight: 600;
    pointer-events: none;
    color: #0a1c3f;
    margin: 0;
    line-height: 1.3;
}

.bbiz-product-card__title a {
    color: inherit;
    text-decoration: none !important;
}

.bbiz-product-card__price {
    display: flex;
    flex-direction: row;
    justify-content: flex-end;
    align-items: baseline;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: #00A6C9;
    margin: 0;
    direction: ltr;
}

.bbiz-product-card__price .woocommerce-Price-amount,
.bbiz-product-card__price .woocommerce-Price-amount.amount,
.bbiz-product-card__price bdi {
    display: inline-flex;
    flex-direction: row-reverse;
    align-items: baseline;
    gap: 4px;
}

.bbiz-product-card__price del,
.bbiz-product-card__price .woocommerce-Price-amount del {
    color: #a0aec0;
    font-weight: 500;
    font-size: 16px;
    text-decoration: line-through;
}

.bbiz-product-card__price ins {
    text-decoration: none;
    background: transparent;
    color: #00A6C9;
    font-weight: 700;
}

.bbiz-product-card__desc {
    font-family: 'Heebo', sans-serif;
    font-size: 17px;
    font-weight: 400;
    color: #4a5568;
    line-height: 1.55;
    margin: 0;
    /* Clamp to 2 lines with an ellipsis so long descriptions don't
       explode the card height. Works in every modern browser. */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    word-break: break-word;
}

.bbiz-product-card__desc p {
    margin: 0;
    display: inline;
}

.bbiz-product-card__btn {
    align-self: flex-start;
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(180deg, #00A6C9 0%, #00689E 100%);
    color: #fff;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none !important;
    transition: opacity .2s;
}

.bbiz-product-card__btn:hover {
    color: #fff;
    text-decoration: none !important;
    opacity: .95;
}

.bbiz-product-card__btn svg {
    display: block;
    flex-shrink: 0;
}

.bbiz-product-card .added_to_cart,
.bbiz-product-card a.added_to_cart,
.bbiz-product-card .wc-forward {
    display: none !important;
}

.bbiz-cat-products__load-more-wrap {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.bbiz-cat-products__load-more-wrap[hidden] {
    display: none !important;
}

.bbiz-cat-products__load-more {
    background: linear-gradient(180deg, #00A6C9 0%, #00689E 100%);
    color: #fff;
    border: none;
    padding: 14px 40px;
    border-radius: 10px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 180px;
    min-height: 52px;
    transition: opacity .2s, transform .1s;
}

.bbiz-cat-products__load-more:hover:not(:disabled) {
    opacity: .95;
}

.bbiz-cat-products__load-more:active:not(:disabled) {
    transform: translateY(1px);
}

.bbiz-cat-products__load-more:disabled {
    opacity: .7;
    cursor: wait;
}

.bbiz-cat-products__spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: bbiz-spin 0.7s linear infinite;
    display: inline-block;
}

.bbiz-cat-products__spinner[hidden] {
    display: none !important;
}

@keyframes bbiz-spin {
    to {
        transform: rotate(360deg);
    }
}

.bbiz-cat-products__grid.is-loading {
    opacity: .5;
    pointer-events: none;
    transition: opacity .2s;
}

/* ---------- Filter modal ---------- */

body.bbiz-modal-open {
    overflow: hidden;
}

.bbiz-filter-modal {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    direction: rtl;
    font-family: 'Heebo', sans-serif;
}

.bbiz-filter-modal.is-open {
    display: flex;
}

.bbiz-filter-modal[hidden]:not(.is-open) {
    display: none;
}

.bbiz-filter-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(20, 30, 50, 0.45);
    backdrop-filter: blur(2px);
    cursor: pointer;
}

.bbiz-filter-modal__dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 20px;
    padding: 28px 32px 32px;
    width: 92%;
    max-width: 450px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

.bbiz-filter-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 6px;
    direction: ltr;
    border-bottom: 1px solid #00000026;
    padding-bottom: 1.5em;
}

.bbiz-filter-modal__title {
    font-size: 32px;
    font-weight: 800;
    color: #0a1c3f;
    margin: 0;
    text-align: right;
}

.bbiz-filter-modal__close {
    background: #f2f2f2;
    border: none;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    outline: none;
    padding: 0;
}

.bbiz-filter-modal__close:hover {
    background: #e0e0e0;
}

.bbiz-filter-modal__close:focus,
.bbiz-filter-modal__close:active {
    outline: none;
    box-shadow: none;
}

.bbiz-filter-modal__divider {
    border: none;
    display: block;
    width: 100%;
    height: 1px;
    background-color: #e5e5e5;
    margin: 12px 0 24px;
}

.bbiz-filter-form {
    display: flex;
    margin-top: 1em;
    flex-direction: column;
    gap: 22px;
}

.bbiz-filter-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.bbiz-filter-group__title {
    font-size: 18px;
    font-weight: 700;
    color: #0a1c3f;
    margin: 0;
    text-align: right;
}

/* Color swatches */
.bbiz-filter-swatches {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: flex-start;
    direction: rtl;
}

.bbiz-swatch {
    display: inline-block;
    cursor: pointer;
    position: relative;
    padding: 3px;
    border-radius: 50%;
    box-shadow: 0 0 0 1px transparent inset;
    transition: box-shadow .15s;
}

.bbiz-swatch input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
    width: 0;
    height: 0;
}

.bbiz-swatch__circle {
    display: block;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background-clip: padding-box;
}

.bbiz-swatch:hover {
    box-shadow: 0 0 0 2px rgba(0, 166, 201, 0.25);
}

.bbiz-swatch.is-checked {
    box-shadow: 0 0 0 2px #00A6C9;
}

/* Dropdowns */
.bbiz-filter-select-wrap {
    position: relative;
}

.bbiz-filter-select {
    width: 100%;
    padding: 14px 18px;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    color: #4a5568;
    direction: rtl;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg width='12' height='7' viewBox='0 0 12 7' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23898989' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 18px center;
    background-size: 12px 7px;
    outline: none;
}

.bbiz-filter-select:focus {
    border-color: #00A6C9;
}

/* Price range */
.bbiz-filter-price-range {
    display: flex;
    align-items: center;
    gap: 12px;
}

.bbiz-filter-price-range input {
    flex: 1;
    min-width: 0;
    padding: 14px 18px;
    border: 1px solid #eaeaea;
    border-radius: 12px;
    background: #fff;
    font-family: inherit;
    font-size: 15px;
    color: #4a5568;
    direction: rtl;
    outline: none;
    text-align: right;
}

.bbiz-filter-price-range input:focus {
    border-color: #00A6C9;
}

.bbiz-filter-price-range__dash {
    color: #9aa3af;
    font-size: 20px;
}

/* Quick selects */
.bbiz-filter-quick-selects {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-start;
    direction: rtl;
}

.bbiz-quick-pill {
    padding: 10px 22px;
    border: 1px solid #eaeaea;
    background: #fff;
    border-radius: 999px;
    font-family: inherit;
    font-size: 14px;
    color: #4a5568;
    cursor: pointer;
    transition: all .15s;
}

.bbiz-quick-pill:hover {
    border-color: #c8b5d1;
}

.bbiz-quick-pill.is-active {
    background: #f4ecfa;
    border-color: #b58cc9;
    color: #7f4ea3;
}

/* Actions */
.bbiz-filter-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-start;
    direction: rtl;
    margin-top: 8px;
}

.bbiz-filter-submit,
.bbiz-filter-cancel {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, background .2s;
}

.bbiz-filter-submit {
    background: #1DAFD6;
    color: #fff;
}

.bbiz-filter-submit:hover {
    background: #159bbf;
}

.bbiz-filter-cancel {
    background: #fff;
    color: #4a5568;
    border: 1px solid #eaeaea;
}

.bbiz-filter-cancel:hover {
    background: #f7f7f7;
}

.bbiz-filter-submit svg,
.bbiz-filter-cancel svg {
    flex-shrink: 0;
    display: block;
}
