/* /css/game-search-popup.css
   Popup de busqueda y filtros (goldenpark-game-search-popup.vm + /js/game-search-popup.js).*/

.gsp[hidden],
.gsp [hidden] {
    display: none !important;
}
html.gsp-open {
    overflow: hidden;
}

.gsp {
    position: fixed;
    inset: 0;
    z-index: 1000;
    font-family: inherit;
    color: #fff;
}
.gsp-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    transition: opacity .2s ease;
}
.gsp-dialog {
    position: absolute;
    inset: 16px;
    max-width: 1500px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    background: #141414;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    overflow: hidden;
    opacity: 0;
    transform: translateY(12px);
    transition: opacity .2s ease, transform .25s cubic-bezier(0.22, 1, 0.36, 1);
}
.gsp.is-visible .gsp-backdrop { opacity: 1; }
.gsp.is-visible .gsp-dialog { opacity: 1; transform: none; }

/* ----- barra superior: filtros (mobile) + buscador + cerrar ----- */
.gsp-top {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    flex-shrink: 0;
}
.gsp-search {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 4px;
    background: rgba(255, 255, 255, 0.04);
    border-bottom: 1px solid #e60881;
}
.gsp-search-input {
    flex: 1;
    min-width: 0;
    padding: 10px 4px 10px 10px;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-family: inherit;
    outline: none;
}
.gsp-search-input::placeholder { color: rgba(255, 255, 255, 0.4); }
.gsp-search-clear,
.gsp-search-button,
.gsp-close,
.gsp-filters-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
}
.gsp-search-clear { width: 26px; height: 26px; color: rgba(255, 255, 255, 0.45); }
.gsp-search-clear:hover { color: #fff; }
.gsp-search-button { width: 34px; height: 34px; margin-right: 4px; color: #e60881; }
.gsp-close { width: 40px; height: 40px; border-radius: 5px; background: rgba(255, 255, 255, 0.06); }
.gsp-close:hover { background: rgba(255, 255, 255, 0.12); }
.gsp-filters-toggle { position: relative; width: 36px; height: 36px; display: none; }
.gsp-filters-toggle img { width: 22px; height: 22px; filter: brightness(0) invert(1); }
.gsp-filters-count {
    position: absolute;
    top: 1px;
    right: 0;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    box-sizing: border-box;
    border-radius: 999px;
    background: #e60881;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    box-shadow: 0 0 0 2px #141414;
}

/* ----- cuerpo: filtros + resultados ----- */
.gsp-body {
    flex: 1;
    min-height: 0;
    display: flex;
}
.gsp-filters {
    width: 270px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    border-right: 1px solid rgba(255, 255, 255, 0.08);
    background: #1a1a1a;
    min-height: 0;
}
.gsp-filters-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px 16px;
    flex-shrink: 0;
}
.gsp-filters-head span { font-size: 15px; font-weight: 700; text-transform: uppercase; }
.gsp-filters-clear,
.gsp-filters-done {
    height: 32px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 5px;
    background: transparent;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
}
.gsp-filters-clear:disabled { border-color: rgba(255, 255, 255, 0.12); color: rgba(255, 255, 255, 0.3); cursor: default; }
.gsp-filters-done { display: none; background: #e60881; border-color: #e60881; font-weight: 700; }
.gsp-filters-groups {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 0 16px 20px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.gsp-group + .gsp-group { margin-top: 18px; }
.gsp-group-title {
    position: relative;
    display: block;
    padding: 6px 30px 6px 10px;
    margin-bottom: 8px;
    border-radius: 3px;
    background: #1e1e1e;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.85);
    cursor: pointer;
    user-select: none;
}
/* Flecha de plegar/desplegar (misma que la pagina de filtros) */
.gsp-group-title::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 10px;
    width: 14px;
    height: 9px;
    margin-top: -4.5px;
    background: url("/img/layout/icons/desplegar.svg") center / 14px auto no-repeat;
    transform: rotate(180deg);
    transition: transform .2s linear;
}
.gsp-group.is-collapsed .gsp-group-title::after { transform: none; }
.gsp-group.is-collapsed .gsp-options { display: none; }
.gsp-options { display: flex; flex-direction: column; gap: 6px; padding: 0 6px; }
.gsp-option {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    cursor: pointer;
    min-width: 0;
}
/* reveal-mobile.css da a todo input padding 5px 10px, width 69% y borde gris, y a los
   checkbox width: 20px !important: se anula aqui */
.gsp-option input {
    appearance: none;
    -webkit-appearance: none;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 14px !important;
    min-width: 0;
    max-width: none;
    height: 14px;
    margin: 0;
    padding: 0;
    border: 1px solid #fff;
    border-radius: 2px;
    background-color: transparent;
    cursor: pointer;
}
.gsp-option input:checked { background-color: #e60881; border-color: #e60881; }
.gsp-option-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gsp-option-count { flex-shrink: 0; font-size: 11px; color: rgba(255, 255, 255, 0.35); }
.gsp-option.is-disabled { opacity: .35; }

.gsp-results {
    position: relative;
    z-index: 0;
    flex: 1;
    min-width: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 16px;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.3) transparent;
}
.gsp-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    overflow-x: auto;
    scrollbar-width: none;
}
.gsp-chips::-webkit-scrollbar { display: none; }
.gsp-chips-title { flex-shrink: 0; align-self: center; width: 3px; height: 20px; background: #e60881; }
.gsp-chips-list { display: flex; gap: 6px; }
.gsp-chip {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 14px;
    background: #282828;
    color: #fff;
    font-family: inherit;
    font-size: 14px;
    white-space: nowrap;
    cursor: pointer;
}
.gsp-chip::after {
    content: "";
    width: 12px;
    height: 12px;
    background: url("/img/layout/icons/X.png") center / 12px auto no-repeat;
}
.gsp-loading { display: flex; justify-content: center; padding: 80px 0; }
.gsp-loading img { width: 110px; }

/* ----- tarjetas (mismo aspecto que la pagina de filtros) ----- */
.gsp-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(146px, 1fr));
    gap: 16px;
    align-content: start;
}
.gsp-card {
    position: relative;
    margin: 0;
    min-width: 0;
}
.gsp-card-link { display: block; position: relative; color: #fff; text-decoration: none; }
.gsp-card-image { position: relative; line-height: 0; margin-bottom: 5px; aspect-ratio: 146 / 230; overflow: hidden; border-radius: 3px; background: #1e1e1e; }
.gsp-card-image img { width: 100%; height: 100%; object-fit: cover; }
.gsp-card-disabled {
    position: absolute;
    inset: 0;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
}
.gsp-card-disabled p { margin: 0; text-align: center; line-height: normal; }
/* Bote de Amusnet sobre la imagen, como en la home (jackpots.css) */
.gsp-card-jackpot {
    position: absolute;
    left: 50%;
    bottom: 8px;
    z-index: 1;
    transform: translateX(-50%);
    max-width: 90%;
    padding: 1.5px 10px;
    box-sizing: border-box;
    border: 1px solid #F8DE6F;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.8);
    color: #fff;
    font-family: var(--roboto-bold, inherit);
    font-size: 14px;
    line-height: normal;
    white-space: nowrap;
}
.gsp-card-jackpot:empty { display: none; }
.gsp-card-caption span {
    display: block;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-family: "Roboto Bold Condensed", inherit;
    font-size: 15px;
}
.gsp-card-caption .gsp-card-provider {
    width: calc(100% - 52px);
    font-family: var(--roboto-regular-condensed, inherit);
    color: #ababab;
}
.gsp-card-fav,
.gsp-card-info { position: absolute; bottom: 0; line-height: 0; cursor: pointer; }
.gsp-card-fav { right: 25px; }
.gsp-card-info { right: 0; }
.gsp-card-fav img,
.gsp-card-info img { width: 20px; height: 20px; }

/* ----- sin resultados + recomendados ----- */
.gsp-empty { padding: 40px 0 24px; text-align: center; }
.gsp-empty-title { margin: 0 0 6px; font-size: 18px; font-weight: 700; }
.gsp-empty-subtitle { margin: 0; color: rgba(255, 255, 255, 0.55); font-size: 14px; }
.gsp-recommended { margin-top: 36px; text-align: left; }
.gsp-recommended-title {
    display: block;
    margin: 0 0 12px;
    padding-left: 10px;
    border-left: 3px solid #e60881;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: .5px;
    text-transform: uppercase;
}

/* ===== MOBILE / TABLET ===== */
@media (max-width: 1279px) {
    .gsp-dialog {
        inset: 0;
        border: 0;
        border-radius: 0;
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
    }
    .gsp-top { padding: 8px 12px; gap: 8px; }
    .gsp-search-input { font-size: 16px; } /* evita el zoom de iOS al enfocar */
    .gsp-filters-toggle { display: inline-flex; }

    /* Filtros como panel que se despliega sobre los resultados */
    .gsp-body { position: relative; }
    .gsp-filters {
        position: absolute;
        inset: 0;
        z-index: 2;
        width: auto;
        border-right: 0;
        transform: translateX(-100%);
        visibility: hidden;
        transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s linear .3s;
    }
    .gsp.filters-open .gsp-filters {
        transform: none;
        visibility: visible;
        transition: transform .3s cubic-bezier(0.22, 1, 0.36, 1), visibility 0s;
    }
    .gsp-filters-done { display: inline-block; }
    .gsp-options {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 10px 8px;
    }
    .gsp-option { width: calc(50% - 4px); }

    .gsp-results { padding: 12px 8px; }
    .gsp-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 8px;
    }
    .gsp-card-caption span { font-size: clamp(12px, 3.4vw, 14px); }
    .gsp-card-caption .gsp-card-provider { font-size: clamp(11px, 3vw, 13px); }
    .gsp-card-jackpot { bottom: 5px; padding: 1px 5px; font-size: clamp(9px, 2.6vw, 12px); }
    .gsp-card-fav img,
    .gsp-card-info img { width: 18px; height: 18px; }
}

@media (max-width: 1279px) and (orientation: landscape) {
    .gsp-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); }
    .gsp-card-caption span { font-size: clamp(11px, 1.6vw, 14px); }
    .gsp-card-caption .gsp-card-provider { font-size: clamp(10px, 1.4vw, 13px); }
}

@media (min-width: 1280px) {
    /* Filtros a toda altura en la columna izquierda; el buscador queda encima de
       los resultados y alineado con las tarjetas (mismo padding lateral de 16px) */
    .gsp-dialog {
        display: grid;
        grid-template-columns: 270px minmax(0, 1fr);
        grid-template-rows: auto minmax(0, 1fr);
    }
    .gsp-body { display: contents; }
    .gsp-filters { grid-column: 1; grid-row: 1 / -1; }
    .gsp-top { grid-column: 2; grid-row: 1; }
    .gsp-results { grid-column: 2; grid-row: 2; }
    .gsp-filters-head {
        box-sizing: border-box;
        height: 65px; /* alto de .gsp-top (12 + 40 + 12 + 1 de borde) */
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }
    .gsp-filters-head span { order: -1; } /* FILTRAR a la izquierda, LIMPAR a la derecha */
    .gsp-filters-groups { padding-top: 12px; }

    .gsp-chips {
        align-items: flex-start;
        overflow-x: visible;
    }
    .gsp-chips-title { align-self: flex-start; margin-top: 4px; }
    .gsp-chips-list {
        flex-wrap: wrap;
        min-width: 0;
    }
}