/* ==========================================================
   Enviroline Fleet — Configurator Styles
   Companion to styles.css — imports its CSS custom properties
   ========================================================== */

/* ----------------------------------------------------------
   Page intro header
   ---------------------------------------------------------- */
.config-page-intro {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 20px 0;
}

/* ----------------------------------------------------------
   Two-column layout wrapper
   ---------------------------------------------------------- */
.config-wrap {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 20px 80px;
  align-items: start;
}

/* ----------------------------------------------------------
   Left-hand main column
   ---------------------------------------------------------- */
.config-main {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ----------------------------------------------------------
   Config panel (accordion / section card)
   ---------------------------------------------------------- */
.config-panel {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 24px;
}

.config-panel-title {
  font-size: 17px;
  font-weight: 800;
  color: var(--black);
  margin: 0 0 16px;
}

/* ----------------------------------------------------------
   Select element with custom chevron
   ---------------------------------------------------------- */
.config-select {
  display: block;
  width: 100%;
  padding: 10px 36px 10px 14px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background-color: var(--white);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4' stroke='%235f6b68' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  font-size: 15px;
  color: var(--black);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.config-select:focus {
  outline: none;
  border-color: var(--green);
}

/* ----------------------------------------------------------
   Option grid + buttons
   ---------------------------------------------------------- */
.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.option-btn {
  /* reset */
  appearance: none;
  -webkit-appearance: none;
  background: none;
  border: none;
  font: inherit;
  /* layout */
  display: flex;
  flex-direction: column;
  text-align: left;
  padding: 12px;
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  transition: border-color 0.15s, background 0.15s;
}

.option-btn:hover {
  border-color: var(--green);
}

.option-btn.selected {
  border-color: var(--green);
  background: color-mix(in srgb, var(--green) 12%, white);
}

.option-btn img {
  width: 100%;
  height: 72px;
  object-fit: contain;
  border-radius: 4px;
  background: var(--soft);
  display: block;
  margin-bottom: 8px;
}

.option-code {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green-dark);
}

.option-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--black);
  margin-top: 3px;
}

.option-desc {
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.5;
}

/* Disabled state */
.option-btn.is-disabled {
  position: relative;
  opacity: 0.5;
  pointer-events: none;
}

.disabled-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(255, 255, 255, 0.82);
  border-radius: 6px;
  font-size: 11px;
  font-weight: 800;
  color: var(--black);
  text-align: center;
  padding: 8px;
}

/* ----------------------------------------------------------
   Sticky sidebar (build summary)
   ---------------------------------------------------------- */
.config-sidebar {
  position: sticky;
  top: 76px;
  background: var(--black);
  border-radius: 8px;
  padding: 20px;
  color: var(--white);
}

.sidebar-eyebrow {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--green);
  margin: 0 0 12px;
}

/* Build code display */
.build-code-box {
  background: var(--green);
  color: var(--black);
  border-radius: 6px;
  padding: 12px 16px;
  margin-bottom: 12px;
}

.build-code-label {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.build-code-value {
  font-size: 14px;
  font-weight: 800;
  margin-top: 4px;
  word-break: break-all;
}

/* Preview image box */
.build-img-box {
  background: var(--white);
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 12px;
  min-height: 100px;
  display: grid;
  place-items: center;
}

.build-img-box img {
  max-height: 110px;
  object-fit: contain;
  width: 100%;
}

/* Selected items list */
.build-items-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.build-item {
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.build-item:first-child {
  border-top: none;
}

.build-item-code {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--green);
}

.build-item-name {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.88);
}

/* CTA button inside sidebar */
.sidebar-cta {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  background: var(--green);
  color: var(--black);
  border: none;
  border-radius: 4px;
  font-weight: 800;
  font-size: 14px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.sidebar-cta:hover {
  background: var(--green-dark);
  color: var(--white);
}

/* Empty state */
.sidebar-empty {
  text-align: center;
  padding: 20px 0;
  color: rgba(255, 255, 255, 0.35);
  font-size: 13px;
}

/* ----------------------------------------------------------
   CTA band (footer call-to-action strip)
   Defined here as a local fallback; styles.css takes precedence
   if the class is already declared there.
   ---------------------------------------------------------- */
.cta-band {
  max-width: var(--max);
  margin: 0 auto;
  padding: 40px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-top: 1px solid var(--line);
}

/* ----------------------------------------------------------
   Responsive — tablet / narrow desktop
   ---------------------------------------------------------- */
@media (max-width: 900px) {
  .config-wrap {
    grid-template-columns: 1fr;
  }

  .config-sidebar {
    position: static;
  }
}

/* ----------------------------------------------------------
   Responsive — mobile
   ---------------------------------------------------------- */
@media (max-width: 580px) {
  .option-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  }

  .cta-band {
    flex-direction: column;
    align-items: flex-start;
  }
}
