/* ============================================================
   SAC AERO DESIGN — configurator.css
============================================================ */

/* Page hero reuse */
.page-hero {
  padding: calc(var(--nav-height) + 4rem) 0 4rem;
  position: relative;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
}
.page-hero-bg-grid {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(0,200,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0,200,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
}

/* ---- LAYOUT ---- */
.configurator-section {
  background: var(--bg-dark);
  padding: 3rem 0 6rem;
}

.configurator-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2.5rem;
  align-items: start;
  width: 92%;
  max-width: 1280px;
  margin-inline: auto;
}

/* ============================================================
   STEPS
============================================================ */
.configurator-steps {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.cfg-step {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color 0.3s ease, opacity 0.3s ease;
}
.cfg-step.locked {
  opacity: 0.45;
  pointer-events: none;
  filter: grayscale(0.4);
}
.cfg-step.active,
.cfg-step:not(.locked) {
  opacity: 1;
}

/* Step header */
.cfg-step-header {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.cfg-step-num {
  font-family: var(--font-display);
  font-size: 2.2rem;
  font-weight: 900;
  color: rgba(0,200,255,0.18);
  line-height: 1;
  flex-shrink: 0;
  min-width: 52px;
}
.cfg-step-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.35rem;
  letter-spacing: 0.04em;
}
.cfg-step-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
}
.compat-note {
  display: block;
  font-size: 0.88rem;
  color: var(--accent);
  background: rgba(0,200,255,0.07);
  border: 1px solid rgba(0,200,255,0.2);
  border-radius: var(--radius);
  padding: 0.5rem 0.85rem;
  margin-top: 0.4rem;
}

/* ---- OPTIONS LIST ---- */
.cfg-options {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Individual option button */
.cfg-option {
  display: flex;
  align-items: flex-start;
  gap: 1.25rem;
  padding: 1.25rem 2rem;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  text-align: left;
  width: 100%;
  transition: background var(--transition);
  position: relative;
}
.cfg-option:last-child { border-bottom: none; }
.cfg-option:hover { background: rgba(255,255,255,0.03); }

.cfg-option.selected {
  background: rgba(0,200,255,0.07);
  border-left: 3px solid var(--accent);
  padding-left: calc(2rem - 3px);
}
.cfg-option.selected::after {
  content: '\f058'; /* fa-circle-check */
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  color: var(--accent);
  font-size: 1.1rem;
}

/* Multi-select: show check differently */
.multi-select .cfg-option.selected {
  background: rgba(0,200,255,0.07);
  border-left: 3px solid var(--accent);
}

/* Option icon */
.cfg-option-icon {
  width: 40px;
  height: 40px;
  background: rgba(0,200,255,0.08);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 0.1rem;
  transition: background var(--transition);
}
.cfg-option-icon i { color: var(--accent); font-size: 1rem; }
.cfg-option.selected .cfg-option-icon { background: rgba(0,200,255,0.18); }

/* Option body */
.cfg-option-body strong {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.3rem;
}
.cfg-option-body p {
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 0.6rem;
}

/* Tags */
.cfg-option-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  list-style: none;
}
.cfg-option-tags li {
  font-size: 0.72rem;
  font-family: var(--font-display);
  letter-spacing: 0.06em;
  background: rgba(0,200,255,0.08);
  color: var(--accent);
  border: 1px solid rgba(0,200,255,0.18);
  border-radius: 100px;
  padding: 0.15rem 0.55rem;
}
.cfg-option-tags li.tag-warn {
  background: rgba(255,100,100,0.08);
  color: #e08080;
  border-color: rgba(255,100,100,0.2);
}

/* Complete button wrap */
.cfg-complete-wrap {
  padding: 1.5rem 2rem;
  border-top: 1px solid var(--border);
}

/* ============================================================
   SUMMARY SIDEBAR
============================================================ */
.cfg-summary {
  position: sticky;
  top: calc(var(--nav-height) + 1.5rem);
  max-height: calc(100vh - var(--nav-height) - 3rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.cfg-summary-inner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}

.cfg-summary-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1.25rem 1.5rem;
  background: rgba(0,200,255,0.05);
  border-bottom: 1px solid var(--border);
}
.cfg-summary-header i { color: var(--accent); font-size: 1rem; }
.cfg-summary-header h3 {
  font-family: var(--font-display);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
}

/* Progress bar */
.cfg-summary-progress {
  padding: 1rem 1.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
}
.cfg-progress-bar {
  height: 4px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 0.4rem;
}
.cfg-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-dim), var(--accent));
  border-radius: 4px;
  transition: width 0.4s ease;
}
.cfg-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: var(--font-display);
  letter-spacing: 0.08em;
}

/* Summary list */
.cfg-summary-list {
  padding: 1rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  min-height: 60px;
}
.summary-empty {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-style: italic;
}
.summary-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.summary-item:last-child { border-bottom: none; padding-bottom: 0; }
.summary-label {
  font-family: var(--font-display);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}
.summary-value {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.4;
}

/* Warnings */
.cfg-warnings {
  margin: 0 1.5rem 1rem;
  background: rgba(255,100,50,0.07);
  border: 1px solid rgba(255,100,50,0.25);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
}
.warning-title {
  font-family: var(--font-display);
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #e08060;
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.cfg-warnings ul {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.cfg-warnings li {
  font-size: 0.8rem;
  color: #c09080;
  line-height: 1.5;
  padding-left: 0.75rem;
  position: relative;
}
.cfg-warnings li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: #e08060;
}
/* Base */
.cfg-warnings li {
  font-size: 0.8rem;
  line-height: 1.5;
  padding-left: 0.75rem;
  position: relative;
}

/* 🔴 REQUIRED */
.cfg-warnings li.warn-required {
  color: #ff6b6b;
}
.cfg-warnings li.warn-required::before {
  content: '!';
  color: #ff6b6b;
}

/* 🟡 RECOMMENDED */
.cfg-warnings li.warn-recommended {
  color: #f5c96a;
}
.cfg-warnings li.warn-recommended::before {
  content: '›';
  color: #f5c96a;
}

/* 🔵 INFO */
.cfg-warnings li.warn-info {
  color: #6ab7ff;
}
.cfg-warnings li.warn-info::before {
  content: 'i';
  color: #6ab7ff;
}
/* CTA */
.cfg-summary-cta {
  padding: 1.25rem 1.5rem;
  border-top: 1px solid var(--border);
}
.cfg-summary-cta-note {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 0.85rem;
  line-height: 1.5;
}

/* ============================================================
   SPEC MODAL
============================================================ */
.cfg-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
}
.cfg-modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
  padding: 2.5rem;
}
.cfg-modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  transition: color var(--transition);
}
.cfg-modal-close:hover { color: #fff; }
.cfg-modal-header {
  text-align: center;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.cfg-modal-header i { font-size: 2rem; color: var(--accent); display: block; margin-bottom: 0.75rem; }
.cfg-modal-header h3 {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}
.cfg-modal-header p { font-size: 0.88rem; color: var(--text-muted); }

/* Spec sheet content */
.cfg-spec-sheet {
  background: var(--bg-dark);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  font-size: 0.82rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.spec-heading { color: var(--accent); font-weight: 700; }
.spec-divider { color: var(--border); }
.spec-row { display: flex; gap: 0.5rem; }
.spec-key { color: var(--text-muted); min-width: 180px; flex-shrink: 0; }
.spec-val { color: #fff; }

.cfg-modal-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.cfg-modal-actions .btn { flex: 1; justify-content: center; }

/* ============================================================
   STEP 7 TWO-SECTION LAYOUT
   Step 7 is split into Part A (COM radio count) and Part B
   (audio panel). Each part has a sub-section header row above
   its group of option buttons.
============================================================ */

/* Thin header bar separating the two sub-sections */
.cfg-subsection-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.85rem 2rem 0.6rem;
  background: rgba(0, 200, 255, 0.04);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

/* Label inside the sub-section header (e.g. "Part A — COM Radio Count") */
.cfg-subsection-label {
  font-family: var(--font-display);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.cfg-subsection-label i {
  margin-right: 0.3rem;
}

/*
 * Inline warning note shown inside the audio sub-section header
 * when "Two COM Radios" is selected — reminds the user they must
 * also pick an audio panel before proceeding.
 */
.cfg-audio-note {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  color: #e09060;
  background: rgba(255, 120, 50, 0.07);
  border: 1px solid rgba(255, 120, 50, 0.25);
  border-radius: var(--radius);
  padding: 0.3rem 0.75rem;
}
.cfg-audio-note i {
  color: #e09060;
  font-size: 0.8rem;
  flex-shrink: 0;
}

/* Wrapper div around each group of option buttons within a sub-section */
.cfg-option-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* Remove the top border on the very first sub-section header
   so it blends into the step card's existing option divider */
.cfg-options > .cfg-subsection-header:first-child {
  border-top: none;
}

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1000px) {
  .configurator-layout {
    grid-template-columns: 1fr;
  }
  .cfg-summary {
    position: static;
    max-height: none;
    order: -1; /* show summary above steps on mobile */
  }
}
@media (max-width: 600px) {
  .cfg-step-header { flex-direction: column; gap: 0.5rem; padding: 1.25rem; }
  .cfg-option { padding: 1rem 1.25rem; gap: 0.85rem; }
  .cfg-option.selected { padding-left: calc(1.25rem - 3px); }
  .cfg-modal { padding: 1.5rem; }
  .cfg-modal-actions { flex-direction: column; }
}

/* ============================================================
   OPTION IMAGE PLACEHOLDERS
   Each option has a photo slot on the left.
   When the image is missing it shows a grey box.
   When loaded it shows the photo with the icon overlaid.
============================================================ */

/* Outer wrapper — fixed size left of the option body */
.cfg-option-img-wrap {
  position: relative;
  width: 210px;
  height: 150px;
  flex-shrink: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-mid);
  border: 1px solid var(--border);
}

/* The photo itself */
.cfg-option-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: opacity var(--transition);
}

/* Fallback: if img is hidden (onerror), show icon centred */
.cfg-option-img[style*="display: none"] ~ .cfg-icon-overlay {
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 0;
  bottom: unset;
  right: unset;
  background: rgba(0,200,255,0.06);
}
.cfg-option-img[style*="display: none"] ~ .cfg-icon-overlay i {
  font-size: 1.2rem;
}

/* Selected state — image gets a slight accent tint */
.cfg-option.selected .cfg-option-img-wrap {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(0,200,255,0.2);
}

/* Tighten the option layout now that we have a wider left element */
.cfg-option {
  gap: 1rem;
}

/* On mobile stack image above text */
@media (max-width: 500px) {
  .cfg-option {
    flex-wrap: wrap;
  }
  .cfg-option-img-wrap {
    width: 100%;
    height: 160px;
  }
  .cfg-option-img {
    object-fit: contain;
    object-position: center;
    background: var(--bg-mid);
  }
}