/* Wepic — catalog pages (shop, categories, tags, product search). */

.catalog__header { padding-block: clamp(24px, 4vw, 40px) clamp(20px, 3vw, 32px); background: var(--sand); }
.catalog__title { margin: 0; font-size: clamp(2.3rem, 1.6rem + 2.8vw, 3.6rem); }
.category-track--sub { margin-top: clamp(20px, 3vw, 28px); }

.catalog__layout { display: grid; gap: 32px; padding-block: 28px var(--section-space); }
@media (min-width: 1024px) { .catalog__layout { grid-template-columns: 260px minmax(0, 1fr); gap: 48px; } }

/* Toolbar */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 24px; }
.toolbar__count { margin: 0 auto 0 0; color: var(--muted); font-size: .9rem; }
.toolbar__filter { min-height: 42px; padding: 8px 18px; }
.toolbar__sort { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--muted); }
.toolbar__sort select {
	min-height: 42px; padding: 0 36px 0 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232b2b2b' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 16px;
	color: var(--ink); font-weight: 600; appearance: none; cursor: pointer;
}
.toolbar__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--sand-2); color: var(--ink); font-size: .85rem; font-weight: 600; }
.chip:hover { background: var(--ink); color: var(--white); }
.toolbar__reset, .filters__reset { font-size: .85rem; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 599px) {
	.toolbar { gap: 10px; }
	.toolbar__sort span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.toolbar__sort select { max-width: 160px; font-size: .88rem; }
}

/* Product grid */
.product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 28px 16px; }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px 24px; } }
.catalog__empty { padding: 48px 24px; border-radius: var(--radius-lg); background: var(--sand); text-align: center; }

/* Filters: bottom sheet on mobile (inline without JavaScript), sidebar from 1024px */
.toolbar__filter { display: none; }
.js .toolbar__filter { display: inline-flex; }
@media (min-width: 1024px) { .js .toolbar__filter { display: none; } }
.filters { background: var(--white); }
.js .filters { position: fixed; inset: auto 0 0; z-index: 60; max-height: 85dvh; overflow-y: auto; padding: 0 var(--gutter) 24px; border-radius: 20px 20px 0 0; box-shadow: 0 -10px 40px rgb(0 0 0 / 0.2); transform: translateY(105%); transition: transform .25s ease-out; visibility: hidden; }
.js .filters[data-open] { transform: none; visibility: visible; }
.filters-backdrop { position: fixed; inset: 0; z-index: 55; background: rgb(0 0 0 / 0.45); }
.filters__head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 16px 0 8px; background: var(--white); }
.filters__title { margin: 0; font-weight: 800; font-size: 1.1rem; color: var(--ink); }
.filters__close { color: var(--ink); }
.filters__actions { position: sticky; bottom: -24px; display: flex; align-items: center; gap: 16px; margin-top: 8px; padding: 16px 0 24px; background: var(--white); }
.filters__actions .btn { flex: 1; }
@media (min-width: 1024px) {
	.filters, .js .filters { position: sticky; top: calc(var(--header-h) + 16px); inset: auto; z-index: auto; align-self: start; max-height: calc(100dvh - var(--header-h) - 32px); overflow-y: auto; padding: 0 8px 0 0; border-radius: 0; box-shadow: none; transform: none; visibility: visible; transition: none; scrollbar-width: thin; }
	.filters__head { padding-top: 0; }
	.filters__close { display: none; }
	/* With JavaScript, changes apply instantly on desktop; the button stays as a fallback. */
	.js .filters__actions .btn { display: none; }
	.filters__actions { position: static; padding: 8px 0 0; }
}

.filter { border-bottom: 1px solid var(--line); }
.filter__title { display: flex; align-items: center; gap: 8px; padding: 14px 0; color: var(--ink); font-weight: 700; font-size: .95rem; cursor: pointer; list-style: none; }
.filter__title::-webkit-details-marker { display: none; }
.filter__title::after { content: ""; width: 8px; height: 8px; margin: -4px 4px 0 auto; border: solid var(--muted); border-width: 0 1.6px 1.6px 0; transform: rotate(45deg); transition: transform .2s; }
.filter[open] .filter__title::after { transform: rotate(-135deg); margin-top: 4px; }
.filter__badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--black); font-size: .72rem; }
.filter__options { display: grid; gap: 2px; max-height: 300px; overflow-y: auto; margin: 0; padding: 0 0 14px; border: 0; scrollbar-width: thin; }
.filter__option { display: flex; align-items: center; gap: 10px; padding: 7px 4px; border-radius: 6px; cursor: pointer; font-size: .92rem; color: var(--text); }
.filter__option:hover { background: var(--sand); }
.filter__option input { width: 18px; height: 18px; margin: 0; accent-color: var(--black); flex: none; }
.filter__label { flex: 1; }
.filter__option input:checked ~ .filter__label { color: var(--ink); font-weight: 700; }
.filter__count { color: var(--muted); font-size: .8rem; }

/* Color swatches */
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 1px solid rgb(0 0 0 / 0.15); flex: none; background: var(--sw, #ccc); }
.swatch--beige { --sw: #e8dcc4; } .swatch--blanc { --sw: #fff; } .swatch--bleu { --sw: #2f5d9a; } .swatch--dore { --sw: linear-gradient(135deg, #f5d77a, #b8892b); }
.swatch--gris { --sw: #9a9a9a; } .swatch--jaune { --sw: #f5c518; } .swatch--marron { --sw: #7a4b2a; } .swatch--noir { --sw: #111; }
.swatch--orange { --sw: #f08a24; } .swatch--rose { --sw: #f2a7b9; } .swatch--rouge { --sw: #c62828; } .swatch--terracota { --sw: #c0663f; } .swatch--vert { --sw: #3c8c4a; }

/* SEO description below the grid */
.catalog__description { max-width: 860px; padding-bottom: var(--section-space); color: var(--text); }
.catalog__description h2 { font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.3rem); margin-top: 1.2em; }
.catalog__description h3 { font-size: 1.15rem; margin-top: 1.2em; }
.catalog__description a { color: var(--accent-text); text-decoration: underline; text-underline-offset: 3px; }
