/* Styles specific to the Feedlot ROI Calculator (products/feedlot-roi.html) */
/* Inherits the shared .roi-* component styles from style.css; only adds the
   hero treatment and the slider + value pairing not present elsewhere. */

/* ── HERO (matches products/mat-roi.html grammar) ── */
.feedlot-roi-hero {
  background-color: var(--color-offwhite);
  padding: 5rem 2rem 4rem;
}

.feedlot-roi-hero-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

.feedlot-roi-hero-sub {
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--color-text-secondary);
  max-width: 580px;
  margin: 0 auto;
}

/* ── In-calculator image (ear_sensor; portrait, so constrain height) ── */
.feedlot-roi-image {
  border-radius: 8px;
  margin-top: 1.5rem;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  object-position: center 38%;
}

/* ── Slider + value pairing ── */
.roi-slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.roi-slider-head label {
  margin-bottom: 0;
}

.roi-slider-value {
  flex: 0 0 auto;
  width: 6.5rem;
  text-align: right;
  padding: 0.3rem 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-primary);
  background: var(--color-white);
  transition: border-color 0.2s;
}

.roi-slider-value:focus {
  outline: none;
  border-color: var(--color-pink);
}

.roi-field-note {
  font-size: 0.8rem;
  color: var(--color-text-muted);
  margin-top: 0.4rem;
  line-height: 1.5;
}

.roi-field-cta {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.35rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-pink);
  background: color-mix(in srgb, var(--color-pink) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-pink) 30%, transparent);
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

.roi-field-cta:hover {
  background: color-mix(in srgb, var(--color-pink) 15%, transparent);
  border-color: var(--color-pink);
}

/* Loss-model toggle. Same segmented-pill grammar as .toggle-pill on the mat
   pricing page; duplicated rather than shared because that rule lives in
   pricing-mat.css, which this page doesn't load. Stretches full width here —
   these are two long phrases in a narrow input column, not short billing terms. */
.roi-model-toggle {
  display: flex;
  background: var(--color-offwhite);
  border-radius: 8px;
  padding: 4px;
  gap: 4px;
}

.roi-model-pill {
  flex: 1;
  padding: 0.55rem 0.75rem;
  border-radius: 6px;
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.2s ease;
}

.roi-model-pill.is-active {
  background: var(--color-white);
  color: var(--color-text-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.roi-model-pill:focus-visible {
  outline: 2px solid var(--color-pink);
  outline-offset: 1px;
}

.roi-model-note {
  margin-bottom: 1.5rem;
}

/* The "600 lb × $441/cwt" trailing detail on a Math-card row. */
.roi-row-detail {
  color: var(--color-text-light);
  white-space: nowrap;
}

/* Range input, branded to the site palette */
input[type="range"].roi-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 4px;
  background: var(--color-border);
  outline: none;
  margin: 0.35rem 0 0;
  cursor: pointer;
}

input[type="range"].roi-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-pink);
  border: 2px solid var(--color-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: background 0.2s, transform 0.1s;
}

input[type="range"].roi-slider::-webkit-slider-thumb:active {
  transform: scale(1.12);
  background: var(--color-pink-hover);
}

input[type="range"].roi-slider::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--color-pink);
  border: 2px solid var(--color-white);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  cursor: pointer;
}

input[type="range"].roi-slider:focus-visible {
  box-shadow: 0 0 0 3px var(--color-light-pink-bg);
}

/* ── Headline ROI card ── */
.roi-headline-card {
  background: var(--color-dark-bg);
  color: var(--color-white);
  text-align: center;
  padding: 2rem 1.5rem;
}

.roi-headline-card .roi-card-title {
  color: var(--color-pink);
  border-bottom-color: rgba(255, 255, 255, 0.12);
}

.roi-headline-figures {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 2.5rem;
  margin: 0.5rem 0 1.25rem;
}

.roi-headline-figure .roi-headline-number {
  font-size: 2.4rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.roi-headline-figure .roi-headline-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.4rem;
}

.roi-supporting-line {
  font-size: 0.95rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.85);
  max-width: 28rem;
  margin: 0 auto;
}

.roi-supporting-line strong {
  color: var(--color-white);
}

/* ── Cost-per-head emphasis ── */
.roi-cost-per-head {
  text-align: center;
  background: var(--color-light-pink-bg);
  border-radius: 8px;
  padding: 1.1rem 1.5rem;
}

.roi-cost-per-head .roi-cph-value {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--color-pink);
  line-height: 1.1;
}

.roi-cost-per-head .roi-cph-label {
  display: block;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  margin-top: 0.35rem;
}

/* ── Waterfall bar ── */
.roi-waterfall {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.roi-bar-row {
  display: grid;
  grid-template-columns: 9rem 1fr;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  color: var(--color-text-secondary);
}

.roi-bar-track {
  position: relative;
  background: var(--color-offwhite);
  border-radius: 4px;
  height: 1.6rem;
  overflow: hidden;
}

.roi-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.25s ease;
  min-width: 2px;
}

.roi-bar-fill.is-cost { background: var(--color-text-muted); }
.roi-bar-fill.is-savings { background: var(--color-blue); }
.roi-bar-fill.is-net { background: var(--color-success); }
.roi-bar-fill.is-net-negative { background: var(--color-error); }

.roi-bar-value {
  position: absolute;
  right: 0.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-primary);
}

@media (max-width: 480px) {
  .roi-bar-row { grid-template-columns: 7rem 1fr; }
}

/* ── Retrieval checkbox ── */
.roi-checkbox-field {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin-bottom: 0.75rem;
}

.roi-checkbox-field input[type="checkbox"] {
  margin-top: 0.2rem;
  accent-color: var(--color-pink);
  width: 1rem;
  height: 1rem;
  flex: 0 0 auto;
}

.roi-checkbox-field label {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: 0;
}

/* ── Floating ROI summary ──
   The headline card leaves the viewport well before the last control does — on
   mobile the results stack below the inputs, on desktop they sit in a right-hand
   column that scrolls off the top. Either way the float keeps the live result on
   screen while the user is still working the sliders. */
.roi-float {
  display: flex;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 90;
  justify-content: space-around;
  align-items: center;
  gap: 1rem;
  background: var(--color-dark-bg);
  color: var(--color-white);
  padding: 0.7rem 1.25rem calc(0.7rem + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.28);
  transform: translateY(115%);
  transition: transform 0.28s ease;
  pointer-events: none;
}

.roi-float.is-visible {
  transform: translateY(0);
}

/* Desktop: sit in the results column, at the width of the real Net Return card,
   pinned just under the nav — so it reads as that card holding its place rather
   than as a new element. Anywhere further left would cover the sliders.

   The three offsets are measured off the live card by the template's script;
   the fallbacks here only matter before that first measurement. */
@media (min-width: 769px) {
  .roi-float {
    --roi-float-left: 50%;
    --roi-float-width: 22rem;
    --roi-float-top: 6rem;

    left: var(--roi-float-left);
    width: var(--roi-float-width);
    top: var(--roi-float-top);
    right: auto;
    bottom: auto;
    padding: 0.9rem 1.5rem;  /* matches the card's horizontal padding */
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
    /* Parked clear of the top edge, and behind the fixed nav on the way in. The
       112px term exceeds --roi-float-top, so this clears regardless of height. */
    transform: translateY(calc(-100% - 112px));
  }

  .roi-float.is-visible {
    transform: translateY(0);
  }
}

.roi-float-figure {
  text-align: center;
}

.roi-float-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.01em;
}

.roi-float-label {
  display: block;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
  margin-top: 0.15rem;
}

/* ── Sources / citations panel ── */
.roi-sources {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem 4rem;
}

.roi-sources-inner {
  background: var(--color-offwhite);
  border-radius: 8px;
  padding: 1.75rem 2rem;
}

.roi-sources h2 {
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--color-text-muted);
  margin-bottom: 1rem;
}

.roi-sources ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.roi-sources li {
  font-size: 0.85rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  padding-left: 1rem;
  position: relative;
}

.roi-sources li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--color-text-light);
}

.roi-sources a {
  color: var(--color-blue);
}
