/* ==========================================================================
   Rage — Shop page
   Loaded after home.css; reuses its tokens, header, product cards and cart.
   ========================================================================== */

.rg-shop { padding-top: 28px; }

@media (min-width: 1024px) {
    .rg-shop { padding-top: 44px; }
}

/* Category filter & sorting ---------------------------------------------- */

.rg-shop__bar {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 22px;
}

/* Phones: one swipeable row of category chips */
.rg-shop__cats {
    display: flex;
    gap: 8px;
    margin-inline: calc(var(--rg-pad) * -1);
    padding: 2px var(--rg-pad);
    overflow-x: auto;
    scrollbar-width: none;
}

.rg-shop__cats::-webkit-scrollbar { display: none; }

.rg-chip {
    display: inline-flex;
    align-items: center;
    flex: none;
    min-height: 38px;
    padding: 0 16px;
    border: 1px solid var(--rg-line-strong);
    border-radius: 999px;
    background: var(--rg-paper);
    color: var(--rg-ink);
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    transition: background-color .2s, border-color .2s, color .2s;
}

.rg-chip:hover { border-color: var(--rg-indigo); color: var(--rg-indigo); }

.rg-chip[aria-current="page"] {
    border-color: var(--rg-indigo);
    background: var(--rg-indigo);
    color: var(--rg-cotton);
}

/* Active search, removed with its × */
.rg-chip--search {
    gap: 8px;
    padding-right: 12px;
    border-color: var(--rg-copper);
    background: var(--rg-copper-soft);
    color: var(--rg-copper-dark);
}

.rg-chip--search svg { width: 16px; height: 16px; }
.rg-chip--search:hover { border-color: var(--rg-copper-dark); color: var(--rg-copper-dark); }

.rg-shop__sort {
    display: flex;
    align-items: center;
    gap: 10px;
}

.rg-shop__sort label {
    flex: none;
    color: var(--rg-muted);
    font-size: 14px;
}

.rg-shop__sort select {
    flex: 1;
    min-width: 0;
    height: 40px;
    padding: 0 38px 0 16px;
    border: 1px solid var(--rg-line-strong);
    border-radius: 999px;
    background: var(--rg-paper) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231D3354' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px;
    color: var(--rg-ink);
    font: 500 14px var(--rg-sans);
    -webkit-appearance: none;
    appearance: none;
    cursor: pointer;
}

.rg-shop__sort select:focus {
    outline: none;
    border-color: var(--rg-indigo);
    box-shadow: 0 0 0 3px rgba(29, 51, 84, .1);
}

.rg-shop__apply { min-height: 40px; }

/* With JavaScript the sort applies on change */
.rg-js .rg-shop__apply { display: none; }

@media (min-width: 768px) {
    .rg-shop__bar {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 24px;
        margin-bottom: 28px;
    }

    .rg-shop__cats {
        flex-wrap: wrap;
        margin-inline: 0;
        padding: 0;
        overflow: visible;
    }

    .rg-shop__sort { flex: none; }
    .rg-shop__sort select { flex: none; width: 210px; }
}

/* Empty state ------------------------------------------------------------ */

.rg-shop .rg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding-block: 48px;
}

/* AJAX loading ----------------------------------------------------------- */

/* Thin bar under the top of the window while products load */
.rg-shop__progress {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    height: 3px;
    background: var(--rg-copper);
    transform: scaleX(0);
    transform-origin: left;
    opacity: 0;
    pointer-events: none;
}

.rg-shop__progress.is-active {
    opacity: 1;
    animation: rg-shop-progress 1.4s var(--rg-ease) forwards;
}

@keyframes rg-shop-progress {
    from { transform: scaleX(0); }
    to { transform: scaleX(.85); }
}

.rg-shop__listing .rg-grid,
.rg-shop__listing .rg-empty,
.rg-shop__listing .rg-pager { transition: opacity .2s; }

.rg-shop__listing.is-loading .rg-grid,
.rg-shop__listing.is-loading .rg-empty,
.rg-shop__listing.is-loading .rg-pager {
    opacity: .45;
    pointer-events: none;
}

.rg-shop__listing .rg-section__title:focus { outline: none; }

/* Pagination ------------------------------------------------------------- */

.rg-pager {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 36px;
}

.rg-pager__pages { display: flex; gap: 6px; }

.rg-pager__step,
.rg-pager__page,
.rg-pager__gap {
    display: inline-grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 6px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 600;
}

.rg-pager__step,
.rg-pager__page { border: 1px solid var(--rg-line-strong); background: var(--rg-paper); transition: border-color .2s, color .2s; }

.rg-pager__step svg { width: 18px; height: 18px; }

a.rg-pager__step:hover,
a.rg-pager__page:hover { border-color: var(--rg-indigo); color: var(--rg-indigo); }

.rg-pager__page[aria-current="page"] {
    border-color: var(--rg-indigo);
    background: var(--rg-indigo);
    color: var(--rg-cotton);
}

.rg-pager__step.is-disabled { opacity: .35; }
.rg-pager__gap { min-width: 24px; padding: 0; color: var(--rg-muted); }

@media (min-width: 1024px) {
    .rg-pager { margin-top: 48px; }
}
