/* Dana search window (components/search-dialog.jinja): the template's
 * full-screen #search (.popup-search.modal-fullscreen, styles.css
 * 6339-6451, 20012-20020, 22340-22357; index.html:3870).
 *
 * A white page over the whole window. A fixed strip along the top (8px 15px,
 * the close glyph at its end, 16px in a 36px box, the accent on hover);
 * 68px above and below the content (50px under 768). In the middle
 * (col-lg-8, from 992px two thirds of the container): the heading 32/38.4
 * at 500 (20/30 under 768), 42px (24px) above the 50px pill field (16px
 * words, the placeholder black, the search glyph 20px from its end), 32px
 * (24px) above «Popular searches:» (16px at 500) and its chips (9px 19px,
 * 10px corners, #f9f9f9 with a light line, 10px apart), 50px (30px) above
 * the featured products: their title 20/24 at 500 and 30px under it a
 * slider of the page's product card, 2, 3 and 4 to a view (90px in on each
 * side from 1200px). One sheet for both directions. */
.dana-search {
  position: fixed;
  inset: 0;
  inline-size: 100%;
  max-inline-size: none;
  block-size: 100%;
  max-block-size: none;
  margin: 0;
  padding: 0;
  border: 0;
  background-color: var(--dana-bg);
  color: var(--dana-text);
  font-family: var(--dana-font-body);
  font-size: 14px;
  line-height: 20px;
  overflow: hidden;
}
.dana-search[open] { display: block; }
.dana-search::backdrop { background-color: rgba(0, 0, 0, .4); }
.dana-search:focus { outline: none; }
.dana-search *, .dana-search *::before, .dana-search *::after { box-sizing: border-box; }
:where(.dana-search) p { margin: 0; }
:where(.dana-search) ul { margin: 0; padding: 0; list-style: none; }
:where(.dana-search) a { color: inherit; text-decoration: none; }
/* The page behind stays still while the window is open. */
html:has(.dana-search[open]) { overflow: hidden; }

.dana-search__bar { position: absolute; inset-block-start: 0; inset-inline: 0; z-index: 50; display: flex; justify-content: flex-end; padding: 8px 15px; background-color: var(--dana-bg); }
.dana-search__bar form { margin: 0; }
.dana-search__close {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 36px;
  block-size: 36px;
  padding: 10px;
  border: 0;
  background: transparent;
  color: var(--dana-heading);
  font-size: 16px;
  cursor: pointer;
  transition: color .3s ease-in-out;
}
/* A thumb's 44px round the template's 36px box, drawn as before (the strip
   is 52px tall, so it stays inside it). */
.dana-search__close::before { content: ""; position: absolute; inset: -4px; }
.dana-search__close:hover, .dana-search__close:focus-visible { color: var(--dana-accent-ink); }
.dana-search__body { block-size: 100%; padding-block: 68px; overflow-y: auto; overscroll-behavior: contain; }
.dana-search__main { max-inline-size: 100%; margin-inline: auto; margin-block-end: 50px; text-align: center; }
@media (min-width: 992px) {
  .dana-search__main { inline-size: calc((100% + 24px) * 8 / 12 - 24px); }
}
.dana-search__heading { margin-block-end: 42px; font-family: var(--dana-font-heading); font-size: 32px; line-height: 38.4px; font-weight: 500; color: var(--dana-heading); }

/* The field (.form-search: 50px, a pill, the line colour, 20px in). */
.dana-search__form { position: relative; margin: 0 0 32px; }
.dana-search__form input.dana-search__input {
  display: block;
  inline-size: 100%;
  block-size: 50px;
  margin: 0;
  padding-block: 14px;
  padding-inline: 20px 56px;
  border: 1px solid color-mix(in srgb, var(--dana-heading) 20%, transparent);
  border-radius: min(var(--dana-radius-button), 99px);
  background-color: var(--dana-bg);
  box-shadow: none;
  font-family: inherit;
  font-size: 16px;
  line-height: 1.2;
  color: var(--dana-heading);
  text-align: start;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .3s ease-in-out;
}
.dana-search__input::placeholder { color: var(--dana-heading); opacity: 1; }
.dana-search__form input.dana-search__input:hover, .dana-search__form input.dana-search__input:focus { border-color: var(--dana-heading); }
.dana-search__submit {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  inline-size: 24px;
  block-size: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--dana-heading);
  font-size: 24px;
  cursor: pointer;
  transform: translateY(-50%);
  transition: color .3s ease-in-out;
}
/* The 24px glyph a 44px target: inside the 50px field, and short of the
   words, which stop 56px from its end. */
.dana-search__submit::before { content: ""; position: absolute; inset: -10px; }
.dana-search__submit:hover, .dana-search__submit:focus-visible { color: var(--dana-accent-ink); }

/* «Popular searches:» and its chips; the store's categories come with their
   pictures when the merchant typed no words (header.js). */
.dana-search__popular { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-start; gap: 20px; font-size: 16px; line-height: 1.2; }
.dana-search__popular[hidden] { display: none; }
@media (min-width: 768px) { .dana-search__popular { justify-content: center; } }
.dana-search__popular-title { font-weight: 500; color: var(--dana-heading); }
.dana-search__chips { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.dana-search__chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 19px;
  border: 1px solid rgba(161, 161, 161, .2);
  border-radius: 10px;
  /* The template's #f9f9f9 as the heading at 2.5% over the page: a dark
     page gets a dark chip under its light words. */
  background-color: color-mix(in srgb, var(--dana-heading) 2.5%, var(--dana-bg));
  color: var(--dana-heading);
  font-size: 16px;
  line-height: 1.2;
  transition: color .3s ease-in-out, border-color .3s ease-in-out, background-color .3s ease-in-out;
}
.dana-search__chip:hover, .dana-search__chip:focus-visible { color: var(--dana-accent-ink); border-color: currentColor; }
.dana-search__chip--category { padding-block: 5px; padding-inline-start: 5px; }
.dana-search__chip-thumb { flex: none; display: block; inline-size: 28px; block-size: 28px; border-radius: 3px; object-fit: cover; background-color: var(--dana-surface); }
.dana-search__chip-thumb.is-empty { display: grid; place-items: center; font-size: 14px; color: var(--dana-muted); }

/* The products found as the visitor types (Amer's live results, in the
   template's result rows: a 60px picture, the name, the price). */
.dana-search__results { margin-block: -8px 32px; text-align: start; }
.dana-search__results[hidden], .dana-search__all[hidden] { display: none; }
.dana-search__status { margin-block-end: 16px; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--dana-heading); }
.dana-search__status.is-empty { font-weight: 400; color: var(--dana-muted); }
.dana-search__results[aria-busy="true"] .dana-search__list { opacity: .45; }
.dana-search__list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 8px 24px; transition: opacity .2s ease-in-out; }
.dana-search__item { display: flex; align-items: center; gap: 15px; padding: 8px; border-radius: 10px; color: var(--dana-heading); transition: background-color .3s ease-in-out; }
.dana-search__item:hover, .dana-search__item:focus-visible { background-color: var(--dana-surface); }
.dana-search__thumb { flex: none; display: block; inline-size: 60px; block-size: 60px; border-radius: 8px; object-fit: cover; background-color: var(--dana-surface); }
.dana-search__thumb.is-empty { display: grid; place-items: center; font-size: 20px; color: var(--dana-muted); }
.dana-search__text { display: grid; gap: 2px; min-inline-size: 0; }
.dana-search__name { overflow: hidden; font-size: 14px; line-height: 22px; font-weight: 500; white-space: nowrap; text-overflow: ellipsis; transition: color .3s ease-in-out; }
.dana-search__item:hover .dana-search__name, .dana-search__item:focus-visible .dana-search__name { color: var(--dana-accent-ink); }
.dana-search__price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; font-size: 14px; line-height: 22px; font-weight: 500; }
.dana-search__price > * { unicode-bidi: isolate; }
.dana-search__price-now.is-sale { color: var(--dana-sale-ink); }
.dana-search__price-was { font-weight: 400; color: var(--dana-price-old); text-decoration: line-through; }
.dana-search__all { display: inline-flex; align-items: center; gap: 8px; margin-block-start: 16px; font-size: 16px; line-height: 24px; font-weight: 500; color: var(--dana-heading); transition: color .3s ease-in-out; }
.dana-search__all .di { font-size: 12px; }
[dir="rtl"] .dana-search__all .di { transform: scaleX(-1); }
.dana-search__all:hover, .dana-search__all:focus-visible { color: var(--dana-accent-ink); }

/* The featured products (.featured-product). */
.dana-search__featured[hidden] { display: none; }
.dana-search__featured-title { margin-block-end: 30px; font-size: 20px; line-height: 24px; font-weight: 500; color: var(--dana-heading); text-align: start; }
@media (min-width: 1200px) {
  .dana-search__featured { padding-inline: 90px; }
}
/* «A product grid with articles beside it» (search_layout grid_posts,
   fashion-02's .type-search-product, styles.css 6403-6451, 21528-21535,
   1990-1995, 19711-19714, measured at 1440, 1200, 1199, 1024, 768 and 390):
   two blocks, each under a title row (20/32 at 500 and «View all» 14/22.4
   at 500, underlined, at its two ends; 10px under them a hairline, then
   20px, 42px from 1200px). The products: the page's card in 2, 3 (from
   768px) and 4 (from 1200px) columns, 12px apart (24px from 992px), rows
   24px apart. The posts: four rows 20px apart, a 128px picture with 8px
   corners that grows on hover, 11px before the title (16/25.6 at 500) and,
   6px under it, the date (14/16.8). From 1200px the two sit side by side as
   the template's col-xl-8 and col-xl-4 (920 and 448px in the 1392px row at
   1440, 24px apart); under 1200px the posts come under the products, 30px
   on (the template's own 30px under its product block there, 21528-21531,
   written for a class its markup no longer carries: as drawn the two
   touched). Without posts (none, or the blog off) the grid has the row. */
.dana-search__shelf { display: grid; grid-template-columns: minmax(0, 1fr); row-gap: 30px; text-align: start; }
.dana-search__shelf[hidden], .dana-search__block[hidden] { display: none; }
/* Kept invisible on the first open until its blocks have come (header.js,
   holdShelf), so no card changes width once seen. */
.dana-search__shelf.is-pending { visibility: hidden; }
.dana-search__block { min-inline-size: 0; }
.dana-search__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-block-end: 20px;
  padding-block-end: 10px;
  border-block-end: 1px solid rgba(161, 161, 161, .2);
}
/* A long title wraps beside its link, which keeps its place at the end. */
.dana-search__top-title { flex: 1 1 auto; min-inline-size: 0; overflow-wrap: anywhere; font-size: 20px; line-height: 32px; font-weight: 500; color: var(--dana-heading); }
.dana-search__top-link {
  flex: none;
  margin-inline-start: auto;
  font-size: 14px;
  line-height: 22.4px;
  font-weight: 500;
  color: var(--dana-heading);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
  transition: color .3s ease-in-out;
}
.dana-search__top-link:hover, .dana-search__top-link:focus-visible { color: var(--dana-accent-ink); }
.dana-search__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 12px; }
.dana-search__posts { display: flex; flex-direction: column; gap: 20px; }
.dana-search__post { display: flex; align-items: flex-start; gap: 11px; }
.dana-search__post-media { flex: none; display: block; inline-size: 128px; block-size: 128px; border-radius: 8px; overflow: hidden; background-color: var(--dana-surface); }
.dana-search__post-pic { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; transition: opacity .5s ease, transform 2s cubic-bezier(0, 0, .44, 1.18); }
.dana-search__post-pic.is-empty { display: grid; place-items: center; font-size: 28px; color: var(--dana-muted); }
.dana-search__post:hover .dana-search__post-pic:not(.is-empty) { transform: scale(1.06); }
.dana-search__post-body { display: flex; flex-direction: column; gap: 6px; min-inline-size: 0; }
.dana-search__post-title {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
  font-size: 16px;
  line-height: 25.6px;
  font-weight: 500;
  color: var(--dana-heading);
  overflow-wrap: anywhere;
  transition: color .3s ease-in-out;
}
.dana-search__post-title:hover, .dana-search__post-title:focus-visible { color: var(--dana-accent-ink); }
.dana-search__post-date { font-size: 14px; line-height: 16.8px; color: var(--dana-text); }
@media (min-width: 768px) {
  .dana-search__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 992px) {
  .dana-search__grid { column-gap: 24px; }
}
@media (min-width: 1200px) {
  .dana-search__top { margin-block-end: 42px; }
  .dana-search__grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  /* Side by side only while both blocks show; posts alone take the row, and
     posts that came after the grid was seen go under it (is-late). */
  .dana-search__shelf.has-posts:not(.is-late):has(> .dana-search__block--products:not([hidden])) { grid-template-columns: calc((100% + 24px) * 2 / 3 - 24px) minmax(0, 1fr); column-gap: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .dana-search__post-pic { transition: none; }
  .dana-search__post:hover .dana-search__post-pic:not(.is-empty) { transform: none; }
}

@media (max-width: 767px) {
  .dana-search__body { padding-block: 50px; }
  .dana-search__main { margin-block-end: 30px; }
  .dana-search__heading { margin-block-end: 24px; font-size: 20px; line-height: 30px; }
  .dana-search__form { margin-block-end: 24px; }
}
