:root {
    --mks-white: #ffffff;
    --mks-ink: var(--primary-semi-dark);
    --mks-muted: #737373;
    --mks-panel: var(--mks-white);
    --mks-rail: #F5F4F2;
    --mks-chip: var(--mks-white);
    --mks-chip-hover: #ecebe7;
    --mks-line: rgba(38, 38, 38, 0.1);
    --mks-accent: #e8b30a;
    --mks-accent-dark: #a74f2f;
    --mks-card-text: var(--mks-white);
    --mks-card-text-muted: rgba(255, 255, 255, 0.85);
    --mks-card-overlay: linear-gradient(180deg, rgba(0, 0, 0, 0.04) 20%, rgba(0, 0, 0, 0.74) 100%);
    --mks-content-overlay: rgba(255, 255, 255, 0.72);
    --mks-place-badge-bg: rgba(0, 0, 0, 0.3);
    --mks-page-scrim: rgba(22, 22, 20, 0.62);
    --mks-close-shadow: 0 16px 40px rgba(0, 0, 0, 0.18);
    --mks-panel-shadow: 0 24px 90px rgba(0, 0, 0, 0.24);
    --mks-placeholder: #a7a7a7;
    --mks-badge-bg: rgba(255, 255, 255, 0.65);
    --mks-badge-glint: inset 0 1px 0 rgba(255, 255, 255, 0.22);
    --mks-explorer-panel-max-width: 1100px;
    --mks-check-size: 18px;
    --mks-green: #6c7d3a;
}

.mks-search-trigger {
    align-items: center;
    background: var(--mks-white);
    border: 1px solid var(--mks-line);
    border-radius: 999px;
    color: var(--mks-ink);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
}

.mks-search-trigger__icon,
.mks-explorer__search-icon {
    border: 2px solid currentColor;
    border-radius: 999px;
    color: var(--mks-muted);
    display: inline-block;
    flex: 0 0 auto;
    height: 18px;
    position: relative;
    width: 18px;
}

.mks-search-trigger__icon::after,
.mks-explorer__search-icon::after {
    background: currentColor;
    border-radius: 999px;
    content: "";
    height: 2px;
    position: absolute;
    right: -7px;
    top: 13px;
    transform: rotate(45deg);
    width: 9px;
}

.mks-explorer,
.mks-explorer * {
    box-sizing: border-box;
}

.mks-explorer {
    color: var(--mks-ink);
    font-family: inherit;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    position: fixed;
    transition: opacity 180ms ease;
    z-index: 999999;
}

.mks-explorer.is-open {
    opacity: 1;
    pointer-events: auto;
}

.mks-explorer__scrim {
    backdrop-filter: blur(5px);
    background: var(--mks-page-scrim);
    inset: 0;
    position: absolute;
}

.mks-explorer__actions {
    align-items: center;
    display: flex;
    gap: 8px;
    position: absolute;
    right: var(--space-s);
    top: 20px;
    z-index: 999;
}

.mks-explorer__close {
    align-items: center;
    background: var(--white);
    border: 1px solid var(--primary-light);
    border-radius: 62% 38% 60% 40% / 50% 49% 51% 50%;
    color: var(--mks-ink);
    cursor: pointer;
    display: flex;
    font-size: calc(var(--text-l) * 1.35);
    font-weight: 400 !important;
    height: 42px;
    justify-content: center;
    line-height: 1;
    padding: 0 0 4px;
    position: static;
    width: 42px;
}

.mks-explorer__close:hover {
    background: var(--mks-rail);
}

.mks-explorer__panel {
    background: var(--mks-panel);
    border-radius: 22px;
    box-shadow: var(--mks-panel-shadow);
    display: grid;
    gap: 0;
    grid-template-columns: 265px minmax(0, 1fr);
    height: min(86vh, 980px);
    left: 50%;
    overflow: hidden;
    padding-block: 0;
    padding-inline: 0;
    position: absolute;
    top: 50%;
    transform: translate(-50%, -50%) scale(0.98);
    transition: transform 180ms ease;
    width: min(86vw, var(--mks-explorer-panel-max-width));
}

.mks-explorer.is-open .mks-explorer__panel {
    transform: translate(-50%, -50%) scale(1);
}

.mks-explorer__filters {
    background: var(--mks-rail);
    font-size: var(--text-s);
    overflow: auto;
    padding: 28px 24px 36px;
}

.mks-explorer__search {
    align-items: center;
    background: var(--mks-white);
    border-radius: 14px;
    display: flex;
    gap: 10px;
    min-height: 48px;
    padding: 0 14px;
}

.mks-explorer__search-block {
    position: relative;
}

.mks-explorer__mobile-more {
    display: none;
}

.mks-explorer__clear {
    align-items: center;
    background: var(--secondary-light);
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: var(--text-s);
    font-weight: 800;
    justify-content: center;
    line-height: 1;
    margin: 0;
    min-height: calc(var(--space-m) * 0.75);
    padding: 0 10px;
    width: auto;
}

.mks-explorer__clear:hover {
    color: var(--black);
}

.mks-explorer__clear[hidden] {
    display: none;
}

.mks-explorer__clear--mobile {
    display: none;
}

.mks-explorer__search input {
    background: transparent;
    border: 0;
    color: var(--mks-ink);
    font: inherit;
    font-size: 16px;
    font-weight: 600;
    min-width: 0;
    outline: 0;
    width: 100%;
}

.mks-explorer__search input::placeholder {
    color: var(--mks-placeholder);
}

.mks-explorer__group {
    margin-top: 28px;
}

.mks-explorer__group-head {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin: 0 0 14px;
}

.mks-explorer__label,
.mks-explorer__bar p {
    color: var(--mks-muted);
    font-size: var(--text-s);
    font-weight: 850;
    letter-spacing: 0;
    line-height: 1.2;
    margin: 0 0 14px;
    text-transform: uppercase;
}

.mks-explorer__group-head .mks-explorer__label {
    margin: 0;
}

.mks-explorer__label {
    font-family: var(--heading-font-family);
    font-weight: 700;
}

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

.mks-explorer__chips--months {
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.mks-explorer__length-buttons {
    display: none;
}

.mks-explorer__chips button {
    align-items: center;
    background: var(--mks-chip);
    border: 1px solid transparent;
    border-radius: 14px;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-size: var(--text-s);
    font-weight: 800;
    justify-content: center;
    min-height: var(--space-m);
    padding: 5px 10px;
    position: relative;
    transition: background 140ms ease, border-color 140ms ease, color 140ms ease;
}

.mks-explorer__chips button:hover {
    background: var(--mks-chip-hover);
    color: var(--black);
}

.mks-explorer__chips button.is-active {
    background: var(--mks-chip-hover);
    border-color: var(--primary);
    color: var(--primary);
}

.mks-explorer__chips button.is-active::after {
    align-items: center;
    background: var(--primary);
    border-radius: var(--radius-circle);
    color: var(--mks-white);
    content: "✓";
    display: flex;
    font-size: calc(var(--text-s) * 0.75);
    font-weight: 800;
    height: var(--mks-check-size);
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: calc(var(--mks-check-size) / -3);
    top: calc(var(--mks-check-size) / -3);
    width: var(--mks-check-size);
}

.mks-explorer__range.is-active::after {
    align-items: center;
    background: var(--primary);
    border-radius: var(--radius-circle);
    color: var(--mks-white);
    content: "✓";
    display: flex;
    font-size: calc(var(--text-s) * 0.75);
    font-weight: 800;
    height: var(--mks-check-size);
    justify-content: center;
    line-height: 1;
    position: absolute;
    right: calc(var(--mks-check-size) / -3);
    top: calc(var(--mks-check-size) / -3);
    width: var(--mks-check-size);
}

.mks-explorer__content {
    background: var(--mks-white);
    overflow: auto;
    padding: var(--space-s);
    position: relative;
}

.mks-explorer__loader {
    align-items: center;
    background: var(--mks-content-overlay);
    display: flex;
    inset: 0;
    justify-content: center;
    position: absolute;
    z-index: 4;
}

.mks-explorer__loader[hidden] {
    display: none;
}

.mks-explorer__spinner {
    animation: mks-explorer-spin 720ms linear infinite;
    border: 3px solid var(--primary-ultra-light);
    border-radius: var(--radius-circle);
    border-top-color: var(--primary-semi-dark);
    height: 42px;
    width: 42px;
}

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

.mks-explorer__bar {
    align-items: center;
    background: var(--white);
    display: flex;
    height: 36px;
    justify-content: flex-start;
    margin-bottom: 24px;
}

.mks-explorer__bar p {
    font-weight: 700;
    margin-bottom: 0;
}

.mks-explorer__range {
    background: var(--mks-chip);
    border-radius: 14px;
    padding: 16px;
    position: relative;
}

.mks-explorer__range-value {
    color: var(--primary);
    font-size: var(--text-s);
    font-weight: 600;
    margin-bottom: 12px;
}

.mks-explorer__range input {
    accent-color: var(--primary-semi-dark);
    background: var(--mks-rail);
    border-radius: var(--radius-xl);
    display: block;
    width: 100%;
}

.mks-explorer__range-labels {
    color: var(--mks-muted);
    display: flex;
    font-size: var(--text-s);
    justify-content: space-between;
    margin-top: 8px;
}

.mks-explorer__bar button[hidden] {
    display: none;
}

.mks-explorer__grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.mks-explorer__more {
    display: flex;
    justify-content: center;
    margin: 24px auto 0;
    width: fit-content;
}

.mks-explorer__more.btn--primary {
    margin-inline: auto;
    width: fit-content;
}

.mks-explorer__more[hidden] {
    display: none;
}

.mks-explorer__card {
    aspect-ratio: 4 / 5;
    background: var(--mks-rail);
    border-radius: var(--radius-xl);
    color: var(--mks-card-text);
    display: flex;
    isolation: isolate;
    min-height: 260px;
    overflow: hidden;
    position: relative;
    text-decoration: none;
}

.mks-explorer__card::before {
    background: var(--mks-card-overlay);
    content: "";
    inset: 0;
    position: absolute;
    z-index: -1;
}

.mks-explorer__card--fallback::before {
    background: none;
}

.mks-explorer__card img {
    height: 100%;
    inset: 0;
    object-fit: cover;
    position: absolute;
    transition: transform 420ms ease;
    width: 100%;
    z-index: -2;
}

.mks-explorer__card:hover img {
    transform: scale(1.08);
}

.mks-explorer__fallback {
    align-items: center;
    background: var(--mks-rail);
    display: flex;
    inset: 0;
    justify-content: center;
    padding-bottom: 40px;
    position: absolute;
    z-index: -2;
}

.mks-explorer__fallback::before {
    background: var(--primary-semi-light);
    content: "";
    height: min(38%, 150px);
    -webkit-mask: url("/wp-content/uploads/MKS-logo-block.svg") center / contain no-repeat;
    mask: url("/wp-content/uploads/MKS-logo-block.svg") center / contain no-repeat;
    width: min(46%, 180px);
}

.mks-explorer__badge-row {
    display: flex;
    gap: 8px;
    justify-content: space-between;
    left: 16px;
    position: absolute;
    right: 16px;
    top: 16px;
}

.mks-explorer__badge {
    align-self: center;
    background: var(--mks-badge-bg);
    border-radius: var(--radius-l);
    color: var(--mks-card-text);
    font-size: calc(var(--text-l) / 1.55);
    font-weight: 400;
    max-width: 68%;
    overflow: hidden;
    padding: 0 calc(var(--space-xs) / 2);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mks-explorer__badge--new {
    background: var(--mks-accent);
    color: var(--primary-dark);
}

.mks-explorer__badge--place {
    -webkit-backdrop-filter: blur(12px) saturate(135%);
    backdrop-filter: blur(12px) saturate(135%);
    background: var(--mks-place-badge-bg);
    border: 0;
    box-shadow: var(--mks-badge-glint);
    font-weight: 400;
}

.mks-explorer__card-body {
    align-self: flex-end;
    padding: 22px 22px 11px;
    width: 100%;
}

.mks-explorer__card h4 {
    color: var(--mks-card-text);
    display: -webkit-box;
    font-weight: 900;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    line-height: 2.5rem;
    margin: 0 0 6px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mks-explorer__card p {
    color: var(--mks-card-text-muted);
    display: -webkit-box;
    font-size: var(--text-s);
    font-weight: 400;
    height: 32px;
    line-height: 1.25;
    margin: 0;
    overflow: hidden;
    text-wrap: balance;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.mks-explorer__card--fallback .mks-explorer__card-body h3,
.mks-explorer__card--fallback .mks-explorer__card-body h4,
.mks-explorer__card--fallback .mks-explorer__card-body p {
    color: var(--primary-semi-dark);
}

.mks-explorer__empty {
    margin: 12vh auto 0;
    max-width: 420px;
    text-align: center;
}

.mks-explorer__empty h3 {
    font-size: 28px;
    margin: 0 0 8px;
}

.mks-explorer__empty p {
    color: var(--mks-muted);
    font-size: 17px;
    margin: 0;
}

html.mks-explorer-lock,
body.mks-explorer-lock {
    overflow: hidden;
    overscroll-behavior: none;
}

body.mks-explorer-lock {
    left: 0;
    position: fixed;
    right: 0;
    top: var(--mks-scroll-lock-top, 0);
    width: 100%;
}

@media (max-width: 1180px) {
    .mks-explorer__scrim {
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .mks-explorer__panel {
        grid-template-columns: 320px minmax(0, 1fr);
        height: 100dvh;
        min-width: 0;
        width: 100vw;
        border-radius: 0;
    }

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

    .mks-explorer__card:hover img {
        transform: none;
    }

    .mks-explorer__actions {
        right: 16px;
        top: 20px;
    }

    .mks-explorer__close {
        height: 42px;
        width: 42px;
    }

    .mks-explorer__bar {
        padding-right: 0;
    }
}

@media (max-width: 820px) {
    .mks-explorer__panel {
        display: flex;
        flex-direction: column;
    }

    .mks-explorer__filters {
        flex: 0 0 auto;
        max-height: 48dvh;
        overflow-x: hidden;
        padding: 18px 16px 20px;
    }

    .mks-explorer__chips {
        -ms-overflow-style: none;
        scrollbar-width: none;
    }

    .mks-explorer__chips::-webkit-scrollbar {
        display: none;
        height: 0;
        width: 0;
    }

    .mks-explorer__content {
        flex: 1 1 auto;
        padding: 20px 16px 32px;
    }

    .mks-explorer__search {
        margin-right: 64px;
        min-height: 48px;
    }

    .mks-explorer__actions {
        right: var(--space-s);
        top: var(--space-s);
    }

    .mks-explorer__group {
        margin-top: calc(var(--space-xs) * 0.5);
    }

    .mks-explorer__group--travel-mode {
        margin-top: var(--space-m);
    }

    .mks-explorer__label {
        display: none;
    }

    .mks-explorer__group-head {
        justify-content: flex-end;
        margin: 0;
    }

    .mks-explorer__bar {
        height: var(--space-xs);
        justify-content: space-between;
        margin-bottom: var(--space-xs);
    }

    .mks-explorer__clear--desktop {
        display: none;
    }

    .mks-explorer__clear--mobile {
        display: inline-flex;
        min-height: var(--space-xs);
        padding-inline: 8px;
    }

    .mks-explorer__mobile-more {
        align-items: center;
        align-self: center;
        background: none;
        border: 0;
        border-radius: var(--radius-circle);
        color: var(--primary);
        cursor: pointer;
        display: flex;
        font: inherit;
        font-size: var(--text-m);
        font-weight: 800;
        gap: 10px;
        justify-content: center;
        margin: 6px auto -18px;
        min-height: var(--space-l);
        padding: 0 var(--space-l);
        width: fit-content;
    }

    .mks-explorer__mobile-more-icon {
        border-bottom: 2px solid currentColor;
        border-right: 2px solid currentColor;
        display: inline-block;
        height: 9px;
        transform: rotate(45deg) translateY(-2px);
        transition: transform 160ms ease;
        width: 9px;
    }

    .mks-explorer.is-mobile-filters-open .mks-explorer__mobile-more-icon {
        transform: rotate(225deg) translate(-2px, -1px);
    }

    .mks-explorer__mobile-more + .mks-explorer__group,
    .mks-explorer__mobile-more + .mks-explorer__group + .mks-explorer__group,
    .mks-explorer__mobile-more + .mks-explorer__group + .mks-explorer__group + .mks-explorer__group {
        display: none;
    }

    .mks-explorer.is-mobile-filters-open .mks-explorer__mobile-more + .mks-explorer__group,
    .mks-explorer.is-mobile-filters-open .mks-explorer__mobile-more + .mks-explorer__group + .mks-explorer__group,
    .mks-explorer.is-mobile-filters-open .mks-explorer__mobile-more + .mks-explorer__group + .mks-explorer__group + .mks-explorer__group {
        display: block;
    }

    .mks-explorer__chips {
        display: flex;
        gap: 8px;
        max-width: 100%;
        overflow-x: auto;
        overflow-y: hidden;
        overscroll-behavior-inline: contain;
        padding: 6px 0 2px;
        scroll-behavior: smooth;
        touch-action: pan-x;
        -webkit-overflow-scrolling: touch;
    }

    .mks-explorer.is-loading .mks-explorer__content {
        overflow: hidden;
    }

    .mks-explorer__range {
        display: none;
    }

    .mks-explorer__length-buttons {
        display: flex;
    }

    .mks-explorer__chips button {
        flex: 0 0 auto;
        min-height: var(--space-m);
        white-space: nowrap;
    }

    .mks-explorer__grid {
        gap: 14px;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .mks-explorer__card {
        aspect-ratio: 16 / 11;
        min-height: 220px;
    }

    .mks-explorer__card-body {
        padding: var(--space-xs);
    }

    .mks-explorer__card p {
        font-size: var(--text-xs);
    }
}

@media (max-width: 359px) {
    .mks-explorer__grid {
        grid-template-columns: 1fr;
    }
}
