/**
 * Hand-written CSS for the Solution Finder — the parent theme's
 * tailwind.config.js only scans its own paths (index.php, views/**,
 * resources/js/alpine/**, functions/**), never duravant-oc-child/, so
 * Tailwind classes used here would not be compiled.
 *
 * Colors: the parent's --color-* tokens where they match exactly, shared
 * values from oc-tokens.css (--oc-*), and literals only for one-offs.
 */

.solution-finder-tabs {
  display: flex;
  flex-wrap: nowrap;
  justify-content: space-around; /* spread the tabs across the full width instead of clustering left */
  overflow-x: auto; /* one row that scrolls sideways when the tabs don't fit */
  scrollbar-width: thin;
  gap: 0.5rem;
  border-bottom: 1px solid var(--oc-border);
  margin-bottom: 2rem;
  margin-top: 2rem;
}

.solution-finder-tabs button {
  flex: none;
  white-space: nowrap;
  padding: 4px 4vw;
  border: none;
  background: transparent;
  cursor: pointer;
  font-weight: var(--font-weight-semibold);
  color: var(--color-black);
  font-family: var(--font-aktiv-grotesk-extended);
  text-transform: uppercase;
  font-size: .75rem;
  border-bottom: 3px solid transparent;
}
.solution-finder-tabs button:hover {
  border-color: var(--color-blue);
}
.solution-finder-tabs button.is-active {
  border-bottom-color: var(--color-blue-deep);
}

/* One row per step: label + description on the left, options on the right
   (keeps the form short). Fixed-width text column so the rows line up;
   stacks on narrow screens where the option cards wouldn't fit beside it. */
.solution-finder-field-block {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 2rem;
  margin-bottom: 0.5rem;
}

.solution-finder-field-heading {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  flex: 0 0 20rem;
  margin-top:20px;
  max-width: 20rem;
}

.solution-finder-field-text {
  min-width: 0;
}

/* Numbered step bullet (1-5): a round badge that also grows for two-digit
   numbers. */
.solution-finder-step {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2rem;
  height: 2rem;
  padding: 0 0.5rem;
  border-radius: 9999px;
  background-color: var(--color-blue);
  color: var(--color-black);
  font-family: var(--font-aktiv-grotesk-extended);
  font-weight: var(--font-weight-semibold);
  line-height: 1;
}

.solution-finder-field-label {
  display: block;
  font-family: var(--font-aktiv-grotesk);
  font-size: var(--text-base);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.25rem;
}

.solution-finder-field-description {
  margin: 0;
}

.solution-finder-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  flex: 1 1 0;
  min-width: 0;
}

@media (max-width: 47.99rem) {
  .solution-finder-field-block {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }

  .solution-finder-field-heading {
    flex-basis: auto;
    max-width: none;
  }
}

label.solution-finder-radio-option:hover {
  border-color: var(--color-blue);
}
label.solution-finder-radio-option input[type="radio"] {
  display: none;
}

.solution-finder-radio-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  width: 8rem;
  padding: 0.75rem 0.5rem;
  border: 4px solid var(--color-white);
  border-radius: 0.4rem;
  text-align: center;
  font-size: 0.8rem;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.solution-finder-radio-option:has(input:checked) {
  border-color: var(--color-blue-deep);
  background: var(--oc-surface-alt);
}

.solution-finder-radio-option.is-disabled {
  opacity: 0.4;
  cursor: not-allowed;
  background: #f0f0f0;
}

.solution-finder-radio-option img {
  width: 100%;
  height: 4.5rem;
  object-fit: contain;
}

/* Right-hand column of step 5: the fields' grid with the note under it. */
.solution-finder-field-body {
  flex: 1 1 0;
  min-width: 0;
}

.solution-finder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1.25rem;
  padding: 1.25rem 0;
}

/* Below the width where 4 fields fit in a row, always a 2x2 grid (instead
   of auto-fit's 3+1 / 1-column steps). */
@media (max-width: 71.99rem) {
  .solution-finder-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Note under the four fields (why Volume is unavailable). It sits OUTSIDE the
   grid on purpose: an item spanning every column of an auto-fit grid keeps
   the empty columns from collapsing, so the fields were narrower while the
   note showed and jumped wider once it hid. */
.solution-finder-grid-note {
  margin: 0 0 1.25rem;
}

.solution-finder-field {
  display: flex;
  flex-direction: column;
  justify-content: flex-end; /* inputs stay aligned when a neighbour's label wraps */
  gap: 0.35rem;
  font-size: 0.875rem;
}

.solution-finder-field-name {
  font-weight: var(--font-weight-semibold);
}

.solution-finder-field input {
  padding: 0.5rem 0.65rem;
  border: 1px solid var(--oc-input-border);
  border-radius: 0.25rem;
  font-size: 1rem;
}

.solution-finder-field input:focus {
  outline-width: 0;
  border-color: var(--color-blue);
}

/* Locked inputs (:read-only also matches :disabled): Volume when it can't be
   used, Width/Height while a Volume drives them. Greyed the same way in
   every browser instead of relying on each one's own default. */
.solution-finder-field input:read-only {
  background: var(--oc-surface);
  cursor: not-allowed;
}

/* Unit attached to the input (Bootstrap-style input group): the input drops
   its right-hand rounding and the unit box closes the field. */
.solution-finder-input-group {
  display: flex;
  align-items: stretch;
}

.solution-finder-input-group input {
  flex: 1;
  min-width: 0;
  border-radius: 0.25rem 0 0 0.25rem;
}

.solution-finder-unit {
  display: flex;
  align-items: center;
  padding: 0 0.75rem;
  border: 1px solid var(--oc-input-border);
  border-left: 0;
  border-radius: 0 0.25rem 0.25rem 0;
  background: var(--oc-surface);
  white-space: nowrap;
}

/* The parent's button-regular-primary has no disabled look (only hover). */
.solution-finder-form button[type="submit"]:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.solution-finder-form button[type="submit"]:disabled:hover {
  background-color: var(--color-blue);
  border-color: var(--color-blue);
}

.solution-finder-secondary-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 1.25rem;
}

.solution-finder-secondary-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
  padding: 1.5rem;
  border: 4px solid var(--color-bone);
  border-radius: 0.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--oc-ink);
  font-weight: var(--font-weight-semibold);
  transition: border-color 0.15s ease;
}

.solution-finder-secondary-option:hover {
  border-color: var(--color-blue);
}

.solution-finder-secondary-option img {
  max-width: 100%;
  max-height: 8rem;
  object-fit: contain;
}

.solution-finder-results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.5rem;
}

/* Desktop: always exactly 4 columns, even with 1-2 results — auto-fit alone
   stretches a lone result into a full-width card instead of a normal-sized
   one. Same 71.99rem boundary as .solution-finder-grid above (this file's
   own established "4 items fit in a row" width for this page). */
@media (min-width: 72rem) {
  .solution-finder-results-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.machine-result-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem;
  border: 1px solid var(--oc-border);
  border-radius: 0.5rem;
}

.machine-result-card.is-best-match {
  border-color: var(--oc-highlight);
  box-shadow: 0 0 0 1px var(--oc-highlight);
}

.machine-result-badge {
  position: absolute;
  top: -0.65rem;
  left: 1rem;
  background: var(--oc-highlight);
  color: var(--oc-ink);
  font-size: 0.7rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.machine-result-image img {
  width: 100%;
  height: 8rem;
  object-fit: contain;
}

.machine-result-model {
  font-size: 0.75rem;
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  color: #666;
  text-decoration: none;
}

.machine-result-title {
  font-size: 1.1rem;
  font-weight: var(--font-weight-bold);
  margin: 0;
}

.machine-result-title a {
  color: inherit;
  text-decoration: none;
}

.machine-result-specs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 1rem;
  margin: 0.5rem 0 0;
  font-size: 0.85rem;
}

.machine-result-specs dt {
  color: #888;
}

.machine-result-specs dd {
  margin: 0;
  font-weight: var(--font-weight-semibold);
}
