/* The Product search page (search.md → Search page and result card), from the owner's chosen
   prototype layout: short search with a Filters button once results show, the parameters on
   the right, a roomy two-up shop grid; every colour and size on the product's own page. */

main:has(form.search.short) { max-width: none; padding: 0 16px 48px; }
.search { margin: 0; }
.search fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.search label { margin: 0; font-weight: 400; }
.search h2 { font-size: 17px; margin: 0; }
.search h3 { margin: 16px 0 6px; font-size: 13px; font-weight: 600; letter-spacing: 0; }

.q-row { position: sticky; top: 0; z-index: 3; display: flex; gap: 8px; padding: 8px 0 6px; background: var(--bg); }
.q { flex: 1; min-width: 0; font: 400 16px/1.3 var(--font); padding: 11px 14px; border: 1.5px solid var(--ink);
     border-radius: var(--radius); background: var(--bg); color: var(--ink); }
.q-row button { flex: none; width: auto; padding: 0 16px; border-radius: var(--radius); font-size: 14px; }
.filters-toggle { background: var(--bg); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--ink); }
.filters-toggle:hover { background: var(--mist-soft); }
.filters-toggle b { display: inline-block; min-width: 19px; padding: 1px 5px; border-radius: 99px;
                    background: var(--ink); color: #fff; font-size: 12px; }
.filters-open .filters-toggle { background: var(--ink); color: #fff; }
.filters-open .filters-toggle b { background: #fff; color: var(--ink); }

/* Parameters: colour families, department, category, price. */
.filters header { display: none; justify-content: space-between; align-items: center; }
.filters-close { width: 32px; height: 32px; padding: 0; border-radius: 50%; background: var(--mist-soft); color: var(--ink); }
.families { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px 2px; }
.family { position: relative; text-align: center; }
.family small { display: block; font-size: 10.5px; color: var(--mute); }
.family input, .segments input { position: absolute; opacity: 0; }
.family .dot { display: block; width: 30px; height: 30px; margin: 0 auto 2px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); }
.family input:checked + .dot { outline: 2px solid var(--ink); outline-offset: 2px; }
.family input:focus-visible + .dot, .segments input:focus-visible + span { outline: 3px solid var(--sage); outline-offset: 2px; }
.family-any { background: conic-gradient(#c33, #ec3, #3a6, #36c, #a3c, #c33); }
.family-black { background: #111; } .family-white { background: #fff; } .family-cream { background: #f3ecd9; }
.family-beige { background: #d6c3a5; } .family-brown { background: #6e4a2f; } .family-grey { background: #8d9196; }
.family-navy { background: #1b2a4a; } .family-blue { background: #3a78c2; } .family-green { background: #3f7d4e; }
.family-yellow { background: #efc73e; } .family-orange { background: #e0812e; } .family-red { background: #c0302f; }
.family-pink { background: #ec9ab5; } .family-purple { background: #7a4a9e; }
.family-gold { background: linear-gradient(135deg, #b98f2e, #f1dc8a); }
.family-silver { background: linear-gradient(135deg, #9ea3a8, #eef0f2); }
.family-multi { background: conic-gradient(#c33, #ec3, #3a6, #36c, #c33); }
/* Vocabulary 2 (#243), shown once its photo type passes its gate. */
.family-champagne { background: linear-gradient(135deg, #e3cfa4, #f7ecd2); } .family-teal { background: #1f7f80; }
.family-burgundy { background: #6d1f33; } .family-khaki { background: #a39264; } .family-olive { background: #6b6b2f; }
.segments { display: flex; gap: 6px; }
/* The site styles a label around a checkbox as a consent line; the price tiers are segments. */
.search .segments label { display: block; flex: 1; position: relative; }
.search .segments input { width: 1px; height: 1px; margin: 0; }
.segments span { display: block; text-align: center; font-size: 14px; padding: 9px 4px; border: 1px solid var(--line); border-radius: var(--radius); }
.segments input:checked + span { background: var(--ink); color: #fff; border-color: var(--ink); }
.segments.multi { margin-top: 8px; }
.search select { margin: 0; padding: 10px; }
.search .field { display: flex; align-items: center; gap: 8px; font-size: 14px; white-space: nowrap; }
.field input { width: 110px; font: inherit; padding: 9px 10px; border: 1.5px solid var(--line); border-radius: var(--radius); }
.show-results { margin-top: 18px; border-radius: var(--radius); }
.scrim { display: none; }

/* With results the parameters live on the right: a panel sliding in on a phone, applying on
   "Show results"; a column on a wide screen, applying each change at once. */
.short .filters { position: fixed; z-index: 6; top: 0; bottom: 0; right: 0; width: min(340px, 86vw);
                  overflow-y: auto; padding: 16px 16px 84px; background: var(--bg);
                  box-shadow: -8px 0 24px rgba(0, 0, 0, .14); transform: translateX(110%); visibility: hidden;
                  transition: transform .22s ease, visibility .22s; }
.short .filters header { display: flex; }
.filters-open .short .filters { transform: none; visibility: visible; }
.filters-open .scrim { display: block; position: fixed; inset: 0; z-index: 5; background: rgba(0, 0, 0, .35); }
@media (min-width: 900px) {
  .short .filters { width: 300px; box-shadow: -1px 0 0 var(--line); }
  .filters-open .scrim, .short .filters-close, .short .show-results { display: none; }
  .filters-open main:has(form.search.short) { padding-right: 332px; }
  /* The column is fixed to the right edge, so the header keeps clear of it too, or it hides the tabs. */
  .filters-open:has(form.search.short) .site-header { max-width: none; margin-right: 316px; padding-left: 16px; }
}

/* Chips, the rest, nothing at all, Show more. */
.chips, .nothing p { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 14px; }
.corrected { margin: 8px 0; color: #555; }
.chip, .removal { font: 500 13px/1 var(--font); padding: 8px 11px; border: 1px solid var(--line); border-radius: 99px;
                  color: var(--ink); text-decoration: none; }
.removal small { color: var(--mute); }
.nothing h2 { font-size: 17px; margin: 20px 0 6px; }
.more { text-align: center; margin: 32px 0 0; }
.show-more { display: inline-block; padding: 12px 28px; border-radius: 999px; box-shadow: inset 0 0 0 1.5px var(--ink);
             color: var(--ink); font-weight: 600; text-decoration: none; }

/* The grid: two up on a phone, as many 220px columns as fit on a wide screen. */
.grid { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px 16px; }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 40px 24px; } }
.rest { grid-column: 1 / -1; font-weight: 600; font-size: 14px; color: var(--mute); padding-top: 12px; border-top: 1px solid var(--line); }
.result { min-width: 0; scroll-margin-top: 72px; }
.card-link { display: block; color: inherit; text-decoration: none; }
.card-photo { display: block; aspect-ratio: 3 / 4; margin-bottom: 10px; border-radius: 8px; overflow: hidden; background: var(--mist-soft); }
.card-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-store { display: block; font-size: 11.5px; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.card-title { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
              font-weight: 500; font-size: 13.5px; line-height: 1.35; margin: 3px 0 5px; }
.card-price, .colour-price { display: block; font-size: 14px; }
.card-price s, .colour-price s { color: var(--mute); font-size: 12.5px; }
.card-colours { display: flex; gap: 6px; align-items: center; margin: 8px 0 6px; }
.card-colours .dot { width: 18px; height: 18px; border-radius: 50%; overflow: hidden; background: var(--mist-soft); border: 1px solid rgba(0, 0, 0, .18); }
.card-colours img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-colours small { font-size: 11px; color: var(--mute); }
.card-sizes { display: block; font-size: 12px; color: var(--mute); }
.card-make { display: block; font-size: 12px; margin-top: 4px; }
.search .well-made { display: flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 14px; }
.product .make { margin-top: 18px; font-size: 14px; }
.product .make h3 { font-size: 14px; margin: 0 0 6px; }
.product .make h4 { font-size: 13px; font-weight: 600; margin: 10px 0 4px; }
.product .make ul { margin: 0; padding-left: 18px; color: var(--mute); }

/* A product's own page: every colour and size, Make and care. */
.product { max-width: 860px; margin: 0 auto; padding: 8px 0 22px; }
.product-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.product-bar .back { white-space: nowrap; font-size: 14px; color: var(--ink); text-decoration: none; }
.product-bar .back:hover { text-decoration: underline; }
.copy-link { width: auto; flex: none; margin-left: auto; white-space: nowrap; font: 600 13px var(--font); padding: 8px 14px; border-radius: var(--radius);
             border: 1px solid var(--ink-soft); background: #fff; color: var(--ink); }
.copy-link:hover { background: var(--mist-soft); }
.product header { margin-bottom: 12px; }
.product-store { display: block; font-size: 11.5px; color: var(--mute); text-transform: uppercase; letter-spacing: .04em; margin: 0; }
.product h1 { font-size: 17px; margin: 2px 0 0; line-height: 1.3; }
/* On search the same view opens in a popup: a sheet from the bottom on a phone, centred on a wide
   screen. Its content fills the dialog, so a tap that lands on the dialog itself is the backdrop. */
dialog.sheet { position: fixed; inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 480px; max-height: 88vh;
               border: 0; border-radius: 18px 18px 0 0; padding: 0; }
dialog.sheet::backdrop { background: rgba(0, 0, 0, .4); }
dialog.sheet .product { padding: 14px 16px 22px; }
.sheet-close { width: 32px; height: 32px; flex: none; padding: 0; border-radius: 50%; background: var(--mist-soft); color: var(--ink); }
.sheet-close:hover { background: var(--mist); }
.product h2 { font-size: 17px; margin: 2px 0 0; line-height: 1.3; }
@media (min-width: 900px) {
  dialog.sheet { inset: 0; margin: auto; max-width: 860px; border-radius: 18px; }
  dialog.sheet .product { padding: 18px 22px 24px; }
}
/* Wide screens: the photo on the left, and everything about the product beside it, Make and care
   included, so none of it hides below the fold. The shown colour's children join the page's grid. */
@media (min-width: 900px) {
  .product { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 24px; align-items: start; }
  .product > * { grid-column: 2; }
  .product > .product-bar, .product > header { grid-column: 1 / -1; }
  .product .colour:not([hidden]) { display: contents; }
  .product .colour-photo { grid-column: 1; grid-row: 3 / span 30; max-height: 70vh; }
  .product .colour-picker { grid-column: 1; }
  .product .colour > :not(.colour-photo) { grid-column: 2; }
  .product .colour h3 { margin-top: 0; }
}
.colour-photo { width: 100%; aspect-ratio: 4 / 5; max-height: 50vh; object-fit: contain; border-radius: 10px; background: var(--mist-soft); }
.colour h3 { font-size: 14px; font-weight: 600; margin: 10px 0 2px; }
.sizes { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; margin: 10px 0; }
.size { font: 500 12.5px/1 var(--font); padding: 7px 9px; border: 1px solid var(--ink-soft); border-radius: 6px; }
.size.out { color: #aab0b6; border-color: var(--line); }
.size.unknown { border-style: dashed; }
.store { display: block; text-align: center; font: 700 14px var(--font); padding: 12px; border-radius: var(--radius);
         background: var(--ink); color: #fff; text-decoration: none; margin-top: 8px; }
.colour-picker { display: flex; gap: 6px; overflow-x: auto; margin: 14px 0 0; scrollbar-width: none; }
.colour-picker button { flex: 0 0 52px; width: 52px; height: 52px; padding: 0; border: 2px solid transparent; border-radius: 8px;
                        background: var(--mist-soft); overflow: hidden; }
.colour-picker button[aria-pressed="true"] { border-color: var(--ink); }
.colour-picker img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Colours: the ones picked, each with a cross, and a popup to choose several. */
.picked { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 0; }
.search .picked-colour { display: inline-flex; align-items: center; gap: 6px; padding: 6px 10px; border: 1px solid var(--ink);
                         border-radius: 99px; font-size: 13px; cursor: pointer; }
.search .picked-colour[hidden] { display: none; }
.picked-colour .dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0, 0, 0, .18); }
.colour-choose { width: auto; padding: 7px 12px; border-radius: 99px; background: var(--bg); color: var(--ink);
                 box-shadow: inset 0 0 0 1px var(--line); font-size: 13px; font-weight: 500; }
.colour-choose:hover { background: var(--mist-soft); }
.colour-popup { width: min(360px, 92vw); padding: 16px 16px 18px; border: 0; border-radius: 18px;
                box-shadow: 0 12px 40px rgba(0, 0, 0, .25); }
.colour-popup::backdrop { background: rgba(0, 0, 0, .35); }
.colour-popup h3 { margin: 0 0 12px; font-size: 15px; }
.colour-done { margin-top: 16px; border-radius: var(--radius); }
.family input[type="checkbox"] { position: absolute; opacity: 0; width: 1px; height: 1px; margin: 0; }
@media (max-width: 899px) {
  .colour-popup { inset: auto 0 0 0; margin: 0 auto; width: 100%; max-width: 480px; border-radius: 18px 18px 0 0; }
}
.search .family { display: block; }

/* On a wide screen the popup opens beside the colour that opened it, flipping where there is no
   room. Browsers without anchor positioning (Firefox today) keep it centred. */
@media (min-width: 900px) {
  [popovertarget="family-colours"] { anchor-name: --family-colours; }
  [popovertarget="accent-colours"] { anchor-name: --accent-colours; }
  #family-colours { position-anchor: --family-colours; }
  #accent-colours { position-anchor: --accent-colours; }
  .colour-popup { inset: auto; margin: 6px 0; position-area: block-end span-inline-start;
                  position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline; }
  .colour-popup::backdrop { background: transparent; }
}

/* "Any" is a button, not a checkbox, but looks like the colours beside it. */
.search .any-colour { display: block; width: auto; padding: 0; border-radius: 0; background: none; color: inherit; font: inherit; }
.any-colour[aria-pressed="true"] .dot { outline: 2px solid var(--ink); outline-offset: 2px; }
.family input:checked + .dot { outline: 2px solid var(--ink); outline-offset: 2px; }
.price-range { display: flex; gap: 8px; flex-wrap: wrap; }
.price-range .field input { width: 72px; padding: 9px 8px; }

.examples { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 4px 0 10px; font-size: 13px; color: var(--mute); }
.examples a { padding: 6px 11px; border: 1px solid var(--line); border-radius: 99px; color: var(--ink); text-decoration: none; }
.examples a:hover { background: var(--mist-soft); }

/* The site's buttons turn black on hover; these round close buttons keep a dark cross, so they
   darken only to the mist shade. */
.filters-close:hover { background: var(--mist); color: var(--ink); }

.page-title { font-size: 26px; margin: 8px 0 12px; letter-spacing: -.02em; }
.page-title.short { font-size: 18px; margin: 4px 0 2px; }

/* Before a search: the band Personal Styling opens with (owner, 2026-11-12), the box inside it and
   the filters on a card below. The band runs the page's full width, so main gives up its own. */
main:has(form.search.expanded) { max-width: none; padding: 0 0 32px; }
.search-hero .page-title { font-size: 33px; line-height: 1.12; letter-spacing: -.03em; margin: 0 0 14px; }
.search-hero .q-row { position: static; background: none; padding: 4px 0 6px; }
.search-hero .q { padding: 14px 16px; border-radius: 999px; box-shadow: 0 6px 20px rgba(37, 40, 47, .10); }
.search-hero .examples a { background: var(--bg); }
.expanded .filters.card { margin: 18px 0 0; box-shadow: 0 14px 34px rgba(37, 40, 47, .12); }
.expanded .filters header { display: flex; }
.expanded .filters h2 { font-size: 19px; }
@media (min-width: 720px) {
  .search-hero .page-title { font-size: 44px; }
  .expanded .filters.card { padding: 20px 22px; }
}
/* Wide: the box on the left and the filters card on the right, as Personal Styling's hero. */
@media (min-width: 900px) {
  .search-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start;
                 max-width: 1040px; padding-top: 40px; padding-bottom: 40px; }
  .search-intro { padding-top: 24px; }
  .expanded .filters.card { margin: 0; }
}

.privacy-link { margin: 28px var(--gutter) 0; font-size: 13px; text-align: center; }
.privacy-link a { color: var(--mute); }
