/* Carta pública · configurador para clientes (orden M-2b), como el lienzo
   aprobado por Jimmy el 02/11/2026: una sola pantalla con secciones, rojo
   #a30013, verde azulado #1a7a72, fondo #f0efed. Orden M-2e: más compacto, al
   tamaño de "Pedido enviado", y sin los dibujos de pizza. Lo que se toca mide
   44 px o más (algunos se ven de 40 y se tocan en 44 con un relleno invisible). */

body.cc-abierto { overflow: hidden; }

.cc-fondo {
  position: fixed;
  inset: 0;
  z-index: 1090;
  background: rgba(20, 18, 16, 0.55);
}
.cc-fondo[hidden], .cc-hoja[hidden] { display: none !important; }

.cc-hoja {
  position: fixed;
  inset: 0;
  z-index: 1091;
  display: flex;
  flex-direction: column;
  background: #f0efed;
  color: #1a1a1a;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
}
@media (min-width: 768px) {
  .cc-hoja {
    left: 50%;
    width: 480px;
    transform: translateX(-50%);
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.25);
  }
}
.cc-hoja button { font-family: inherit; cursor: pointer; color: inherit; }
.cc-hoja button:focus-visible, .cc-hoja textarea:focus-visible {
  outline: 3px solid #1a7a72;
  outline-offset: 2px;
}

/* Cabecera */
.cc-cabecera {
  flex: none;
  background: #fff;
  padding: 8px 14px;
  border-bottom: 1px solid #c9c4c0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: calc(8px + env(safe-area-inset-top));
}
.cc-cabecera-fila { display: flex; align-items: center; gap: 10px; }
.cc-volver {
  position: relative;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: 1px solid #c9c4c0;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cc-cabecera-textos { flex: 1; min-width: 0; }
.cc-titulo {
  margin: 0;
  font-family: 'Changa One', sans-serif;
  font-weight: 400;
  font-size: 20px;
  line-height: 1.1;
  color: #a30013;
}
.cc-sub { margin: 2px 0 0; font-size: 13px; color: #5a5550; line-height: 1.35; }

/* Se ven de 40 px y se tocan en 44 */
.cc-volver::after, .cc-redondo::after, .cc-segmento::after, .cc-cambiar::after {
  content: '';
  position: absolute;
  inset: -2px;
}

.cc-avance { display: flex; flex-direction: column; gap: 4px; }
.cc-avance[hidden] { display: none; }
.cc-avance-textos { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.cc-avance-textos span { color: #5a5550; text-align: right; }
.cc-avance-barra { height: 6px; border-radius: 3px; background: #e4e1de; overflow: hidden; }
.cc-avance-barra div { height: 6px; border-radius: 3px; background: #1a7a72; transition: width 0.25s; }

/* Cuerpo y secciones */
.cc-cuerpo {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
#ccSecciones { display: flex; flex-direction: column; gap: 10px; }

.cc-seccion {
  background: #fff;
  border-radius: 14px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  border: 2px solid transparent;
  scroll-margin-top: 12px;
}
.cc-seccion[hidden] { display: none; }
.cc-seccion-activa { border-color: #a30013; }
.cc-seccion-cerrada { flex-direction: row; align-items: center; gap: 10px; }

.cc-seccion-cabeza { display: flex; align-items: center; gap: 8px; }
.cc-seccion-textos { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cc-seccion-titulo {
  margin: 0;
  font-family: 'Changa One', sans-serif;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.15;
}
label.cc-seccion-titulo { font-size: 15px; }   /* "¿Algo para la cocina?" */
.cc-seccion-pista, .cc-opcional { font-size: 13px; color: #5a5550; }
.cc-seccion-elegido { font-size: 14px; color: #5a5550; line-height: 1.35; }

.cc-numero {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 12px;
  background: #a30013;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.cc-numero-gris { background: #6b6560; }
.cc-numero-listo { background: #1a7a72; }

.cc-cambiar {
  position: relative;
  flex: none;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 20px;
  border: 1px solid #c9c4c0;
  background: #fff;
  font-size: 14px;
  font-weight: 700;
  color: #a30013 !important;
}

/* Opciones */
.cc-grid { display: grid; gap: 8px; }
.cc-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.cc-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.cc-opcion {
  min-height: 44px;
  border-radius: 12px;
  border: 1px solid #c9c4c0;
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  padding: 4px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
  line-height: 1.2;
}
.cc-opcion svg { color: #a30013; flex: none; }
.cc-elegida {
  border: 2px solid #a30013 !important;
  background: #fff7f7 !important;
  font-weight: 800;
}
.cc-opcion-alta { min-height: 44px; flex-direction: column; gap: 0; }
.cc-opcion-nombre { font-weight: 700; font-size: 14px; }
.cc-opcion-precio { font-size: 13px; color: #5a5550; font-weight: 700; }
.cc-elegida .cc-opcion-precio { color: #a30013; }
.cc-opcion-pista { font-size: 12px; color: #5a5550; font-weight: 500; }
/* "Un sabor" / "Mitad y mitad": sin dibujo, dos botones de 48 px lado a lado */
.cc-modo { min-height: 48px; flex-direction: column; gap: 0; padding: 4px 6px; }
.cc-modo .cc-opcion-nombre { font-size: 15px; line-height: 1.2; }
.cc-modo .cc-opcion-pista { line-height: 1.2; }
/* A 380 px o más, "Dos sabores, sin costo extra" entra en una línea. */
@media (min-width: 380px) {
  .cc-modo { padding: 4px 3px; }
  .cc-modo .cc-opcion-pista { white-space: nowrap; letter-spacing: -0.01em; }
}
/* "Agranda tu combo": las dos opciones */
.cc-opcion-fila {
  min-height: 56px;
  justify-content: space-between;
  text-align: left;
  padding: 8px 12px;
}
.cc-opcion-fila .cc-opcion-nombre { font-size: 15px; }
.cc-opcion-fila .cc-opcion-pista { font-size: 13px; }
.cc-opcion-textos { display: flex; flex-direction: column; gap: 2px; }

/* Mitades */
.cc-pista { margin: 0; font-size: 13px; color: #5a5550; }
.cc-ranura {
  min-height: 48px;
  border-radius: 12px;
  border: 1px dashed #c9c4c0;
  background: #fff;
  padding: 5px 10px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
  text-align: left;
}
.cc-ranura-1.cc-ranura-activa { border: 2px solid #c05e00; background: #fff3e0; }
.cc-ranura-2.cc-ranura-activa { border: 2px solid #1a7a72; background: #e8f4f2; }
.cc-ranura-etiqueta { font-size: 11px; font-weight: 800; letter-spacing: 0.04em; line-height: 1.2; }
.cc-ranura-1 .cc-ranura-etiqueta { color: #8a4500; }
.cc-ranura-2 .cc-ranura-etiqueta { color: #11504b; }
.cc-ranura-sabor { font-size: 15px; font-weight: 700; line-height: 1.2; }

.cc-aviso {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  background: #fff3e0;
  color: #8a4500;
  border-radius: 10px;
  padding: 6px 10px;
  font-size: 13px;
}
.cc-aviso svg { flex: none; width: 16px; height: 16px; }

.cc-sabores { display: flex; flex-direction: column; gap: 6px; }
.cc-sabor {
  width: 100%;
  min-height: 52px;
  border-radius: 12px;
  border: 1px solid #c9c4c0;
  background: #fff;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1px;
  text-align: left;
}
.cc-sabor-fila { display: flex; align-items: center; gap: 6px; width: 100%; flex-wrap: wrap; }
.cc-sabor-nombre { font-weight: 700; font-size: 15px; flex: 1; min-width: 40%; line-height: 1.25; }
/* Ingredientes: hasta 2 líneas; si no caben, "…" */
.cc-sabor-ing {
  font-size: 13px;
  color: #5a5550;
  line-height: 1.35;
  font-weight: 400;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cc-premium {
  font-size: 12px;
  font-weight: 800;
  color: #8a4500;
  background: #fff3e0;
  border-radius: 999px;
  padding: 2px 8px;
  line-height: 1.3;
}
.cc-marca {
  font-size: 12px;
  font-weight: 800;
  color: #fff;
  background: #a30013;
  border-radius: 999px;
  padding: 2px 8px;
}
.cc-marca-1 { background: #c05e00; }
.cc-marca-2 { background: #1a7a72; }

/* Alitas */
.cc-reparto {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  background: #e8f4f2;
  color: #11504b;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
}
.cc-reparto-manual { flex-direction: column; align-items: stretch; }
.cc-reparto-fila { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 700; }
.cc-reparto p { margin: 0; font-weight: 800; }
.cc-ok { color: #11504b; }
.cc-mal { color: #a30013; }
.cc-enlace {
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 700;
  color: #11504b !important;
  text-decoration: underline;
  align-self: flex-start;
}

/* Cola */
.cc-unidad-etiqueta { margin: 2px 0 0; font-size: 13px; font-weight: 700; color: #5a5550; }
.cc-segmentos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #c9c4c0;
  border-radius: 12px;
  padding: 2px;
  background: #f0efed;
}
.cc-segmento {
  position: relative;
  min-height: 40px;
  border-radius: 10px;
  border: 0;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
}
.cc-segmento-activo { background: #1a7a72; color: #fff !important; font-weight: 800; }

/* Ya viene incluido */
.cc-incluido { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }
.cc-incluido li { display: flex; align-items: center; gap: 8px; }
.cc-incluido svg { color: #1a7a72; }

.cc-nota {
  border: 1px solid #c9c4c0;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 16px;   /* 16 px: con menos, el iPhone hace zoom al escribir */
  font-family: inherit;
  resize: none;
  width: 100%;
}

/* Pie */
.cc-pie {
  flex: none;
  background: #fff;
  border-top: 1px solid #c9c4c0;
  padding: 8px 14px calc(12px + env(safe-area-inset-bottom));
  /* Orden M-2e: la cantidad va al lado del botón principal, en la misma fila;
     el resumen arriba, solo si tiene texto. */
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  column-gap: 10px;
  row-gap: 6px;
  box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
}
.cc-pie-fila { display: contents; }
.cc-pie .cc-resumen { grid-column: 1 / -1; grid-row: 1; }
.cc-pie .cc-resumen:empty { display: none; }
.cc-pie .cc-error { grid-column: 1 / -1; grid-row: 2; }
.cc-pie > .cc-pie-fila > .cc-cantidad { grid-column: 1; grid-row: 3; }
.cc-pie .cc-principal { grid-column: 2; grid-row: 3; }
.cc-resumen { font-size: 13px; color: #5a5550; min-width: 0; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.cc-cantidad { flex: none; display: flex; align-items: center; gap: 4px; font-size: 16px; font-weight: 800; }
.cc-cantidad > span { min-width: 32px; text-align: center; }
.cc-redondo {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 20px;
  border: 1px solid #c9c4c0;
  background: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
}
.cc-redondo:disabled { opacity: 0.4; cursor: default; }
.cc-error { margin: 0; font-size: 14px; color: #a30013; font-weight: 700; }
.cc-error[hidden] { display: none; }
.cc-principal {
  width: 100%;
  min-height: 52px;
  border-radius: 14px;
  border: 0;
  background: #a30013;
  color: #fff !important;
  font-size: 16px;
  font-weight: 800;
}
.cc-principal-falta { background: #e4e1de; color: #3d3a37 !important; }
.cc-principal:disabled { cursor: progress; }
