/* Pro Gear Service - Rental Form v2
   Loaded only when RENTAL_FORM_V2 flag is on. All rules scoped to body.rental-v2.
   Disable the flag in index.php to instantly revert to v1. */

/* ----- v1 ↔ v2 visibility switches ----- */
/* Hide v2-only elements on v1 */
body:not(.rental-v2) .rental-stepper,
body:not(.rental-v2) .rental-pref-cards,
body:not(.rental-v2) .section-hint,
body:not(.rental-v2) .voice-questions-summary {
  display: none !important;
}
/* Hide v1-only fork toggle on v2 */
body.rental-v2 .rental-pref-toggles {
  display: none !important;
}

/* ----- Step indicator ----- */
.rental-stepper {
  /* DIAGNOSTIC: sticky temporarily off to isolate Step 3 crash */
  position: relative;
  top: 0;
  z-index: 50;
  background: var(--bg-primary);
  border-bottom: 1px solid var(--border-light);
  padding: 0.5rem 0;
  -webkit-overflow-scrolling: touch;
}
.rental-stepper-list {
  display: flex;
  gap: 0.4rem;
  margin: 0;
  padding: 0 1rem;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: none;
  max-width: 1100px;
  margin: 0 auto;
}
.rental-stepper-list::-webkit-scrollbar { display: none; }
.rental-stepper-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid transparent;
  transition: all var(--transition);
}
.rental-stepper-pill:hover { color: var(--text-primary); }
.rental-stepper-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.4rem;
  height: 1.4rem;
  border-radius: 50%;
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  font-size: 0.78rem;
}
.rental-stepper-pill.is-active {
  background: var(--gradient-primary, var(--accent));
  color: #fff;
  border-color: var(--accent);
}
.rental-stepper-pill.is-active .rental-stepper-num {
  background: rgba(255,255,255,0.25);
  border-color: transparent;
  color: #fff;
}
.rental-stepper-pill.is-visited:not(.is-active) {
  color: var(--text-primary);
}
.rental-stepper-pill.is-visited:not(.is-active) .rental-stepper-num {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

/* ----- Section hints (sub-header guidance) ----- */
.section-hint {
  margin: 0.5rem auto 0;
  max-width: 580px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.92rem;
  line-height: 1.5;
}

/* ----- Step 3: card-style primary fork ----- */
.rental-pref-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  max-width: 720px;
  margin: 0 auto 1.5rem;
}
.rental-pref-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  padding: 1.4rem 1.1rem;
  border: 2px solid var(--border-light);
  border-radius: var(--radius-lg, 14px);
  background: var(--bg-primary);
  cursor: pointer;
  font-family: var(--font-sans);
  transition: all var(--transition);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}
.rental-pref-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0,0,0,0.08);
}
.rental-pref-card.is-selected {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(255,165,0,0.06), transparent);
  box-shadow: 0 4px 14px rgba(0,0,0,0.06);
}
.rental-pref-card-icon {
  font-size: 1.8rem;
  line-height: 1;
}
.rental-pref-card-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}
.rental-pref-card-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
}

/* ----- Help-me-choose: bounded text panel ----- */
body.rental-v2 .help-text-panel {
  background: var(--bg-primary);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
}
body.rental-v2 .help-text-panel .form-group + .form-group {
  margin-top: 1rem;
}
@media (min-width: 640px) {
  body.rental-v2 .form-group-weight {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 9rem;
    align-items: center;
    gap: 0.75rem;
  }
  body.rental-v2 .form-group-weight label { margin: 0; }
}

/* ----- Voice questions: collapsible only in v2 ----- */
body.rental-v2 .voice-questions-details > .voice-questions-list {
  margin-top: 0.5rem;
}
.voice-questions-list {
  padding-left: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.8;
  margin: 0;
}
.voice-questions-summary {
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--accent);
  font-weight: 600;
  list-style: none;
  user-select: none;
  padding: 0.25rem 0;
}
.voice-questions-summary::-webkit-details-marker { display: none; }
.voice-questions-summary::before {
  content: "▸ ";
  display: inline-block;
  transition: transform var(--transition);
  color: inherit;
}
details[open] > .voice-questions-summary::before { content: "▾ "; }

/* ----- Mobile ----- */
@media (max-width: 640px) {
  .rental-pref-cards { grid-template-columns: 1fr; gap: 0.75rem; }
  .rental-pref-card { padding: 1.1rem 1rem; }
  .rental-stepper-pill { padding: 0.35rem 0.7rem; font-size: 0.78rem; }
  .rental-stepper-label { display: none; }
  .rental-stepper-pill.is-active .rental-stepper-label { display: inline; }
}
