/**
 * File: assets/css/frontend/catalog/responsive.css
 * Purpose: Adapts the Marketplace shell, merged three-field toolbar, three-column grid, sidebar and compact pagination.
 * Scope: Marketplace responsive rules only.
 * Related PHP: src/Product/Catalog/Frontend/CatalogRenderer.php, src/Product/Catalog/Frontend/CatalogToolbarRenderer.php, src/Product/Catalog/Frontend/CatalogPaginationRenderer.php
 * Related CSS: assets/css/frontend/catalog/*.css
 * Related JS: assets/js/frontend/catalog/toolbar.js
 * Package: HyperDAF Engine
 */

@media (max-width: 1180px) {
    .hdf-marketplace-layout--sidebar {
        grid-template-columns: minmax(0, 1fr) 260px;
    }

    .hdf-products-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .hdf-catalog-toolbar {
        grid-template-columns: minmax(160px, auto) minmax(0, 1fr);
    }

    .hdf-catalog-toolbar__form {
        grid-template-columns: minmax(190px, 1.15fr) minmax(135px, .7fr) minmax(145px, .75fr) minmax(112px, .55fr) auto;
    }

    .hdf-catalog-view {
        display: none;
    }
}

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

    .hdf-marketplace-sidebar {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

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

    .hdf-catalog-toolbar {
        grid-template-columns: minmax(145px, auto) minmax(0, 1fr);
    }

    .hdf-catalog-toolbar__form {
        grid-template-columns: minmax(180px, 1.15fr) minmax(130px, .75fr) minmax(140px, .8fr) auto;
    }

    .hdf-catalog-toolbar__secondary {
        display: none;
    }

    .hdf-catalog-pagination__number:not(.is-compact-visible),
    .hdf-catalog-pagination__ellipsis {
        display: none;
    }
}

@media (max-width: 680px) {
    .hdf-marketplace__inner {
        width: min(calc(100% - 1.25rem), var(--hdf-market-width));
        padding-block: 1.25rem 3rem;
    }

    .hdf-marketplace__header h1 {
        font-size: 2rem;
    }

    .hdf-products-grid,
    .hdf-marketplace-sidebar {
        grid-template-columns: 1fr;
    }

    .hdf-catalog-toolbar {
        grid-template-columns: 1fr;
        gap: .65rem;
    }

    .hdf-catalog-toolbar__summary {
        white-space: normal;
    }

    .hdf-catalog-toolbar__form {
        grid-template-columns: 1fr;
    }

    .hdf-catalog-toolbar__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hdf-catalog-pagination > .page-numbers {
        gap: .15rem;
    }

    .hdf-catalog-pagination a,
    .hdf-catalog-pagination span {
        min-width: 34px;
        min-height: 36px;
        padding: .4rem .5rem;
        font-size: .8rem;
    }

    .hdf-catalog-pagination__direction a,
    .hdf-catalog-pagination__direction span {
        padding-inline: .55rem;
    }

    .hdf-products-grid--list .hdf-product-card {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hdf-product-card,
    .hdf-product-card__image {
        transition: none;
    }
}
