/* ==========================================================================
   Shop, category and product-search listings.
   ========================================================================== */

/* ---------- Category header (tinted by department) ---------- */
.sfd-shophead { --dept: var(--navy); padding-block: 24px 28px; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: inset 0 4px 0 var(--dept); }
.sfd-shophead--art { --dept: var(--pg-art); }
.sfd-shophead--students { --dept: var(--pg-students); }
.sfd-shophead--office { --dept: var(--pg-office); }
.sfd-shophead--writing { --dept: var(--pg-writing); }
.sfd-shophead--boards { --dept: var(--pg-boards); }
.sfd-shophead--misc { --dept: var(--pg-misc); }
.sfd-shophead--books { --dept: var(--pg-books); }
.sfd-shophead--gift { --dept: var(--pg-gift); }
.sfd-shophead__row { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 16px; margin-top: 18px; }
.sfd-shophead__title { font-size: clamp(30px, 4vw, 46px); letter-spacing: -.02em; color: var(--navy); }
.sfd-shophead__count { font: 500 13px/1.4 var(--font-mono); color: var(--text-3); }
.sfd-shophead__desc { margin-top: 10px; max-width: 70ch; font-size: 15px; color: var(--text-2); }

.sfd-subcats { display: flex; gap: 10px; margin-top: 22px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.sfd-subcat { flex: none; display: flex; align-items: center; gap: 10px; padding: 6px 14px 6px 6px; border: 1.5px solid var(--line); border-radius: 100px; background: var(--surface); font-size: 14px; font-weight: 500; white-space: nowrap; transition: border-color .15s, box-shadow .15s; }
.sfd-subcat:hover { border-color: var(--navy); box-shadow: var(--shadow); }
.sfd-subcat__img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; background: var(--tint); }
.sfd-subcat:not(:has(img)) { padding-left: 14px; }
.sfd-subcat__n { font: 500 11px/1 var(--font-mono); color: var(--text-3); }

/* ---------- Layout ---------- */
.sfd-shop__layout { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 36px; align-items: start; padding-block: 28px 72px; }

/* ---------- Filters ---------- */
.sfd-filters { position: sticky; top: 146px; max-height: calc(100vh - 166px); overflow-y: auto; scrollbar-width: thin; padding-right: 6px; }
.sfd-filters__top, .sfd-filters__foot { display: none; }
.sfd-filters__title { font-size: 20px; }
.sfd-fgroup { margin: 0; padding: 0 0 20px; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; min-width: 0; }
.sfd-fgroup + .sfd-fgroup { padding-top: 20px; }
.sfd-fgroup__title { display: block; padding: 0; margin-bottom: 12px; font: 600 11px/1.4 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); }
.sfd-fgroup__search { width: 100%; margin-bottom: 10px; padding: 9px 12px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--paper); font-size: 14px; }
.sfd-fgroup__search:focus { outline: none; border-color: var(--blue); background: #fff; }

/* Toggle switch */
.sfd-switch { display: flex; align-items: center; gap: 12px; padding: 6px 0; font-size: 14.5px; cursor: pointer; }
.sfd-switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sfd-switch__ui { position: relative; flex: none; width: 38px; height: 22px; border-radius: 11px; background: var(--line); transition: background-color .15s; }
.sfd-switch__ui::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); transition: transform .18s var(--ease); }
.sfd-switch input:checked + .sfd-switch__ui { background: var(--navy); }
.sfd-switch input:checked + .sfd-switch__ui::after { transform: translateX(16px); }
.sfd-switch input:focus-visible + .sfd-switch__ui { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Checkboxes */
.sfd-checks { display: grid; gap: 2px; }
.sfd-checks--scroll { max-height: 280px; overflow-y: auto; padding-right: 4px; scrollbar-width: thin; }
.sfd-check { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 4px; font-size: 14px; cursor: pointer; }
.sfd-check:hover { background: var(--paper); }
.sfd-check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.sfd-check__ui { flex: none; width: 18px; height: 18px; border: 1.5px solid var(--text-3); border-radius: 4px; background: #fff; transition: background-color .12s, border-color .12s; }
.sfd-check input:checked + .sfd-check__ui { background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6L9 17l-5-5'/%3E%3C/svg%3E") center / 13px no-repeat; border-color: var(--navy); }
.sfd-check input:focus-visible + .sfd-check__ui { outline: 2px solid var(--blue); outline-offset: 2px; }
.sfd-check__label { flex: 1; }
.sfd-check__n { font: 500 11px/1 var(--font-mono); color: var(--text-3); }

/* Price range: two thumbs on one track */
.sfd-range__track { position: relative; height: 28px; margin: 0 9px; }
.sfd-range__track::before { content: ""; position: absolute; left: 0; right: 0; top: 12px; height: 4px; border-radius: 2px; background: var(--line); }
.sfd-range__fill { position: absolute; top: 12px; height: 4px; border-radius: 2px; background: var(--navy); }
.sfd-range__track input[type="range"] { position: absolute; left: -9px; right: -9px; top: 0; width: calc(100% + 18px); height: 28px; margin: 0; background: none; pointer-events: none; -webkit-appearance: none; appearance: none; }
.sfd-range__track input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); box-shadow: 0 1px 3px rgba(9, 50, 82, .3); pointer-events: auto; cursor: grab; }
.sfd-range__track input[type="range"]::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); pointer-events: auto; cursor: grab; }
.sfd-range__track input[type="range"]::-moz-range-track { background: none; }
.sfd-range__track input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--blue); outline-offset: 2px; }
.sfd-range__inputs { display: flex; align-items: flex-end; gap: 8px; margin-top: 10px; }
.sfd-range__inputs label { flex: 1; display: grid; gap: 4px; font-size: 11.5px; color: var(--text-3); }
.sfd-range__inputs input { width: 100%; padding: 8px 10px; border: 1.5px solid var(--line); border-radius: var(--radius); font: 500 14px/1 var(--font-mono); background: #fff; }
.sfd-range__inputs input:focus { outline: none; border-color: var(--blue); }
.sfd-range__inputs > span { padding-bottom: 10px; color: var(--text-3); }

.sfd-catlinks { display: grid; gap: 2px; }
.sfd-catlinks a { display: flex; justify-content: space-between; gap: 10px; padding: 6px 4px; border-radius: 4px; font-size: 14px; color: var(--text-2); }
.sfd-catlinks a:hover { background: var(--paper); color: var(--blue); }
.sfd-catlinks span { font: 500 11px/1.8 var(--font-mono); color: var(--text-3); }

/* ---------- Toolbar ---------- */
.sfd-toolbar { display: flex; align-items: center; gap: 12px 20px; flex-wrap: wrap; margin-bottom: 16px; }
.sfd-toolbar__filters { display: none; align-items: center; gap: 8px; height: 42px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface); font-size: 14px; font-weight: 600; }
.sfd-toolbar__filters .sfd-icon { width: 18px; height: 18px; }
.sfd-toolbar__n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--cadmium); color: #fff; font: 600 11px/20px var(--font-mono); text-align: center; }
.sfd-toolbar__count { font-size: 14px; color: var(--text-2); }
.sfd-sort { display: flex; align-items: center; gap: 10px; margin-left: auto; font-size: 13.5px; color: var(--text-3); }
.sfd-sort select { height: 42px; padding: 0 36px 0 14px; border: 1.5px solid var(--line); border-radius: var(--radius); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2341586B' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right 12px center / 14px no-repeat; font-size: 14px; font-weight: 500; color: var(--text); -webkit-appearance: none; appearance: none; cursor: pointer; }
.sfd-sort select:focus { outline: none; border-color: var(--blue); }

.sfd-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 18px; }
.sfd-chipbtn { display: inline-flex; align-items: center; gap: 6px; padding: 6px 8px 6px 14px; border-radius: 100px; background: var(--navy); color: #fff; font-size: 13px; font-weight: 500; }
.sfd-chipbtn .sfd-icon { width: 14px; height: 14px; opacity: .75; }
.sfd-chipbtn:hover .sfd-icon { opacity: 1; }
.sfd-chips__clear { font-size: 13px; font-weight: 600; color: var(--cadmium); text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Grid ---------- */
.sfd-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.sfd-grid__item { display: flex; min-width: 0; }
.sfd-grid__item > .sfd-card { flex: 1; }
[data-sfd-results] { transition: opacity .2s; }
[data-sfd-results].is-loading { opacity: .45; pointer-events: none; }
[data-sfd-results].is-loading .sfd-grid { filter: saturate(.4); }

.sfd-more-wrap { display: flex; flex-direction: column; align-items: center; margin-top: 36px; }
.sfd-loadmore { min-width: 240px; }
.sfd-loadmore.is-loading { opacity: .6; pointer-events: none; }
.sfd-more-wrap .sfd-pagination ul { margin-top: 20px; }

.sfd-noresults { padding: 56px 24px; border: 1.5px dashed var(--line); border-radius: 10px; background: var(--surface); text-align: center; }
.sfd-noresults__title { font-size: 26px; }
.sfd-noresults p { max-width: 50ch; margin: 10px auto 0; color: var(--text-2); }
.sfd-noresults__cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 22px; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
	.sfd-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
	.sfd-shop__layout { grid-template-columns: minmax(0, 1fr); padding-top: 20px; }
	.sfd-toolbar__filters { display: inline-flex; }
	/* Filters become a slide-out drawer */
	.sfd-filters { position: fixed; inset: 0 auto 0 0; z-index: 100; width: min(360px, 90vw); max-height: none; padding: 0; display: flex; flex-direction: column; background: var(--surface); box-shadow: var(--shadow-lift); transform: translateX(-102%); transition: transform .3s var(--ease); overflow: hidden; }
	.sfd-filters.is-open { transform: none; }
	.sfd-filters__top { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--line); }
	.sfd-filters__close { width: 40px; height: 40px; display: grid; place-items: center; border-radius: var(--radius); }
	.sfd-filters__form { flex: 1; overflow-y: auto; padding: 20px; }
	.sfd-filters__foot { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--line); }
}
@media (max-width: 760px) {
	.sfd-shophead { padding-block: 18px 20px; }
	.sfd-subcats { margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); scrollbar-width: none; }
	.sfd-subcats::-webkit-scrollbar { display: none; }
	.sfd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
	.sfd-grid .sfd-card__body { padding: 10px 10px 12px; }
	.sfd-grid .sfd-card__title { font-size: 13.5px; }
	.sfd-grid .sfd-card__price { font-size: 14.5px; }
	.sfd-grid .sfd-card__add { min-height: 38px; font-size: 13px; }
	.sfd-grid .sfd-card__img { inset: 10px; width: calc(100% - 20px); height: calc(100% - 20px); }
	.sfd-toolbar { gap: 10px; }
	.sfd-toolbar__count { order: 3; width: 100%; font-size: 13px; }
	.sfd-sort__label { display: none; }
	.sfd-sort select { max-width: 190px; }
}

/* Price boxes: no browser spinner arrows (Safari draws them like a dropdown). */
.sfd-range__inputs input { -moz-appearance: textfield; appearance: textfield; }
.sfd-range__inputs input::-webkit-outer-spin-button, .sfd-range__inputs input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* ---------- Brand pages (/brands/…) ---------- */
.sfd-brandhead { display: flex; align-items: center; gap: 28px; flex-wrap: wrap; margin-top: 20px; padding: 22px 24px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.sfd-brandhead__mark { font-size: 34px; }
.sfd-brandhead__text { flex: 1; min-width: 260px; }
.sfd-brandhead__blurb { margin-top: 6px; max-width: 68ch; font-size: 15.5px; color: var(--text-2); }
.sfd-brandhead + .sfd-shophead__row { margin-top: 18px; }
@media (max-width: 760px) {
	.sfd-brandhead { gap: 16px; padding: 18px; }
	.sfd-brandhead__mark { font-size: 27px; }
	.sfd-brandhead__blurb { font-size: 14.5px; }
}


/* ---- Brand wordmark: the name set in the display face, no supplied artwork ---- */
.sfd-wordmark { font-family: var(--font-display); font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--navy); line-height: 1; }

/* ---- Brand landing page ---- */
.sfd-brandland { background: var(--surface); }
.sfd-brandland__hero { padding-block: clamp(32px, 5vw, 60px); background: linear-gradient(180deg, var(--tint), var(--surface)); border-bottom: 1px solid var(--line-soft); }
.sfd-brandland__hero-inner { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.sfd-brandland__name { font-size: clamp(40px, 7vw, 76px); letter-spacing: .04em; text-transform: uppercase; color: var(--navy); margin-top: 6px; }
.sfd-brandland__tagline { margin-top: 10px; font-family: var(--font-mono); font-size: 12.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--cadmium); }
.sfd-brandland__lede { margin-top: 16px; max-width: 58ch; font-size: clamp(16px, 1.3vw, 18px); line-height: 1.62; color: var(--text-2); }
.sfd-brandland__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.sfd-brandland__logo { display: block; width: min(300px, 70%); height: auto; margin: 4px 0 2px; }

/* Hero collage: three product photographs, overlapped like prints on a desk. */
/* The collage is sized by the grid, not by the photographs, so it cannot grow
   taller than the hero text beside it and spill into the band below. */
.sfd-brandland__shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); gap: 16px; height: clamp(300px, 30vw, 440px); }
.sfd-brandland__shot { margin: 0; min-height: 0; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: var(--surface); box-shadow: var(--shadow); }
.sfd-brandland__shot img { display: block; width: 100%; height: 100%; object-fit: cover; }
.sfd-brandland__shot--1 { grid-row: span 2; }
/* A packshot is shown whole on a tinted panel: cropping one cuts the product in half. */
.sfd-brandland__plate--photo { padding: clamp(14px, 2vw, 26px); border: 1px solid var(--line); border-style: solid; overflow: hidden; background: var(--paper); }
.sfd-brandland__plate--photo img { display: block; width: 100%; height: 100%; max-height: 380px; aspect-ratio: 4 / 3; object-fit: contain; }
.sfd-brandland__mark { display: grid; place-items: center; min-height: 190px; padding: 24px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface) repeating-linear-gradient(180deg, transparent 0 27px, var(--rule) 27px 28px); font-family: var(--font-display); font-size: clamp(34px, 5vw, 58px); font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--navy); box-shadow: var(--shadow); }
.sfd-brandland__pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 18px; margin-top: clamp(32px, 4vw, 48px); list-style: none; padding: 0; }
.sfd-brandland__pillar { padding: 22px 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.sfd-brandland__num { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--tint); font-family: var(--font-mono); font-size: 13px; color: var(--navy); }
.sfd-brandland__pillar-title { margin: 12px 0 6px; font-size: 18px; color: var(--navy); }
.sfd-brandland__pillar p { font-size: 14.5px; line-height: 1.6; color: var(--text-2); }
.sfd-brandland__story { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: clamp(24px, 4vw, 48px); align-items: center; margin-top: clamp(36px, 5vw, 56px); }
.sfd-brandland__story p { margin-top: 12px; font-size: 16px; line-height: 1.65; color: var(--text-2); }
.sfd-brandland__plate { display: grid; place-items: center; gap: 8px; min-height: 230px; border: 1px dashed var(--line); border-radius: 14px; background: var(--paper); text-align: center; }
.sfd-brandland__plate span { font-family: var(--font-display); font-size: clamp(26px, 3.4vw, 40px); letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.sfd-brandland__plate small { font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-3); }
.sfd-brandland__cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; margin: clamp(36px, 5vw, 56px) 0 clamp(28px, 4vw, 44px); padding: clamp(20px, 3vw, 32px); border-radius: 14px; background: var(--navy); color: #fff; }
.sfd-brandland__cta h2 { font-size: clamp(20px, 2.2vw, 26px); color: #fff; }
.sfd-brandland__cta p { margin-top: 6px; max-width: 60ch; font-size: 15px; line-height: 1.6; color: #C9DBEA; }

@media (max-width: 1000px) {
	.sfd-brandland__pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
	.sfd-brandland__hero-inner,
	.sfd-brandland__story { grid-template-columns: minmax(0, 1fr); }
	.sfd-brandland__mark { min-height: 140px; order: -1; }
	.sfd-brandland__plate { min-height: 170px; }
	.sfd-brandland__shots { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: auto; height: auto; }
	.sfd-brandland__shot--1 { grid-row: auto; }
	.sfd-brandland__shot img { aspect-ratio: 1 / 1; height: auto; }
	.sfd-brandland__logo { width: min(230px, 62%); }
}
@media (max-width: 560px) {
	.sfd-brandland__pillars { grid-template-columns: minmax(0, 1fr); }
	.sfd-brandland__shots { gap: 10px; }
	.sfd-brandland__actions .sfd-btn { flex: 1 1 100%; justify-content: center; }
	.sfd-brandland__cta { flex-direction: column; align-items: flex-start; }
}

/* ---- Listing: the next page loads itself, so no page numbers ---- */
.sfd-more-wrap__status { margin-top: 10px; font-size: 13px; color: var(--text-3); text-align: center; }
