/* Precium · site design · codigo1811 · directorios-sd: the search of /tiendas, /marcas and /marcas/<letra> (the owner's B12 of 06-11,
   with `design.directoriosT31D` on and the site design «nuevo»). Its own sheet, apart from the group's marcas-campanas.<sha8>.css,
   linked only by the pages that draw the search, so the piece comes and goes with its key alone. Every rule scoped to
   [data-site-design="nuevo"], painted only with the --sd-* variables, no shadow but the one of what opens over the page (ESPEC §4).
   ESPEC §5.8 (the box's own search: grey, radius 16, the paper and the focus ring with the focus), §8 «Resultados del buscador»
   (the suggestions in the pop paper, radius 20, under the field) and «Marcas y tiendas». */

/* ---------- The bar: the field; on /tiendas, the kind of shop and the order beside it ---------- */
[data-site-design="nuevo"] .sd-dir-bar { display: grid; grid-template-columns: minmax(0, 1fr); align-items: end; gap: var(--sd-s-12); margin-top: var(--sd-s-16); }
/* the 2 px around the kind of shop hold its focus ring (2 px at 2 px from an option, 1 px past the track) inside what slides */
[data-site-design="nuevo"] .sd-dir-bar__nav { min-width: 0; max-width: 100%; padding: 2px; margin: -2px; overflow-x: auto; scrollbar-width: none; }
[data-site-design="nuevo"] .sd-dir-bar__nav::-webkit-scrollbar { display: none; }
[data-site-design="nuevo"] .sd-dir-bar__note { margin: 0; }
/* without JavaScript the island's <noscript> (its style still applies) takes no cell of the bar */
[data-site-design="nuevo"] .sd-dir-bar > noscript { display: none; }

/* ---------- The field: the label above it; the count, the × and (without JavaScript) the button inside it ---------- */
[data-site-design="nuevo"] .sd-dir-search { display: grid; gap: var(--sd-s-8); min-width: 0; margin: 0; }
[data-site-design="nuevo"] .sd-dir-search__label { justify-self: start; font-size: var(--sd-t-15); line-height: var(--sd-l-15); font-weight: var(--sd-w-700); color: var(--sd-ink); }
[data-site-design="nuevo"] .sd-dir-search__box { height: var(--sd-h-48); padding-right: var(--sd-s-6); }
[data-site-design="nuevo"] .sd-dir-search__count { flex: none; font-size: var(--sd-t-13); line-height: var(--sd-l-13); color: var(--sd-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
[data-site-design="nuevo"] .sd-dir-search__count:empty { display: none; }
[data-site-design="nuevo"] .sd-dir-search__clear { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: var(--sd-r-round); color: var(--sd-ink-2); text-decoration: none; }
[data-site-design="nuevo"] .sd-dir-search__clear:hover { background: var(--sd-grey-3); color: var(--sd-ink); }
[data-site-design="nuevo"] .sd-dir-search__clear[hidden] { display: none; }
/* the ×'s ring inside it, apart from the box's own (:focus-within) */
[data-site-design="nuevo"] .sd-dir-search .sd-dir-search__clear:focus-visible { outline-offset: -2px; }
/* Only without JavaScript (the island's <noscript> style shows it): with it, the list is filtered as you type */
[data-site-design="nuevo"] .sd-dir-search__box .sd-dir-search__go { display: none; width: 40px; height: 40px; border-radius: var(--sd-r-12); }

/* ---------- The suggestions of /marcas: the pop paper under the field ---------- */
[data-site-design="nuevo"] .sd-dir-search__list { position: absolute; top: calc(100% + var(--sd-s-6)); left: 0; right: 0; z-index: 30; display: grid; gap: var(--sd-s-2); max-height: min(440px, 70vh); margin: 0; padding: var(--sd-s-6); overflow-y: auto; list-style: none; border-radius: var(--sd-r-20); background: var(--sd-pop); box-shadow: var(--sd-pop-shadow); }
[data-site-design="nuevo"] .sd-dir-search__list[hidden] { display: none; }
[data-site-design="nuevo"] .sd-dir-search__none { padding: var(--sd-s-8) var(--sd-s-10) var(--sd-s-4); font-size: var(--sd-t-15); line-height: var(--sd-l-15); font-weight: var(--sd-w-700); color: var(--sd-ink); }
[data-site-design="nuevo"] .sd-dir-search__option { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: var(--sd-s-12); min-height: 44px; padding: var(--sd-s-6) var(--sd-s-10); border-radius: var(--sd-r-12); color: var(--sd-ink); font-size: var(--sd-t-15); line-height: var(--sd-l-15); cursor: pointer; }
[data-site-design="nuevo"] .sd-dir-search__option:hover { background: var(--sd-grey-3); }
[data-site-design="nuevo"] .sd-dir-search__option--way { grid-template-columns: minmax(0, 1fr) 16px; font-weight: var(--sd-w-700); color: var(--sd-link); }
[data-site-design="nuevo"] .sd-dir-search__option--all { position: sticky; bottom: 0; z-index: 1; margin-top: var(--sd-s-4); border-top: 1px solid var(--sd-line); border-radius: 0 0 var(--sd-r-12) var(--sd-r-12); background: var(--sd-pop); }
[data-site-design="nuevo"] .sd-dir-search__option[aria-selected="true"] { background: var(--sd-accent-soft); color: var(--sd-accent-soft-ink); }
[data-site-design="nuevo"] .sd-dir-search__name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[data-site-design="nuevo"] .sd-dir-search__models { font-size: var(--sd-t-13); line-height: var(--sd-l-13); color: var(--sd-ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
[data-site-design="nuevo"] .sd-dir-search__option[aria-selected="true"] .sd-dir-search__models { color: var(--sd-accent-soft-ink); }
[data-site-design="nuevo"] .sd-dir-search__mark { display: grid; place-items: center; width: 28px; height: 28px; overflow: hidden; border-radius: var(--sd-r-round); background: var(--sd-on-grey); color: var(--sd-ink); font-size: var(--sd-t-12); line-height: 1; font-weight: var(--sd-w-700); }
[data-site-design="nuevo"] .sd-dir-search__mark--logo { background: var(--sd-tile-white); }
[data-site-design="nuevo"] .sd-dir-search__mark img { width: 100%; height: 100%; padding: 3px; object-fit: contain; }
[data-site-design="nuevo"] .sd-dir-search__error { padding: var(--sd-s-8) var(--sd-s-10); font-size: var(--sd-t-14); line-height: var(--sd-l-14); color: var(--sd-ink-soft); }
[data-site-design="nuevo"] .sd-dir-search__ghost { height: 44px; border-radius: var(--sd-r-12); background: var(--sd-grey-3); animation: sd-dir-pulse 1.2s ease-in-out infinite; }
@keyframes sd-dir-pulse { 50% { opacity: .55; } }

/* ---------- A match marked in a name: the soft blue under the text, underlined in the link's blue ---------- */
[data-site-design="nuevo"] .sd-dir-hit { padding: 0 1px; border-radius: 3px; background: var(--sd-accent-soft); color: inherit; text-decoration: underline; text-decoration-color: var(--sd-link); text-decoration-thickness: 2px; text-underline-offset: 3px; }

/* ---------- /tiendas: a shop the search leaves out ---------- */
[data-site-design="nuevo"] .sd-mc-shops > li[hidden] { display: none; }

/* ---------- «Ninguna tienda con…», always with a way out ---------- */
[data-site-design="nuevo"] .sd-dir-empty { display: flex; align-items: flex-start; gap: var(--sd-s-14); max-width: 640px; margin-top: var(--sd-s-24); }
[data-site-design="nuevo"] .sd-dir-empty__icon { display: grid; place-items: center; flex: none; width: 40px; height: 40px; border-radius: var(--sd-r-round); background: var(--sd-accent-soft); color: var(--sd-link); }
[data-site-design="nuevo"] .sd-dir-empty__body { min-width: 0; }
[data-site-design="nuevo"] .sd-dir-empty__title { margin: 0; font-size: var(--sd-t-17); line-height: var(--sd-l-17); font-weight: var(--sd-w-700); color: var(--sd-ink); }
[data-site-design="nuevo"] .sd-dir-empty__text { margin: var(--sd-s-4) 0 0; font-size: var(--sd-t-15); line-height: 22px; color: var(--sd-ink-soft); }
[data-site-design="nuevo"] .sd-dir-empty__actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sd-s-12) var(--sd-s-20); margin-top: var(--sd-s-12); }

/* ---------- /marcas?q=: the page of results ---------- */
[data-site-design="nuevo"] .sd-dir-results__clear { margin: var(--sd-s-24) 0 0; }

/* ---------- The A–Z right under the search ----------
   What sticks is the wrapper, and the letters' paper fills it whole: the 16 px above them go on the wrapper, outside what sticks
   (with them inside, a transparent band of 16 px stuck under the header and the page showed through it). On /marcas it scrolls
   with the page on phones and tablets; on a letter's page (up to 400 brands) it sticks at every width, as today's. */
[data-site-design="nuevo"] .sd-dir-az { min-width: 0; margin-top: var(--sd-s-16); }
[data-site-design="nuevo"] .sd-dir-az > .sd-mc-letters { position: relative; top: auto; margin-top: 0; }
[data-site-design="nuevo"] .sd-dir-az--letra { position: sticky; top: var(--sd-row-h); z-index: 5; }
/* after the results of /marcas?q=: apart from them */
[data-site-design="nuevo"] .sd-dir-az--tras { margin-top: var(--sd-s-32); }
/* the 4 px around the letters hold their focus ring (2 px at 2 px) inside the list, which slides on a phone */
[data-site-design="nuevo"] .sd-dir-az .sd-mc-letters__list { padding: 4px; margin: -4px; }

@media (min-width: 768px) {
  /* /tiendas: the field (40 rem at most) and the kind of shop on one row, the order under both; their centres level:
     (48 − 38) / 2 = 5 px = these 3 + the 2 of its padding */
  [data-site-design="nuevo"] .sd-dir-bar--tiendas { grid-template-columns: minmax(0, 40rem) auto; column-gap: var(--sd-s-24); }
  [data-site-design="nuevo"] .sd-dir-bar--tiendas .sd-dir-bar__nav { margin-bottom: 3px; }
  [data-site-design="nuevo"] .sd-dir-bar--tiendas .sd-dir-bar__note { grid-column: 1 / -1; }
  [data-site-design="nuevo"] .sd-dir-bar--marcas { grid-template-columns: minmax(0, 40rem); }
  /* every letter in sight: on a tablet in two rows of 44 px (no letter hidden past the edge without a hint) */
  [data-site-design="nuevo"] .sd-dir-az .sd-mc-letters__list { flex-wrap: wrap; overflow: visible; }
}
@media (min-width: 1024px) {
  /* the A–Z sticks under the header's row on a computer, every letter on one row: at most 36 px each, narrower when the 27 do
     not fit otherwise (31 px at 1024) */
  [data-site-design="nuevo"] .sd-dir-az { position: sticky; top: var(--sd-row-h); z-index: 5; }
  [data-site-design="nuevo"] .sd-dir-az .sd-mc-letters__list { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 36px); justify-content: space-between; }
  [data-site-design="nuevo"] .sd-dir-az .sd-mc-letter { min-width: 0; }
}
@media (pointer: coarse) {
  [data-site-design="nuevo"] .sd-dir-search__clear { width: 40px; height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  [data-site-design="nuevo"] .sd-dir-search__ghost { animation: none; }
}
