/* ==========================================================================
   AURAANIX — Shop / Category listing
   Uses the global theme tokens from style.css (--ax-gold, --ax-ink, etc.)
   ========================================================================== */
.ax-shop { background: #fff; padding: 28px 0 72px; }

/* Header */
.ax-shop__head { margin-bottom: 6px; }
.ax-shop__crumbs { font-size: 12px; letter-spacing: .4px; color: #9a9a9a; text-transform: uppercase; }
.ax-shop__crumbs a { color: #9a9a9a; }
.ax-shop__crumbs a:hover { color: var(--ax-gold); }
.ax-shop__crumbs span { margin: 0 6px; }
.ax-shop__crumbs em { color: var(--ax-ink); font-style: normal; font-weight: 600; }
.ax-shop__title {
    font-family: 'Oswald', sans-serif;
    font-size: 30px; font-weight: 700; text-transform: uppercase;
    color: var(--ax-ink); margin: 10px 0 2px;
}
.ax-shop__count { color: #9a9a9a; font-size: 13px; margin: 0; }

/* Title row: heading/count on the left, filter button on the right */
.ax-shop__headmain { display: flex; align-items: center; justify-content: space-between; gap: 16px; }

/* Mobile filter toggle (hidden on desktop) */
.ax-shop__filterbar { display: flex; justify-content: flex-end; flex: 0 0 auto; }
.ax-shop__filterbtn { display: none; }

/* Layout */
.ax-shop__layout {
    display: grid;
    grid-template-columns: 252px 1fr;
    gap: 30px;
    margin-top: 22px;
    align-items: start;
}

/* Sidebar / filters */
.ax-filter { border: 1px solid var(--ax-border); border-radius: 12px; padding: 18px; margin-bottom: 18px; }
.ax-filter__title {
    font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase;
    color: var(--ax-ink); margin: 0 0 12px;
}
.ax-filter__cats, .ax-filter__sub { list-style: none; margin: 0; padding: 0; }
.ax-filter__cats > li { margin-bottom: 7px; }
.ax-filter__cats a { color: #444; font-size: 14px; display: inline-block; padding: 2px 0; transition: color .15s ease; }
.ax-filter__cats a:hover, .ax-filter__cats a.is-active { color: var(--ax-gold); font-weight: 600; }
.ax-filter__sub { margin: 6px 0 4px 6px; padding-left: 12px; border-left: 1px solid var(--ax-border); }
.ax-filter__sub a { font-size: 13px; color: #7a7a7a; padding: 3px 0; }
.ax-filter__price { display: flex; align-items: center; gap: 8px; }
.ax-filter__price input {
    width: 100%; height: 38px; border: 1px solid var(--ax-border);
    border-radius: 8px; padding: 0 10px; font-size: 13px; color: var(--ax-ink); outline: none;
}
.ax-filter__price input:focus { border-color: var(--ax-gold); }
.ax-filter__apply {
    margin-top: 12px; width: 100%; height: 40px; border: 0; border-radius: 8px;
    background: var(--ax-ink); color: #fff; font-weight: 600; font-size: 12.5px;
    text-transform: uppercase; letter-spacing: .6px; cursor: pointer;
}
.ax-filter__apply:hover { background: #000; }
.ax-filter__clear { display: block; text-align: center; margin-top: 10px; font-size: 12px; color: #9a9a9a; }
.ax-filter__clear:hover { color: var(--ax-gold); }

/* Toolbar */
.ax-shop__toolbar {
    display: flex; align-items: center; justify-content: space-between;
    gap: 14px; margin-bottom: 20px; flex-wrap: wrap;
}
.ax-shop__showing { font-size: 13px; color: #9a9a9a; }
.ax-shop__sort { display: flex; align-items: center; gap: 8px; margin: 0; }
.ax-shop__sort label { font-size: 12px; text-transform: uppercase; letter-spacing: .5px; color: #9a9a9a; }
.ax-shop__sort select {
    height: 40px; border: 1px solid var(--ax-border); border-radius: 8px;
    padding: 0 12px; font-size: 13px; color: var(--ax-ink); background: #fff; cursor: pointer; outline: none;
}
.ax-shop__sort select:focus { border-color: var(--ax-gold); }

/* Product grid (reuses .ax-product cards) — fixed column counts so cards are a
   consistent, standardised size on every category page (Task 011). */
.ax-shop__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}
.ax-shop__grid .ax-product { flex: initial; width: 100%; }

@media (max-width: 1199.98px) {
    .ax-shop__grid:not(.ax-shop__grid--list) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 767.98px) {
    .ax-shop__grid:not(.ax-shop__grid--list) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* View toggle (grid / list) beside the Sort control */
.ax-shop__tools { display: flex; align-items: center; gap: 14px; }
.ax-viewtoggle { display: inline-flex; border: 1px solid var(--ax-border); border-radius: 8px; overflow: hidden; }
.ax-viewtoggle__btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; border: 0; background: #fff;
    color: #9a9a9a; cursor: pointer; transition: background .15s ease, color .15s ease;
}
.ax-viewtoggle__btn + .ax-viewtoggle__btn { border-left: 1px solid var(--ax-border); }
.ax-viewtoggle__btn:hover { color: var(--ax-ink); }
.ax-viewtoggle__btn.is-active { background: var(--ax-ink); color: #fff; }

/* List view layout — horizontal cards (image left, details right) */
.ax-shop__grid--list { grid-template-columns: 1fr; gap: 16px; }
.ax-shop__grid--list .ax-product {
    display: grid;
    grid-template-columns: 200px 1fr;
    grid-template-areas:
        "img brand"
        "img name"
        "img row"
        "img opts"
        "img btn";
    align-content: start;
    column-gap: 24px;
    row-gap: 8px;
    padding: 16px;
}
.ax-shop__grid--list .ax-product:hover { transform: none; }
.ax-shop__grid--list .ax-product__wish { top: 24px; left: 24px; right: auto; }
.ax-shop__grid--list .ax-product__img {
    grid-area: img; margin: 0; width: 200px; height: 100%; min-height: 190px;
    border-radius: 8px; aspect-ratio: auto;
}
.ax-shop__grid--list .ax-product__brand { grid-area: brand; }
.ax-shop__grid--list .ax-product__name  { grid-area: name; margin: 0; font-size: 18px; }
.ax-shop__grid--list .ax-product__row   { grid-area: row; margin: 0; justify-content: flex-start; gap: 20px; }
.ax-shop__grid--list .ax-product__opts  { grid-area: opts; margin: 0; }
.ax-shop__grid--list .ax-product__btn   { grid-area: btn; width: max-content; margin-top: 8px; padding-left: 30px; padding-right: 30px; }

/* Pagination — custom themed pager */
.ax-shop__pagination { margin-top: 38px; display: flex; justify-content: center; }
.ax-pager__list {
    list-style: none; margin: 0; padding: 0;
    display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.ax-pager__link {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 8px;
    border: 1px solid var(--ax-border); border-radius: 8px;
    color: var(--ax-ink); font-size: 14px; font-weight: 600; line-height: 1;
    text-decoration: none; transition: color .15s ease, border-color .15s ease, background .15s ease;
}
.ax-pager__arrow { font-size: 20px; }
a.ax-pager__link:hover { color: var(--ax-gold); border-color: var(--ax-gold); }
.ax-pager__item.is-active .ax-pager__link { background: var(--ax-ink); border-color: var(--ax-ink); color: #fff; }
.ax-pager__item.is-disabled .ax-pager__link { opacity: .4; cursor: default; }
.ax-pager__dots { border-color: transparent; }

/* Empty state */
.ax-shop__empty { text-align: center; padding: 64px 20px; border: 1px dashed var(--ax-border); border-radius: 14px; }
.ax-shop__empty h3 { font-family: 'Oswald', sans-serif; text-transform: uppercase; color: var(--ax-ink); margin: 0 0 6px; }
.ax-shop__empty p { color: #9a9a9a; font-size: 14px; margin: 0; }
.ax-shop__emptybtn {
    display: inline-block; margin-top: 16px; background: var(--ax-gold); color: #1a1a1a;
    padding: 10px 24px; border-radius: 8px; font-weight: 700; font-size: 13px;
    text-transform: uppercase; letter-spacing: .5px;
}

/* Keep sidebar visible on desktop despite the .collapse class + make it sticky */
@media (min-width: 992px) {
    .ax-shop__sidebar.collapse:not(.show) { display: block !important; }
    .ax-shop__sidebar {
        position: sticky;
        top: 24px;
        max-height: calc(100vh - 48px);
        overflow-y: auto;
    }
    /* thin, themed scrollbar for the sticky sidebar */
    .ax-shop__sidebar::-webkit-scrollbar { width: 6px; }
    .ax-shop__sidebar::-webkit-scrollbar-thumb { background: var(--ax-border); border-radius: 6px; }
}

/* Tablet / mobile */
@media (max-width: 991.98px) {
    .ax-shop__layout { grid-template-columns: 1fr; }
    .ax-shop__filterbtn {
        display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
        background: var(--ax-ink); color: #fff; border: 0; border-radius: 8px;
        padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
    }
    .ax-shop__sidebar { margin-top: 14px; }
}
@media (max-width: 575.98px) {
    .ax-shop__title { font-size: 24px; }
    .ax-shop__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }

    /* Narrow cards: stack Color above Sizes so the S/M/L/XL row isn't clipped */
    .ax-shop__grid:not(.ax-shop__grid--list) .ax-product__opts {
        flex-direction: column; align-items: flex-start; gap: 10px;
    }
    .ax-shop__grid:not(.ax-shop__grid--list) .ax-sizes { flex-wrap: wrap; }

    /* compact list cards on phones */
    .ax-shop__grid--list { grid-template-columns: 1fr; }
    .ax-shop__grid--list .ax-product { grid-template-columns: 120px 1fr; column-gap: 14px; }
    .ax-shop__grid--list .ax-product__img { width: 120px; min-height: 120px; }
    .ax-shop__grid--list .ax-product__name { font-size: 15px; }
    .ax-shop__grid--list .ax-product__btn { width: 100%; }
}

/* ============================================================
   Infinite scroll — loader + skeleton placeholder cards
   ============================================================ */
.ax-shop__more {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 24px;
    padding: 26px 0 8px;
    color: var(--ax-gray, #8a8a8a);
    font-size: 14px;
    visibility: hidden;          /* trigger stays in layout; reveal while loading */
}
.ax-shop__more.is-loading { visibility: visible; }
.ax-shop__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(201, 151, 77, 0.3);
    border-top-color: var(--ax-gold, #c9974d);
    border-radius: 50%;
    animation: ax-spin 0.7s linear infinite;
}
@keyframes ax-spin { to { transform: rotate(360deg); } }

/* Skeleton card — mirrors the real product card box so the grid doesn't jump */
.ax-skel-card {
    background: #f3f3f3;
    border-radius: 8px;
    padding: 14px;
    overflow: hidden;
}
.ax-skel-card__img {
    aspect-ratio: 1 / 1;
    margin: -14px -14px 12px;
    background: #e6e6e6;
}
.ax-skel-card__line {
    height: 14px;
    margin-top: 12px;
    border-radius: 6px;
    background: #e6e6e6;
}
.ax-skel-card__line--sm { width: 55%; }

.ax-skel-card__img,
.ax-skel-card__line { position: relative; overflow: hidden; }
.ax-skel-card__img::after,
.ax-skel-card__line::after {
    content: "";
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent);
    animation: ax-shimmer 1.3s infinite;
}
@keyframes ax-shimmer { 100% { transform: translateX(100%); } }

/* In list view, skeletons keep the same single-column rhythm */
.ax-shop__grid--list .ax-skel-card__img { aspect-ratio: 16 / 9; }
