/*
 * MS Jewellery AJAX Shop
 * Front-end styles are intentionally scoped to .msjs-shop so theme primary
 * colours (for example pink/magenta button rules) do not leak into the shop UI.
 */
.msjs-shop {
    --msjs-blue: #001E38;
    --msjs-blue-2: #063553;
    --msjs-text: #172033;
    --msjs-muted: #6f7a8c;
    --msjs-border: #e2e7ed;
    --msjs-soft: #f5f7f9;
    --msjs-white: #ffffff;
    --msjs-sticky-top: 82px;
    width: 100%;
    color: var(--msjs-text);
    background: var(--msjs-white);
    box-sizing: border-box;
    font-family: inherit;
    isolation: isolate;
}

.msjs-shop *,
.msjs-shop *::before,
.msjs-shop *::after {
    box-sizing: border-box;
}

/* Prevent common WooCommerce/theme primary-colour rules leaking into plugin controls. */
.msjs-shop button,
.msjs-shop select,
.msjs-shop a.button {
    font-family: inherit !important;
    box-shadow: none;
}

.msjs-heading-row {
    padding: 16px 24px 26px;
    background: var(--msjs-white);
}

.msjs-page-title-wrap {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.msjs-page-title {
    margin: 0 !important;
    color: var(--msjs-blue) !important;
    font-size: clamp(32px, 3vw, 50px);
    line-height: 1;
    font-family: Georgia, 'Times New Roman', serif;
    font-weight: 500;
}

.msjs-divider {
    width: 1px;
    height: 30px;
    background: #cdd2da;
}

.msjs-result-count {
    font-size: 18px;
    color: #647084;
}

.msjs-toolbar {
    min-height: 72px;
    padding: 12px 24px;
    background: var(--msjs-blue) !important;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    position: relative;
    z-index: 15;
    box-shadow: 0 7px 18px rgba(0, 30, 56, .08);
}

.msjs-stock-tabs {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Selected filter summary — shown only when sidebar filters are active. */
.msjs-active-filters {
    width: 100%;
    min-height: 74px;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #fff;
    border-bottom: 1px solid var(--msjs-border);
    box-shadow: 0 5px 18px rgba(0, 30, 56, .035);
    overflow: hidden;
    animation: msjsFilterBarIn .24s ease both;
}

.msjs-active-filters[hidden] {
    display: none !important;
}

.msjs-active-filters-label {
    flex: 0 0 auto;
    color: var(--msjs-blue);
    font-size: 14px;
    font-weight: 900;
    letter-spacing: .08em;
    white-space: nowrap;
}

.msjs-active-filter-chips {
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 9px;
    flex-wrap: wrap;
}

.msjs-active-chip {
    appearance: none !important;
    -webkit-appearance: none !important;
    min-height: 42px;
    padding: 0 12px 0 15px !important;
    display: inline-flex !important;
    align-items: center;
    gap: 9px;
    border: 1px solid #cbd5df !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--msjs-blue) !important;
    font-size: 14px;
    line-height: 1.2 !important;
    font-weight: 650 !important;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 2px 7px rgba(0, 30, 56, .025) !important;
    transition: border-color .18s ease, background-color .18s ease, transform .18s ease, box-shadow .18s ease !important;
    animation: msjsChipIn .24s cubic-bezier(.2,.8,.2,1) both;
}

.msjs-active-chip:hover,
.msjs-active-chip:focus-visible {
    border-color: var(--msjs-blue) !important;
    background: #f6f9fb !important;
    color: var(--msjs-blue) !important;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 30, 56, .09) !important;
}

.msjs-active-chip-x {
    width: 19px;
    height: 19px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: #eef3f6;
    color: var(--msjs-blue);
    font-size: 17px;
    font-weight: 500;
    line-height: 1;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.msjs-active-chip:hover .msjs-active-chip-x {
    background: var(--msjs-blue);
    color: #fff;
    transform: rotate(90deg);
}

.msjs-active-clear-all {
    flex: 0 0 auto;
    margin-left: auto !important;
    padding: 8px 4px !important;
    border: 0 !important;
    background: transparent !important;
    color: var(--msjs-blue) !important;
    font-size: 13px;
    font-weight: 800 !important;
    text-decoration: underline;
    text-underline-offset: 4px;
    cursor: pointer;
}

.msjs-active-clear-all:hover,
.msjs-active-clear-all:focus-visible {
    opacity: .72;
}

.msjs-stock-tab,
.msjs-mobile-filter-toggle {
    appearance: none !important;
    -webkit-appearance: none !important;
    border: 2px solid rgba(255, 255, 255, .96) !important;
    border-radius: 9px !important;
    background: transparent !important;
    color: #fff !important;
    min-height: 48px;
    padding: 0 20px;
    font-weight: 600!important;
    font-size: 14px;
    line-height: 1 !important;
    letter-spacing: .02em;
    cursor: pointer;
    text-transform: uppercase;
    transition: background-color .22s ease, color .22s ease, transform .22s ease, box-shadow .22s ease !important;
}

.msjs-stock-tab:hover,
.msjs-stock-tab:focus-visible {
    background: rgba(255, 255, 255, .10) !important;
    color: #fff !important;
    transform: translateY(-1px);
}

.msjs-stock-tab.is-active,
.msjs-stock-tab.is-active:hover,
.msjs-stock-tab.is-active:focus {
    background: #fff !important;
    color: var(--msjs-blue) !important;
    border-color: #fff !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .12) !important;
}

.msjs-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.msjs-sort-wrap {
    position: relative;
    margin: 0;
}

.msjs-sort {
    min-width: 190px;
    height: 48px;
    border: 1px solid transparent !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: var(--msjs-blue) !important;
    padding: 0 44px 0 16px !important;
    font-size: 14px;
    font-weight: 700 !important;
    cursor: pointer;
    outline: 0;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.msjs-sort:hover,
.msjs-sort:focus {
    border-color: rgba(255, 255, 255, .9) !important;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .10) !important;
    transform: translateY(-1px);
}

.msjs-sort option {
    color: var(--msjs-text);
    background: #fff;
}

.msjs-mobile-filter-toggle {
    display: none;
    background: #fff !important;
    color: var(--msjs-blue) !important;
    border-color: #fff !important;
}

.msjs-filter-icon {
    margin-right: 5px;
}

.msjs-layout {
    display: grid;
    grid-template-columns: clamp(270px, 20vw, 310px) minmax(0, 1fr);
    gap: clamp(16px, 1.5vw, 24px);
    padding: 24px 24px 52px;
    align-items: start;
    background: #fff;
}

/*
 * Sticky is applied to the COLUMN, not the inner card. This keeps the filter
 * panel fixed within its grid column while the product column continues to scroll.
 */
.msjs-sidebar {
    min-width: 0;
    position: sticky;
    top: var(--msjs-sticky-top);
    align-self: start;
    height: calc(100vh - var(--msjs-sticky-top) - 18px);
    max-height: calc(100vh - var(--msjs-sticky-top) - 18px);
    z-index: 8;
}

.msjs-sidebar-inner {
    position: relative;
    height: 100%;
    max-height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    background: #fff;
    border: 1px solid var(--msjs-border);
    border-radius: 11px;
    box-shadow: 0 8px 26px rgba(0, 30, 56, .06);
    scrollbar-width: thin;
    scrollbar-color: #aab4bf transparent;
}

.msjs-sidebar-inner::-webkit-scrollbar {
    width: 6px;
}

.msjs-sidebar-inner::-webkit-scrollbar-thumb {
    background: #aab4bf;
    border-radius: 999px;
}

.msjs-filter-header {
    position: sticky;
    top: 0;
    z-index: 4;
    min-height: 62px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--msjs-blue) !important;
    color: #fff !important;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 19px;
    letter-spacing: .03em;
    box-shadow: 0 3px 10px rgba(0, 30, 56, .08);
}

.msjs-mobile-filter-close {
    display: none;
    border: 0 !important;
    background: transparent !important;
    color: #fff !important;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}

.msjs-filter-section {
    padding: 20px;
    border-bottom: 1px solid var(--msjs-border);
}

.msjs-filter-section-title {
    margin-bottom: 14px;
    color: var(--msjs-blue);
    font-size: 16px;
    font-weight: 800;
}

.msjs-check-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 13px;
    cursor: pointer;
    line-height: 1.35;
    color: #526074;
    transition: color .18s ease, transform .18s ease;
}

.msjs-check-row:hover {
    color: var(--msjs-blue);
    transform: translateX(2px);
}

.msjs-check-row:last-child {
    margin-bottom: 0;
}

.msjs-check-row input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.msjs-custom-check {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    border: 1.5px solid #aeb8c5;
    border-radius: 5px;
    background: #fff;
    position: relative;
    transition: background-color .18s ease, border-color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.msjs-check-row:hover .msjs-custom-check {
    border-color: var(--msjs-blue);
}

.msjs-check-row input:focus-visible + .msjs-custom-check {
    box-shadow: 0 0 0 3px rgba(0, 30, 56, .14);
}

.msjs-check-row input:checked + .msjs-custom-check {
    background: var(--msjs-blue) !important;
    border-color: var(--msjs-blue) !important;
    transform: scale(.96);
}

.msjs-check-row input:checked + .msjs-custom-check::after {
    content: '';
    position: absolute;
    left: 6px;
    top: 2px;
    width: 6px;
    height: 11px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.msjs-check-row em {
    font-style: normal;
    color: #7f8999;
}

.msjs-clear-filters {
    width: calc(100% - 40px) !important;
    margin: 18px 20px 22px !important;
    min-height: 46px;
    padding: 0 14px !important;
    border: 1px solid var(--msjs-blue) !important;
    background: #fff !important;
    color: var(--msjs-blue) !important;
    border-radius: 8px !important;
    font-weight: 800 !important;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, transform .2s ease, box-shadow .2s ease !important;
}

.msjs-clear-filters:hover,
.msjs-clear-filters:focus-visible {
    background: var(--msjs-blue) !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: 0 7px 18px rgba(0, 30, 56, .15) !important;
}

.msjs-products-area {
    min-width: 0;
}

.msjs-products-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: clamp(14px, 1.35vw, 22px);
}

.msjs-product-card {
    background: #fff;
    border: 1px solid var(--msjs-border) !important;
    border-radius: 14px !important;
    overflow: hidden;
    min-width: 0;
    box-shadow: 0 3px 10px rgba(0, 30, 56, .025);
    transition: transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .28s ease, border-color .28s ease;
    animation: msjsCardIn .42s ease both;
}

.msjs-product-card:hover {
    transform: translateY(-5px);
    border-color: #cfd8e1 !important;
    box-shadow: 0 16px 34px rgba(0, 30, 56, .12);
}

.msjs-product-media {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
    background: #f5f6f7;
}

.msjs-product-image-link {
    display: block;
    width: 100%;
    height: 100%;
}

.msjs-product-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s cubic-bezier(.2,.8,.2,1), filter .35s ease;
}

.msjs-product-card:hover .msjs-product-image {
    transform: scale(1.045);
    filter: saturate(1.03);
}

.msjs-sale-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    background: var(--msjs-blue) !important;
    color: #fff !important;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 12px;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(0, 30, 56, .16);
}

.msjs-cart-overlay {
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 14px;
    z-index: 3;
    transform: translateY(16px);
    opacity: 0;
    transition: transform .25s cubic-bezier(.2,.8,.2,1), opacity .2s ease;
}

.msjs-product-card:hover .msjs-cart-overlay,
.msjs-product-card:focus-within .msjs-cart-overlay {
    transform: translateY(0);
    opacity: 1;
}

.msjs-cart-overlay .button,
.msjs-cart-overlay a.button,
.msjs-cart-overlay .button:hover,
.msjs-cart-overlay a.button:hover,
.msjs-cart-overlay .button:focus,
.msjs-cart-overlay a.button:focus {
    width: 100%;
    min-height: 46px;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    border: 1px solid var(--msjs-blue) !important;
    border-radius: 8px !important;
    background: var(--msjs-blue) !important;
    color: #fff !important;
    font-weight: 600 !important;
    text-transform: uppercase;
    text-decoration: none !important;
    font-size: 15px;
    line-height: 1.2 !important;
    box-shadow: 0 8px 22px rgba(0, 30, 56, .22) !important;
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease !important;
}

.msjs-cart-overlay .button:hover,
.msjs-cart-overlay a.button:hover {
    background: var(--msjs-blue-2) !important;
    border-color: var(--msjs-blue-2) !important;
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(0, 30, 56, .28) !important;
}

.msjs-cart-overlay .added_to_cart {
    display: block;
    margin-top: 8px;
    text-align: center;
    background: #fff !important;
    color: var(--msjs-blue) !important;
    border-radius: 7px;
    padding: 8px;
    font-weight: 800;
    text-decoration: none;
}

.msjs-product-info {
    padding: 16px 17px 19px;
}

.msjs-product-title {
    display: block;
    color: #657184 !important;
    text-decoration: none !important;
    font-size: 15px;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: color .2s ease;
}

.msjs-product-title:hover {
    color: var(--msjs-blue) !important;
}

.msjs-product-price {
    font-size: clamp(20px, 2vw, 25px);
    font-weight: 700;
    color: var(--msjs-blue) !important;
    line-height: 1.25;
}

.msjs-product-price .woocommerce-Price-amount,
.msjs-product-price bdi {
    color: inherit !important;
}

.msjs-product-price del {
    font-size: .7em;
    color: #8a94a4 !important;
    font-weight: 500;
    opacity: 1;
}

.msjs-product-price ins {
    text-decoration: none;
    color: var(--msjs-blue) !important;
}

.msjs-sale-text {
    color: var(--msjs-blue) !important;
    margin-top: 6px;
    font-size: 13px;
    font-weight: 700;
}

.msjs-pagination-wrap {
    margin-top: 32px;
}

.msjs-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
}

.msjs-pagination button {
    min-width: 40px;
    height: 40px;
    padding: 0 10px !important;
    border: 1px solid var(--msjs-border) !important;
    background: #fff !important;
    color: var(--msjs-blue) !important;
    border-radius: 8px !important;
    cursor: pointer;
    font-weight: 600 !important;
    transition: .2s ease !important;
}

.msjs-pagination button:hover,
.msjs-pagination button.is-current {
    background: var(--msjs-blue) !important;
    color: #fff !important;
    border-color: var(--msjs-blue) !important;
    transform: translateY(-1px);
}

.msjs-pagination span {
    padding: 0 4px;
    color: #7c8796;
}

.msjs-no-products {
    grid-column: 1 / -1;
    min-height: 260px;
    border: 1px dashed #cdd4dc;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 8px;
    color: #657287;
    text-align: center;
    padding: 30px;
}

.msjs-no-products strong {
    color: var(--msjs-blue);
    font-size: 20px;
}

.msjs-skeleton-card {
    border: 1px solid var(--msjs-border);
    border-radius: 11px;
    overflow: hidden;
    background: #fff;
}

.msjs-skeleton-image,
.msjs-skeleton-lines span {
    background: linear-gradient(90deg, #edf0f3 25%, #f8f9fa 37%, #edf0f3 63%);
    background-size: 400% 100%;
    animation: msjsShimmer 1.25s ease infinite;
}

.msjs-skeleton-image {
    aspect-ratio: 1 / 1;
}

.msjs-skeleton-lines {
    padding: 16px;
}

.msjs-skeleton-lines span {
    display: block;
    height: 15px;
    border-radius: 99px;
    margin-bottom: 10px;
}

.msjs-skeleton-lines span:nth-child(2) {
    height: 22px;
    width: 72%;
}

.msjs-skeleton-lines span.short {
    width: 52%;
    margin-bottom: 0;
}

.msjs-shop.is-loading .msjs-products-grid {
    animation: msjsSoftFade .18s ease;
}

@keyframes msjsShimmer {
    0% { background-position: 100% 0; }
    100% { background-position: 0 0; }
}

@keyframes msjsCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes msjsSoftFade {
    from { opacity: .65; }
    to { opacity: 1; }
}

@keyframes msjsFilterBarIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes msjsChipIn {
    from { opacity: 0; transform: translateY(-4px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.msjs-mobile-overlay {
    display: none;
}

body.msjs-filter-open {
    overflow: hidden;
}

@media (min-width: 1500px) {
    .msjs-products-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 1100px) {
    .msjs-layout {
        grid-template-columns: 270px minmax(0, 1fr);
    }

    .msjs-products-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 900px) {
    .msjs-active-filters {
        padding: 10px 16px;
        min-height: 66px;
    }

    .msjs-active-chip {
        min-height: 38px;
        font-size: 13px;
    }

    .msjs-heading-row {
        padding: 12px 16px 20px;
    }

    .msjs-toolbar {
        padding: 10px 16px;
    }

    .msjs-layout {
        display: block;
        padding: 18px 16px 40px;
    }

    .msjs-mobile-filter-toggle {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }

    .msjs-sidebar {
        position: fixed;
        z-index: 100002;
        left: 0;
        top: 0;
        bottom: 0;
        width: min(360px, 90vw);
        height: 100vh;
        max-height: 100vh;
        transform: translateX(-105%);
        transition: transform .3s cubic-bezier(.2,.8,.2,1);
    }

    .msjs-sidebar.is-open {
        transform: translateX(0);
    }

    .msjs-sidebar-inner {
        position: static;
        border-radius: 0;
        height: 100%;
        max-height: 100%;
        box-shadow: 12px 0 35px rgba(0, 30, 56, .16);
    }

    .msjs-mobile-filter-close {
        display: inline-block;
    }

    .msjs-mobile-overlay {
        position: fixed;
        z-index: 100001;
        inset: 0;
        background: rgba(4, 17, 29, .58);
        backdrop-filter: blur(2px);
        opacity: 0;
        transition: opacity .25s ease;
    }

    .msjs-mobile-overlay.is-visible {
        display: block;
        opacity: 1;
    }
}

@media (max-width: 640px) {
    .msjs-active-filters {
        min-height: 0;
        padding: 10px 12px;
        gap: 9px;
        align-items: center;
    }

    .msjs-active-filters-label {
        font-size: 11px;
        letter-spacing: .06em;
    }

    .msjs-active-filter-chips {
        flex: 1 1 auto;
        flex-wrap: nowrap;
        overflow-x: auto;
        overscroll-behavior-x: contain;
        scrollbar-width: none;
        padding: 2px 0;
    }

    .msjs-active-filter-chips::-webkit-scrollbar {
        display: none;
    }

    .msjs-active-chip {
        min-height: 36px;
        padding: 0 9px 0 11px !important;
        border-radius: 9px !important;
        font-size: 12px;
    }

    .msjs-active-chip-x {
        width: 17px;
        height: 17px;
        font-size: 15px;
    }

    .msjs-active-clear-all {
        display: none !important;
    }

    .msjs-page-title {
        font-size: 34px;
    }

    .msjs-result-count {
        font-size: 15px;
    }

    .msjs-divider {
        height: 24px;
    }

    .msjs-toolbar {
        align-items: stretch;
        flex-direction: column;
        gap: 10px;
    }

    .msjs-stock-tabs,
    .msjs-toolbar-actions {
        width: 100%;
    }

    .msjs-stock-tab {
        flex: 1 1 50%;
        padding: 0 10px;
    }

    .msjs-mobile-filter-toggle,
    .msjs-sort-wrap {
        flex: 1 1 50%;
    }

    .msjs-sort {
        width: 100%;
        min-width: 0;
    }

    .msjs-products-grid {
        gap: 10px;
    }

    .msjs-product-info {
        padding: 11px 11px 14px;
    }

    .msjs-product-title {
        font-size: 13px;
    }

    .msjs-product-price {
        font-size: 18px;
    }

    .msjs-cart-overlay {
        left: 8px;
        right: 8px;
        bottom: 8px;
        opacity: 1;
        transform: none;
    }

    .msjs-cart-overlay .button,
    .msjs-cart-overlay a.button {
        min-height: 40px;
        font-size: 11px;
    }

    .msjs-sale-badge {
        top: 8px;
        left: 8px;
        padding: 5px 8px;
        font-size: 10px;
    }
}

@media (max-width: 420px) {
    .msjs-active-filters {
        padding-left: 10px;
        padding-right: 10px;
    }

    .msjs-heading-row {
        padding-left: 12px;
        padding-right: 12px;
    }

    .msjs-layout,
    .msjs-toolbar {
        padding-left: 12px;
        padding-right: 12px;
    }

    .msjs-stock-tab,
    .msjs-mobile-filter-toggle,
    .msjs-sort {
        font-size: 12px;
    }
}


@media (max-width: 360px) {
    .msjs-products-grid {
        grid-template-columns: 1fr;
    }

    .msjs-page-title {
        font-size: 30px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .msjs-shop *,
    .msjs-shop *::before,
    .msjs-shop *::after {
        scroll-behavior: auto !important;
        animation-duration: .001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .001ms !important;
    }
}
