/**
 * Archive / catalog page visual system.
 * Scoped to `.page-archive` — keeps homepage / PDP layout contracts intact.
 */

.page-archive {
    --arch-radius: 1rem;
    --arch-radius-sm: 0.65rem;
    --arch-ease: var(--sf-ease, cubic-bezier(0.22, 1, 0.36, 1));
}

.page-archive .storefront-shell {
    padding-inline: 0;
}

/* ── Hero / page head ── */
.page-archive .archive-page-head {
    position: relative;
    margin-bottom: 1rem;
    padding-block: 1rem 1.15rem;
    overflow: hidden;
    background:
        radial-gradient(900px 180px at 100% -10%, color-mix(in srgb, var(--sf-color-primary) 16%, transparent), transparent 68%),
        radial-gradient(520px 160px at 0% 120%, color-mix(in srgb, var(--sf-color-accent, var(--sf-color-primary)) 10%, transparent), transparent 70%),
        linear-gradient(180deg, var(--sf-surface-card), color-mix(in srgb, var(--sf-surface-subtle) 55%, white));
    border-bottom: 1px solid var(--sf-border-subtle);
}

.page-archive .archive-page-head::after {
    content: "";
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        color-mix(in srgb, var(--sf-color-primary) 35%, transparent),
        transparent
    );
}

.page-archive .archive-page-head .container-fluid,
.page-archive .archive-active-filters .container-fluid,
.page-archive .content > .container-fluid,
.page-archive .archive-seo-text .container-fluid {
    padding-inline: var(--sf-layout-gutter);
}

.page-archive .archive-page-head__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.85rem;
    flex-wrap: wrap;
    padding: 0.55rem 0.8rem;
    border-radius: var(--arch-radius);
    background: color-mix(in srgb, var(--sf-surface-card) 92%, transparent);
    border: 1px solid color-mix(in srgb, var(--sf-border-subtle) 85%, var(--sf-color-primary) 15%);
    box-shadow: 0 10px 28px rgb(15 23 42 / 0.05);
    backdrop-filter: blur(8px);
}

.page-archive .archive-page-head__trail {
    min-width: 0;
    flex: 1 1 auto;
}

.page-archive .archive-page-head__meta {
    flex: 0 0 auto;
}

.page-archive .archive-page-head__count-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.85rem;
    border-radius: var(--arch-radius-sm);
    font-size: 0.8rem;
    font-weight: 800;
    color: var(--sf-color-primary);
    background: color-mix(in srgb, var(--sf-color-primary) 10%, white);
    border: 1px solid color-mix(in srgb, var(--sf-color-primary) 22%, transparent);
    white-space: nowrap;
}

.page-archive .archive-page-head__count-chip i {
    font-size: 0.95rem;
}

.page-archive .archive-page-head__context {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1rem;
    padding: 0.85rem 0.15rem 0.1rem;
}

.page-archive .archive-page-head__media {
    flex: 0 0 auto;
}

.page-archive .archive-page-head__banner {
    width: 72px;
    height: 72px;
    object-fit: cover;
    border-radius: var(--arch-radius-sm);
    border: 1px solid var(--sf-border-subtle);
    box-shadow: 0 8px 18px rgb(15 23 42 / 0.1);
    background: var(--sf-surface-subtle);
}

.page-archive .archive-page-head__copy {
    min-width: 0;
    flex: 1;
}

.page-archive .archive-page-head__title {
    margin: 0;
    font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.75rem);
    font-weight: 800;
    color: var(--sf-text-strong);
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.page-archive .archive-page-head__intro {
    margin: 0.4rem 0 0;
    font-size: 0.88rem;
    color: var(--sf-text-muted);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    max-width: 70ch;
    line-height: 1.6;
}

/* ── Active filters ── */
.page-archive .archive-active-filters {
    margin-bottom: 0.85rem;
}

.page-archive .archive-active-filters__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.8rem;
    border-radius: var(--arch-radius);
    background: var(--sf-surface-card);
    border: 1px solid color-mix(in srgb, var(--sf-color-primary) 18%, var(--sf-border-subtle));
    box-shadow: 0 4px 14px rgb(15 23 42 / 0.04);
}

.page-archive .archive-active-filters__label {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--sf-text-muted);
}

.page-archive .archive-active-filters__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    flex: 1;
}

.page-archive .archive-active-filters__clear {
    border: 0;
    background: color-mix(in srgb, var(--sf-color-primary) 8%, transparent);
    color: var(--sf-color-primary);
    font-size: 0.78rem;
    font-weight: 800;
    padding: 0.35rem 0.7rem;
    border-radius: var(--arch-radius-sm);
    cursor: pointer;
    transition: background 160ms var(--arch-ease);
}

.page-archive .archive-active-filters__clear:hover {
    background: color-mix(in srgb, var(--sf-color-primary) 14%, white);
}

.page-archive .archive-filter-chip,
.page-archive .archive-active-filters__chips .archive-filter-chip {
    border: 1px solid color-mix(in srgb, var(--sf-color-primary) 20%, var(--sf-border-subtle));
    background: color-mix(in srgb, var(--sf-color-primary) 6%, white);
    border-radius: var(--arch-radius-sm);
    padding: 0.3rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--sf-text-strong);
}

/* ── Layout ── */
.page-archive .content {
    padding-top: 0.35rem;
    padding-bottom: var(--sf-section-gap);
}

.page-archive .archive-page__grid {
    align-items: flex-start;
    --bs-gutter-x: 1.25rem;
}

.page-archive .archive-page__filters {
    align-self: flex-start;
}

/* ── Filters panel ── */
.page-archive .filter-items.archive-filters-sticky,
.page-archive .archive-page__filters .filter-items {
    position: sticky;
    top: calc(var(--sf-header-offset, 72px) + 0.65rem);
    max-height: calc(100vh - var(--sf-header-offset, 72px) - 1.25rem);
    overflow: auto;
    padding: 0.85rem 0.75rem 1rem;
    border-radius: var(--arch-radius);
    border: 1px solid color-mix(in srgb, var(--sf-border-subtle) 80%, var(--sf-color-primary) 20%);
    background:
        linear-gradient(180deg, var(--sf-surface-card), color-mix(in srgb, var(--sf-surface-subtle) 45%, white));
    box-shadow: 0 12px 28px rgb(15 23 42 / 0.06);
    scrollbar-width: thin;
}

.page-archive .archive-page__filters .filter-items > .container-fluid {
    padding-inline: 0.25rem;
}

.page-archive .archive-filters__title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    margin: 0 0 0.85rem;
    padding: 0 0.15rem 0.7rem;
    border-bottom: 1px solid var(--sf-border-subtle);
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--sf-text-strong);
}

.page-archive .archive-filters__title i {
    color: var(--sf-color-primary);
}

.page-archive .filter-item {
    margin-bottom: 0.95rem;
    padding: 0.75rem 0.7rem;
    border-radius: var(--arch-radius-sm);
    background: color-mix(in srgb, var(--sf-surface-subtle) 70%, white);
    border: 1px solid color-mix(in srgb, var(--sf-border-subtle) 90%, transparent);
}

.page-archive .filter-item-title {
    margin: 0 0 0.65rem;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    color: var(--sf-text-muted);
}

.page-archive .filter-item-content .form-check {
    min-height: 0;
    padding: 0.35rem 0;
    margin: 0;
}

.page-archive .filter-item-content .form-check-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--sf-text-default);
    cursor: pointer;
}

.page-archive .filter-item-content .form-check-input {
    width: 1.05rem;
    height: 1.05rem;
    margin-top: 0.15rem;
    border-radius: 0.3rem;
    border-color: var(--sf-border-default);
}

.page-archive .filter-item-content .form-check-input:checked {
    background-color: var(--sf-color-primary);
    border-color: var(--sf-color-primary);
}

.page-archive .archive-cat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 1px dashed color-mix(in srgb, var(--sf-border-subtle) 80%, transparent);
}

.page-archive .archive-cat-row:last-child {
    border-bottom: 0;
}

.page-archive .archive-cat-count {
    display: inline-flex;
    min-width: 1.6rem;
    justify-content: center;
    padding: 0.1rem 0.4rem;
    border-radius: 0.4rem;
    font-size: 0.72rem;
    font-weight: 800;
    color: var(--sf-color-primary);
    background: color-mix(in srgb, var(--sf-color-primary) 9%, white);
}

.page-archive .filter-item .search-filed {
    position: relative;
}

.page-archive .filter-item .search-input {
    min-height: 2.55rem;
    padding-inline-end: 2.75rem;
    border-radius: var(--arch-radius-sm);
    border-color: var(--sf-border-subtle);
    background: var(--sf-surface-card);
}

.page-archive .filter-item .search-btn {
    position: absolute;
    inset-inline-end: 0.35rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.1rem;
    height: 2.1rem;
    min-height: 2.1rem;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem !important;
}

.page-archive .filter-item .input-range-filter {
    min-height: 2.4rem;
    border-radius: var(--arch-radius-sm);
    font-size: 0.82rem;
}

.page-archive .js-archive-apply-filter,
.page-archive .filter-item .btn-outline-site {
    width: 100%;
    min-height: 2.65rem;
    border-radius: var(--arch-radius-sm);
    font-weight: 800;
    border: 1px solid color-mix(in srgb, var(--sf-color-primary) 35%, transparent);
    color: var(--sf-color-primary);
    background: color-mix(in srgb, var(--sf-color-primary) 8%, white);
    transition:
        background 180ms var(--arch-ease),
        color 180ms var(--arch-ease),
        transform 140ms var(--arch-ease);
}

.page-archive .js-archive-apply-filter:hover,
.page-archive .filter-item .btn-outline-site:hover {
    background: var(--sf-color-primary);
    color: #fff;
}

.page-archive .js-archive-apply-filter:active {
    transform: translateY(1px);
}

/* ── Sort / view toolbar ── */
.page-archive .category-sort {
    margin-bottom: 0.9rem !important;
}

.page-archive .archive-toolbar {
    --at-radius: var(--arch-radius);
    --at-seg-radius: 0.55rem;
}

.page-archive .archive-toolbar__shell {
    position: relative;
    overflow: hidden;
    border-radius: var(--at-radius);
    border: 1px solid color-mix(in srgb, var(--sf-border-subtle) 75%, var(--sf-color-primary) 25%);
    background:
        radial-gradient(560px 150px at 0% 0%, color-mix(in srgb, var(--sf-color-primary) 14%, transparent), transparent 70%),
        linear-gradient(135deg, var(--sf-surface-card) 0%, color-mix(in srgb, var(--sf-surface-subtle) 65%, white) 100%);
    box-shadow: 0 10px 26px rgb(15 23 42 / 0.06);
}

.page-archive .archive-toolbar__shell::before {
    content: "";
    position: absolute;
    inset-inline-start: 0;
    inset-block: 0;
    width: 3px;
    background: linear-gradient(
        180deg,
        var(--sf-color-primary),
        color-mix(in srgb, var(--sf-color-primary) 25%, transparent)
    );
}

.page-archive .archive-toolbar__inner {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem 1.25rem;
    flex-wrap: wrap;
    padding: 0.9rem 1rem 0.95rem 1.2rem;
}

.page-archive .archive-toolbar__lead {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    min-width: 0;
    flex: 1 1 18rem;
}

.page-archive .archive-toolbar__kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sf-color-primary);
}

.page-archive .archive-toolbar__hint {
    font-size: 0.78rem;
    color: var(--sf-text-muted);
    line-height: 1.35;
}

.page-archive .archive-toolbar__heading {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.page-archive .archive-toolbar__segment {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    max-width: 100%;
    padding: 0.22rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    border-radius: calc(var(--at-seg-radius) + 0.15rem);
    background: color-mix(in srgb, var(--sf-surface-subtle) 88%, var(--sf-color-primary) 4%);
    border: 1px solid color-mix(in srgb, var(--sf-border-subtle) 92%, transparent);
}

.page-archive .archive-toolbar__segment::-webkit-scrollbar {
    display: none;
}

.page-archive .archive-toolbar__seg.form-check {
    position: relative;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    min-height: 0;
    flex: 0 0 auto;
}

.page-archive .archive-toolbar__seg .form-check-input {
    position: absolute;
    opacity: 0;
    width: 1px;
    height: 1px;
    margin: 0;
    pointer-events: none;
}

.page-archive .archive-toolbar__seg .form-check-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    min-height: 2.2rem;
    padding: 0.4rem 0.8rem;
    border: 0;
    border-radius: var(--at-seg-radius);
    background: transparent;
    color: var(--sf-text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    cursor: pointer;
    transition:
        color 200ms var(--arch-ease),
        background 200ms var(--arch-ease),
        box-shadow 200ms var(--arch-ease),
        transform 140ms var(--arch-ease);
}

.page-archive .archive-toolbar__seg .form-check-label:hover {
    color: var(--sf-text-strong);
    background: color-mix(in srgb, var(--sf-surface-card) 75%, transparent);
}

.page-archive .archive-toolbar__seg.active .form-check-label,
.page-archive .archive-toolbar__seg .form-check-input:checked + .form-check-label {
    color: var(--sf-color-primary);
    background: var(--sf-surface-card);
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08), 0 0 0 1px color-mix(in srgb, var(--sf-color-primary) 18%, transparent);
}

.page-archive .archive-toolbar__aside {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.45rem;
    flex: 0 0 auto;
}

.page-archive .archive-toolbar__aside-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--sf-text-muted);
}

.page-archive .archive-toolbar__views {
    display: inline-flex;
    align-items: center;
    gap: 0.2rem;
    padding: 0.22rem;
    border-radius: calc(var(--at-seg-radius) + 0.15rem);
    background: color-mix(in srgb, var(--sf-surface-subtle) 88%, var(--sf-color-primary) 4%);
    border: 1px solid color-mix(in srgb, var(--sf-border-subtle) 92%, transparent);
}

.page-archive .archive-toolbar__view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.35rem;
    height: 2.2rem;
    padding: 0;
    border: 0;
    border-radius: var(--at-seg-radius);
    background: transparent;
    color: var(--sf-text-muted);
    cursor: pointer;
    transition:
        color 200ms var(--arch-ease),
        background 200ms var(--arch-ease),
        box-shadow 200ms var(--arch-ease);
}

.page-archive .archive-toolbar__view i {
    font-size: 1.05rem;
}

.page-archive .archive-toolbar__view:hover {
    color: var(--sf-text-strong);
    background: color-mix(in srgb, var(--sf-surface-card) 75%, transparent);
}

.page-archive .archive-toolbar__view.active {
    color: var(--sf-color-primary);
    background: var(--sf-surface-card);
    box-shadow: 0 1px 2px rgb(15 23 42 / 0.08), 0 0 0 1px color-mix(in srgb, var(--sf-color-primary) 18%, transparent);
}

/* ── Product grid cards (archive-scoped) ── */
.page-archive .category-items #list_files {
    --bs-gutter-y: 1.15rem;
}

.page-archive .archive-product-col .product-box {
    height: 100%;
    border-radius: var(--arch-radius);
    border: 1px solid var(--sf-border-subtle);
    background: var(--sf-surface-card);
    box-shadow: 0 6px 18px rgb(15 23 42 / 0.04);
    overflow: hidden;
    transition:
        transform 220ms var(--arch-ease),
        box-shadow 220ms var(--arch-ease),
        border-color 220ms var(--arch-ease);
}

.page-archive .archive-product-col .product-box:hover {
    transform: translateY(-4px);
    border-color: color-mix(in srgb, var(--sf-color-primary) 28%, var(--sf-border-subtle));
    box-shadow: 0 16px 34px rgb(15 23 42 / 0.1);
}

.page-archive .archive-product-col .product-image {
    background: linear-gradient(180deg, #f8fafc, #fff);
}

.page-archive .archive-product-col .product-title .title p {
    font-weight: 700;
    color: var(--sf-text-strong);
}

.page-archive .archive-product-col .product-action .new-price {
    font-weight: 800;
    color: var(--sf-color-primary);
}

.page-archive .archive-product-col .product-action .btn,
.page-archive .archive-product-col .product-action a.btn {
    border-radius: var(--arch-radius-sm);
    font-weight: 700;
}

/* List / compact density */
.page-archive .archive-view--list .archive-product-col {
    flex: 0 0 100%;
    max-width: 100%;
}

.page-archive .archive-view--list .product-box {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    gap: 1rem;
}

.page-archive .archive-view--list .product-image {
    flex: 0 0 180px;
    max-width: 180px;
}

.page-archive .archive-view--list .product-title,
.page-archive .archive-view--list .product-action {
    flex: 1 1 200px;
}

.page-archive .archive-view--compact .archive-product-col {
    flex: 0 0 50%;
    max-width: 50%;
}

@media (min-width: 992px) {
    .page-archive .archive-view--compact .archive-product-col {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* ── Empty + pagination + SEO ── */
.page-archive .archive-empty-state {
    border-radius: var(--arch-radius);
    border: 1px dashed color-mix(in srgb, var(--sf-color-primary) 25%, var(--sf-border-subtle));
    background:
        radial-gradient(420px 160px at 50% 0%, color-mix(in srgb, var(--sf-color-primary) 10%, transparent), transparent 70%),
        var(--sf-surface-card);
}

.page-archive .archive-empty-state__icon i {
    color: color-mix(in srgb, var(--sf-color-primary) 55%, #94a3b8);
}

.page-archive .my-paginate .pagination {
    gap: 0.35rem;
}

.page-archive .my-paginate .page-link {
    min-width: 2.4rem;
    min-height: 2.4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--arch-radius-sm) !important;
    border: 1px solid var(--sf-border-subtle);
    color: var(--sf-text-default);
    font-weight: 700;
    background: var(--sf-surface-card);
}

.page-archive .my-paginate .page-item.active .page-link {
    background: var(--sf-color-primary);
    border-color: var(--sf-color-primary);
    color: #fff;
}

.page-archive .archive-seo-text .content-box {
    border-radius: var(--arch-radius);
    border: 1px solid var(--sf-border-subtle);
    box-shadow: 0 8px 20px rgb(15 23 42 / 0.04);
}

/* ── Mobile filter FAB ── */
.page-archive .btn-filter-float {
    z-index: 1040;
    inset-inline-start: 1rem;
    bottom: calc(1.1rem + env(safe-area-inset-bottom, 0px));
    border-radius: var(--arch-radius-sm) !important;
    min-width: 4.4rem;
    padding-block: 0.55rem !important;
    box-shadow: 0 12px 28px color-mix(in srgb, var(--sf-color-primary) 35%, rgb(15 23 42 / 0.25)) !important;
}

.page-archive .custom-filter .offcanvas {
    border-inline-end: 1px solid var(--sf-border-subtle);
}

.page-archive .custom-filter .offcanvas-header {
    border-bottom: 1px solid var(--sf-border-subtle);
    background: color-mix(in srgb, var(--sf-color-primary) 6%, white);
}

.page-archive .custom-filter .filter-items {
    border: 0;
    box-shadow: none;
    background: transparent;
    padding: 0;
    max-height: none;
    overflow: visible;
    position: static;
}

@media (max-width: 991.98px) {
    .page-archive .archive-toolbar__inner {
        align-items: stretch;
        padding: 0.8rem 0.85rem 0.85rem 1rem;
    }

    .page-archive .archive-toolbar__aside {
        width: 100%;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    .page-archive .archive-toolbar__hint {
        display: none;
    }
}

@media (max-width: 575.98px) {
    .page-archive .archive-page-head__banner {
        width: 56px;
        height: 56px;
    }

    .page-archive .archive-page-head__title {
        font-size: 1.15rem;
    }

    .page-archive .archive-view--compact .archive-product-col {
        flex: 0 0 50%;
        max-width: 50%;
    }
}
