/* ==========================================================================
   USAMOD — watch directory
   Scoped to .um-wd so the shop archive and its facet styles stay untouched.
   ========================================================================== */

.um-wd,
.um-wd * {
  box-sizing: border-box;
}

.um-wd {
  --wd-ink: var(--um-navy);
  --wd-paper: var(--um-paper);
  --wd-line: var(--um-line);
  --wd-soft: var(--um-line);
  --wd-muted: var(--um-muted);
  --wd-mid: var(--um-muted);
  --wd-red: var(--um-red);
  --wd-media: var(--um-navy);
  --wd-focus: var(--um-gold);
  --wd-sans: "Inter", Arial, "Noto Sans CJK SC", sans-serif;
  display: grid;
  grid-template-columns: 244px minmax(0, 1fr);
  gap: 44px;
  width: 100%;
  padding: 26px var(--um-pad) 22px;
  background: var(--wd-paper);
  color: var(--wd-ink);
  font: 14px/1.5 var(--wd-sans);
}

.um-wd :where(button) {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.um-wd :where(a) {
  color: inherit;
}

.um-wd :focus-visible {
  outline: 2px solid var(--wd-focus);
  outline-offset: 4px;
}

.um-wd [hidden] {
  display: none !important;
}

/* Sidebar ---------------------------------------------------------------- */

.um-wd-side {
  min-width: 0;
  border-right: 1px solid var(--wd-line);
  padding: 0 22px 0 0;
}

.um-wd-side-inner {
  position: sticky;
  top: calc(var(--um-header) + 20px);
  max-height: calc(100vh - var(--um-header) - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
}

.um-wd-side-link,
.um-wd-side-end > a {
  display: block;
  min-height: 44px;
  padding: 12px 0;
  font-size: 13px;
  line-height: 1.45;
  text-decoration: none;
  transition: color 0.2s var(--um-ease);
}

.um-wd-side-link:hover,
.um-wd-side-end > a:hover {
  color: var(--wd-red);
}

.um-wd-side summary {
  min-height: 44px;
  padding: 12px 0;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
  list-style-position: inside;
}

.um-wd-picker select {
  width: 100%;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--um-line);
  background: var(--wd-paper);
  color: var(--wd-ink);
  font: 12px/normal var(--wd-sans);
}

.um-wd-small-link {
  min-height: 40px;
  padding: 8px 0;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.um-wd-find {
  margin-top: 8px;
  border-top: 1px solid var(--wd-line);
  padding-top: 5px;
}

.um-wd-find .um-wd-facet summary {
  font-size: 12px;
  color: var(--wd-mid);
}

.um-wd-side-end {
  margin-top: 12px;
  border-top: 1px solid var(--wd-line);
  padding-top: 8px;
}

/* Facets ----------------------------------------------------------------- */

.um-wd-options label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  margin-right: 12px;
  font-size: 12px;
  line-height: 1.5;
  cursor: pointer;
}

.um-wd-options input {
  flex-shrink: 0;
  width: 15px;
  height: 15px;
  accent-color: var(--wd-ink);
}

.um-wd-options small {
  margin-left: auto;
  color: var(--wd-muted);
  font-size: 11px;
}

.um-wd-options label:has(input:disabled) {
  opacity: 0.45;
  cursor: default;
}

.um-wd-prices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin: 5px 0 8px;
}

.um-wd-prices label {
  min-width: 0;
  margin-right: 12px;
  font-size: 11px;
  color: var(--wd-mid);
}

.um-wd-prices input {
  width: 100%;
  min-width: 0;
  min-height: 40px;
  padding: 5px;
  border: 1px solid var(--um-line);
  background: transparent;
  color: var(--wd-ink);
  font: 14px/normal var(--wd-sans);
}

.um-wd-help {
  margin: 7px 0 12px;
  color: var(--wd-muted);
  font-size: 11px;
  line-height: 1.5;
}

.um-wd-error {
  margin: 8px 0;
  color: var(--wd-red);
  font-size: 12px;
  line-height: 1.5;
}

/* Main ------------------------------------------------------------------- */

.um-wd-main {
  min-width: 0;
}

.um-wd-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 25px;
  margin-bottom: 14px;
}

.um-wd-heading > div {
  display: flex;
  align-items: center;
  gap: 17px;
}

.um-wd-heading h1 {
  margin: 0;
  font-size: 29px;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.9px;
}

.um-wd-back {
  display: none;
  color: var(--wd-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.um-wd-search-wrap {
  display: block;
}

.um-wd-search {
  display: block;
  width: 230px;
  min-width: 0;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--um-line);
  border-radius: 0;
  background: transparent;
  color: var(--wd-ink);
  font: 14px/normal var(--wd-sans);
}

.um-wd-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 35px;
  margin-bottom: 12px;
}

.um-wd-result-label {
  color: var(--wd-muted);
  font-size: 11px;
}

.um-wd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 15px;
  margin-bottom: 6px;
}

.um-wd-chips:empty {
  display: none;
}

.um-wd-chips button {
  min-height: 35px;
  padding: 6px 0;
  color: var(--wd-mid);
  font-size: 11px;
}

.um-wd-chips .um-wd-clear {
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* Result rail ------------------------------------------------------------ */

.um-wd-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.um-wd-rail::-webkit-scrollbar {
  display: none;
}

.um-wd-card {
  display: block;
  flex: 0 0 calc((100% - 42px) / 4);
  min-width: 0;
  padding: 0;
  scroll-snap-align: start;
  color: var(--wd-ink);
  text-align: left;
  text-decoration: none;
}

.um-wd-media {
  display: block;
  width: 100%;
  aspect-ratio: 9 / 16;
  background: var(--wd-media);
  transition: background-color 0.2s var(--um-ease);
}

.um-wd-card:hover .um-wd-media,
.um-wd-card:focus-visible .um-wd-media {
  background: #26384f;
}

.um-wd-card:hover .um-wd-name {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.um-wd-name {
  display: block;
  margin-top: 11px;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
}

.um-wd-meta {
  display: block;
  margin-top: 6px;
  color: var(--wd-muted);
  font-size: 11px;
  line-height: 1.5;
}

.um-wd-money {
  display: block;
  margin-top: 7px;
  font-size: 13px;
  line-height: 1.5;
}

/* Footer ----------------------------------------------------------------- */

.um-wd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 20px;
  border-top: 1px solid var(--wd-line);
  padding-top: 6px;
  color: var(--wd-muted);
  font-size: 11px;
}

.um-wd-footer > div {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-left: auto;
}

.um-wd-footer button {
  min-height: 44px;
  padding: 8px 0;
  font-size: 11px;
  text-align: center;
}

.um-wd-footer button:disabled {
  opacity: 0.3;
  cursor: default;
}

.um-wd-mobile-controls,
.um-wd-mobile-all {
  display: none;
}

/* Empty state ------------------------------------------------------------ */

.um-wd-empty {
  flex: 1 0 100%;
  min-height: 210px;
  padding: 45px 0;
}

.um-wd-empty h2 {
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: normal;
}

.um-wd-empty p {
  margin-bottom: 14px;
  color: var(--wd-muted);
  font-size: 13px;
  line-height: 1.5;
}

.um-wd-empty button {
  min-height: 50px;
  padding: 14px 24px;
  border: 1px solid var(--um-navy);
  background: var(--um-navy);
  color: #fff;
  font-size: 14px;
  text-align: center;
}

.um-wd-empty button:hover {
  background: #26384f;
  border-color: #26384f;
}

/* Mobile filter (rendered, shown by JS) ---------------------------------- */

.um-wd-mobile-filter {
  display: none;
  margin: 0;
}

.um-wd-filter-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--wd-line);
  padding: 8px 0;
}

.um-wd-filter-heading h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: normal;
}

.um-wd-filter-heading button {
  min-height: 44px;
  padding: 8px 0;
  color: var(--wd-muted);
  font-size: 11px;
}

.um-wd-filter-collection {
  display: block;
  margin: 0 0 10px;
  font-size: 13px;
}

.um-wd-filter-collection select {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--um-line);
  background: var(--wd-paper);
  color: var(--wd-ink);
  font: 16px/normal var(--wd-sans);
}

.um-wd-apply {
  display: flex;
  align-items: center;
  gap: 25px;
  padding: 20px 0 4px;
}

.um-wd-apply button {
  min-height: 44px;
  padding: 10px 0;
  font-size: 13px;
  text-align: center;
}

.um-wd-apply .um-wd-primary {
  min-height: 50px;
  padding: 14px 24px;
  border: 1px solid var(--um-navy);
  background: var(--um-navy);
  color: #fff;
  font-size: 14px;
}

.um-wd-apply .um-wd-primary:hover {
  border-color: #26384f;
  background: #26384f;
}

.um-wd-apply .um-wd-primary:disabled {
  opacity: 0.6;
  cursor: default;
}

.um-wd-apply [data-wd-clear-draft] {
  color: var(--wd-muted);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.um-wd-apply [data-wd-clear-draft]:hover {
  color: var(--wd-red);
}

/* Narrow desktop --------------------------------------------------------- */

@media (max-width: 1200px) and (min-width: 1024px) {
  .um-wd {
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 32px;
  }

  .um-wd-card {
    flex-basis: calc((100% - 28px) / 3);
  }
}

/* Tablet and below: same single-column breakpoint as the collection page. */

@media (max-width: 1023px) {
  .um-wd {
    display: block;
    padding: 10px var(--um-pad) 16px;
  }

  .um-wd-side {
    display: none;
  }

  .um-wd-heading {
    display: block;
    margin: 0 0 9px;
  }

  .um-wd-heading > div {
    min-height: 44px;
  }

  .um-wd-back {
    display: block;
    min-height: 44px;
    padding: 8px 0;
  }

  .um-wd-heading h1 {
    font-size: 26px;
    letter-spacing: -0.8px;
  }

  .um-wd-search-wrap {
    display: block;
  }

  .um-wd-search {
    display: block;
    width: 100%;
    max-width: none;
    min-height: 44px;
    margin-top: 3px;
    font-size: 16px;
    line-height: normal;
  }

  .um-wd-mobile-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin: 0 0 3px;
  }

  .um-wd-mobile-controls select {
    max-width: 75%;
    min-height: 44px;
    padding: 8px 20px 8px 0;
    border: 0;
    background: transparent;
    color: var(--wd-ink);
    font: 13px/normal var(--wd-sans);
  }

  .um-wd-mobile-controls button {
    min-height: 44px;
    padding: 8px 0;
    font-size: 13px;
  }

  .um-wd-tools {
    min-height: 25px;
    margin: 0 0 10px;
  }

  .um-wd-chips {
    gap: 2px 14px;
    margin: 0 0 7px;
  }

  .um-wd-chips button {
    min-height: 44px;
    padding: 8px 0;
    font-size: 12px;
  }

  .um-wd-rail {
    gap: 12px;
    padding: 0;
    scroll-padding-left: 0;
  }

  .um-wd-card {
    flex-basis: calc((100% - 28px) / 3);
  }

  .um-wd-name {
    margin-top: 10px;
    font-size: 14px;
  }

  .um-wd-meta {
    font-size: 12px;
  }

  .um-wd-footer {
    margin: 16px 0 0;
    padding-top: 5px;
  }

  .um-wd-mobile-all {
    display: block;
  }

  .um-wd-footer button {
    font-size: 12px;
  }

  .um-wd-range {
    display: none;
  }

  .um-wd-mobile-filter:not([hidden]) {
    display: block;
  }

  .um-wd-find .um-wd-facet summary {
    font-size: 14px;
    line-height: 1.45;
  }

  .um-wd-facet {
    border-bottom: 1px solid var(--wd-soft);
  }

  .um-wd-facet summary {
    min-height: 48px;
    padding: 14px 0;
    font-size: 14px;
  }

  .um-wd-options label {
    min-height: 44px;
    font-size: 14px;
  }

  .um-wd-options input {
    width: 17px;
    height: 17px;
  }

  .um-wd-prices input {
    min-height: 44px;
    font-size: 16px;
    line-height: normal;
  }

  .um-wd-empty {
    min-height: 150px;
    padding: 30px 0;
  }

  .um-wd.is-filtering .um-wd-mobile-controls,
  .um-wd.is-filtering .um-wd-chips,
  .um-wd.is-filtering .um-wd-tools,
  .um-wd.is-filtering .um-wd-rail,
  .um-wd.is-filtering .um-wd-footer {
    display: none;
  }
}

/* Phones keep the single-card rail from R11. */

@media (max-width: 767px) {
  .um-wd-card {
    flex-basis: 66%;
  }
}
