/* Archive sản phẩm: style riêng cho trang shop/danh mục sản phẩm và item WooCommerce. */

/* Container Hero/Stats tính padding vào 100% chiều rộng, tránh tràn và lệch phải. */
.pql-shop-hero__inner,
.pql-shop-stats > .pql-shared-container,
.pql-product-archive.pql-shared-container {
    box-sizing: border-box;
}

/* ================= HERO SHOP ================= */
/* Hero Shop chỉ hiện ở trang cửa hàng chính: nền máy, veil navy trái sang phải. */
.pql-shop-hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: clamp(220px, 22vw, 310px);
    color: #fff;
}

.pql-shop-hero__bg {
    position: absolute;
    inset: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center right;
}

.pql-shop-hero__veil {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(90deg,
            rgba(13, 27, 62, .96) 0%,
            rgba(13, 27, 62, .88) 34%,
            rgba(13, 27, 62, .48) 62%,
            rgba(13, 27, 62, .12) 100%);
}

.pql-shop-hero__inner {
    padding-top: clamp(18px, 2.5vw, 32px);
    padding-bottom: clamp(28px, 4vw, 54px);
}

/* Breadcrumb trong hero: bỏ nền navy riêng, giữ chữ sáng. */
.pql-shop-hero .pql-breadcrumb {
    padding-right: 0;
    padding-left: 0;
    background: transparent;
}

.pql-shop-hero__inner h1 {
    margin: 0;
    color: #fff;
    font-size: clamp(2rem, 4.2vw, 3.2rem);
    font-weight: 800;
    line-height: 1.08;
}

.pql-shop-hero__inner > p {
    max-width: 570px;
    margin: 14px 0 0;
    color: rgba(255, 255, 255, .84);
    font-size: clamp(.9rem, 1.25vw, 1.05rem);
    line-height: 1.55;
}

/* ================= SỐ LIỆU SHOP ================= */
.pql-shop-stats {
    border-bottom: 1px solid var(--pql-shared-line);
    background: #fff;
    box-shadow: 0 8px 20px rgba(13, 27, 62, .05);
}

.pql-shop-stats__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin: 0;
    padding: 20px 0;
    list-style: none;
}

.pql-shop-stats__item {
    display: grid;
    grid-template-columns: 54px 150px;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-width: 0;
    padding: 8px clamp(14px, 2vw, 28px);
    border-left: 1px solid var(--pql-shared-line);
    color: var(--pql-shared-navy);
}

.pql-shop-stats__item:first-child {
    border-left: 0;
}

/* Font Awesome cùng khung 54px, lớn hơn text và giúp 3 cột cân tuyệt đối. */
.pql-shop-stats__item > i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    color: var(--pql-shared-navy);
    font-size: 2.7rem;
    line-height: 1;
}

.pql-shop-stats__item > span {
    display: grid;
}

.pql-shop-stats__item strong {
    font-size: clamp(1.25rem, 2vw, 1.65rem);
    font-weight: 800;
    line-height: 1;
}

.pql-shop-stats__item small {
    margin-top: 5px;
    color: var(--pql-shared-muted);
    font-size: .78rem;
    line-height: 1.2;
}

@media (max-width: 900px) {
    .pql-shop-stats__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 16px 0;
    }

    .pql-shop-stats__item:nth-child(3) {
        border-left: 0;
    }
}

@media (max-width: 560px) {
    .pql-shop-hero__bg {
        object-position: center;
    }

    /* Mobile giữ 2 cột; thu gọn icon/text để không tràn màn hình. */
    .pql-shop-stats__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 14px 0;
    }

    .pql-shop-stats__item {
        grid-template-columns: 38px minmax(0, 1fr);
        justify-content: stretch;
        gap: 8px;
        padding: 8px 6px;
    }

    .pql-shop-stats__item > i {
        width: 38px;
        height: 38px;
        font-size: 2rem;
    }

    .pql-shop-stats__item strong {
        font-size: 1.15rem;
    }

    .pql-shop-stats__item small {
        font-size: .68rem;
    }
}

/* ================= BỘ LỌC AJAX SHOP ================= */
.pql-shop-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: clamp(28px, 3vw, 48px);
    align-items: start;
}

.pql-shop-filter {
    position: sticky;
    top: 20px;
    align-self: start;
    max-height: calc(100vh - 40px);
    padding-right: 24px;
    overflow-y: auto;
    border-right: 1px solid var(--pql-shared-line);
    scrollbar-width: thin;
    scrollbar-color: var(--pql-shared-line) transparent;
}

.pql-shop-filter__form {
    position: static;
}

/* Nút accordion chỉ hiện trên iPad/mobile. */
.pql-shop-filter__toggle {
    display: none;
}

.pql-shop-filter__form h2 {
    margin: 0 0 22px;
    color: var(--pql-shared-navy);
    font-size: 1.2rem;
    font-weight: 800;
}

.pql-shop-filter__group {
    display: block;
    margin: 0;
    padding: 0 0 20px;
    border: 0;
    border-bottom: 1px solid var(--pql-shared-line);
}

.pql-shop-filter__group + .pql-shop-filter__group {
    padding-top: 0;
}

.pql-shop-filter__group legend {
    display: block;
    width: 100%;
    margin: 0 0 12px;
    padding: 1rem 0 0 !important;
    color: var(--pql-shared-navy);
    font-size: .88rem;
    font-weight: 800;
    line-height: 1.2;
}

.pql-shop-filter__group label {
    display: flex;
    align-items: center;
    gap: 9px;
    min-height: 30px;
    margin: 0 0 5px;
    color: var(--pql-shared-muted);
    font-size: .84rem;
    cursor: pointer;
}

.pql-shop-filter__group input {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--pql-shared-red);
}

.pql-shop-filter__group input:checked + span {
    color: var(--pql-shared-ink);
    font-weight: 700;
}

.pql-shop-filter__reset {
    width: 100%;
    min-height: 42px;
    margin-top: 22px;
    border: 1px solid var(--pql-shared-navy);
    background: #fff;
    color: var(--pql-shared-navy);
    font-size: .78rem;
    font-weight: 800;
    cursor: pointer;
}

.pql-shop-filter__reset:hover,
.pql-shop-filter__reset:focus-visible {
    background: var(--pql-shared-navy);
    color: #fff;
}

.pql-shop-results {
    min-width: 0;
}

.pql-shop-results__toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.pql-shop-results__count {
    margin: 0;
    color: var(--pql-shared-muted);
    font-size: .84rem;
}

.pql-shop-results__sort {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--pql-shared-muted);
    font-size: .82rem;
}

.pql-shop-results__sort select {
    min-width: 170px;
    min-height: 38px;
    padding: 7px 32px 7px 10px;
    border: 1px solid var(--pql-shared-line);
    background: #fff;
    color: var(--pql-shared-ink);
}

.pql-shop-results__loading,
.pql-shop-results__error,
.pql-shop-results__empty {
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    min-height: 360px;
    margin: 0;
    color: var(--pql-shared-muted);
    text-align: center;
}

.pql-shop-results__loading::before {
    content: "";
    width: 34px;
    height: 34px;
    margin: 0;
    border: 3px solid var(--pql-shared-line);
    border-top-color: var(--pql-shared-red);
    border-radius: 50%;
    animation: pql-shop-spin .7s linear infinite;
}

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

.pql-shop-results__error {
    align-content: center;
    gap: 12px;
}

.pql-shop-results__error p {
    margin: 0;
}

.pql-shop-results__error button {
    padding: 10px 18px;
    border: 0;
    background: var(--pql-shared-red);
    color: #fff;
    cursor: pointer;
}

.pql-shop-results .woocommerce-pagination {
    margin-top: 28px;
}

.pql-shop-results .woocommerce-pagination ul {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* Phân trang ô vuông: mũi tên hai bên, trang hiện tại nền đỏ như mẫu. */
.pql-shop-results .woocommerce-pagination a,
.pql-shop-results .woocommerce-pagination span {
    display: grid;
    place-items: center;
    width: 36px;
    min-width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #edf0f4;
    border-radius: 2px;
    background: #fff;
    color: var(--pql-shared-navy);
    font-size: .78rem;
    font-weight: 600;
    line-height: 1;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(13, 27, 62, .04);
}

.pql-shop-results .woocommerce-pagination a:hover,
.pql-shop-results .woocommerce-pagination a:focus-visible {
    border-color: var(--pql-shared-red);
    color: var(--pql-shared-red);
}

.pql-shop-results .woocommerce-pagination .current {
    border-color: var(--pql-shared-red);
    background: var(--pql-shared-red);
    color: #fff;
    box-shadow: 0 4px 10px rgba(200, 16, 46, .24);
}

/* CTA cuối vùng kết quả Shop: nội dung cố định, icon Lineicons và nút Contact. */
.pql-shop-results__cta,
.pql-shop-results__cta * {
    box-sizing: border-box;
}

.pql-shop-results__cta {
    display: grid;
    grid-template-columns: 54px minmax(220px, 1fr) auto;
    align-items: center;
    gap: 20px;
    margin-top: 30px;
    padding: 18px 28px;
    border: 1px solid #edf1f8;
    background: #f2f6fd;
    box-shadow: 0 8px 22px rgba(13, 27, 62, .05);
}

.pql-shop-results__cta > i {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    color: var(--pql-shared-navy);
    font-size: 2.65rem;
}

.pql-shop-results__cta strong {
    display: block;
    color: var(--pql-shared-navy);
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.pql-shop-results__cta p {
    margin: 5px 0 0;
    color: var(--pql-shared-muted);
    font-size: .9rem;
    line-height: 1.35;
}

.pql-shop-results__cta > a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-width: 190px;
    min-height: 44px;
    padding: 11px 20px;
    color: #fff;
    background: var(--pql-shared-navy);
    font-size: 1rem;
    font-weight: 800;
    text-decoration: none;
    white-space: nowrap;
    transition: background .2s ease;
}

.pql-shop-results__cta > a:hover,
.pql-shop-results__cta > a:focus-visible {
    background: var(--pql-shared-red);
}

@media (max-width: 900px) {
    /* iPad: CTA vẫn giữ icon, nội dung và nút trên cùng một hàng. */
    .pql-shop-results__cta {
        grid-template-columns: 46px minmax(0, 1fr) auto;
        gap: 14px;
        padding: 16px 18px;
    }

    .pql-shop-results__cta > i {
        width: 46px;
        height: 46px;
        font-size: 2.25rem;
    }

    .pql-shop-results__cta > a {
        grid-column: auto;
        min-width: 170px;
        justify-self: auto;
    }

    .pql-shop-layout {
        grid-template-columns: 1fr;
        gap: 22px;
    }

    .pql-shop-filter {
        position: static;
        max-height: none;
        padding: 0;
        overflow: visible;
        border: 1px solid var(--pql-shared-line);
        background: #fff;
    }

    .pql-shop-filter__form {
        position: static;
        max-height: none;
        overflow: visible;
    }

    /* Thanh Filter Projects gọn; bấm để mở nội dung. */
    .pql-shop-filter__toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        min-height: 48px;
        padding: 0 16px;
        border: 0;
        background: #fff;
        color: var(--pql-shared-navy);
        font-size: .9rem;
        font-weight: 800;
        cursor: pointer;
    }

    .pql-shop-filter__toggle i {
        color: var(--pql-shared-red);
        font-size: 1rem;
        transition: transform .2s ease;
    }

    .pql-shop-filter.is-open .pql-shop-filter__toggle i {
        transform: rotate(90deg);
    }

    .pql-shop-filter__form h2 {
        display: none;
    }

    .pql-shop-filter__body {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
        padding: 4px 16px 16px;
        border-top: 1px solid var(--pql-shared-line);
    }

    .pql-shop-filter.is-open .pql-shop-filter__body {
        display: grid;
    }

    .pql-shop-filter__reset {
        grid-column: 1 / -1;
        margin-top: 0;
    }

    .pql-shop-filter__group + .pql-shop-filter__group {
        padding-top: 0;
    }
}

@media (max-width: 560px) {
    .pql-shop-results__cta {
        grid-template-columns: 1fr;
        justify-items: center;
        padding: 20px 16px;
        text-align: center;
    }

    .pql-shop-results__cta > a {
        grid-column: auto;
        justify-self: stretch;
        width: 100%;
    }

    .pql-shop-filter__body {
        grid-template-columns: 1fr;
    }

    .pql-shop-filter__reset {
        grid-column: auto;
    }

    .pql-shop-results__toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .pql-shop-results__sort {
        justify-content: space-between;
    }

    .pql-shop-results__sort select {
        flex: 1;
        min-width: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .pql-shop-results__loading::before { animation: none; }
}

/* ================= DANH SÁCH SẢN PHẨM ================= */
.pql-product-archive {
    padding-top: 38px;
    padding-bottom: 56px;
}

.pql-product-archive__header {
    margin-bottom: 28px;
}

.pql-product-archive__header h1 {
    margin: 0;
    color: var(--pql-shared-navy);
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.2;
}

.woocommerce .pql-product-archive ul.products,
.pql-product-archive ul.products {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin: 0;
    padding: 0;
}

.woocommerce .pql-product-archive ul.products::before,
.woocommerce .pql-product-archive ul.products::after,
.pql-product-archive ul.products::before,
.pql-product-archive ul.products::after {
    display: none;
}

.woocommerce .pql-product-archive ul.products li.product,
.pql-product-archive ul.products li.product {
    float: none;
    width: auto;
    margin: 0;
}

@media (max-width: 900px) {
    .woocommerce .pql-product-archive ul.products,
    .pql-product-archive ul.products {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 560px) {
    .woocommerce .pql-product-archive ul.products,
    .pql-product-archive ul.products {
        grid-template-columns: 1fr;
    }
}
