/* Size guide page (prototype). Builds on site.css tokens and size-finder.css. */

.dw-sg-hero .dw-collection-hero-overlay {
  background: linear-gradient(180deg, rgba(13, 42, 41, 0.05) 0%, rgba(13, 42, 41, 0.72) 100%);
}
.dw-sg-hero__lead {
  max-width: 34rem;
  margin: 0.75rem 0 0;
  color: #fff;
  font-size: clamp(1rem, 2.4vw, 1.25rem);
  line-height: 1.45;
}
.dw-sg-jump {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.25rem;
}
.dw-sg-jump a {
  padding: 0.45rem 0.9rem;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 999px;
  color: #fff;
  font-size: 0.8125rem;
  text-decoration: none;
  backdrop-filter: blur(4px);
  background: rgba(255, 255, 255, 0.08);
}
.dw-sg-jump a:hover { background: rgba(255, 255, 255, 0.2); }

/* Shared type */
.dw-sg-title {
  font-family: var(--dw-font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.6vw, 2.25rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--dw-green-ink);
  margin: 0 0 0.75rem;
}
.dw-sg-lead {
  color: var(--dw-muted);
  font-size: 1rem;
  line-height: 1.6;
  max-width: 40rem;
  margin: 0;
}
.dw-sg-head { margin-bottom: clamp(1.5rem, 4vw, 2.5rem); }

section.dw-sg-finder,
section.dw-sg-measure,
section.dw-sg-widths,
section.dw-sg-chart,
section.dw-sg-faq { padding: clamp(2.75rem, 7vw, 5.5rem) 0; }

/* ---- Finder ---- */
.dw-sg-finder { background: var(--dw-paper); }
.dw-sg-finder__grid { display: flex; flex-direction: column; }

@media (max-width: 991.98px) {
  .dw-sg-finder__copy { display: contents; }
  .dw-sg-finder__copy > .dw-sg-title { order: 1; }
  .dw-sg-finder__copy > .dw-sg-lead { order: 2; }
  .dw-sg-finder__app { order: 3; }
  .dw-sg-result { order: 4; }
  .dw-sg-mm { order: 5; }
  .dw-sg-hint { order: 6; }
  .dw-sg-link { order: 7; align-self: flex-start; }

  /* Mobile + tablet: both sliders horizontal under the counter. */
  .dw-sg-finder .dw-size-finder {
    --sf-length-v: 0;
    --sf-width-v: 0;
    --sf-areas: "counter" "length" "width";
    --sf-cols: minmax(0, 1fr);
    --sf-digit: clamp(2.75rem, 13vw, 4.25rem);
    max-width: 34rem;
    padding: 1.25rem 0 0.5rem;
  }
  .dw-sg-finder .dw-sf__stage { grid-template-rows: auto auto auto; }
}

@media (min-width: 992px) {
  .dw-sg-finder__grid {
    display: grid;
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: clamp(2rem, 5vw, 5rem);
    align-items: center;
  }
  .dw-sg-finder__app {
    background: var(--dw-mist);
    border-radius: 1.5rem;
    padding: 1.5rem 2rem;
  }
  .dw-sg-finder .dw-size-finder { padding: 1rem 0; }
}

.dw-sg-result {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  margin: 1.25rem 0 1rem;
  padding: 1rem 1.25rem;
  border-left: 4px solid var(--dw-green);
  background: linear-gradient(90deg, rgba(27, 115, 88, 0.09), rgba(27, 115, 88, 0));
  border-radius: 0 0.75rem 0.75rem 0;
}
.dw-sg-result__label {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--dw-green);
}
.dw-sg-result__value {
  font-family: var(--dw-font-display);
  font-weight: 700;
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--dw-green-ink);
  font-variant-numeric: tabular-nums;
}

.dw-sg-mm {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.dw-sg-mm__field { display: flex; flex-direction: column; gap: 0.35rem; font-size: 0.8125rem; color: var(--dw-muted); }
.dw-sg-mm__input {
  display: flex;
  align-items: center;
  border: 1px solid #d6d6d6;
  border-radius: 0.6rem;
  padding: 0 0.85rem;
  background: #fff;
  transition: border-color 150ms;
}
.dw-sg-mm__input:focus-within { border-color: var(--dw-green); box-shadow: 0 0 0 3px rgba(27, 115, 88, 0.15); }
.dw-sg-mm__input input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0.7rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--dw-ink);
  font-variant-numeric: tabular-nums;
  background: transparent;
}
.dw-sg-mm__input span { color: var(--dw-muted); font-size: 0.875rem; }

.dw-sg-hint {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.875rem;
  color: var(--dw-ink);
  margin: 0 0 0.75rem;
}
.dw-sg-hint svg { flex: none; margin-top: 0.1rem; color: var(--dw-green); }
.dw-sg-link {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--dw-green);
  text-decoration: none;
  border-bottom: 2px solid currentColor;
  padding-bottom: 0.1rem;
}

/* ---- Measure steps ---- */
.dw-sg-measure { background: var(--dw-mist); }
.dw-sg-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
  counter-reset: sg-step;
}
@media (min-width: 576px) { .dw-sg-steps { grid-template-columns: 1fr 1fr; } }
@media (min-width: 992px) { .dw-sg-steps { grid-template-columns: repeat(4, 1fr); gap: 1.25rem; } }
.dw-sg-step {
  counter-increment: sg-step;
  background: #fff;
  border-radius: 1.25rem;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
}
@media (max-width: 575.98px) {
  .dw-sg-step { display: grid; grid-template-columns: 4.25rem 1fr; column-gap: 1rem; padding: 1.25rem; }
  .dw-sg-step__art { grid-row: span 2; margin: 0 !important; height: 4.25rem !important; }
  .dw-sg-step__icon { width: 3.5rem !important; height: 2.5rem !important; }
}
.dw-sg-step__art {
  position: relative;
  display: grid;
  place-items: center;
  height: 7.5rem;
  margin-bottom: 1.25rem;
  border-radius: 1rem;
  background: radial-gradient(circle at 30% 20%, rgba(27, 115, 88, 0.14), rgba(27, 115, 88, 0.04));
  color: var(--dw-green);
}
.dw-sg-step__num::before {
  content: counter(sg-step);
  position: absolute;
  top: 0.55rem;
  left: 0.65rem;
  width: 1.6rem;
  height: 1.6rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--dw-green-ink);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
}
.dw-sg-step__icon { display: none; width: 7.5rem; height: 5rem; }
.dw-sg-step--prepare .dw-sg-step__icon--prepare,
.dw-sg-step--trace .dw-sg-step__icon--trace,
.dw-sg-step--measure .dw-sg-step__icon--measure,
.dw-sg-step--choose .dw-sg-step__icon--choose { display: block; }
.dw-sg-step__title {
  font-family: var(--dw-font-display);
  font-weight: 700;
  font-size: 1.125rem;
  color: var(--dw-green-ink);
  margin: 0 0 0.4rem;
}
.dw-sg-step__body { font-size: 0.9375rem; line-height: 1.55; color: var(--dw-ink); margin: 0; }
.dw-sg-note {
  margin: 1.75rem 0 0;
  font-size: 0.875rem;
  color: var(--dw-muted);
  font-style: italic;
}

/* ---- Widths ---- */
.dw-sg-widths { background: var(--dw-green-ink); color: #fff; }
.dw-sg-widths .dw-sg-title { color: #fff; }
.dw-sg-widths .dw-sg-lead { color: rgba(255, 255, 255, 0.78); }
.dw-sg-widths__grid { display: grid; gap: 2rem; align-items: center; }
@media (min-width: 992px) { .dw-sg-widths__grid { grid-template-columns: 5fr 6fr; gap: 4rem; } .dw-sg-widths .dw-sg-head { margin: 0; } }
.dw-sg-widths__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
}
.dw-sg-width {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  padding: 1.25rem 0.5rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  transition: background-color 200ms, border-color 200ms;
}
.dw-sg-width__sole { height: clamp(6rem, 22vw, 9rem); width: auto; margin-bottom: 0.5rem; overflow: visible; }
.dw-sg-width__sole path { fill: rgba(255, 255, 255, 0.1); stroke: rgba(255, 255, 255, 0.85); stroke-width: 2.5; }
.dw-sg-width[data-sg-width="M"] .dw-sg-width__sole { transform: scaleX(0.84); }
.dw-sg-width[data-sg-width="XW"] .dw-sg-width__sole { transform: scaleX(1.18); }
.dw-sg-width__letter { font-family: var(--dw-font-display); font-weight: 800; font-size: 1.5rem; }
.dw-sg-width__name { font-size: 0.8125rem; color: rgba(255, 255, 255, 0.75); text-align: center; }
.dw-sg-width.is-active { background: var(--dw-green); border-color: var(--dw-green); }
.dw-sg-width.is-active .dw-sg-width__sole path { fill: rgba(255, 255, 255, 0.25); stroke: #fff; }
.dw-sg-width.is-active .dw-sg-width__name { color: #fff; }

/* ---- Chart ---- */
.dw-sg-table-wrap {
  overflow-x: auto;
  border-radius: 1rem;
  border: 1px solid #e3e3e3;
  -webkit-overflow-scrolling: touch;
}
.dw-sg-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-size: 0.9375rem;
}
.dw-sg-table th,
.dw-sg-table td { padding: 0.7rem 1rem; text-align: center; border-bottom: 1px solid #ececec; }
.dw-sg-table thead th {
  background: var(--dw-green-ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.8125rem;
  letter-spacing: 0.02em;
  border-bottom-color: rgba(255, 255, 255, 0.15);
}
.dw-sg-table tbody th {
  position: sticky;
  left: 0;
  background: #fff;
  font-family: var(--dw-font-display);
  font-weight: 700;
  color: var(--dw-green-ink);
  box-shadow: 1px 0 0 #ececec;
}
.dw-sg-table thead tr:first-child th:first-child { position: sticky; left: 0; z-index: 1; }
.dw-sg-table tbody tr:nth-child(even) td,
.dw-sg-table tbody tr:nth-child(even) th { background: #fafafa; }
.dw-sg-table tbody tr:last-child > * { border-bottom: 0; }
.dw-sg-table tbody tr.is-row > * { background: rgba(27, 115, 88, 0.1); }
.dw-sg-table tbody tr.is-row th { background: #e3efea; }
.dw-sg-table td.is-cell {
  background: var(--dw-green) !important;
  color: #fff;
  font-weight: 700;
  border-radius: 0.4rem;
}
@media (max-width: 575.98px) {
  .dw-sg-table th, .dw-sg-table td { padding: 0.6rem 0.65rem; font-size: 0.8125rem; }
}

/* ---- Collections ---- */
.dw-sg-pair { padding: clamp(2.75rem, 7vw, 5rem) 0; background: var(--dw-mist); }
.dw-sg-pair__item:nth-child(n + 5) { display: none; }

/* ---- FAQ ---- */
.dw-sg-faq__grid { display: grid; gap: 1.5rem; }
@media (min-width: 992px) { .dw-sg-faq__grid { grid-template-columns: 4fr 8fr; gap: 4rem; } }
.dw-sg-faq__item { border-bottom: 1px solid #e3e3e3; }
.dw-sg-faq__item:first-child { border-top: 1px solid #e3e3e3; }
.dw-sg-faq__item summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.15rem 0;
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--dw-green-ink);
}
.dw-sg-faq__item summary::-webkit-details-marker { display: none; }
.dw-sg-faq__item summary::after {
  content: "+";
  flex: none;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--dw-mist);
  color: var(--dw-green);
  font-size: 1.25rem;
  transition: transform 200ms;
}
.dw-sg-faq__item[open] summary::after { content: "−"; background: var(--dw-green); color: #fff; }
.dw-sg-faq__item p { margin: 0 0 1.25rem; color: var(--dw-ink); line-height: 1.6; max-width: 46rem; }

/* Hero: let the copy set the height (the 16:9 box clipped title + lead on phones). */
.dw-sg-hero.dw-hero--video {
  aspect-ratio: auto;
  min-height: clamp(30rem, 72vh, 42rem);
  max-height: none;
  display: flex;
  align-items: flex-end;
}
.dw-sg-hero .dw-collection-hero-overlay { padding-top: 7rem; }
@media (max-width: 575.98px) {
  .dw-sg-hero .dw-collection-title { font-size: clamp(2.1rem, 10vw, 2.6rem); }
}

.dw-sg-intro {
  max-width: 46rem;
  margin: -0.5rem 0 2rem;
  padding-left: 1rem;
  border-left: 3px solid var(--dw-green);
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--dw-ink);
}

/* Mobile: keep the counter in view while the sliders are dragged. */
@media (max-width: 991.98px) {
  .dw-sg-finder .dw-sf__counter {
    position: sticky;
    top: 4.75rem;
    z-index: 3;
    align-self: start;
  }
}

/* Accessibility: visible focus on the mm boxes and jump links. */
.dw-sg-jump a:focus-visible,
.dw-sg-link:focus-visible,
.dw-sg-faq__item summary:focus-visible,
.dw-sg-table-wrap:focus-visible {
  outline: 3px solid var(--dw-green);
  outline-offset: 3px;
}
.dw-sg-hero .dw-sg-jump a:focus-visible { outline-color: #fff; }
@media (prefers-reduced-motion: reduce) {
  .dw-sg-width, .dw-sg-faq__item summary::after { transition: none; }
}
