.mmapa-grid-shell,
.mmapa-filter-panel,
.mmapa-grid-shell *,
.mmapa-filter-panel * {
    box-sizing: border-box;
}

.mmapa-grid-shell {
    position: relative;
    width: 100%;
    direction: rtl;
    padding: 14px 4px;
}

.mmapa-result-bar {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 14px;
    min-height: 22px;
}

.mmapa-result-count {
    font-size: 14px;
    font-weight: 600;
    color: #555;
    line-height: 1.8;
}

.mmapa-products-grid {
    display: grid;
    grid-template-columns: repeat(var(--mmapa-cols-desktop, 4), minmax(0, 1fr));
    gap: 22px;
    align-items: stretch;
    width: 100%;
}

.mmapa-product-card-wrap {
    min-width: 0;
    width: 100%;
    height: 100%;
    padding: 1px;
}

.mmapa-product-card {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-height: 100%;
    overflow: hidden;
    text-decoration: none !important;
    background-color: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 14px;
    padding: 18px;
    transition: background-color 240ms ease, box-shadow 240ms ease, border-color 240ms ease;
    isolation: isolate;
}

.mmapa-product-card:hover,
.mmapa-product-card:focus {
    text-decoration: none !important;
}

.mmapa-product-card:hover {
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.08);
}

.mmapa-same-height .mmapa-product-card {
    height: 100%;
}

.mmapa-discount-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 12px;
    min-width: 48px;
    border-radius: 999px;
    background-color: #FEECCC;
    color: #FBA95C;
    font-size: 14px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.mmapa-image-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 210px;
    margin: 0 0 16px;
    overflow: hidden;
    border-radius: inherit;
    background: transparent;
}

.mmapa-product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    background: transparent !important;
    mix-blend-mode: multiply;
    transition: transform 320ms ease, opacity 320ms ease;
    will-change: transform, opacity;
}

.mmapa-primary-image {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.mmapa-hover-image {
    position: absolute;
    inset: 0;
    opacity: 0;
    transform: scale(1.04) rotate(-2deg);
}

.mmapa-product-card:hover .mmapa-primary-image {
    transform: scale(1.04) rotate(-3deg);
}

.mmapa-product-card:hover .mmapa-hover-image {
    opacity: 1;
    transform: scale(1.04) rotate(-3deg);
}

.mmapa-product-card:hover .mmapa-image-wrap.has-hover .mmapa-primary-image {
    opacity: 0;
}

.mmapa-card-content {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
}

.mmapa-product-title {
    margin: 0 0 10px;
    padding: 0;
    color: #1f1f1f;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.8;
    text-align: center;
}

.mmapa-same-height .mmapa-product-title {
    min-height: var(--mmapa-title-height, 58px);
    display: flex;
    align-items: center;
    justify-content: center;
}

.mmapa-product-price {
    min-height: 28px;
    margin: 0 0 16px;
    color: #3d5a2a;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.8;
    text-align: center;
}

.mmapa-same-height .mmapa-product-price {
    min-height: var(--mmapa-price-height, 34px);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.mmapa-product-price del {
    opacity: 0.65;
    margin-inline-end: 6px;
    font-weight: 500;
}

.mmapa-product-price ins {
    text-decoration: none;
    font-weight: inherit;
}

.mmapa-product-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-height: 42px;
    margin-top: auto;
    padding: 11px 18px;
    border-radius: 12px;
    background-color: #1f1f1f;
    color: #fff;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    text-align: center;
    transition: background-color 220ms ease, color 220ms ease;
}


.mmapa-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 26px;
}

.mmapa-page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
}

.mmapa-page-number,
.mmapa-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    min-height: 40px;
    padding: 9px 14px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    border-radius: 10px;
    background: #fff;
    color: #1f1f1f;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 220ms ease;
}

.mmapa-page-number.is-active,
.mmapa-page-number:hover,
.mmapa-load-more:hover {
    background: #3d5a2a;
    border-color: #3d5a2a;
    color: #fff;
}

.mmapa-empty {
    grid-column: 1 / -1;
    width: 100%;
    padding: 22px;
    border-radius: 14px;
    background: #fff8ec;
    color: #8a5a12;
    font-size: 14px;
    font-weight: 700;
    line-height: 2;
    text-align: center;
}

.mmapa-grid-loader {
    position: absolute;
    inset: 0;
    z-index: 20;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.62);
    backdrop-filter: blur(2px);
    border-radius: 16px;
}

.mmapa-grid-loader span {
    width: 38px;
    height: 38px;
    border: 3px solid rgba(0, 0, 0, 0.12);
    border-top-color: #3d5a2a;
    border-radius: 50%;
    animation: mmapa-spin 800ms linear infinite;
}

.mmapa-grid-shell.is-loading .mmapa-grid-loader {
    display: flex;
}

@keyframes mmapa-spin {
    to { transform: rotate(360deg); }
}

/* Filters */
.mmapa-filter-panel {
    display: flex;
    flex-direction: column;
    gap: 18px;
    width: 100%;
    direction: rtl;
    background: #fff;
    border-radius: 16px;
    padding: 18px;
}

.mmapa-filter-horizontal {
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
}

.mmapa-filter-horizontal .mmapa-filter-group {
    flex: 1 1 220px;
}

.mmapa-filter-group {
    width: 100%;
}

.mmapa-filter-heading {
    margin: 0 0 10px;
    color: #1f1f1f;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.8;
}

.mmapa-input,
.mmapa-select {
    width: 100%;
    min-height: 44px;
    padding: 11px 14px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    background: #f8f8f8;
    color: #1f1f1f;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.6;
    outline: none;
    box-shadow: none;
    transition: border-color 180ms ease, background-color 180ms ease;
}

.mmapa-input:focus,
.mmapa-select:focus {
    border-color: #3d5a2a;
    background: #fff;
}

.mmapa-price-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}

.mmapa-check-list {
    display: flex;
    flex-direction: column;
    gap: 9px;
    max-height: 260px;
    overflow: auto;
    padding-inline-start: 3px;
}

.mmapa-check-label,
.mmapa-sale-filter {
    display: flex;
    align-items: center;
    gap: 9px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.8;
    cursor: pointer;
    user-select: none;
}

.mmapa-check-label input,
.mmapa-sale-filter input {
    width: 17px;
    height: 17px;
    margin: 0;
    accent-color: #3d5a2a;
    cursor: pointer;
}

.mmapa-filter-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.mmapa-apply-button,
.mmapa-reset-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    padding: 11px 16px;
    border-radius: 10px;
    border: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 800;
    line-height: 1.5;
    transition: transform 180ms ease, background-color 180ms ease, color 180ms ease;
}

.mmapa-apply-button {
    background: #1f1f1f;
    color: #fff;
}

.mmapa-reset-button {
    background: transparent;
    color: #777;
}

.mmapa-apply-button:hover,
.mmapa-reset-button:hover {
    transform: translateY(-1px);
}

@media (max-width: 1024px) {
    .mmapa-products-grid {
        grid-template-columns: repeat(var(--mmapa-cols-tablet, 2), minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .mmapa-products-grid {
        grid-template-columns: repeat(var(--mmapa-cols-mobile, 1), minmax(0, 1fr));
    }

    .mmapa-filter-horizontal {
        flex-direction: column;
    }

    .mmapa-image-wrap {
        height: 185px;
    }

    .mmapa-product-title {
        font-size: 15px;
    }

    .mmapa-price-row {
        grid-template-columns: 1fr;
    }
}

/* v1.0.1 refinements */
.mmapa-result-bar,
.mmapa-result-count {
    display: none !important;
}

.mmapa-filter-panel,
.mmapa-filter-panel *,
.mmapa-grid-shell,
.mmapa-grid-shell * {
    font-family: inherit !important;
}

.mmapa-filter-panel input,
.mmapa-filter-panel select,
.mmapa-filter-panel textarea,
.mmapa-filter-panel button,
.mmapa-filter-panel label,
.mmapa-filter-panel span,
.mmapa-filter-panel option {
    font-family: inherit !important;
}

.mmapa-input,
.mmapa-select {
    font-family: inherit !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 11px 14px !important;
    border-radius: 10px !important;
    box-shadow: none !important;
    outline: none !important;
}

.mmapa-apply-button,
.mmapa-reset-button {
    font-family: inherit !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 42px !important;
    padding: 11px 16px !important;
    border-radius: 12px !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1.5 !important;
    text-decoration: none !important;
    box-shadow: none !important;
}

.mmapa-reset-button {
    border: 1px solid rgba(251, 169, 92, 0.35) !important;
    background: #fff3ea !important;
    color: #f28435 !important;
}

.mmapa-reset-button:hover,
.mmapa-reset-button:focus {
    border-color: #fba95c !important;
    background: #fba95c !important;
    color: #ffffff !important;
}

.mmapa-apply-button:hover,
.mmapa-apply-button:focus,
.mmapa-reset-button:hover,
.mmapa-reset-button:focus {
    transform: translateY(-1px) !important;
}

.mmapa-price-slider {
    width: 100% !important;
    padding: 4px 2px 0 !important;
    direction: rtl !important;
}

.mmapa-price-values {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: 8px !important;
    width: 100% !important;
    margin-bottom: 16px !important;
    color: #1f1f1f !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1.8 !important;
}

.mmapa-price-value {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 32px !important;
    padding: 5px 10px !important;
    border-radius: 10px !important;
    background: #f8f8f8 !important;
    color: #1f1f1f !important;
    white-space: nowrap !important;
}

.mmapa-price-value-sep {
    color: #777 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    white-space: nowrap !important;
}

.mmapa-range-wrap {
    position: relative !important;
    width: 100% !important;
    height: 34px !important;
    padding: 14px 0 !important;
    direction: ltr !important;
}

.mmapa-range-track,
.mmapa-range-progress {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 50% !important;
    height: 6px !important;
    border-radius: 999px !important;
    transform: translateY(-50%) !important;
    pointer-events: none !important;
}

.mmapa-range-track {
    background: #ececec !important;
}

.mmapa-range-progress {
    left: var(--mmapa-range-left, 0%) !important;
    right: auto !important;
    width: var(--mmapa-range-width, 100%) !important;
    background: #fba95c !important;
}

.mmapa-range-input {
    position: absolute !important;
    left: 0 !important;
    right: 0 !important;
    top: 0 !important;
    width: 100% !important;
    height: 34px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    background: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    pointer-events: none !important;
    -webkit-appearance: none !important;
    appearance: none !important;
}

.mmapa-range-input::-webkit-slider-runnable-track {
    height: 6px !important;
    background: transparent !important;
    border: 0 !important;
}

.mmapa-range-input::-webkit-slider-thumb {
    width: 20px !important;
    height: 20px !important;
    border: 3px solid #ffffff !important;
    border-radius: 50% !important;
    background: #fba95c !important;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    margin-top: -7px !important;
}

.mmapa-range-input::-moz-range-track {
    height: 6px !important;
    background: transparent !important;
    border: 0 !important;
}

.mmapa-range-input::-moz-range-thumb {
    width: 20px !important;
    height: 20px !important;
    border: 3px solid #ffffff !important;
    border-radius: 50% !important;
    background: #fba95c !important;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16) !important;
    cursor: pointer !important;
    pointer-events: auto !important;
}

.mmapa-range-input:focus::-webkit-slider-thumb {
    box-shadow: 0 0 0 4px rgba(251, 169, 92, 0.18), 0 5px 14px rgba(0, 0, 0, 0.16) !important;
}

.mmapa-range-input:focus::-moz-range-thumb {
    box-shadow: 0 0 0 4px rgba(251, 169, 92, 0.18), 0 5px 14px rgba(0, 0, 0, 0.16) !important;
}

/* v1.0.2 fixes */
.mmapa-filter-panel .mmapa-reset-button {
    display: none !important;
}

.mmapa-filter-panel.has-active-filters .mmapa-reset-button {
    display: inline-flex !important;
}

.mmapa-filter-panel .mmapa-reset-button[aria-hidden="true"] {
    pointer-events: none !important;
}

.mmapa-filter-panel.has-active-filters .mmapa-filter-actions {
    display: flex !important;
}

/* v1.0.3 reset and price accuracy fixes */
.mmapa-filter-panel .mmapa-reset-button[hidden] {
    display: none !important;
}

.mmapa-filter-panel.has-active-filters .mmapa-reset-button:not([hidden]) {
    display: inline-flex !important;
}

/* v1.0.4 category archive + mobile offcanvas filters */
.mmapa-mobile-filter-shell {
    width: 100% !important;
    position: relative !important;
}

.mmapa-mobile-filter-toggle,
.mmapa-mobile-filter-backdrop,
.mmapa-mobile-filter-head {
    display: none !important;
}

.mmapa-mobile-filter-icon {
    position: relative !important;
    display: inline-block !important;
    width: 18px !important;
    height: 14px !important;
}

.mmapa-mobile-filter-icon::before,
.mmapa-mobile-filter-icon::after {
    content: "" !important;
    position: absolute !important;
    left: 0 !important;
    width: 18px !important;
    height: 2px !important;
    border-radius: 999px !important;
    background: currentColor !important;
}

.mmapa-mobile-filter-icon::before {
    top: 2px !important;
    box-shadow: 0 5px 0 currentColor !important;
}

.mmapa-mobile-filter-icon::after {
    bottom: 0 !important;
    width: 12px !important;
}

.mmapa-mobile-apply-button {
    display: none !important;
}

@media (max-width: 767px) {
    body.mmapa-mobile-filter-is-open {
        overflow: hidden !important;
        touch-action: none !important;
    }

    .mmapa-mobile-filter-toggle {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 9px !important;
        width: 100% !important;
        min-height: 48px !important;
        margin: 0 0 14px !important;
        padding: 12px 16px !important;
        border: 0 !important;
        border-radius: 14px !important;
        background: #1f1f1f !important;
        color: #ffffff !important;
        font-family: inherit !important;
        font-size: 14px !important;
        font-weight: 900 !important;
        line-height: 1.5 !important;
        cursor: pointer !important;
        box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12) !important;
    }

    .mmapa-mobile-filter-backdrop {
        position: fixed !important;
        inset: 0 !important;
        z-index: 999998 !important;
        display: block !important;
        background: rgba(0, 0, 0, 0.42) !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: opacity 220ms ease !important;
    }

    .mmapa-mobile-filter-shell.is-open .mmapa-mobile-filter-backdrop {
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .mmapa-mobile-filter-shell .mmapa-filter-panel {
        position: fixed !important;
        top: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        z-index: 999999 !important;
        width: min(88vw, 380px) !important;
        max-width: 380px !important;
        height: 100vh !important;
        max-height: 100vh !important;
        overflow: auto !important;
        -webkit-overflow-scrolling: touch !important;
        border-radius: 22px 0 0 22px !important;
        transform: translateX(110%) !important;
        transition: transform 260ms cubic-bezier(0.22, 0.61, 0.36, 1) !important;
        box-shadow: -18px 0 44px rgba(0, 0, 0, 0.18) !important;
        padding: 16px !important;
        background: #ffffff !important;
    }

    .mmapa-mobile-filter-shell.is-open .mmapa-filter-panel {
        transform: translateX(0) !important;
    }

    .mmapa-mobile-filter-head {
        position: sticky !important;
        top: -16px !important;
        z-index: 5 !important;
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 12px !important;
        margin: -16px -16px 8px !important;
        padding: 16px !important;
        background: #ffffff !important;
        border-bottom: 1px solid rgba(0, 0, 0, 0.08) !important;
    }

    .mmapa-mobile-filter-head strong {
        color: #1f1f1f !important;
        font-family: inherit !important;
        font-size: 16px !important;
        font-weight: 900 !important;
        line-height: 1.7 !important;
    }

    .mmapa-mobile-filter-close {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
        padding: 0 !important;
        border: 0 !important;
        border-radius: 50% !important;
        background: #f3f3f3 !important;
        color: #1f1f1f !important;
        font-family: inherit !important;
        font-size: 24px !important;
        font-weight: 700 !important;
        line-height: 1 !important;
        cursor: pointer !important;
    }

    .mmapa-filter-horizontal {
        flex-direction: column !important;
    }

    .mmapa-mobile-filter-shell .mmapa-filter-actions {
        position: sticky !important;
        bottom: -16px !important;
        z-index: 4 !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        width: auto !important;
        margin: 10px -16px -16px !important;
        padding: 12px 16px 16px !important;
        background: linear-gradient(180deg, rgba(255,255,255,0.86), #ffffff 28%) !important;
        border-top: 1px solid rgba(0, 0, 0, 0.08) !important;
    }

    .mmapa-mobile-filter-shell .mmapa-apply-button,
    .mmapa-mobile-filter-shell .mmapa-mobile-apply-button,
    .mmapa-mobile-filter-shell .mmapa-reset-button {
        display: inline-flex !important;
        width: 100% !important;
        min-height: 46px !important;
    }

    .mmapa-mobile-filter-shell .mmapa-filter-panel:not(.has-active-filters) .mmapa-reset-button {
        display: none !important;
    }
}
