.shoe-search-button {
  white-space: nowrap;
}

.shoe-search-icon,
.shoe-search-control svg {
  fill: none;
  stroke: #df0038;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.shoe-search-icon {
  width: 17px;
  height: 17px;
}

.shoe-search-dialog {
  width: min(760px, calc(100vw - 28px));
  max-width: none;
  max-height: min(760px, calc(100vh - 28px));
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: transparent;
  box-shadow: 0 22px 70px rgba(0, 0, 0, .24);
  transition: width .2s ease, max-height .2s ease;
}

.shoe-search-dialog:has(.shoe-result-card) {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
}

.shoe-search-dialog::backdrop {
  background: rgba(20, 18, 18, .54);
  backdrop-filter: blur(3px);
}

.shoe-search-card {
  position: relative;
  max-height: min(760px, calc(100vh - 28px));
  overflow: auto;
  padding: 24px;
  border-top: 4px solid #df0038;
  border-radius: 7px;
  background: #fff;
}

.shoe-search-dialog:has(.shoe-result-card) .shoe-search-card {
  max-height: calc(100vh - 24px);
  padding: 26px 28px 28px;
}

.shoe-search-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding-right: 54px;
}

.shoe-search-heading .dialog-close {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 10;
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid #d6d1ce;
  border-radius: 6px;
  background: #fff;
  color: #403b38;
  font-size: 28px;
  font-weight: 400;
  line-height: 1;
  cursor: pointer;
}

.shoe-search-heading .dialog-close:hover {
  background: #f6f3f1;
  color: #111;
}

.shoe-search-heading h2 {
  margin: 2px 0 0;
  color: #111;
  font-size: 24px;
  line-height: 1.1;
  letter-spacing: -.025em;
}

.shoe-search-heading p:not(.eyebrow) {
  margin: 7px 0 0;
  color: #625d59;
  font-size: 13px;
}

.shoe-search-form {
  margin-top: 20px;
}

.shoe-search-form > label {
  display: block;
  margin-bottom: 6px;
  color: #3f3a37;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.shoe-search-control {
  min-height: 46px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  padding-left: 12px;
  border: 1px solid #cfc9c5;
  border-radius: 4px;
  background: #fff;
}

.shoe-search-control:focus-within {
  border-color: #df0038;
  box-shadow: 0 0 0 2px rgba(223, 0, 56, .1);
}

.shoe-search-control svg {
  width: 18px;
  height: 18px;
}

.shoe-search-input-wrap {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: center;
}

.shoe-search-control input {
  width: 100%;
  min-width: 0;
  padding: 12px 38px 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111;
  font-size: 14px;
}

.shoe-search-control button {
  align-self: stretch;
  min-width: 92px;
  padding: 0 15px;
  border: 0;
  border-left: 1px solid #cfc9c5;
  border-radius: 0 3px 3px 0;
  background: #111;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.shoe-search-control .shoe-search-clear {
  position: absolute;
  top: 50%;
  right: 0;
  width: 32px;
  height: 32px;
  min-width: 32px;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6f6965;
  font-size: 24px;
  font-weight: 500;
  line-height: 1;
}

.shoe-search-control .shoe-search-clear:hover {
  background: #f2efed;
  color: #171717;
}

.shoe-search-control .shoe-search-clear[hidden] {
  display: none;
}

.shoe-search-control button:disabled {
  opacity: .65;
  cursor: wait;
}

.shoe-search-status {
  min-height: 18px;
  margin: 12px 0 0;
  color: #6a6460;
  font-size: 12px;
  line-height: 1.4;
}

.shoe-search-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.shoe-search-dialog:has(.shoe-result-card) .shoe-search-results {
  grid-template-columns: 1fr;
  gap: 18px;
  margin-top: 18px;
}

.shoe-result-card {
  min-width: 0;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 13px;
  padding: 10px;
  border: 1px solid #ded9d6;
  border-radius: 6px;
  background: #fff;
  color: #171717;
  text-decoration: none;
  transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.shoe-search-dialog:has(.shoe-result-card) .shoe-result-card {
  grid-template-columns: minmax(430px, 1.35fr) minmax(260px, .65fr);
  gap: 28px;
  padding: 18px;
  border-radius: 8px;
}

.shoe-result-card:hover {
  border-color: #a9a29e;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .07);
  transform: translateY(-1px);
}

.shoe-result-image {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 4px;
  background: #f7f5f3;
}

.shoe-search-dialog:has(.shoe-result-card) .shoe-result-image {
  min-height: min(58vh, 540px);
  aspect-ratio: auto;
  border-radius: 6px;
  background: #fff;
}

.shoe-result-image img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fff;
}

.shoe-image-placeholder {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #918a86;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.shoe-result-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.shoe-result-copy strong {
  display: -webkit-box;
  overflow: hidden;
  color: #171717;
  font-size: 13px;
  line-height: 1.3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

.shoe-search-dialog:has(.shoe-result-card) .shoe-result-copy strong {
  font-size: 22px;
  line-height: 1.25;
}

.shoe-result-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 8px;
  margin-top: 7px;
}

.shoe-result-meta small {
  color: #6f6965;
  font-size: 10.5px;
  font-weight: 600;
}

.shoe-search-dialog:has(.shoe-result-card) .shoe-result-meta {
  gap: 8px 12px;
  margin-top: 12px;
}

.shoe-search-dialog:has(.shoe-result-card) .shoe-result-meta small {
  font-size: 13px;
}

.shoe-result-open {
  margin-top: 10px;
  color: #df0038;
  font-size: 10.5px;
  font-weight: 700;
}

.shoe-search-dialog:has(.shoe-result-card) .shoe-result-open {
  margin-top: 18px;
  font-size: 13px;
}

.shoe-result-open b {
  font-size: 11px;
}

.shoe-search-fallback {
  width: fit-content;
  margin-top: 16px;
  padding-bottom: 2px;
  display: inline-flex;
  color: #171717;
  border-bottom: 1px solid #171717;
  font-size: 11px;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 760px) {
  .shoe-search-dialog:has(.shoe-result-card) {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .shoe-search-dialog:has(.shoe-result-card) .shoe-search-card {
    max-height: calc(100vh - 16px);
    padding: 20px 16px 18px;
  }

  .shoe-search-results,
  .shoe-search-dialog:has(.shoe-result-card) .shoe-search-results {
    grid-template-columns: 1fr;
  }

  .shoe-search-dialog:has(.shoe-result-card) .shoe-result-card {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 12px;
  }

  .shoe-search-dialog:has(.shoe-result-card) .shoe-result-image {
    min-height: min(52vh, 460px);
    aspect-ratio: 4 / 3;
  }

  .shoe-search-dialog:has(.shoe-result-card) .shoe-result-copy {
    padding: 2px 4px 8px;
  }
}

@media (max-width: 580px) {
  .shoe-search-card {
    padding: 20px 14px 16px;
  }

  .shoe-search-heading {
    padding-right: 50px;
  }

  .shoe-search-heading .dialog-close {
    top: 14px;
    right: 12px;
    width: 40px;
    height: 40px;
    min-width: 40px;
    font-size: 26px;
  }

  .shoe-search-heading h2 {
    font-size: 22px;
  }

  .shoe-search-control {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 0 10px;
  }

  .shoe-search-control button {
    grid-column: 1 / -1;
    min-height: 40px;
    margin: 0 -10px;
    border-top: 1px solid #cfc9c5;
    border-left: 0;
    border-radius: 0 0 3px 3px;
  }

  .shoe-search-control .shoe-search-clear {
    grid-column: auto;
    min-height: 32px;
    margin: 0;
    border: 0;
    border-radius: 50%;
  }

  .shoe-result-card {
    grid-template-columns: 1fr;
  }

  .shoe-search-dialog:has(.shoe-result-card) .shoe-result-image {
    min-height: min(46vh, 390px);
    aspect-ratio: 1 / 1;
  }

  .shoe-search-dialog:has(.shoe-result-card) .shoe-result-copy strong {
    font-size: 18px;
  }
}

@media print {
  .shoe-search-dialog,
  .shoe-search-button {
    display: none !important;
  }
}


/* Keep the expanded shoe-search dialog stable between consecutive searches. */
.shoe-search-dialog.shoe-search-expanded {
  width: min(1120px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
}

@media (max-width: 1100px) {
  .shoe-search-dialog.shoe-search-expanded {
    width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    margin: 8px auto auto;
  }

  .shoe-search-dialog.shoe-search-expanded .shoe-search-card {
    height: 100%;
    max-height: 100%;
    box-sizing: border-box;
    padding: 20px 16px 18px;
  }
}
