.mks-wrap {
    width: 100%;
    box-sizing: border-box;
}

.mks-wrap *,
.mks-wrap *::before,
.mks-wrap *::after {
    box-sizing: border-box;
}

.mks-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--mks-gap, 10px);
    margin: 0 0 24px;
    padding: 0;
}

.mks-wrap .mks-filter-btn {
    appearance: none;
    -webkit-appearance: none;
    background: #ffffff;
    color: #00aea9;
    border: 2px solid #00aea9;
    border-radius: 999px;
    font-size: 17px;
    font-weight: 600;
    padding: 10px 22px;
    cursor: pointer;
    line-height: 1.2;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
    font-family: inherit;
    white-space: nowrap;
    user-select: none;
    -webkit-user-select: none;
}

.mks-wrap .mks-filter-btn:hover,
.mks-wrap .mks-filter-btn:focus-visible {
    background: #00aea9;
    color: #ffffff;
    border-color: #00aea9;
    outline: none;
}

.mks-wrap .mks-filter-btn.is-active {
    background: #00aea9;
    color: #ffffff;
    border-color: #00aea9;
}

/* Wrapper that hosts navigation arrows */
.mks-filters-wrapper {
    position: relative;
    margin: 0 0 24px;
}
.mks-filters-wrapper > .mks-filters {
    margin: 0;
}

/* Carousel mode for filters when they overflow */
.mks-filters-carousel {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    cursor: grab;
    padding: 4px 12px;
    margin-left: -12px;
    margin-right: -12px;
    scroll-snap-type: x proximity;
    mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 16px, #000 calc(100% - 16px), transparent 100%);
}

/* Navigation arrows */
.mks-filters-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    border: 1px solid #00aea9;
    background: #ffffff;
    color: #00aea9;
    font-size: 16px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.08);
    padding: 0;
    transition: background-color .2s ease, color .2s ease, opacity .2s ease;
}
.mks-filters-arrow:hover,
.mks-filters-arrow:focus-visible {
    background: #00aea9;
    color: #ffffff;
    outline: none;
}
.mks-filters-arrow-prev { left: -4px; }
.mks-filters-arrow-next { right: -4px; }

.mks-filters-wrapper.has-prev .mks-filters-arrow-prev { display: inline-flex; }
.mks-filters-wrapper.has-next .mks-filters-arrow-next { display: inline-flex; }

@media (max-width: 768px) {
    .mks-filters-arrow { display: none !important; }
}

/* ===== Stage mode (mobile / tablet) =====
   Mobile: jeden przycisk wycentrowany pomiędzy strzałkami.
   Tablet: trzy przyciski (poprzedni / aktywny / następny) wycentrowane,
   środkowy zawsze idealnie na środku, strzałki na zewnątrz.
*/
@media (max-width: 1024px) {
    /* Wrapper zmienia się we flex: strzałka | filtr | strzałka,
       dzięki czemu strzałki zawsze przylegają do bieżącego tematu. */
    .mks-filters-wrapper.is-stage {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 18px;
        padding: 0;
        touch-action: pan-y;
    }
    .mks-filters-wrapper.is-stage > .mks-filters {
        flex: 0 1 auto;
        width: auto;
        max-width: 100%;
        order: 2;
        will-change: width;
        transition: width .3s cubic-bezier(.4, 0, .2, 1);
    }
    .mks-filters-wrapper.is-stage .mks-filters-arrow-prev { order: 1; }
    .mks-filters-wrapper.is-stage .mks-filters-arrow-next { order: 3; }

    .mks-filters-wrapper.is-stage .mks-filters-arrow {
        display: inline-flex !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        transform: none !important;
        flex: 0 0 auto;
        width: 42px;
        height: 42px;
        border-radius: 999px;
        border: 2px solid #00aea9;
        background: #ffffff;
        color: #00aea9;
        font-size: 18px;
        font-weight: 700;
        line-height: 1;
        padding: 0;
        box-shadow: 0 2px 6px rgba(0, 0, 0, .08);
        opacity: 1;
        transition: background-color .2s ease, color .2s ease, transform .25s ease, opacity .25s ease, box-shadow .2s ease;
    }
    .mks-filters-wrapper.is-stage .mks-filters-arrow:hover,
    .mks-filters-wrapper.is-stage .mks-filters-arrow:focus-visible {
        background: #00aea9;
        color: #ffffff;
        opacity: 1;
    }

    /* Krańce: strzałka zostaje widoczna, ale wyciszona — sygnał, że nie da się dalej. */
    .mks-filters-wrapper.is-stage.is-stage-edge-start .mks-filters-arrow-prev,
    .mks-filters-wrapper.is-stage.is-stage-edge-end .mks-filters-arrow-next {
        opacity: .35;
        cursor: not-allowed;
        box-shadow: none;
    }
    .mks-filters-wrapper.is-stage.is-stage-edge-start .mks-filters-arrow-prev:hover,
    .mks-filters-wrapper.is-stage.is-stage-edge-start .mks-filters-arrow-prev:focus-visible,
    .mks-filters-wrapper.is-stage.is-stage-edge-end .mks-filters-arrow-next:hover,
    .mks-filters-wrapper.is-stage.is-stage-edge-end .mks-filters-arrow-next:focus-visible {
        background: #ffffff;
        color: #00aea9;
        opacity: .35;
    }

    /* Animacja: strzałki rozsuwają się na zewnątrz przed wjazdem nowego tematu. */
    .mks-filters-wrapper.is-stage.is-stage-anim-next .mks-filters-arrow-next {
        transform: translateX(8px) !important;
    }
    .mks-filters-wrapper.is-stage.is-stage-anim-next .mks-filters-arrow-prev {
        transform: translateX(-4px) !important;
    }
    .mks-filters-wrapper.is-stage.is-stage-anim-prev .mks-filters-arrow-prev {
        transform: translateX(-8px) !important;
    }
    .mks-filters-wrapper.is-stage.is-stage-anim-prev .mks-filters-arrow-next {
        transform: translateX(4px) !important;
    }

    .mks-filters.mks-filters-stage {
        flex-wrap: nowrap;
        justify-content: center;
        align-items: center;
        overflow: hidden;
        cursor: grab;
        padding: 4px 0;
        margin: 0;
        min-height: 48px;
        position: relative;
        mask-image: none;
        -webkit-mask-image: none;
        scroll-snap-type: none;
        user-select: none;
        -webkit-user-select: none;
        touch-action: pan-y;
    }
    .mks-filters.mks-filters-stage.is-swiping {
        cursor: grabbing;
    }

    .mks-filters.mks-filters-stage .mks-filter-btn {
        display: none;
        flex: 0 0 auto;
        scroll-snap-align: none;
        transition: opacity .25s ease, transform .25s ease;
    }
    .mks-filters.mks-filters-stage .mks-filter-btn.is-stage-current {
        display: inline-flex;
        opacity: 1;
        transform: translateX(0);
    }

    .mks-filters.mks-filters-stage.is-stage-anim-next .mks-filter-btn.is-stage-current {
        animation: mksStageInRight .3s ease both;
    }
    .mks-filters.mks-filters-stage.is-stage-anim-prev .mks-filter-btn.is-stage-current {
        animation: mksStageInLeft .3s ease both;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .mks-filters.mks-filters-stage .mks-filter-btn.is-stage-prev,
    .mks-filters.mks-filters-stage .mks-filter-btn.is-stage-next {
        display: inline-flex;
        opacity: .55;
        margin: 0 6px;
    }
    .mks-filters.mks-filters-stage.is-stage-anim-next .mks-filter-btn.is-stage-prev,
    .mks-filters.mks-filters-stage.is-stage-anim-next .mks-filter-btn.is-stage-next {
        animation: mksStageInRight .3s ease both;
    }
    .mks-filters.mks-filters-stage.is-stage-anim-prev .mks-filter-btn.is-stage-prev,
    .mks-filters.mks-filters-stage.is-stage-anim-prev .mks-filter-btn.is-stage-next {
        animation: mksStageInLeft .3s ease both;
    }
}

@keyframes mksStageInRight {
    from { opacity: 0; transform: translateX(36px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes mksStageInLeft {
    from { opacity: 0; transform: translateX(-36px); }
    to   { opacity: 1; transform: translateX(0); }
}
@media (min-width: 769px) and (max-width: 1024px) {
    @keyframes mksStageInRight {
        from { opacity: 0; transform: translateX(36px); }
        to   { opacity: .55; transform: translateX(0); }
    }
    @keyframes mksStageInLeft {
        from { opacity: 0; transform: translateX(-36px); }
        to   { opacity: .55; transform: translateX(0); }
    }
}

@media (prefers-reduced-motion: reduce) {
    .mks-filters.mks-filters-stage .mks-filter-btn,
    .mks-filters-wrapper.is-stage .mks-filters-arrow {
        animation: none !important;
        transition: none !important;
    }
}

.mks-filters-carousel::-webkit-scrollbar {
    display: none;
    height: 0;
}

.mks-filters-carousel.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
}

.mks-filters-carousel.is-dragging .mks-filter-btn {
    pointer-events: none;
}

.mks-filters-carousel .mks-filter-btn {
    flex: 0 0 auto;
    scroll-snap-align: center;
}

@media (max-width: 768px) {
    .mks-wrap .mks-filter-btn {
        font-size: 16px;
    }
}

.mks-grid {
    position: relative;
    width: 100%;
}

.mks-item {
    width: calc(100% / var(--mks-cols-pc, 4));
    padding: 12px;
    display: block;
    text-decoration: none;
    color: inherit;
    perspective: 1200px;
}

a.mks-item { cursor: pointer; }

/* ===== Flip card ===== */
.mks-item-flip {
    position: relative;
    width: 100%;
    aspect-ratio: 3 / 2;
    transform-style: preserve-3d;
    transition: transform .6s cubic-bezier(.4, 0, .2, 1);
    will-change: transform;
}

.mks-item.has-contact:hover .mks-item-flip,
.mks-item.has-contact:focus-within .mks-item-flip,
.mks-item.has-contact.is-flipped .mks-item-flip {
    transform: rotateY(180deg);
}

.mks-card-face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    border-radius: var(--mks-popup-radius, 0);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.mks-card-front {
    background: #fff;
    border: 1px solid transparent;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.mks-item:hover .mks-card-front,
.mks-item:focus-within .mks-card-front {
    cursor:pointer;
}

.mks-card-front img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    min-width: 0;
    min-height: 0;
}

.mks-card-back {
    background: var(--mks-popup-bg, #ffffff);
    color: var(--mks-popup-color, #000000);
   
    transform: rotateY(180deg);
    padding: 16px 13px 16px;
    justify-content: start;
    align-items: stretch;
}

.mks-popup-number {
    top: 10px;
    left: 10px;
    width: 30px;
    height: 30px;
    border: 1.5px solid #000000;
    color:  #000000;
    background: var(--mks-popup-num-bg, transparent);
    border-radius: 0%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    line-height: 1;
}

.mks-popup-contacts {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
    margin-top: 4px;
}

.mks-popup-row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--mks-popup-link, #000000);
    text-decoration: none;
    font-size: 13px;
    line-height: 1.3;
    word-break: break-word;
    transition: color .2s ease, transform .15s ease;
}

.mks-popup-row:hover,
.mks-popup-row:focus-visible {
    color: var(--mks-popup-link, #000000);
    text-decoration: underline;
    outline: none;
}

.mks-popup-icon {
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--mks-popup-icon, #00aea9);
}

.mks-popup-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.mks-popup-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.mks-popup-text {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.mks-top-card{
	margin-bottom:5%;
}


@media (max-width: 1160px) {
    .mks-item { width: calc(100% / 3); }
}




@media (max-width: 1024px) {
    .mks-item { width: calc(100% / var(--mks-cols-tablet, 2)); }
}

@media (max-width: 768px) {


.mks-item:hover .mks-card-front,
.mks-item:focus-within .mks-card-front {
    border-color: transparent;
}


	.mks-card-back {
		   justify-content: center;	
		border: none;
	}

	.mks-card-back:hover {

		border: none;
	}

    .mks-item { width: calc(100% / var(--mks-cols-mobile, 2)); }
    .mks-item-flip { aspect-ratio: 5 / 4; }
    .mks-card-back {
        padding: 10px 8px 10px 8px;
    }
    .mks-popup-number {
        top: 6px;
        left: 6px;
        width: 26px;
        height: 26px;
        font-size: 12px;
        border-width: 1.5px;
    }
    .mks-popup-contacts {
        
        gap: 5px;
    }
    .mks-popup-row {
        font-size: 12.5px;
        line-height: 1.3;
        gap: 7px;
    }
    .mks-popup-icon {
        flex: 0 0 18px;
        width: 18px;
        height: 18px;
    }
    .mks-popup-text, .mks-popup-title {
        font-size: 12px;
        word-break: break-all;
    }
}

@media (max-width: 480px) {
    .mks-popup-row { font-size: 11.5px; }
    .mks-popup-text { font-size: 11px; }
}


@media (prefers-reduced-motion: reduce) {
    .mks-item-flip { transition: none; }
}

/* Shuffle helper */
.mks-grid.shuffle { overflow: visible; }

/* ===== Progress bar (mks_progress shortcode) ===== */
.mks-progress-wrap {
    position: relative;
    width: 100%;
    height: 56px;
    border: 2px solid var(--mks-prog-color, #00b2b1);
    border-radius: 999px;
    background: #ffffff;
    overflow: hidden;
    box-sizing: border-box;
}

.mks-progress-bar {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 0;
    background: var(--mks-prog-color, #00b2b1);
    border-radius: 0;
}

.mks-progress-label {
    position: relative;
    z-index: 1;
    display: block;
    height: 100%;
    text-align: center;
    line-height: 52px;
    font-weight: 700;
    font-size: 18px;
    color: var(--mks-prog-color, #00b2b1);
    mix-blend-mode: difference;
    filter: invert(1);
}

@media (prefers-reduced-motion: reduce) {
    .mks-progress-bar { transition: none; }
}

/* ===== Mobile scroll for legend (.mc_list) ===== */
@media (max-width: 767px) {
    .mc_list {
        max-height: calc(7 * 46px);
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
        scroll-behavior: smooth;
        padding-right: 6px;
        scrollbar-width: thin;
        scrollbar-color: #00aea9 #e6f6f5;
    }
    .mc_list::-webkit-scrollbar { width: 6px; }
    .mc_list::-webkit-scrollbar-track { background: #e6f6f5; }
    .mc_list::-webkit-scrollbar-thumb { background: #00aea9; }
    .mc_list::-webkit-scrollbar-thumb:hover { background: #008e8a; }

    .mc-list-search {
        margin: 8px 0 10px;
        padding: 0 2px;
    }
    .mc-list-search-input {
        width: 100%;
        height: 40px;
        padding: 8px 14px;
        font-size: 14px;
        line-height: 1.2;
        border: 1.5px solid #00aea9;
        border-radius: 999px;
        background: #fff;
        color: #000;
        outline: none;
        box-sizing: border-box;
        -webkit-appearance: none;
        appearance: none;
    }
    .mc-list-search-input:focus {
        border-color: #008e8a;
        box-shadow: 0 0 0 2px rgba(0, 174, 169, .18);
    }
    .mc-list-search-input::placeholder {
        color: #8a8a8a;
    }
}