/* ============================================================
   ARCHIVE PAGE — quà tặng
   v3 – redesign sidebar & toolbar
============================================================ */

/* ── VARIABLES ─────────────────────────────────────────── */
:root {
    --sb-width:     268px;
    --sb-gap:        36px;
    --arch-gold:     #C9A96E;
    --arch-gold-lt:  #FDF6EC;
    --arch-gold-brd: #F0DFC0;
}

/* ── ARCHIVE PAGE WRAPPER ─────────────────────────────── */
.archive-page { background: #F7F8FA; min-height: 100vh; }

/* ============================================================
   PAGE HERO HEADER
============================================================ */
.archive-hero {
    background: var(--color-white);
    border-bottom: 1px solid var(--color-border);
    padding: 20px 0 28px;
}

.archive-hero .mqt-breadcrumb { margin-bottom: 18px; }

.archive-hero__body {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
}

.archive-hero__icon {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--arch-gold), #B8924A);
    color: #fff;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(201,169,110,.35);
}

.archive-hero__title {
    font-size: clamp(1.5rem, 2.8vw, 2.1rem);
    margin: 0 0 4px;
    color: var(--color-primary);
}

.archive-hero__desc {
    font-size: 0.88rem;
    color: var(--color-text-light);
    margin: 0;
}

.archive-hero__count {
    margin-left: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: var(--arch-gold-lt);
    border: 1px solid var(--arch-gold-brd);
    border-radius: 12px;
    padding: 10px 20px;
    min-width: 80px;
    text-align: center;
}

.count-num {
    font-size: 1.8rem;
    font-weight: 800;
    line-height: 1;
    color: var(--arch-gold);
    font-family: var(--font-heading);
}

.count-lbl {
    font-size: 0.72rem;
    color: #9C7740;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Active filter chips */
.archive-chips {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.archive-chips__label {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    font-weight: 600;
}

.archive-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    background: var(--arch-gold-lt);
    color: #92400E;
    border: 1px solid var(--arch-gold-brd);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
}

.archive-chip__x {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background: rgba(0,0,0,.08);
    border-radius: 50%;
    color: #92400E;
    font-size: 0.6rem;
    transition: background .15s;
}

.archive-chip__x:hover { background: rgba(0,0,0,.18); }

.archive-chips__clear {
    font-size: 0.8rem;
    color: #DC2626;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ============================================================
   LAYOUT
============================================================ */
.archive-layout {
    display: grid;
    grid-template-columns: var(--sb-width) 1fr;
    gap: var(--sb-gap);
    padding: 32px 0 80px;
    align-items: start;
}

/* ============================================================
   SIDEBAR
============================================================ */
.archive-sidebar {
    position: sticky;
    top: calc(var(--header-height, 72px) + 16px);
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0,0,0,.06);
}

/* Sidebar header */
.sidebar-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px 18px;
    background: var(--color-primary);
    color: #fff;
}

.sidebar-head__title {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: .03em;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sidebar-head__title i { opacity: .8; }

.sidebar-head__clear {
    font-size: 0.75rem;
    color: rgba(255,255,255,.7);
    border: 1px solid rgba(255,255,255,.3);
    border-radius: 100px;
    padding: 3px 10px;
    transition: all .15s;
    white-space: nowrap;
}

.sidebar-head__clear:hover { background: rgba(255,255,255,.15); color: #fff; }

.sidebar-close-btn {
    display: none;
    width: 28px;
    height: 28px;
    background: rgba(255,255,255,.15);
    border-radius: 6px;
    color: #fff;
    font-size: 0.85rem;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

/* ── FILTER GROUP ─────────────────────────────────────── */
.filter-group {
    border-bottom: 1px solid #F1F3F5;
}

.filter-group:last-child { border-bottom: none; }

.filter-group__head {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 14px 16px;
    background: none;
    cursor: pointer;
    transition: background .12s;
    text-align: left;
}

.filter-group__head:hover { background: #FAFAFA; }

.filter-group__icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.filter-group__icon--dip   { background: #EDE9FE; color: #6D28D9; }
.filter-group__icon--doi   { background: #DCFCE7; color: #15803D; }
.filter-group__icon--price { background: #FEF3C7; color: #D97706; }
.filter-group__icon--col   { background: #DBEAFE; color: #1D4ED8; }
.filter-group__icon--brand { background: #FCE7F3; color: #BE185D; }

.filter-group__name {
    flex: 1;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: .01em;
}

.filter-group__arrow {
    font-size: 0.7rem;
    color: #9CA3AF;
    transition: transform .25s;
}

.filter-group__head[aria-expanded="false"] .filter-group__arrow {
    transform: rotate(-90deg);
}

/* ── FILTER BODY ──────────────────────────────────────── */
.filter-group__body {
    padding: 4px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

/* ── FILTER ITEM ──────────────────────────────────────── */
.filter-item {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 7px 10px;
    border-radius: 8px;
    font-size: 0.845rem;
    color: var(--color-text);
    transition: all .15s;
    text-decoration: none;
}

.filter-item:hover {
    background: var(--arch-gold-lt);
    color: #92400E;
}

.filter-item--active {
    background: var(--arch-gold-lt);
    color: #92400E;
    font-weight: 600;
}

.filter-item--active .filter-item__dot {
    background: var(--arch-gold);
    border-color: var(--arch-gold);
    box-shadow: 0 0 0 3px rgba(201,169,110,.2);
}

.filter-item__dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    border: 2px solid #D1D5DB;
    flex-shrink: 0;
    transition: all .15s;
}

.filter-item:hover .filter-item__dot { border-color: var(--arch-gold); }

.filter-item__name { flex: 1; line-height: 1.3; }

.filter-item__count {
    font-size: 0.7rem;
    font-weight: 600;
    background: #F3F4F6;
    color: #6B7280;
    padding: 2px 7px;
    border-radius: 100px;
    flex-shrink: 0;
}

.filter-item--active .filter-item__count {
    background: var(--arch-gold-brd);
    color: #92400E;
}

/* ── COLLECTION CHIPS ─────────────────────────────────── */
.filter-group__body--cards {
    padding: 6px 12px 12px;
    gap: 4px;
}

.collection-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 8px 10px;
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--color-text);
    transition: all .15s;
    text-decoration: none;
    border: 1px solid transparent;
}

.collection-chip:hover {
    background: var(--arch-gold-lt);
    border-color: var(--arch-gold-brd);
    color: #92400E;
}

.collection-chip__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid rgba(0,0,0,.1);
}

.collection-chip__name { flex: 1; font-weight: 500; }

.collection-chip__arrow {
    font-size: 0.65rem;
    color: #D1D5DB;
    transition: color .15s, transform .15s;
}

.collection-chip:hover .collection-chip__arrow {
    color: var(--arch-gold);
    transform: translateX(2px);
}

/* ============================================================
   TOOLBAR
============================================================ */
.archive-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
    padding: 12px 16px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.archive-toolbar__left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.archive-toolbar__right {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Filter toggle button */
.filter-toggle-btn {
    display: none;
    align-items: center;
    gap: 7px;
    padding: 8px 14px;
    background: var(--color-primary);
    color: #fff;
    border-radius: 8px;
    font-size: 0.84rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    position: relative;
}

.filter-toggle-btn:hover { background: #2D2D2D; }

.filter-toggle-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 16px;
    height: 16px;
    background: var(--arch-gold);
    color: #fff;
    border-radius: 50%;
    font-size: 0.65rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toolbar-result {
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.toolbar-result strong {
    color: var(--color-primary);
    font-weight: 700;
}

/* Sort dropdown */
.sort-wrap {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--color-white);
    transition: border-color .15s;
}

.sort-wrap:focus-within { border-color: var(--arch-gold); }

.sort-wrap__icon {
    padding: 0 10px;
    color: #9CA3AF;
    font-size: 0.8rem;
    pointer-events: none;
}

.sort-select {
    padding: 8px 12px 8px 0;
    border: none;
    outline: none;
    font-size: 0.84rem;
    color: var(--color-text);
    background: transparent;
    cursor: pointer;
    min-width: 140px;
}

/* View toggle */
.view-toggle {
    display: flex;
    gap: 2px;
    background: #F3F4F6;
    border-radius: 8px;
    padding: 3px;
}

.view-btn {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    font-size: 0.82rem;
    color: #9CA3AF;
    cursor: pointer;
    background: transparent;
    border: none;
    transition: all .15s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn.active,
.view-btn:hover {
    background: var(--color-white);
    color: var(--color-primary);
    box-shadow: 0 1px 3px rgba(0,0,0,.12);
}

/* ============================================================
   LOAD MORE
============================================================ */
.load-more-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    margin-top: 40px;
    text-align: center;
}

.btn-load-more {
    min-width: 240px;
    justify-content: center;
    font-size: 0.9rem;
    padding: 14px 32px;
}

.btn-load-more.loading { pointer-events: none; opacity: .7; }

.btn-load-more.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--color-primary);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin .8s linear infinite;
    display: inline-block;
    margin-left: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

.load-more-count { font-size: 0.78rem; font-weight: 400; opacity: .65; }

.load-more-progress {
    width: 220px;
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
}

.load-more-bar {
    height: 100%;
    background: linear-gradient(to right, var(--arch-gold), #B8924A);
    border-radius: 2px;
    transition: width .4s ease;
}

.load-more-text { font-size: 0.8rem; color: var(--color-text-muted); margin: 0; }

.no-more-products {
    padding: 20px;
    text-align: center;
    color: var(--color-text-muted);
    font-size: 0.875rem;
    background: var(--color-white);
    border-radius: 10px;
    margin-top: 24px;
    border: 1px solid var(--color-border);
}

/* ============================================================
   SIDEBAR OVERLAY (mobile)
============================================================ */
.sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 900;
    opacity: 0;
    visibility: hidden;
    transition: all .3s;
    backdrop-filter: blur(2px);
}

.sidebar-overlay.active { opacity: 1; visibility: visible; }

/* ============================================================
   LIST VIEW
============================================================ */
.archive-main.list-view .products-grid--3 { grid-template-columns: 1fr; }
.archive-main.list-view .product-card { flex-direction: row; height: 160px; }
.archive-main.list-view .product-card__image-wrap {
    width: 160px;
    flex-shrink: 0;
    aspect-ratio: unset;
    height: 100%;
}
.archive-main.list-view .product-card__body {
    justify-content: center;
    flex-direction: row;
    flex-wrap: wrap;
    align-content: center;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1080px) {
    :root { --sb-width: 240px; --sb-gap: 24px; }
}

@media (max-width: 900px) {
    .archive-layout { grid-template-columns: 1fr; }

    .archive-sidebar {
        position: fixed;
        top: 0;
        left: -320px;
        height: 100vh;
        width: 300px;
        z-index: 1000;
        border-radius: 0;
        overflow-y: auto;
        transition: left .3s cubic-bezier(.4,0,.2,1);
        border: none;
        box-shadow: 4px 0 24px rgba(0,0,0,.15);
    }

    .archive-sidebar.open { left: 0; }
    .sidebar-close-btn    { display: flex; }
    .filter-toggle-btn    { display: flex; }
}

@media (max-width: 640px) {
    .products-grid--3 { grid-template-columns: repeat(2, 1fr); gap: 10px; }
    .archive-hero__count { display: none; }
    .sort-wrap__icon { display: none; }
    .sort-select { min-width: 120px; }
    .toolbar-result { display: none; }
}

@media (max-width: 400px) {
    .products-grid--3 { grid-template-columns: 1fr; }
}

/* ========================================
   2026 CPT LISTING UPGRADE
======================================== */
.mqt-listing-page {
    background: linear-gradient(180deg, #fbfaf7 0%, #f6f7f9 46%, #ffffff 100%);
}

.archive-hero {
    padding: 26px 0 40px;
    border-bottom: 1px solid rgba(26, 26, 26, .08);
    background:
        linear-gradient(135deg, rgba(255,255,255,.94), rgba(246,240,226,.9)),
        url('../images/generated/mqt-gift-hero-premium.png') right center / min(46vw, 620px) auto no-repeat;
}

.archive-hero--blog {
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(238,244,243,.92)),
        url('../images/generated/mqt-collection-thank-you-gifts.png') right center / min(42vw, 560px) auto no-repeat;
}

.archive-hero--collections {
    background:
        linear-gradient(135deg, rgba(255,255,255,.96), rgba(246,240,226,.9)),
        url('../images/generated/mqt-collection-tet-gifts.png') right center / min(44vw, 600px) auto no-repeat;
}

.archive-hero__body {
    min-height: 260px;
    align-items: center;
}

.archive-hero__copy {
    max-width: 650px;
}

.archive-hero__title {
    font-size: clamp(2.15rem, 5vw, 4.2rem);
    letter-spacing: 0;
    line-height: 1.05;
    margin: 0 0 18px;
}

.archive-hero__desc {
    max-width: 620px;
    font-size: 1.02rem;
    line-height: 1.8;
}

.archive-hero__facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 22px;
}

.archive-hero__facts span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,.82);
    border: 1px solid rgba(201,169,110,.24);
    color: #675031;
    font-size: .86rem;
    font-weight: 600;
}

.archive-hero__count {
    background: rgba(255,255,255,.86);
    backdrop-filter: blur(8px);
    box-shadow: 0 18px 45px rgba(26,26,26,.08);
}

.archive-layout {
    padding-top: 42px;
}

.archive-sidebar {
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(31,35,44,.08);
}

.sidebar-head {
    background: #1f2329;
}

.filter-group__icon {
    background: var(--color-secondary-light);
    color: var(--color-secondary);
}

.sidebar-help {
    margin: 14px;
    padding: 16px;
    border-radius: 8px;
    background: #fbf7ee;
    border: 1px solid #ead8b7;
    display: grid;
    gap: 7px;
    color: #715633;
    font-size: .86rem;
    line-height: 1.55;
}

.sidebar-help i {
    color: var(--color-secondary);
    font-size: 1.2rem;
}

.archive-toolbar {
    border-radius: 8px;
    box-shadow: 0 12px 30px rgba(31,35,44,.06);
}

.collection-archive-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.collections-archive__body {
    padding: 44px 0 84px;
}

.collection-archive-card {
    display: flex;
    flex-direction: column;
}

.collection-archive-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.collection-archive-card .product-card__cta {
    margin-top: auto;
}

@media (max-width: 980px) {
    .archive-hero,
    .archive-hero--blog,
    .archive-hero--collections {
        background-image: linear-gradient(135deg, rgba(255,255,255,.96), rgba(246,240,226,.92));
    }

    .archive-hero__body {
        min-height: auto;
    }

    .collection-archive-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .archive-hero {
        padding: 18px 0 30px;
    }

    .archive-hero__title {
        font-size: 2.25rem;
    }

    .archive-hero__facts {
        display: none;
    }

    .collection-archive-grid {
        grid-template-columns: 1fr;
    }
}
