
/************* Listado básico UI *************/

/* Fila cabecera: título a la izquierda, botones a la derecha, y sticky */
.spt-listado-basico-wrap .spt-header-row {
  position: sticky;
  top: 0px; /* Regulamos la posición superior de la barra */
  z-index: 50; /* por encima del contenido de los grupos */
  disp lay: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 0 0 8px;
  padding: 28px 0 8px;
  background: #f0f0f1;      /* color de fondo del admin para que no sea transparente */
  border-bottom: 1px solid #dcdcde;
}


/* Botones de la cabecera: añadir producto y añadir grupo */
.spt-listado-basico-wrap .spt-header-add-product,
.spt-listado-basico-wrap .spt-add-group {
  padding: 0 10px;           /* mismo padding */
  display: inline-flex;    /* para centrar bien la imagen */
  align-items: center;
  justify-content: center;
}

/* Iconos dentro de esos botones */
.spt-listado-basico-wrap .spt-header-add-product img,
.spt-listado-basico-wrap .spt-add-group img {
  display: block;
  height: 18px;              /* mismo alto que el texto del botón */
  width: auto;               /* mantiene proporción */
}

/* Quitar margen extra del h1 en esta vista */
.spt-listado-basico-wrap .spt-header-row .titulo-listado h1 {
  margin: 0;
}

/* Como .spt-actions ya tiene margin, lo anulamos arriba */
.spt-listado-basico-wrap .spt-header-row .spt-actions-top {
  margin: 0;
}


/********** Estilos ventana pop up modal **********/
.spt-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: none;              /* se activa con la clase is-open */
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.spt-modal-backdrop.is-open {
  display: flex;
}

/* Caja del modal */
.spt-modal {
  background: #fff;
  border-radius: 6px;
  padding: 10px 15px;
  max-width: 720px;
  width: 90%;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  background-color: #e3f2fd;
  border: solid 4px #2271b1;
  transform: translateY(10px);
}

.spt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  margin-top: -15px;
  line-height: 0.7em;
}

.spt-modal-header h2 {
  color: #3585bf;
  font-variant: small-caps;
}

.spt-modal-close {
  border: none;
  background: none;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.spt-modal-body .spt-line {
  margin-bottom: 10px;
}

.spt-modal-footer {
  margin-top: 12px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.spt-modal-body input[type="text"],
.spt-modal-body input[type="number"],
.spt-modal-body select {
  width: 100%;
  max-width: 100%;
}

/* Que en el modal 1/2 y 1 unidad vayan en línea */
.spt-modal .spt-inline {
  display: flex;
  align-items: center;
  gap: 8px;           /* separación entre checkbox y precio */
}

/* Ajustes visuales del label en el modal */
.spt-modal .spt-toggle-label {
  margin: 0;
}

/* El contenedor del precio va pegado a la derecha del checkbox */
.spt-modal .spt-toggle-price {
  margin-left: 8px;
}

/* (Opcional) ancho razonable del input de precio en el modal */
.spt-modal .spt-toggle-price input {
  max-width: 100px;
}

/* Area de texto de descripcion en ventana modal*/

.spt-modal-short{
	width: 100%;
    max-width: 100%;
}






/******** Listado general *********/

.spt-listado-basico-wrap .spt-actions { margin: 12px 0 16px; display:flex; gap:8px; align-items:center; }
.spt-groups-container { display: grid; gap: 16px; max-width: 1080px; }

.spt-card {
  background: #fff;
  border: 1px solid #c3c4c7;
  border-radius: 6px;
  padding: 12px;
}
.spt-card .spt-card-toolbar { display:flex; gap:8px; align-items:center; margin-bottom: 10px; margin-top: -10px; flex-wrap: wrap;  justify-content:space-between;}
.spt-card .spt-card-title { margin: 4px 0 10px; }
.spt-card input[type="text"],
.spt-card input[type="number"],
.spt-card textarea { width: 100%; max-width: 100%; }

/****** Grupo ******/
.spt-group { border-left: 20px solid #2271b1; border-top: 50px solid #2271b1;  background: #51aff3; padding: 12px 12px 12px 10px;}
.spt-group .spt-children { display:grid; gap:12px; margin-top: 10px; }
.spt-group-title { margin-top: -35px !important; margin- bottom: 19px !important; margin-left: -10px !important; font-size: 1.1em; width: 100%;}
.spt-group-title input[type="text"] {border: 0px; color: white; font-style:capitalize;}

/* Botón Añadir producto y Eliminar grupo con icono */
.spt-listado-basico-wrap .spt-card-toolbar .spt-add-product,
.spt-listado-basico-wrap .spt-card-toolbar .spt-delete-group {
  padding: 0 10px;            /* como pedías para estos también */
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Imágenes dentro de esos botones: adaptadas a la altura */
.spt-listado-basico-wrap .spt-card-toolbar .spt-add-product img,
.spt-listado-basico-wrap .spt-card-toolbar .spt-delete-group img {
  display: block;
  height: 1.2em;              /* ajusta si las quieres más grandes/pequeñas */
  width: auto;
}

/* Arreglos boton eliminar */

 .button-link-delete{
	 background-color: #ffe3e3;
	 border-color: #d63638 !important;
 }
 

/****** Subgrupo ******/
.spt-subgroup { border-left: 15px solid #005976; margin-left:-18px; border-radius: 0px 6px 6px 0px;}



/****** Producto ******/
.spt-product { border: 2px solid #fff; border-left: 4px solid #fff; background-color: #e3f2fd; box-shadow: inset 0 0 1em rgb(0 0 0 / 20%), 0 0 0 2px white;}
.spt-flex { display:flex; gap:10px; flex-wrap: wrap; }
.spt-flex .spt-col { flex:1 1 260px; min-width: 220px; }
.spt-product .spt-line { display:grid; gap:6px; }
.spt-product .spt-inline { display:flex; align-items:center; gap:8px;  justify-content: space-between;}

.spt-muted { color:#646970; font-size:12px; margin-bottom: 4px; line-height: 0.9em;}


/* Área de la imagen */
.spt-image-field{
	display: flex;
}

/* Fila del selector de grupo/subgrupo */
.spt-product-group-row .spt-product-group-select {
  width: 100%;
  max-width: 100%;
}



/* Contenedor de alérgenos:
   - En línea
   - Wrap si hay muchos
   - Separación horizontal 15px, vertical 20px */
.allergens-wrap
.spt-allergens {
  display: flex;
  flex-wrap: wrap;
  column-gap: 5px;
  row-gap: 10px;
  margin: 10px 0 8px;
}

/* Cada alérgeno como "pill" clickable */
.spt-allergen {
  display: inline-block;
  position: relative;
}

/* Ocultamos el checkbox real */
.spt-allergen input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* Apariencia del botón cuando NO está pulsado */
.spt-allergen span {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: #ffffff; /* blanco/clarito */
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08); /* sombra exterior de 3px */
  font-size: 13px;
  cursor: pointer;
  user-select: none;
  transition:
    background 0.15s ease,
    box-shadow 0.15s ease,
    color 0.15s ease,
    transform 0.1s ease;
}

/* Apariencia cuando SÍ está pulsado */
.spt-allergen input[type="checkbox"]:checked + span {
  background: linear-gradient(135deg, #2271b1, #0d4a80); /* azul más oscuro degradado */
  color: #ffffff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.25) inset; /* sombra interior 3px */
}

/* Pequeño efecto "click" */
.spt-allergen span:active {
  transform: scale(0.97);
}






/* Estilos cabeceras y boton de colapsar grupos */

.spt-group {
  position: relative;
  border-left: 20px solid #2271b1;
  border-top: 50px solid #2271b1;
  background: #51aff3;
  padding: 4px 4px 4px 3px;
}

/* Cabecera del grupo dentro de la franja superior */
.spt-group-header {
  position: relative;
  margin-left: -10px;
  margin-right: -12px;
  padding: 6px 40px 6px 10px; /* deja hueco a la derecha para el botón */
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Título */
.spt-group-title {
  margin: 0;
  font-size: 1.1em;
  font-weight: bold;
}

.spt-group-title input[type="text"] {
  background: rgba(255,255,255,0);
  border: 0;
  color: #fff;
  width: 100%;
  font-size: 1.2em;
}


/* Placeholder del título de grupo */
.spt-group-title input[type="text"]::placeholder {
  color: #cce9ff;   /* azul claro, cambia si quieres otro tono */
  opacity: 0.45;       /* asegura que no se vea demasiado tenue */
}

/* Placeholder del título de grupo >>>>>> Soporte extra para navegadores antiguos */
.spt-group-title input[type="text"]::-webkit-input-placeholder {
  color: #cce9ff;
}
.spt-group-title input[type="text"]:-ms-input-placeholder {
  color: #cce9ff;
}
.spt-group-title input[type="text"]::-ms-input-placeholder {
  color: #cce9ff;
}





/* Botón de colapsar en la franja superior */
.spt-group-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateX(35px);
  transform: translateY(-65px);
  border: solid 4px #2271b1 !important;
}

/* Contenido del grupo */
.spt-group .spt-children {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

/* Estado colapsado */
.spt-group.spt-collapsed .spt-children,
.spt-group.spt-collapsed .spt-card-toolbar {
  display: none;
}

/* Opcional: cambia ligeramente el fondo cuando está colapsado */
.spt-group.spt-collapsed {
  background: #3b9adf;
}






/* Línea de toggle + precio en la misma fila */
.spt-product .spt-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
}

.spt-product .spt-toggle-price input[type="number"] {
  max-width: 120px; /* ajusta si quieres más ancho */
}

/* Ocultar el texto "1/2" y "1 unidad" cuando el checkbox está marcado */
.spt-product-half-toggle:checked + .spt-toggle-text,
.spt-product-one-toggle:checked + .spt-toggle-text {
  display: none;
}



/* Cuando haya una ventana modal de SPT abierta, ocultar avisos de WP */
body.spt-modal-open .notice,
body.spt-modal-open div.error,
body.spt-modal-open div.updated,
body.spt-modal-open .update-nag,
body.spt-modal-open .notice-error,
body.spt-modal-open .notice-warning,
body.spt-modal-open .notice-info,
body.spt-modal-open .notice-success {
  display: none !important;
}

/* Ocultar avisos de WP SOLO dentro del modal de producto */
#spt-product-modal .notice,
#spt-product-modal .updated,
#spt-product-modal .error,
#spt-product-modal .update-nag,
#spt-product-modal .notice-error,
#spt-product-modal .notice-warning,
#spt-product-modal .notice-info,
#spt-product-modal .notice-success,
#spt-product-modal .is-dismissible {
  display: none !important;
}

