/* ============================================================
   Caja Mixta — Frontend Configurador
   Color principal: #e8650a (naranja Comenaranjas)
   ============================================================ */

#cm-app {
  margin: 2rem 0;
  font-family: inherit;
}

.cm-configurador {
  max-width: 760px;
}

/* ---------- Breadcrumb de pasos ---------- */
.cm-pasos {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}
.cm-paso-btn {
  display: flex;
  align-items: center;
  gap: .35rem;
  background: none;
  border: none;
  padding: .3rem .4rem;
  cursor: pointer;
  font-size: .9rem;
  border-radius: 4px;
  transition: background .15s;
  font-family: inherit;
}
.cm-paso-btn:hover:not(:disabled) { background: #fff3e8; }
.cm-paso-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px; height: 24px;
  border-radius: 50%;
  font-size: .78rem; font-weight: 700;
  background: #ddd; color: #666;
  flex-shrink: 0;
}
.cm-paso-active .cm-paso-num  { background: #e8650a; color: #fff; }
.cm-paso-done .cm-paso-num    { background: #2e7d32; color: #fff; }
.cm-paso-label { font-weight: 600; font-size: .88rem; color: #333; }
.cm-paso-pending .cm-paso-label { color: #aaa; font-weight: 400; }
.cm-paso-sep { color: #ccc; font-size: 1rem; line-height: 1; }

/* ---------- Seccion ---------- */
.cm-section { animation: cmFadeIn .2s ease; }
@keyframes cmFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.cm-section-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 1.1rem; color: #222; }
.cm-resumen {
  font-size: .82rem; color: #777; margin-bottom: 1rem;
  padding: .35rem .7rem; background: #f9f9f9;
  border-left: 3px solid #e8650a; border-radius: 0 4px 4px 0;
}

/* ---------- Grid tarjetas (paso 1 y 2) ---------- */
.cm-opciones-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: .85rem; margin-bottom: 1.5rem;
}
.cm-card {
  display: flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: 1.1rem .85rem;
  border: 2px solid #e0e0e0; border-radius: 10px; background: #fff;
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s, transform .1s;
  text-align: center; font-family: inherit;
}
.cm-card:hover {
  border-color: #e8650a;
  box-shadow: 0 2px 10px rgba(232,101,10,.13);
  transform: translateY(-2px);
}
.cm-card-selected {
  border-color: #e8650a !important; background: #fff8f3 !important;
  box-shadow: 0 0 0 3px rgba(232,101,10,.18) !important;
}
.cm-card-icon  { font-size: 1.8rem; line-height: 1; }
.cm-card-label { font-weight: 700; font-size: .95rem; color: #222; }
.cm-card-sub   { font-size: .78rem; color: #888; }

/* ---------- Lista opciones (paso 3) ---------- */
.cm-opciones-lista { display: flex; flex-direction: column; gap: .85rem; margin-bottom: 1rem; }
.cm-opcion-card {
  border: 2px solid #e8e8e8; border-radius: 10px;
  padding: 1rem 1.15rem; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
.cm-opcion-card:hover {
  border-color: #e8650a;
  box-shadow: 0 2px 10px rgba(232,101,10,.1);
}
.cm-opcion-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: .55rem; gap: .75rem; flex-wrap: wrap;
}
.cm-opcion-nombre { font-weight: 700; font-size: .97rem; color: #222; flex: 1; min-width: 0; }
.cm-opcion-precio { font-weight: 800; font-size: 1.15rem; color: #e8650a; white-space: nowrap; flex-shrink: 0; }

.cm-comp-list { display: flex; flex-wrap: wrap; gap: .35rem; margin-bottom: .85rem; }
.cm-comp-tag {
  background: #f2f2f2; border-radius: 20px;
  padding: .22rem .7rem; font-size: .8rem; color: #555;
}
.cm-comp-tag strong { color: #222; }

/* ---------- Footer tarjeta ---------- */
.cm-card-footer { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }

/* ---------- Boton carrito ---------- */
.cm-btn-cart {
  background: #e8650a; color: #fff; border: none;
  border-radius: 7px; padding: .6rem 1.4rem;
  font-size: .9rem; font-weight: 700;
  cursor: pointer; transition: background .15s, transform .1s;
  font-family: inherit; white-space: nowrap;
}
.cm-btn-cart:hover:not(:disabled) { background: #cf5809; transform: translateY(-1px); }
.cm-btn-cart:disabled { opacity: .7; cursor: not-allowed; transform: none; }
.cm-btn-cart.cm-btn-success { background: #2e7d32; }

/* ---------- Mensajes ---------- */
.cm-cart-msg { font-size: .85rem; color: #555; }
.cm-cart-msg.cm-error { color: #c62828; }
.cm-ir-carrito { color: #e8650a; font-weight: 700; text-decoration: underline; }
.cm-empty { color: #888; font-style: italic; padding: .75rem 0; }
.cm-price-placeholder { font-weight: 600; color: #e8650a; font-size: 1rem; }

/* ==========================================================
   RESPONSIVE MOVIL
   ========================================================== */
@media (max-width: 600px) {
  .cm-pasos { gap: .25rem; margin-bottom: 1.4rem; }
  .cm-paso-label { display: none; }
  .cm-paso-btn { padding: .2rem .25rem; }

  .cm-opciones-grid { grid-template-columns: 1fr 1fr; gap: .65rem; }
  .cm-card { padding: .9rem .6rem; }
  .cm-card-icon { font-size: 1.5rem; }
  .cm-card-label { font-size: .85rem; }

  .cm-opcion-card { padding: .85rem .9rem; }
  .cm-opcion-header { flex-direction: column; align-items: flex-start; gap: .2rem; }
  .cm-opcion-precio { font-size: 1.05rem; }

  .cm-card-footer { flex-direction: column; align-items: flex-start; gap: .5rem; }
  .cm-btn-cart { width: 100%; text-align: center; padding: .7rem 1rem; }
}

@media (max-width: 380px) {
  .cm-opciones-grid { grid-template-columns: 1fr; }
}
