/* ==========================================================================
   Qemmah — Product listings (store, category, collection, discounts, season,
   search). Scoped to .qm-list. Cards come from sections-premium.css
   (.qm-sections .qm-card, rendered by qm-listing.js); the sidebar filter
   from filter-premium.css. Results / pager markup:
   layoutmodule::components.qm-listing-results.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Page head band (listing pages without a store hero)
   -------------------------------------------------------------------------- */

.qm-list-head {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 14px 24px;
    overflow: hidden;
    isolation: isolate;
    margin-bottom: 24px;
    padding: clamp(24px, 3vw, 36px) var(--qm-head-pad, clamp(22px, 3vw, 40px));
    color: #fff;
    background:
        radial-gradient(600px 300px at 100% -20%, rgba(226, 193, 156, .32), transparent 60%),
        radial-gradient(420px 260px at -10% 120%, rgba(161, 120, 92, .4), transparent 60%),
        linear-gradient(150deg, #1a1210 0%, #2b1a14 50%, #4a2c20 100%);
    border-radius: 26px;
    box-shadow: 0 40px 80px -50px rgba(26, 18, 16, .9);
}

.qm-list-head::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    opacity: .06;
    background-image: linear-gradient(45deg, #fff 1px, transparent 1px), linear-gradient(-45deg, #fff 1px, transparent 1px);
    background-size: 30px 30px;
    -webkit-mask-image: radial-gradient(ellipse at 90% 0, #000 0%, transparent 70%);
    mask-image: radial-gradient(ellipse at 90% 0, #000 0%, transparent 70%);
}

/* brand arch: a doorway standing on the band's base, in the end-side gutter.
   It shares the count chip's inline-end edge and width, so the chip sits centred in it. */
.qm-list-head {
    --qm-head-pad: clamp(22px, 3vw, 40px);
    --qm-arch-w: 176px;
}

.qm-list-head::after {
    content: "";
    position: absolute;
    bottom: 0;
    inset-inline-end: var(--qm-head-pad);
    z-index: -1;
    width: var(--qm-arch-w);
    height: calc(100% - 26px);
    border: 1px solid rgba(226, 193, 156, .26);
    border-bottom: 0;
    border-radius: 999px 999px 0 0;
    background: radial-gradient(70% 55% at 50% 100%, rgba(226, 193, 156, .1), transparent 70%);
}

/* season campaigns: the campaign banner under a dark wash */
.qm-list-head--image {
    background:
        linear-gradient(270deg, rgba(26, 18, 16, .92) 0%, rgba(26, 18, 16, .7) 45%, rgba(26, 18, 16, .25) 100%),
        var(--qm-head-img) center / cover no-repeat,
        #2b1a14;
    min-height: 200px;
}

.qm-en .qm-list-head--image {
    background:
        linear-gradient(90deg, rgba(26, 18, 16, .92) 0%, rgba(26, 18, 16, .7) 45%, rgba(26, 18, 16, .25) 100%),
        var(--qm-head-img) center / cover no-repeat,
        #2b1a14;
}

.qm-list-head__eyebrow { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 12.5px; font-weight: 700; color: var(--qm-gold-2); }
.qm-list-head__eyebrow i { font-size: 12px; }

.qm-list-head h1 {
    margin: 0;
    padding-bottom: .1em;
    font-size: clamp(24px, 2.8vw, 36px);
    font-weight: 800;
    line-height: 1.3;
    text-align: start;
    background: linear-gradient(100deg, #fff 0%, #f6e3c8 45%, #e2c19c 80%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.qm-list-head p { max-width: 560px; margin: 8px 0 0; font-size: 14px; line-height: 1.8; color: rgba(255, 255, 255, .72); text-align: start; }

.qm-list-head__count {
    display: inline-flex;
    justify-content: center;
    width: calc(var(--qm-arch-w) - 32px);
    margin-inline: auto 16px;
    margin-bottom: 8px;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 700;
    color: var(--qm-gold-1);
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(226, 193, 156, .25);
    border-radius: 999px;
}

/* --------------------------------------------------------------------------
   2. Toolbar, filters, grid, pager
   -------------------------------------------------------------------------- */

.qm-list { padding-bottom: 48px; }


.qm-list__toolbar {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px 24px;
    margin-bottom: 24px;
    padding: 14px 18px;
    background: rgba(255, 255, 255, .7);
    border: 1px solid rgba(161, 120, 92, .14);
    border-radius: 20px;
    box-shadow: 0 16px 34px -28px rgba(58, 34, 25, .5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* chips only (no title / sort) */
.qm-list__toolbar--chips { grid-template-columns: minmax(0, 1fr); }

.qm-list__title { margin: 0; font-size: 18px; font-weight: 800; color: var(--qm-ink); white-space: nowrap; }

.qm-list__chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    margin: 0;
    padding: 2px;
    overflow-x: auto;
    list-style: none;
    scrollbar-width: none;
}

.qm-list__chips::-webkit-scrollbar { display: none; }

.qm-list .qm-list__chips .filter_nav_item {
    flex: none;
    margin: 0 !important;
    padding: 8px 16px !important;
    font-size: 13.5px;
    font-weight: 700;
    color: #5a463b;
    background: #fff;
    border: 1px solid rgba(161, 120, 92, .2);
    border-radius: 999px !important;
    box-shadow: none !important;
    cursor: pointer;
    transition: background-color .2s, color .2s, border-color .2s;
}

.qm-list .qm-list__chips .filter_nav_item:hover { border-color: var(--qm-gold-3); color: var(--qm-ink); }

.qm-list .qm-list__chips .filter_nav_item.active,
.qm-list .qm-list__chips .filter_nav_item.is-all:not(:has(~ .active)) {
    color: #fff;
    background: var(--qm-gloss-gold);
    border-color: transparent;
    text-shadow: 0 1px 1px rgba(58, 34, 25, .3);
}

.qm-list__sort { display: flex; align-items: center; gap: 10px; margin: 0; font-size: 13px; font-weight: 700; color: #8a7466; white-space: nowrap; }

.qm-list__sort select {
    height: 42px;
    padding: 0 14px;
    padding-inline-end: 36px;
    font-size: 14px;
    font-weight: 700;
    color: var(--qm-ink);
    background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23a1785c' d='M6 8 0 0h12z'/%3E%3C/svg%3E") no-repeat;
    background-position: left 14px center;
    border: 1px solid rgba(161, 120, 92, .25);
    border-radius: 12px;
    appearance: none;
    -webkit-appearance: none;
    cursor: pointer;
}

.qm-list.qm-en .qm-list__sort select { background-position: right 14px center; }
.qm-list__sort select:focus { outline: 0; border-color: var(--qm-gold-3); box-shadow: 0 0 0 4px rgba(199, 154, 114, .2); }

.qm-list__body { display: grid; grid-template-columns: 270px minmax(0, 1fr); align-items: start; gap: 24px; }

/* ----- Filters (searchmodule filter component, restyled) ----- */

.qm-list__filters { position: sticky; top: 150px; }

.qm-list__filterbox > summary { display: none; }

@media (max-width: 991px) {
    .qm-list__filterbox > summary {
        display: flex;
        align-items: center;
        gap: 10px;
        height: 48px;
        padding: 0 18px;
        font-size: 14.5px;
        font-weight: 800;
        color: var(--qm-ink);
        list-style: none;
        background: #fff;
        border-radius: 16px;
        box-shadow: 0 0 0 1px rgba(161, 120, 92, .14);
        cursor: pointer;
    }
    .qm-list__filterbox > summary::-webkit-details-marker { display: none; }
    .qm-list__filterbox > summary i { color: var(--qm-gold-4); }
    .qm-list__filterbox > summary::after { content: "\f078"; margin-inline-start: auto; font-family: "Font Awesome 6 Free"; font-size: 12px; font-weight: 900; color: var(--qm-gold-4); transition: transform .3s; }
    .qm-list__filterbox[open] > summary { margin-bottom: 10px; }
    .qm-list__filterbox[open] > summary::after { transform: rotate(180deg); }
}

/* ----- Results grid ----- */

.qm-list__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 18px;
}

.qm-list__cell { display: flex; }
.qm-list__cell .qm-card { width: 100%; }

.qm-list__loading { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.qm-list__loading.d-none { display: none !important; }

.qm-list__skeleton {
    aspect-ratio: 3 / 4.4;
    border-radius: 16px;
    background: linear-gradient(100deg, #f1e8df 30%, #faf5f0 50%, #f1e8df 70%);
    background-size: 300% 100%;
    animation: qs-shimmer 1.4s linear infinite;
}

@keyframes qs-shimmer {
    from { background-position: 100% 0; }
    to   { background-position: -100% 0; }
}

.qm-list__empty { display: grid; place-items: center; gap: 10px; padding: 70px 20px; text-align: center; background: #fff; border-radius: 22px; box-shadow: 0 0 0 1px rgba(161, 120, 92, .1); }
.qm-list__empty i { font-size: 38px; color: var(--qm-gold-3); }
.qm-list__empty h4 { margin: 0; font-size: 17px; font-weight: 800; color: #6b5a50; }
.qm-list__empty p { margin: 0; font-size: 13.5px; color: #8a7466; }

/* suggestions under a no-results search (searchmodule::partials.empty-results) */
.qm-empty-suggest { display: grid; gap: 14px; margin-top: 26px; }
.qm-empty-suggest__title { margin: 8px 0 0; font-size: 16px; font-weight: 800; color: #3a2219; text-align: center; }
.qm-empty-suggest__chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.qm-empty-suggest__chips a {
    padding: 8px 16px;
    font-size: 13.5px;
    font-weight: 700;
    color: #6b3e2e !important;
    text-decoration: none !important;
    background: #fff;
    border: 1px solid rgba(161, 120, 92, .28);
    border-radius: 999px;
    transition: border-color .2s, background-color .2s;
}
.qm-empty-suggest__chips a:hover { background: #fdf6ee; border-color: var(--qm-gold-3); }

/* ----- Pager ----- */

.qm-list__pager { display: flex; justify-content: center; margin-top: 34px; }
.qm-list__pager.d-none { display: none !important; }

.qm-list__pager .pageing_nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    padding: 6px;
    list-style: none;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 0 0 1px rgba(161, 120, 92, .12), 0 14px 30px -24px rgba(58, 34, 25, .5);
}

.qm-list__pager .btn_arrow {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    font-size: 13px;
    color: #8a7466;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color .2s, color .2s;
}

.qm-list__pager .btn_arrow:hover { color: var(--qm-ink); background: #f6ede4; }
.qm-list__pager .container_pages { max-width: 220px; }
.qm-list__pager .pages_toggle .item { padding: 0 2px !important; }

.qm-list__pager .btn-pager {
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    padding: 0;
    font-size: 14px;
    font-weight: 800;
    color: #6b5a50;
    background: transparent;
    border: 0;
    border-radius: 50%;
}

.qm-list__pager .btn-pager.btn-primary,
.qm-list__pager .btn-pager.active { color: #fff; background: var(--qm-gloss-gold) !important; box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }

/* server-rendered pager (vendor.pagination.qm) */
.qm-pager { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px; width: fit-content; margin: 34px auto 0; padding: 6px; background: #fff; border-radius: 999px; box-shadow: 0 0 0 1px rgba(161, 120, 92, .12), 0 10px 26px -18px rgba(60, 35, 20, .35); }
.qm-pager__page,
.qm-pager__arrow { display: grid; place-items: center; min-width: 38px; height: 38px; padding: 0 6px; font-size: 14px; font-weight: 700; color: #5a463b; text-decoration: none; border-radius: 999px; transition: background-color .2s, color .2s; }
.qm-pager__arrow { font-size: 13px; color: #8a7466; }
a.qm-pager__page:hover,
a.qm-pager__arrow:hover { color: var(--qm-ink); background: #f6ede4; }
.qm-pager__page.is-active { color: #fff; background: var(--qm-gloss-gold); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5); }
.qm-pager__arrow.is-disabled { opacity: .35; }
.qm-pager__gap { padding: 0 4px; color: #a3917f; }

/* ----- Medals: ranked designer rows ----- */
.qm-medals { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }

.qm-medal {
    position: relative;
    display: grid;
    grid-template-columns: 44px 92px minmax(0, 1fr) auto;
    align-items: center;
    gap: 20px;
    padding: 18px 24px;
    background: #fff;
    border-radius: 22px;
    box-shadow: 0 0 0 1px rgba(161, 120, 92, .12), 0 18px 40px -32px rgba(60, 35, 20, .5);
    transition: transform .3s var(--qm-ease), box-shadow .3s var(--qm-ease);
}

.qm-medal:hover { transform: translateY(-2px); box-shadow: 0 0 0 1px rgba(161, 120, 92, .22), 0 24px 46px -30px rgba(60, 35, 20, .55); }
.qm-medal__link { position: absolute; inset: 0; z-index: 2; border-radius: inherit; }

.qm-medal__rank { font-size: 26px; font-weight: 800; line-height: 1; text-align: center; color: #c9b8a8; font-variant-numeric: tabular-nums; }
.qm-medal--top .qm-medal__rank { background: var(--qm-gloss-gold); -webkit-background-clip: text; background-clip: text; color: transparent; }
.qm-medal--1 { background: linear-gradient(100deg, #fdf6ee, #fff 55%); box-shadow: 0 0 0 1px rgba(199, 154, 114, .45), 0 22px 44px -30px rgba(125, 82, 56, .55); }

.qm-medal__avatar { position: relative; display: grid; place-items: center; width: 92px; height: 92px; background: center / cover no-repeat; border-radius: 50%; }
.qm-medal__avatar > img:first-child { width: 72%; height: 72%; object-fit: cover; background: #fff; border-radius: 50%; }
.qm-medal__badge { position: absolute; bottom: -6px; inset-inline-start: -4px; width: 36px !important; height: 36px; object-fit: contain; filter: drop-shadow(0 4px 8px rgba(60, 35, 20, .3)); }

.qm-medal__name { margin: 0 0 6px; font-size: 18px; font-weight: 800; color: var(--qm-ink); }
.qm-medal__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; }
.qm-medal__chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 11px; font-size: 12px; font-weight: 700; color: var(--qm-brown, #7d5238); background: #f6ede4; border-radius: 999px; }
.qm-medal__chip i { font-size: 11px; color: var(--qm-gold-4); }
.qm-medal__flag { width: 20px !important; height: 14px; object-fit: cover; border-radius: 3px; }
.qm-medal__rating { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; font-weight: 700; color: #5a463b; }
.qm-medal__rating i { font-size: 11px; color: #f2b01e; }
.qm-medal__bio { display: -webkit-box; margin: 8px 0 0; overflow: hidden; font-size: 13.5px; line-height: 1.75; color: #8a7466; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.qm-medal__cta { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 18px; font-size: 13px; font-weight: 700; color: var(--qm-brown, #7d5238); white-space: nowrap; border: 1px solid rgba(161, 120, 92, .3); border-radius: 999px; transition: background-color .2s, color .2s; }
.qm-medal:hover .qm-medal__cta { color: #fff; background: var(--qm-gloss-gold); border-color: transparent; }

@media (max-width: 767px) {
    .qm-medal { grid-template-columns: 30px 68px minmax(0, 1fr); gap: 14px; padding: 16px; }
    .qm-medal__rank { font-size: 20px; }
    .qm-medal__avatar { width: 68px; height: 68px; }
    .qm-medal__badge { width: 28px !important; height: 28px; }
    .qm-medal__name { font-size: 16px; }
    .qm-medal__cta { display: none; }
}

/* DataTables only feeds the cards; hide its own chrome */
.qm-list .dataTables_wrapper .dataTables_info,
.qm-list .dataTables_wrapper .dataTables_paginate,
.qm-list .dataTables_wrapper .dataTables_length,
.qm-list .dataTables_wrapper .dataTables_filter,
.qm-list .dataTables_processing { display: none !important; }


/* ----- Search: matching designers ----- */

.qm-list__shops-sec { margin-bottom: 28px; }
.qm-list__shops-sec.is-empty { display: none; }
.qm-list__sec-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; font-size: 18px; font-weight: 800; color: var(--qm-ink); }
.qm-list__sec-title i { font-size: 14px; color: var(--qm-gold-4); }
.qm-list__shops { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; }
.qm-list__shop { display: flex; }
.qm-list__shop .qm-star { width: 100%; }
.qm-list__shops--page { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }

/* --------------------------------------------------------------------------
   3. Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1199px) {
    .qm-list__body { grid-template-columns: 240px minmax(0, 1fr); }
}

@media (max-width: 991px) {
    .qm-list__toolbar { grid-template-columns: 1fr auto; }
    .qm-list__chips { grid-column: 1 / -1; grid-row: 2; }
    .qm-list__body { grid-template-columns: 1fr; }
    .qm-list__filters { position: static; }
}

@media (max-width: 575px) {
    .qm-list-head { padding: 22px 18px; border-radius: 20px; }
    .qm-list-head::after { display: none; }
    .qm-list__toolbar { padding: 12px; border-radius: 16px; }
    .qm-list__title { font-size: 16px; }
    .qm-list__sort span { display: none; }
    .qm-list__grid,
    .qm-list__loading { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
    .qm-list__shops,
    .qm-list__shops--page { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

@media (prefers-reduced-motion: reduce) {
    .qm-list * { animation: none !important; transition: none !important; }
}
