/* Minimal styling so it fits Elessi without breaking buttons/layout */
.whapido-pca-field-wrap {
  margin: 10px 0 14px 0;
  width: 100%;
}

.whapido-pca-label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
}

.whapido-pca-textarea {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 44px;
}

/* Opciones alineadas (aunque el texto sea largo) */
.whapido-pca-cb-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px 16px;
  align-items: start;
}

.whapido-pca-rb-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Cada opción: checkbox/radio + texto + cantidad (y luego precio) */
.whapido-pca-cb-item,
.whapido-pca-rb-item {
  display: grid;
  /* col1: checkbox/radio | col2: texto | col3: qty | col4: precio */
  grid-template-columns: 18px 1fr auto auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 4px;
  width: 100%;
}

.whapido-pca-cb-item input[type="checkbox"],
.whapido-pca-rb-item input[type="radio"] {
  margin: 0;
}

.whpc-option__price {
  opacity: .85;
  font-size: .95em;
  margin-left: 6px;
  white-space: nowrap;
  justify-self: end;
}

.whpc-option__label {
  display: block;
  min-width: 0;
}

.whpc-qty {
  width: 2.2em !important;
  /* ~2 dígitos */
  min-width: 2.2em !important;
  max-width: 2.2em !important;
  height: 26px !important;
  line-height: 24px !important;
  box-sizing: border-box !important;
  padding: 0 !important;
  border-radius: 0 !important;
  text-align: center !important;
  margin: 0 !important;
}

.whpc-qty-wrap {
  display: inline-flex;
  align-items: center;
  gap: 0;
  margin-left: 0;
  border: 1px solid rgba(0, 0, 0, .18);
  border-radius: 10px;
  overflow: hidden;
}

.whpc-qty-btn {
  width: 26px;
  height: 26px;
  line-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  cursor: pointer;
}

.whpc-qty-btn--minus {
  background: #ffecec;
  color: #b00020;
}

.whpc-qty-btn--plus {
  background: #eaffea;
  color: #0b6b0b;
}

.whpc-qty {
  border: 0;
  border-left: 1px solid rgba(0, 0, 0, .14);
  border-right: 1px solid rgba(0, 0, 0, .14);
}

.whpc-qty-btn:active {
  transform: scale(.98);
}

/* Quita flechas nativas en algunos browsers */
.whpc-qty::-webkit-outer-spin-button,
.whpc-qty::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.whpc-qty {
  -moz-appearance: textfield;
  appearance: textfield;
}


/* --- Whapido: bloques prolijos + alineación columnas (v0.3.4) --- */
.whpc-qty-counter {
  float: right;
  color: #888;
  font-size: 11px;
  font-weight: 400;
  margin-top: 0;
  margin-right: 0;
}

.whpc-qty-counter.whpc-limit-reached {
  color: #15803d;
}

.whpc-field {
  position: relative;
  border: 1px solid rgba(0, 0, 0, .10);
  border-radius: 12px;
  padding: 12px 12px;
  margin: 12px 0;
  background: rgba(255, 255, 255, .55);
}

.whpc-field .whpc-label,
.whpc-field .whapido-pca-label {
  margin-bottom: 10px;
}

/* Listado de opciones */
.whpc-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Cada opción como fila con columnas: izquierda (input + texto) / derecha (qty + precio) */
.whpc-option {
  display: flex;
  align-items: center;
  width: 100%;
  gap: 8px;
  justify-content: space-between;
}

.whpc-option__left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
}

.whpc-option__right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  margin-left: auto;
  white-space: nowrap;
}

.whpc-option__label {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.whpc-option__price {
  min-width: 64px;
  text-align: right;
}


/* Input (radio/checkbox) */
.whpc-option>input.whpc-input {
  margin: 0;
  flex: 0 0 auto;
}

/* Texto: ocupa el espacio, siempre a la izquierda */
.whpc-option__label {
  flex: 1 1 auto;
  min-width: 0;
  text-align: left;
  line-height: 1.25;
}

/* Cantidad se va a la derecha */
.whpc-option .whpc-qty-wrap {
  margin-left: auto;
  flex: 0 0 auto;
}

/* Precio a la derecha (si no hay qty, también empuja a la derecha) */
.whpc-option__price {
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
  text-align: right;
  opacity: .95;
}

/* Si hay qty antes del precio, no queremos que el precio empuje todo (ya lo empuja la qty) */
.whpc-option .whpc-qty-wrap+.whpc-option__price {
  margin-left: 8px;
}

/* Botones +/- bien pegados y notorios */
.whpc-qty-wrap {
  border-radius: 10px;
  overflow: hidden;
}

.whpc-qty-btn {
  border: 0;
}

.whpc-qty-btn--minus {
  background: rgba(255, 59, 48, .12);
  color: #b42318;
}

.whpc-qty-btn--plus {
  background: rgba(52, 199, 89, .14);
  color: #0b6b0b;
}

/* Un poquito más compacto en general */
.whpc-qty,
.whpc-qty-btn {
  height: 30px;
}

/* mobile: un poco menos padding para que respire */
@media (max-width: 480px) {
  .whpc-field {
    padding: 10px 10px;
    border-radius: 12px;
  }
}

/* Títulos de bloques (labels) alineados a la izquierda */
.whpc-field .whapido-pca-label,
.whpc-label {
  text-align: left !important;
  display: block;
  width: 100%;
}


.whpc-max-msg {
  font-size: 12px;
  margin: 6px 0 0;
  opacity: .85;
}

.whpc-option--disabled {
  opacity: .5;
  pointer-events: none;
  cursor: not-allowed;
}

.woocommerce-error,
.woocommerce-message,
.woocommerce-info,
.woocommerce-notices-wrapper {
  position: relative !important;
  z-index: 999999999 !important;
}

/* Category Grouping Styles */
.whpc-cat-title {
  font-size: 1.05em;
  font-weight: 700;
  margin: 18px 0 10px 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  padding-bottom: 6px;
  color: var(--whpc-title, inherit);
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
}

.whpc-cat-limit-info {
  font-size: 0.8em;
  font-weight: normal;
  margin-left: 10px;
  color: #888;
}

.whpc-cat-qty-counter {
  color: #888;
  font-size: 0.8em;
  font-weight: normal;
  margin-left: 10px;
  display: inline-block;
}

.whpc-cat-qty-counter.whpc-cat-limit-reached {
  color: #15803d;
  font-weight: 700;
}