.st-collection-controls {
    display: flex;
    align-items: stretch;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.st-collection-sort,
.st-variant-filters {
    width: auto;
}

body.theme-store .st-collection-control-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    width: auto;
    min-height: 38px;
    padding: 7px 11px;
    border: 1px solid var(--st-border);
    border-radius: 9px;
    background: var(--st-bg);
    color: var(--st-fg);
    font-family: var(--st-sans);
    font-size: 13px;
    font-weight: 650;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

body.theme-store .st-collection-control-button:hover {
    border-color: var(--st-border-strong);
    background: var(--st-bg-alt);
}

.st-collection-control-button > i:first-child {
    color: var(--st-fg-soft);
    font-size: 14px;
}

.st-collection-control-button > span:nth-child(2) {
    line-height: 1;
}

.st-collection-control-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--st-accent-bg);
    color: var(--st-accent-fg);
    font-size: 10px;
    font-weight: 800;
}

.st-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 32px 0 8px;
    padding-top: 24px;
    border-top: 1px solid var(--st-border);
}

.st-pagination-pages {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

body.theme-store .st-pagination-page,
body.theme-store .st-pagination-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--st-border-strong);
    border-radius: var(--st-radius);
    background: var(--st-bg);
    color: var(--st-fg);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.theme-store a.st-pagination-page:hover,
body.theme-store a.st-pagination-arrow:hover {
    background: var(--st-bg-alt);
    border-color: var(--st-fg);
    color: var(--st-fg);
}

body.theme-store .st-pagination-page.is-current {
    background: var(--st-accent-bg);
    border-color: var(--st-accent-bg);
    color: var(--st-accent-fg);
}

body.theme-store .st-pagination-arrow.is-disabled {
    opacity: 0.45;
    cursor: default;
}

.st-pagination-gap {
    display: inline-flex;
    align-items: flex-end;
    justify-content: center;
    min-width: 24px;
    height: 42px;
    padding-bottom: 12px;
    color: var(--st-fg-muted);
    font-size: 14px;
    font-weight: 600;
}

.st-collection-modal[hidden] {
    display: none;
}

.st-collection-modal {
    position: fixed;
    z-index: 1600;
    inset: 0;
    display: grid;
    place-items: center;
    padding: 20px;
}

body.theme-store .st-collection-modal__backdrop {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
    background: rgba(15, 23, 42, 0.2);
    cursor: default;
    backdrop-filter: blur(6px);
}

.st-collection-modal__dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(100%, 400px);
    max-height: min(82vh, 720px);
    overflow: hidden;
    border: 1px solid var(--st-border);
    border-radius: calc(var(--st-radius) + 4px);
    background: var(--st-bg);
    color: var(--st-fg);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.18);
}

.st-collection-modal__dialog--filters {
    width: min(100%, 640px);
}

.st-collection-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding: 17px 20px 14px;
    border-bottom: 1px solid var(--st-border);
}

.st-collection-modal__header h2 {
    margin: 2px 0 0;
    color: var(--st-fg);
    font-size: clamp(20px, 3vw, 23px);
}

body.theme-store .st-collection-modal__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--st-fg);
    cursor: pointer;
}

.st-sort-options {
    display: grid;
    gap: 0;
    padding: 8px 12px 12px;
    overflow-y: auto;
}

body.theme-store .st-sort-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    min-height: 46px;
    padding: 11px 8px;
    border: 0;
    border-bottom: 1px solid var(--st-border);
    border-radius: 0;
    background: var(--st-bg);
    color: var(--st-fg);
    font-family: var(--st-sans);
    font-size: 14px;
    font-weight: 700;
    text-align: left;
    cursor: pointer;
}

body.theme-store .st-sort-option:hover,
body.theme-store .st-sort-option.is-selected {
    background: var(--st-bg-alt);
}

.st-sort-option i {
    color: var(--st-accent);
    font-size: 17px;
}

.st-variant-filters__form {
    display: flex;
    min-height: 0;
    flex: 1;
    flex-direction: column;
}

.st-variant-filters__groups {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px 24px;
    padding: 18px 20px;
    overflow-y: auto;
}

.st-variant-filter {
    min-width: 0;
    margin: 0;
    padding: 0 0 14px;
    border: 0;
    border-bottom: 1px solid var(--st-border);
    border-radius: 0;
    background: transparent;
}

.st-variant-filter legend {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    width: 100%;
    gap: 10px;
    padding: 0 0 10px;
    color: var(--st-fg);
    font-size: 14px;
    font-weight: 800;
}

.st-variant-filter legend small {
    color: var(--st-fg-muted);
    font-size: 11px;
    font-weight: 600;
}

.st-variant-filter__options {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.st-variant-filter__option {
    display: inline-grid;
    grid-template-columns: auto auto minmax(0, auto) auto;
    align-items: center;
    gap: 7px;
    min-height: 38px;
    padding: 7px 9px;
    border: 1px solid var(--st-border);
    border-radius: 999px;
    background: var(--st-bg);
    color: var(--st-fg);
    font-size: 13px;
    cursor: pointer;
    transition: border-color 0.15s ease, background-color 0.15s ease;
}

.st-variant-filter__option:has(input:checked) {
    border-color: var(--st-accent);
    background: var(--st-accent-soft);
}

.st-variant-filter__option input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
    pointer-events: none;
}

.st-variant-filter__check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    border: 1px solid var(--st-border-strong);
    border-radius: 50%;
    color: transparent;
    font-size: 11px;
}

.st-variant-filter__option input:checked + .st-variant-filter__check {
    border-color: var(--st-accent);
    background: var(--st-accent-bg);
    color: var(--st-accent-fg);
}

.st-variant-filter__option:focus-within {
    outline: 2px solid var(--st-accent);
    outline-offset: 2px;
}

.st-variant-filter__option small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--st-bg-alt);
    color: var(--st-fg-muted);
    font-size: 10px;
}

.st-variant-filter__swatch {
    width: 17px;
    height: 17px;
    border: 1px solid var(--st-border-strong);
    border-radius: 50%;
    background: var(--st-filter-swatch);
}

.st-variant-filters__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid var(--st-border);
    background: var(--st-bg);
}

.st-variant-filters__actions .st-btn {
    width: auto;
}

body.st-collection-modal-open {
    overflow: hidden;
}

/* En el celular las flechas quedan a los costados y los números en el medio;
   el texto de las flechas se va porque no entra junto a los números. */
@media (max-width: 560px) {
    .st-collection-controls {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .st-collection-sort,
    .st-variant-filters {
        width: 100%;
    }

    body.theme-store .st-collection-control-button {
        width: 100%;
        min-height: 38px;
        padding: 7px 10px;
    }

    .st-collection-control-button > i:last-child {
        display: none;
    }

    .st-collection-modal {
        align-items: end;
        padding: 0;
    }

    .st-collection-modal__dialog,
    .st-collection-modal__dialog--filters {
        width: 100%;
        max-height: 88vh;
        border-right: 0;
        border-bottom: 0;
        border-left: 0;
        border-radius: 16px 16px 0 0;
    }

    .st-collection-modal__header {
        padding: 18px 16px 14px;
    }

    .st-variant-filters__groups {
        grid-template-columns: 1fr;
        padding: 16px;
    }

    .st-variant-filters__actions {
        padding: 14px 16px max(14px, env(safe-area-inset-bottom));
    }

    .st-variant-filters__actions .st-btn {
        flex: 1 1 130px;
    }

    .st-pagination {
        gap: 6px;
    }

    body.theme-store .st-pagination-arrow span {
        display: none;
    }

    body.theme-store .st-pagination-page,
    body.theme-store .st-pagination-arrow {
        min-width: 40px;
        height: 40px;
        padding: 0 8px;
    }
}

