/* Kogumi wrapper */
.abc-collection-wrapper {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    /* Kui kogum asub konteineris, mille kõrgus on määratud (nt 100vh/Elementor sektsioon),
       siis lase kogumil võtta konteineri kõrgus – muidu võib JS mõõtmise hetkel saada
       "väikese" kõrguse ja suruda nupud kokku. */
    height: 100%;
    min-height: 0;
}

/* Tulbad (CSS grid) */
.abc-columns {
    display: grid;
    grid-template-columns: repeat(var(--abc-cols-desktop, 4), 1fr);
    width: 100%;
    box-sizing: border-box;
    flex: 1 1 auto;
    height: 100%;
    min-height: 0;
}

@media (max-width: 768px) {
    .abc-columns {
        grid-template-columns: repeat(var(--abc-cols-mobile, 3), 1fr);
    }
}

/* Tulp – täiskõrgus, flex-konteiner + 100% lai kogumi sees */
.abc-column {
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    min-height: 0;
}

/* (saab kasutada, kui tahad, aga JS paneb span'id inline-stiilis) */
.abc-column.abc-col-single-row {
    grid-column: 1 / -1;
}

/* Nupud – täidavad tulba kõrguse */
.abc-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100%;
    text-decoration: none;
    box-sizing: border-box;
    border: none;
    cursor: pointer;
    transition: filter 0.15s ease-in-out;
    flex: 1 1 auto;
    /* Kui kogumis on määratud border-radius, siis lõika ka sisu (sh sisupilt) nurkadest */
    overflow: hidden;
}

/* Kui nupule on määratud kindel kõrgus (adminis “Nupu kõrgus”),
   siis ära sunni seda flexiga automaatselt venima – lase height'il töötada.
   Ülejäänud nupud täidavad ülejäänud kõrguse edasi (flex: 1). */
.abc-button.abc-button-has-height {
    flex: 0 1 auto;
}

.abc-button:hover {
    filter: brightness(1.05);
}

.abc-button-disabled {
  pointer-events: none;
  cursor: default;
  filter: none;
}

.abc-button-disabled:hover {
  filter: none;
}

/* Nupu tekst – ära tükelda sõnu + sinu padding */
.abc-button-label {
    display: block;
    text-align: center;
    white-space: normal;
    word-break: keep-all;
    overflow-wrap: normal;
    hyphens: none;
    padding: 10px 4px;
}

/* Nupu sisu pilt (teksti asemel) */
.abc-button-innerimage {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;
    overflow: hidden;
}

.abc-button-innerimage img {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: inherit;

    object-position: top;
}

/* Filtri nupud */
.abc-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.abc-filter-btn {
    position: relative;
    border: 1px solid #ccd0d4;
    background: #f5f5f5;
    padding: 3px 8px 3px 10px;
    border-radius: 12px;
    font-size: 13px;
    cursor: pointer;
}

.abc-filter-btn._active {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

/* vaikimisi ilma parema paddinguta */
.abc-filter-label {
    padding-right: 0;
}

/* padding ainult aktiivsel filtril (kui X nähtav) */
.abc-filter-btn._active .abc-filter-label {
    padding-right: 14px;
}

/* X nupp – ainult aktiivsel filtril */
.abc-filter-clear {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    font-weight: bold;
    font-size: 13px;
    display: none;
}

.abc-filter-btn._active .abc-filter-clear {
    display: inline-block;
}

/* filtriga peidetud elemendid */
.abc-button-hidden {
    display: none !important;
}
.abc-column-hidden {
    display: none !important;
}

/* Popup overlay – alati üle ekraani */
.abc-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.18s ease-in-out, visibility 0.18s ease-in-out;
}

.abc-popup-overlay._visible {
    opacity: 1;
    visibility: visible;
}

/* Popup sisu */
.abc-popup-inner {
    position: relative;
    background: #fff;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    max-width: 100%;
    max-height: 100%;
    overflow: visible; /* et X nupp ei lõigataks ära */
}

/* Sinu X nupp */
.abc-popup-close {
    position: absolute;
    top: -50px;
    right: 0px;
    border: none;
    background: #FFF;
    font-size: 35px;
    cursor: pointer;
    line-height: 1;
    z-index: 100;
    padding: 5px 20px;
}

.abc-popup-close:hover {
    background: #eee;
}

/* iframe wrap + iframe */
.abc-popup-frame-wrap {
    flex: 1 1 auto;
    min-height: 0;
    box-sizing: border-box;
    background: #fff;
}

.abc-popup-iframe {
    border: none;
    width: 100%;
    height: 100%;
    display: block;
}

/* Caption alati popupis sees, taustaga #fff */
.abc-popup-caption {
    flex: 0 0 auto;
    font-size: 14px;
    color: #000;
    text-align: center;
    background: #fff;
    padding: 8px 12px;
    box-sizing: border-box;
}

.abc-popup-caption.abc-caption-hidden {
    display: none;
}

@media (max-width: 768px) {
    .abc-popup-inner {
        max-width: 100vw;
        max-height: 100vh;
    }
}