/*
 * Aakram Elite Search - layout (positions and sizes only, no colours).
 * Values come from aes-tokens.css / the Design tab.
 */

/* the hidden attribute always wins, whatever the theme ships */
.aes-root[hidden],
.aes-root [hidden],
.aes-templates,
[class^="aes-"][hidden],
[class*=" aes-"][hidden] {
    display: none !important;
}
.aes-root,
.aes-root *,
.aes-root *::before,
.aes-root *::after {
    box-sizing: border-box;
}
html.aes-lock,
html.aes-lock body {
    overflow: hidden !important;
}

/* ---------------------------------------------------------------- search window */
.aes-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: var(--aes-z, 99999);
    display: none;
}
.aes-overlay.is-open {
    display: block;
}
.aes-backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
.aes-frame {
    position: relative;
    margin: var(--aes-top-gap, 4vh) auto 0;
    width: min(var(--aes-results-width), calc(100vw - 32px));
    max-height: calc(100vh - var(--aes-top-gap, 4vh) * 2);
    max-height: calc(100dvh - var(--aes-top-gap, 4vh) * 2);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.aes-top {
    display: grid;
    grid-template-columns: 1fr minmax(0, var(--aes-bar-width)) 1fr;
    align-items: center;
    gap: 12px;
    flex: none;
}
.aes-top > * {
    min-width: 0;
}
.aes-top__right {
    display: flex;
    justify-content: flex-end;
}
.aes-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.aes-foot {
    flex: none;
    display: flex;
    justify-content: center;
}
.aes-loadbar {
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    height: 3px;
    z-index: 3;
}
.aes-close {
    position: relative;
    flex: none;
}

/* blocks */
.aes-rows {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 14px 28px;
}
.aes-rows__col:empty {
    display: none;
}
.aes-rows--single,
.aes-rows:has(> .aes-rows__col:empty) {
    grid-template-columns: minmax(0, 1fr);
}
.aes-chips {
    display: flex;
    flex-wrap: wrap;
}
.aes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(var(--aes-card-min), 100%), 1fr));
    gap: var(--aes-gap);
}
.aes-card {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.aes-card__media {
    position: relative;
    display: block;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.aes-card__img {
    display: block;
    width: 100%;
    height: 100%;
}
.aes-card__noimg {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
.aes-card__body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-width: 0;
}
.aes-card__actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
}
.aes-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    overflow: hidden;
}
.aes-banner--image {
    display: block;
}
.aes-banner__img {
    display: block;
    width: 100%;
    height: 100%;
}

/* ---------------------------------------------------------------- dropdown variant (desktop) */
.aes-overlay--dropdown {
    position: absolute;
    top: auto;
    right: auto;
    bottom: auto;
    left: auto;
    left: 0;
    top: 0;
    width: 0;
    height: 0;
}
.aes-overlay--dropdown .aes-backdrop {
    position: fixed;
}
.aes-overlay--dropdown .aes-frame {
    position: absolute;
    margin: 0;
    max-height: 80vh;
}
.aes-overlay--dropdown .aes-top {
    display: none;
}
.aes-overlay--dropdown .aes-frame__close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 4;
}

/* ---------------------------------------------------------------- header search box */
.aes-hbar {
    position: relative;
    width: 100%;
    max-width: var(--aes-hbar-width);
    margin-left: auto;
    margin-right: auto;
}
.aes-hbar--swap {
    display: none;
}
html.aes-ts-all .aes-hbar--swap {
    display: block;
}
html.aes-ts-all .aes-ts-hidden {
    display: none !important;
}
@media (min-width: 768px) {
    html.aes-ts-desktop .aes-hbar--swap {
        display: block;
    }
    html.aes-ts-desktop .aes-ts-hidden {
        display: none !important;
    }
}

/* ---------------------------------------------------------------- Quick View */
.aes-qv {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: calc(var(--aes-z, 99999) + 2);
    display: none;
    align-items: center;
    justify-content: center;
}
.aes-qv.is-open {
    display: flex;
}
.aes-qv__backdrop {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
}
.aes-qv__box {
    position: relative;
    width: min(var(--aes-qv-width), calc(100vw - 32px));
    max-height: 90vh;
    max-height: 90dvh;
    overflow: auto;
    overscroll-behavior: contain;
    display: grid;
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
}
.aes-qv__close {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
}
.aes-qv__main {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}
.aes-qv__img {
    display: block;
    width: 100%;
    height: 100%;
}
.aes-qv__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}
.aes-qv__loading {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}
.aes-toast {
    position: fixed;
    left: 50%;
    bottom: 24px;
    z-index: calc(var(--aes-z, 99999) + 5);
}
.aes-sr {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
.aes-captcha {
    position: fixed;
    right: 0;
    bottom: 0;
    z-index: calc(var(--aes-z, 99999) + 4);
}

/* ---------------------------------------------------------------- phones: full screen, 2 columns */
@media (max-width: 767px) {
    .aes-overlay .aes-frame,
    .aes-overlay--dropdown .aes-frame {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100vw;
        height: 100%;
        max-height: none;
        margin: 0;
    }
    .aes-overlay--dropdown {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        height: auto;
    }
    .aes-overlay--dropdown .aes-top {
        display: grid;
    }
    .aes-top {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
    }
    .aes-top__left {
        display: none;
    }
    .aes-rows {
        grid-template-columns: minmax(0, 1fr);
    }
    .aes-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .aes-card__actions {
        display: flex;
        justify-content: flex-end;
    }
    .aes-foot {
        position: sticky;
        bottom: 0;
    }
    .aes-qv {
        align-items: stretch;
    }
    .aes-qv__box {
        width: 100vw;
        height: 100%;
        max-height: none;
        grid-template-columns: minmax(0, 1fr);
        align-content: start;
    }
    .aes-overlay.aes-overlay--no-fullscreen .aes-frame {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        left: auto;
        width: calc(100vw - 16px);
        height: auto;
        max-height: calc(100vh - 16px);
        margin: 8px auto 0;
    }
}

/* the theme's own suggestion lists are replaced by the search window */
.searchbar-autocomplete {
    display: none !important;
}
