/*
 * TangramFood - editar plato UI polish
 * Scope: editar-plato.php
 * Solo presentacion. No contiene logica de guardado.
 */

:root {
  --tfv3-orange: #f04b23;
  --tfv3-ink: #1f2937;
  --tfv3-muted: #6b7280;
  --tfv3-border: #e6ded8;
  --tfv3-soft: #f7f4f2;
  --tfv3-card: #ffffff;
  --tfv3-radius-lg: 22px;
  --tfv3-radius-md: 16px;
  --tfv3-shadow: 0 24px 60px rgba(31, 41, 55, 0.10);
}

body.page-template-editar-plato,
body:has(.tfv3-editar-plato-page),
body:has(.tf-editar-plato-page) {
  background: #ded9d5;
}

.tfv3-editar-plato-page,
.tf-editar-plato-page,
.tf-plato-editor-page,
body.page-template-editar-plato .site-main,
body.page-template-editar-plato .inside-article {
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
}

.tfv3-editar-plato-page,
.tf-editar-plato-page,
.tf-plato-editor-page,
body.page-template-editar-plato .inside-article {
  background: var(--tfv3-soft);
  border: 1px solid var(--tfv3-border);
  border-radius: var(--tfv3-radius-lg);
  box-shadow: var(--tfv3-shadow);
}

body.page-template-editar-plato .inside-article {
  padding: 42px 48px 52px;
}

body.page-template-editar-plato h1,
.tfv3-editar-plato-page h1,
.tf-editar-plato-page h1,
.tf-plato-editor-page h1 {
  color: var(--tfv3-orange);
  font-size: clamp(42px, 4.2vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.035em;
  margin: 0 0 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid rgba(31, 41, 55, 0.08);
}

body.page-template-editar-plato h2,
.tfv3-editar-plato-page h2,
.tf-editar-plato-page h2,
.tf-plato-editor-page h2 {
  color: var(--tfv3-orange);
  font-size: clamp(28px, 2.6vw, 40px);
  line-height: 1.12;
  letter-spacing: -0.025em;
  margin: 0 0 24px;
}

body.page-template-editar-plato h3,
.tfv3-editar-plato-page h3,
.tf-editar-plato-page h3,
.tf-plato-editor-page h3 {
  color: var(--tfv3-orange);
  font-size: clamp(24px, 2.2vw, 34px);
  line-height: 1.16;
  letter-spacing: -0.02em;
  margin: 34px 0 18px;
}

body.page-template-editar-plato form,
.tfv3-editar-plato-page form,
.tf-editar-plato-page form,
.tf-plato-editor-page form {
  max-width: 860px;
  margin: 0 auto;
}

body.page-template-editar-plato fieldset,
.tfv3-editar-plato-page fieldset,
.tf-editar-plato-page fieldset,
.tf-plato-editor-page fieldset,
body.page-template-editar-plato .tf-form-section,
body.page-template-editar-plato .tf-card,
body.page-template-editar-plato .tfv3-card {
  background: var(--tfv3-card);
  border: 1px solid rgba(230, 222, 216, 0.85);
  border-radius: var(--tfv3-radius-md);
  padding: 30px 34px;
  margin: 0 0 30px;
  box-shadow: 0 14px 34px rgba(31, 41, 55, 0.045);
}

body.page-template-editar-plato label,
.tfv3-editar-plato-page label,
.tf-editar-plato-page label,
.tf-plato-editor-page label {
  color: var(--tfv3-ink);
  font-weight: 800;
  font-size: 14px;
  line-height: 1.35;
  margin-bottom: 8px;
}

body.page-template-editar-plato input[type="text"],
body.page-template-editar-plato input[type="number"],
body.page-template-editar-plato input[type="search"],
body.page-template-editar-plato textarea,
body.page-template-editar-plato select,
.tfv3-editar-plato-page input[type="text"],
.tfv3-editar-plato-page input[type="number"],
.tfv3-editar-plato-page textarea,
.tfv3-editar-plato-page select,
.tf-editar-plato-page input[type="text"],
.tf-editar-plato-page input[type="number"],
.tf-editar-plato-page textarea,
.tf-editar-plato-page select {
  min-height: 50px;
  border: 1px solid #ded8d2;
  border-radius: 12px;
  background: #ffffff;
  color: var(--tfv3-ink);
  font-size: 15px;
  line-height: 1.45;
  padding: 12px 14px;
  box-shadow: none;
}

body.page-template-editar-plato input[type="text"]:focus,
body.page-template-editar-plato input[type="number"]:focus,
body.page-template-editar-plato textarea:focus,
body.page-template-editar-plato select:focus {
  outline: 0;
  border-color: rgba(240, 75, 35, 0.55);
  box-shadow: 0 0 0 4px rgba(240, 75, 35, 0.10);
}

body.page-template-editar-plato .tfv3-checkbox-grid,
body.page-template-editar-plato .tf-checkbox-grid,
body.page-template-editar-plato .tf-check-grid,
body.page-template-editar-plato .alergenos-grid,
body.page-template-editar-plato .ingestas-grid,
body.page-template-editar-plato .checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 18px;
}

body.page-template-editar-plato .tfv3-checkbox-grid label,
body.page-template-editar-plato .tf-checkbox-grid label,
body.page-template-editar-plato .tf-check-grid label,
body.page-template-editar-plato .alergenos-grid label,
body.page-template-editar-plato .ingestas-grid label,
body.page-template-editar-plato .checkbox-grid label,
body.page-template-editar-plato label:has(input[type="checkbox"]) {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  background: #ffffff;
  border: 1px solid rgba(230, 222, 216, 0.9);
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 750;
  color: var(--tfv3-ink);
}

body.page-template-editar-plato label:has(input[type="checkbox"]:checked) {
  border-color: rgba(240, 75, 35, 0.55);
  background: #fff7f3;
  box-shadow: inset 0 0 0 1px rgba(240, 75, 35, 0.08);
}

body.page-template-editar-plato input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  accent-color: var(--tfv3-orange);
}

body.page-template-editar-plato .tfv3-other-allergen-row,
body.page-template-editar-plato .tf-other-allergen-row,
body.page-template-editar-plato .otros-alergenos-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr) auto;
  gap: 12px;
  align-items: center;
}

body.page-template-editar-plato button,
body.page-template-editar-plato .button,
body.page-template-editar-plato input[type="submit"] {
  border-radius: 999px;
  font-weight: 900;
  letter-spacing: -0.01em;
}

body.page-template-editar-plato input[type="submit"],
body.page-template-editar-plato button[type="submit"],
body.page-template-editar-plato .tf-primary-button,
body.page-template-editar-plato .tfv3-primary-button {
  background: var(--tfv3-orange);
  border-color: var(--tfv3-orange);
  color: #ffffff;
  min-height: 46px;
  padding: 12px 24px;
  box-shadow: 0 12px 28px rgba(240, 75, 35, 0.22);
}

body.page-template-editar-plato .tf-form-actions,
body.page-template-editar-plato .tfv3-form-actions,
body.page-template-editar-plato p:has(input[type="submit"]) {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 28px;
}

body.page-template-editar-plato a[href*="mis-platos"],
body.page-template-editar-plato a[href*="mis-platos"] strong {
  color: var(--tfv3-ink);
  font-size: 22px;
  font-weight: 900;
  text-decoration: none;
}

body.page-template-editar-plato a[href*="mis-platos"]:hover {
  color: var(--tfv3-orange);
}

body.page-template-editar-plato .description,
body.page-template-editar-plato .help,
body.page-template-editar-plato small {
  color: var(--tfv3-muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (min-width: 1280px) {
  body.page-template-editar-plato .inside-article {
    max-width: 1120px;
  }

  body.page-template-editar-plato form,
  .tfv3-editar-plato-page form,
  .tf-editar-plato-page form,
  .tf-plato-editor-page form {
    max-width: 900px;
  }
}

@media (max-width: 900px) {
  body.page-template-editar-plato .inside-article {
    padding: 30px 24px 40px;
  }

  body.page-template-editar-plato .tfv3-checkbox-grid,
  body.page-template-editar-plato .tf-checkbox-grid,
  body.page-template-editar-plato .tf-check-grid,
  body.page-template-editar-plato .alergenos-grid,
  body.page-template-editar-plato .ingestas-grid,
  body.page-template-editar-plato .checkbox-grid {
    grid-template-columns: 1fr;
  }

  body.page-template-editar-plato .tfv3-other-allergen-row,
  body.page-template-editar-plato .tf-other-allergen-row,
  body.page-template-editar-plato .otros-alergenos-row {
    grid-template-columns: 1fr;
  }
}

/* POINT6B - fine tuning editar plato
 * Objetivo: aumentar ancho util, mejorar ritmo visual y jerarquia.
 * Solo presentacion.
 */

body.page-template-editar-plato .site-main,
body.page-template-editar-plato .inside-article,
.tfv3-editar-plato-page,
.tf-editar-plato-page,
.tf-plato-editor-page {
  max-width: 1180px;
}

body.page-template-editar-plato .inside-article {
  padding: 38px 56px 50px;
}

body.page-template-editar-plato form,
.tfv3-editar-plato-page form,
.tf-editar-plato-page form,
.tf-plato-editor-page form {
  max-width: 980px;
}

body.page-template-editar-plato h1,
.tfv3-editar-plato-page h1,
.tf-editar-plato-page h1,
.tf-plato-editor-page h1 {
  font-size: clamp(40px, 3.6vw, 56px);
  line-height: 1.02;
  margin-bottom: 24px;
  padding-bottom: 16px;
}

body.page-template-editar-plato h2,
.tfv3-editar-plato-page h2,
.tf-editar-plato-page h2,
.tf-plato-editor-page h2 {
  font-size: clamp(27px, 2.2vw, 34px);
  line-height: 1.12;
  margin-bottom: 20px;
}

body.page-template-editar-plato h3,
.tfv3-editar-plato-page h3,
.tf-editar-plato-page h3,
.tf-plato-editor-page h3 {
  color: var(--tfv3-orange);
  font-size: clamp(24px, 2vw, 31px);
  line-height: 1.14;
  margin: 30px 0 16px;
}

body.page-template-editar-plato fieldset,
.tfv3-editar-plato-page fieldset,
.tf-editar-plato-page fieldset,
.tf-plato-editor-page fieldset,
body.page-template-editar-plato .tf-form-section,
body.page-template-editar-plato .tf-card,
body.page-template-editar-plato .tfv3-card {
  padding: 28px 34px;
  margin-bottom: 24px;
}

body.page-template-editar-plato label,
.tfv3-editar-plato-page label,
.tf-editar-plato-page label,
.tf-plato-editor-page label {
  font-size: 13.5px;
  margin-bottom: 6px;
}

body.page-template-editar-plato input[type="text"],
body.page-template-editar-plato input[type="number"],
body.page-template-editar-plato input[type="search"],
body.page-template-editar-plato textarea,
body.page-template-editar-plato select,
.tfv3-editar-plato-page input[type="text"],
.tfv3-editar-plato-page input[type="number"],
.tfv3-editar-plato-page textarea,
.tfv3-editar-plato-page select,
.tf-editar-plato-page input[type="text"],
.tf-editar-plato-page input[type="number"],
.tf-editar-plato-page textarea,
.tf-editar-plato-page select {
  min-height: 48px;
  font-size: 15px;
  padding: 11px 14px;
}

body.page-template-editar-plato .tfv3-checkbox-grid,
body.page-template-editar-plato .tf-checkbox-grid,
body.page-template-editar-plato .tf-check-grid,
body.page-template-editar-plato .alergenos-grid,
body.page-template-editar-plato .ingestas-grid,
body.page-template-editar-plato .checkbox-grid {
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 12px 20px;
}

body.page-template-editar-plato .tfv3-checkbox-grid label,
body.page-template-editar-plato .tf-checkbox-grid label,
body.page-template-editar-plato .tf-check-grid label,
body.page-template-editar-plato .alergenos-grid label,
body.page-template-editar-plato .ingestas-grid label,
body.page-template-editar-plato .checkbox-grid label,
body.page-template-editar-plato label:has(input[type="checkbox"]) {
  min-height: 42px;
  padding: 9px 12px;
  font-size: 13.5px;
  line-height: 1.25;
}

body.page-template-editar-plato .tfv3-other-allergen-row,
body.page-template-editar-plato .tf-other-allergen-row,
body.page-template-editar-plato .otros-alergenos-row {
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
  gap: 12px;
}

body.page-template-editar-plato .tf-form-actions,
body.page-template-editar-plato .tfv3-form-actions,
body.page-template-editar-plato p:has(input[type="submit"]) {
  gap: 18px;
  margin-top: 24px;
}

body.page-template-editar-plato input[type="submit"],
body.page-template-editar-plato button[type="submit"],
body.page-template-editar-plato .tf-primary-button,
body.page-template-editar-plato .tfv3-primary-button {
  min-height: 44px;
  padding: 11px 24px;
}

body.page-template-editar-plato a[href*="mis-platos"],
body.page-template-editar-plato a[href*="mis-platos"] strong {
  font-size: 20px;
  font-weight: 850;
}

body.page-template-editar-plato .tfv3-card + .tfv3-card,
body.page-template-editar-plato .tf-card + .tf-card,
body.page-template-editar-plato fieldset + fieldset {
  margin-top: 18px;
}

@media (min-width: 1280px) {
  body.page-template-editar-plato .inside-article {
    max-width: 1180px;
  }

  body.page-template-editar-plato form,
  .tfv3-editar-plato-page form,
  .tf-editar-plato-page form,
  .tf-plato-editor-page form {
    max-width: 980px;
  }
}

@media (min-width: 1500px) {
  body.page-template-editar-plato .site-main,
  body.page-template-editar-plato .inside-article,
  .tfv3-editar-plato-page,
  .tf-editar-plato-page,
  .tf-plato-editor-page {
    max-width: 1240px;
  }

  body.page-template-editar-plato form,
  .tfv3-editar-plato-page form,
  .tf-editar-plato-page form,
  .tf-plato-editor-page form {
    max-width: 1040px;
  }
}

@media (max-width: 900px) {
  body.page-template-editar-plato .inside-article {
    padding: 28px 22px 38px;
  }

  body.page-template-editar-plato .tfv3-checkbox-grid,
  body.page-template-editar-plato .tf-checkbox-grid,
  body.page-template-editar-plato .tf-check-grid,
  body.page-template-editar-plato .alergenos-grid,
  body.page-template-editar-plato .ingestas-grid,
  body.page-template-editar-plato .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

/* POINT6C - micro refine editar plato
 * Ajuste fino visual. Sin cambios funcionales.
 */

/* Aprovechar mas el ancho util sin perder lectura */
body.page-template-editar-plato .inside-article {
  max-width: 1260px;
  padding: 34px 60px 46px;
}

body.page-template-editar-plato form,
.tfv3-editar-plato-page form,
.tf-editar-plato-page form,
.tf-plato-editor-page form {
  max-width: 1080px;
}

/* Cards internas mas anchas y un poco mas compactas */
body.page-template-editar-plato fieldset,
.tfv3-editar-plato-page fieldset,
.tf-editar-plato-page fieldset,
.tf-plato-editor-page fieldset,
body.page-template-editar-plato .tf-form-section,
body.page-template-editar-plato .tf-card,
body.page-template-editar-plato .tfv3-card {
  padding: 24px 32px;
  margin-bottom: 20px;
  border-radius: 18px;
}

/* Reducir altura total sin perder comodidad */
body.page-template-editar-plato input[type="text"],
body.page-template-editar-plato input[type="number"],
body.page-template-editar-plato input[type="search"],
body.page-template-editar-plato textarea,
body.page-template-editar-plato select,
.tfv3-editar-plato-page input[type="text"],
.tfv3-editar-plato-page input[type="number"],
.tfv3-editar-plato-page textarea,
.tfv3-editar-plato-page select,
.tf-editar-plato-page input[type="text"],
.tf-editar-plato-page input[type="number"],
.tf-editar-plato-page textarea,
.tf-editar-plato-page select {
  min-height: 44px;
  padding-top: 9px;
  padding-bottom: 9px;
}

/* Labels algo mas compactas */
body.page-template-editar-plato label,
.tfv3-editar-plato-page label,
.tf-editar-plato-page label,
.tf-plato-editor-page label {
  margin-bottom: 5px;
}

/* Checkboxes mas compactos y con mas anchura util */
body.page-template-editar-plato .tfv3-checkbox-grid,
body.page-template-editar-plato .tf-checkbox-grid,
body.page-template-editar-plato .tf-check-grid,
body.page-template-editar-plato .alergenos-grid,
body.page-template-editar-plato .ingestas-grid,
body.page-template-editar-plato .checkbox-grid {
  grid-template-columns: repeat(2, minmax(290px, 1fr));
  gap: 10px 18px;
}

body.page-template-editar-plato .tfv3-checkbox-grid label,
body.page-template-editar-plato .tf-checkbox-grid label,
body.page-template-editar-plato .tf-check-grid label,
body.page-template-editar-plato .alergenos-grid label,
body.page-template-editar-plato .ingestas-grid label,
body.page-template-editar-plato .checkbox-grid label,
body.page-template-editar-plato label:has(input[type="checkbox"]) {
  min-height: 39px;
  padding: 8px 11px;
}

/* Otros alergenos: misma familia visual que el resto de secciones */
body.page-template-editar-plato h3,
.tfv3-editar-plato-page h3,
.tf-editar-plato-page h3,
.tf-plato-editor-page h3 {
  color: var(--tfv3-orange);
  font-size: clamp(23px, 1.8vw, 30px);
  margin: 26px 0 14px;
}

/* Fila de otros alergenos mas equilibrada */
body.page-template-editar-plato .tfv3-other-allergen-row,
body.page-template-editar-plato .tf-other-allergen-row,
body.page-template-editar-plato .otros-alergenos-row {
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto;
  gap: 10px;
}

/* Acciones: CTA principal claro, enlace secundario con menor peso */
body.page-template-editar-plato .tf-form-actions,
body.page-template-editar-plato .tfv3-form-actions,
body.page-template-editar-plato p:has(input[type="submit"]) {
  gap: 18px;
  margin-top: 20px;
  align-items: center;
}

body.page-template-editar-plato a[href*="mis-platos"],
body.page-template-editar-plato a[href*="mis-platos"] strong {
  font-size: 18px;
  font-weight: 800;
  color: #374151;
}

body.page-template-editar-plato a[href*="mis-platos"]:hover,
body.page-template-editar-plato a[href*="mis-platos"]:hover strong {
  color: var(--tfv3-orange);
}

/* Separador superior mas sutil */
body.page-template-editar-plato h1,
.tfv3-editar-plato-page h1,
.tf-editar-plato-page h1,
.tf-plato-editor-page h1 {
  margin-bottom: 20px;
  padding-bottom: 12px;
}

/* Desktop grande: aprovechar aun mas sin desbordar */
@media (min-width: 1500px) {
  body.page-template-editar-plato .inside-article {
    max-width: 1320px;
  }

  body.page-template-editar-plato form,
  .tfv3-editar-plato-page form,
  .tf-editar-plato-page form,
  .tf-plato-editor-page form {
    max-width: 1120px;
  }
}

@media (max-width: 900px) {
  body.page-template-editar-plato .inside-article {
    padding: 26px 20px 36px;
  }

  body.page-template-editar-plato .tfv3-checkbox-grid,
  body.page-template-editar-plato .tf-checkbox-grid,
  body.page-template-editar-plato .tf-check-grid,
  body.page-template-editar-plato .alergenos-grid,
  body.page-template-editar-plato .ingestas-grid,
  body.page-template-editar-plato .checkbox-grid {
    grid-template-columns: 1fr;
  }
}

/* POINT6D - final polish editar plato
 * Ajuste final visual. Sin cambios funcionales.
 */

/* Página: mas anchura util y menos sensacion de columna estrecha */
body.page-template-editar-plato .site-main,
body.page-template-editar-plato .inside-article,
.tfv3-editar-plato-page,
.tf-editar-plato-page,
.tf-plato-editor-page {
  max-width: 1360px;
}

body.page-template-editar-plato .inside-article {
  padding: 32px 72px 42px;
  border-radius: 24px;
  box-shadow: 0 24px 54px rgba(31, 41, 55, 0.085);
}

/* Formulario: apertura real del contenido */
body.page-template-editar-plato form,
.tfv3-editar-plato-page form,
.tf-editar-plato-page form,
.tf-plato-editor-page form {
  max-width: 1160px;
}

/* Titulo principal: mas editorial, menos pesado */
body.page-template-editar-plato h1,
.tfv3-editar-plato-page h1,
.tf-editar-plato-page h1,
.tf-plato-editor-page h1 {
  font-size: clamp(39px, 3.25vw, 52px);
  line-height: 1.02;
  letter-spacing: -0.04em;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom-color: rgba(31, 41, 55, 0.07);
}

/* Cards internas: mas anchas, menos altas, sombra mas fina */
body.page-template-editar-plato fieldset,
.tfv3-editar-plato-page fieldset,
.tf-editar-plato-page fieldset,
.tf-plato-editor-page fieldset,
body.page-template-editar-plato .tf-form-section,
body.page-template-editar-plato .tf-card,
body.page-template-editar-plato .tfv3-card {
  padding: 22px 30px;
  margin-bottom: 18px;
  border-radius: 17px;
  box-shadow: 0 10px 26px rgba(31, 41, 55, 0.038);
}

/* Titulos de bloque: jerarquia consistente y premium */
body.page-template-editar-plato h2,
.tfv3-editar-plato-page h2,
.tf-editar-plato-page h2,
.tf-plato-editor-page h2 {
  font-size: clamp(26px, 2vw, 32px);
  line-height: 1.08;
  letter-spacing: -0.03em;
  margin-bottom: 18px;
}

body.page-template-editar-plato h3,
.tfv3-editar-plato-page h3,
.tf-editar-plato-page h3,
.tf-plato-editor-page h3 {
  color: var(--tfv3-orange);
  font-size: clamp(22px, 1.65vw, 28px);
  line-height: 1.1;
  letter-spacing: -0.025em;
  margin: 22px 0 12px;
}

/* Labels e inputs: compactos pero comodos */
body.page-template-editar-plato label,
.tfv3-editar-plato-page label,
.tf-editar-plato-page label,
.tf-plato-editor-page label {
  font-size: 13px;
  line-height: 1.28;
  margin-bottom: 4px;
}

body.page-template-editar-plato input[type="text"],
body.page-template-editar-plato input[type="number"],
body.page-template-editar-plato input[type="search"],
body.page-template-editar-plato textarea,
body.page-template-editar-plato select,
.tfv3-editar-plato-page input[type="text"],
.tfv3-editar-plato-page input[type="number"],
.tfv3-editar-plato-page textarea,
.tfv3-editar-plato-page select,
.tf-editar-plato-page input[type="text"],
.tf-editar-plato-page input[type="number"],
.tf-editar-plato-page textarea,
.tf-editar-plato-page select {
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 11px;
}

/* Checkboxes: mas anchura util y menos altura total */
body.page-template-editar-plato .tfv3-checkbox-grid,
body.page-template-editar-plato .tf-checkbox-grid,
body.page-template-editar-plato .tf-check-grid,
body.page-template-editar-plato .alergenos-grid,
body.page-template-editar-plato .ingestas-grid,
body.page-template-editar-plato .checkbox-grid {
  grid-template-columns: repeat(2, minmax(320px, 1fr));
  gap: 9px 18px;
}

body.page-template-editar-plato .tfv3-checkbox-grid label,
body.page-template-editar-plato .tf-checkbox-grid label,
body.page-template-editar-plato .tf-check-grid label,
body.page-template-editar-plato .alergenos-grid label,
body.page-template-editar-plato .ingestas-grid label,
body.page-template-editar-plato .checkbox-grid label,
body.page-template-editar-plato label:has(input[type="checkbox"]) {
  min-height: 37px;
  padding: 7px 10px;
  border-radius: 11px;
  font-size: 13px;
}

body.page-template-editar-plato input[type="checkbox"] {
  width: 17px;
  height: 17px;
  flex-basis: 17px;
}

/* Otros alergenos: integrarlo con bloque alergenos sin parecer anexo */
body.page-template-editar-plato .tfv3-other-allergen-row,
body.page-template-editar-plato .tf-other-allergen-row,
body.page-template-editar-plato .otros-alergenos-row {
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1.05fr) auto;
  gap: 10px;
  align-items: center;
}

/* Boton gris de otros alergenos mas alineado con el sistema */
body.page-template-editar-plato button:not([type="submit"]),
body.page-template-editar-plato .button:not(.tf-primary-button):not(.tfv3-primary-button) {
  min-height: 40px;
}

/* Acciones: CTA claro, volver secundario */
body.page-template-editar-plato .tf-form-actions,
body.page-template-editar-plato .tfv3-form-actions,
body.page-template-editar-plato p:has(input[type="submit"]) {
  gap: 16px;
  margin-top: 18px;
  padding-top: 2px;
}

body.page-template-editar-plato input[type="submit"],
body.page-template-editar-plato button[type="submit"],
body.page-template-editar-plato .tf-primary-button,
body.page-template-editar-plato .tfv3-primary-button {
  min-height: 42px;
  padding: 10px 22px;
  box-shadow: 0 10px 22px rgba(240, 75, 35, 0.20);
}

body.page-template-editar-plato a[href*="mis-platos"],
body.page-template-editar-plato a[href*="mis-platos"] strong {
  font-size: 17px;
  font-weight: 760;
  color: #3f4a5a;
  letter-spacing: -0.01em;
}

/* Espaciado final antes del footer */
body.page-template-editar-plato .inside-article {
  margin-bottom: 72px;
}

/* Desktop grande: acabado ancho premium */
@media (min-width: 1500px) {
  body.page-template-editar-plato .site-main,
  body.page-template-editar-plato .inside-article,
  .tfv3-editar-plato-page,
  .tf-editar-plato-page,
  .tf-plato-editor-page {
    max-width: 1400px;
  }

  body.page-template-editar-plato form,
  .tfv3-editar-plato-page form,
  .tf-editar-plato-page form,
  .tf-plato-editor-page form {
    max-width: 1200px;
  }
}

/* Desktop medio: evitar que se sienta gigante */
@media (max-width: 1200px) {
  body.page-template-editar-plato .inside-article {
    padding-left: 48px;
    padding-right: 48px;
  }

  body.page-template-editar-plato .tfv3-checkbox-grid,
  body.page-template-editar-plato .tf-checkbox-grid,
  body.page-template-editar-plato .tf-check-grid,
  body.page-template-editar-plato .alergenos-grid,
  body.page-template-editar-plato .ingestas-grid,
  body.page-template-editar-plato .checkbox-grid {
    grid-template-columns: repeat(2, minmax(260px, 1fr));
  }
}

/* Movil/tablet */
@media (max-width: 900px) {
  body.page-template-editar-plato .inside-article {
    padding: 24px 18px 34px;
    margin-bottom: 44px;
  }

  body.page-template-editar-plato .tfv3-checkbox-grid,
  body.page-template-editar-plato .tf-checkbox-grid,
  body.page-template-editar-plato .tf-check-grid,
  body.page-template-editar-plato .alergenos-grid,
  body.page-template-editar-plato .ingestas-grid,
  body.page-template-editar-plato .checkbox-grid {
    grid-template-columns: 1fr;
  }

  body.page-template-editar-plato .tfv3-other-allergen-row,
  body.page-template-editar-plato .tf-other-allergen-row,
  body.page-template-editar-plato .otros-alergenos-row {
    grid-template-columns: 1fr;
  }

  body.page-template-editar-plato .tf-form-actions,
  body.page-template-editar-plato .tfv3-form-actions,
  body.page-template-editar-plato p:has(input[type="submit"]) {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* POINT6E - fix celdas cortadas y ritmo vertical editar plato
 * Ajuste QA final. Sin cambios funcionales.
 */

/* Base defensiva: evitar overflow por padding/bordes */
body.page-template-editar-plato *,
.tfv3-editar-plato-page *,
.tf-editar-plato-page *,
.tf-plato-editor-page * {
  box-sizing: border-box;
}

/* Contenedor: ancho premium, sin forzar cards internas a desbordar */
body.page-template-editar-plato .site-main,
body.page-template-editar-plato .inside-article,
.tfv3-editar-plato-page,
.tf-editar-plato-page,
.tf-plato-editor-page {
  max-width: 1280px;
}

body.page-template-editar-plato .inside-article {
  padding: 30px 58px 40px;
}

/* Formulario: ancho real estable */
body.page-template-editar-plato form,
.tfv3-editar-plato-page form,
.tf-editar-plato-page form,
.tf-plato-editor-page form {
  max-width: 1040px;
  width: 100%;
}

/* Cards internas: menos altura y ancho correcto */
body.page-template-editar-plato fieldset,
.tfv3-editar-plato-page fieldset,
.tf-editar-plato-page fieldset,
.tf-plato-editor-page fieldset,
body.page-template-editar-plato .tf-form-section,
body.page-template-editar-plato .tf-card,
body.page-template-editar-plato .tfv3-card {
  width: 100%;
  padding: 20px 28px;
  margin-bottom: 16px;
  overflow: visible;
}

/* Títulos: menos distancia hasta los campos */
body.page-template-editar-plato h1,
.tfv3-editar-plato-page h1,
.tf-editar-plato-page h1,
.tf-plato-editor-page h1 {
  margin-bottom: 16px;
  padding-bottom: 8px;
}

body.page-template-editar-plato h2,
.tfv3-editar-plato-page h2,
.tf-editar-plato-page h2,
.tf-plato-editor-page h2 {
  margin-bottom: 12px;
}

body.page-template-editar-plato h3,
.tfv3-editar-plato-page h3,
.tf-editar-plato-page h3,
.tf-plato-editor-page h3 {
  margin: 18px 0 10px;
}

/* Párrafos de formulario: controlar gaps heredados */
body.page-template-editar-plato form p,
.tfv3-editar-plato-page form p,
.tf-editar-plato-page form p,
.tf-plato-editor-page form p {
  margin-top: 0;
  margin-bottom: 14px;
}

/* Labels y campos: cercanía correcta */
body.page-template-editar-plato label,
.tfv3-editar-plato-page label,
.tf-editar-plato-page label,
.tf-plato-editor-page label {
  display: block;
  margin-bottom: 4px;
}

body.page-template-editar-plato input[type="text"],
body.page-template-editar-plato input[type="number"],
body.page-template-editar-plato input[type="search"],
body.page-template-editar-plato textarea,
body.page-template-editar-plato select,
.tfv3-editar-plato-page input[type="text"],
.tfv3-editar-plato-page input[type="number"],
.tfv3-editar-plato-page textarea,
.tfv3-editar-plato-page select,
.tf-editar-plato-page input[type="text"],
.tf-editar-plato-page input[type="number"],
.tf-editar-plato-page textarea,
.tf-editar-plato-page select {
  width: 100%;
  max-width: 100%;
  min-height: 42px;
}

/* GRID CRITICO: no usar minmax(320px). Evita celdas cortadas. */
body.page-template-editar-plato .tfv3-checkbox-grid,
body.page-template-editar-plato .tf-checkbox-grid,
body.page-template-editar-plato .tf-check-grid,
body.page-template-editar-plato .alergenos-grid,
body.page-template-editar-plato .ingestas-grid,
body.page-template-editar-plato .checkbox-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 9px 16px;
  width: 100%;
  max-width: 100%;
  overflow: visible;
}

body.page-template-editar-plato .tfv3-checkbox-grid > *,
body.page-template-editar-plato .tf-checkbox-grid > *,
body.page-template-editar-plato .tf-check-grid > *,
body.page-template-editar-plato .alergenos-grid > *,
body.page-template-editar-plato .ingestas-grid > *,
body.page-template-editar-plato .checkbox-grid > * {
  min-width: 0;
  max-width: 100%;
}

body.page-template-editar-plato .tfv3-checkbox-grid label,
body.page-template-editar-plato .tf-checkbox-grid label,
body.page-template-editar-plato .tf-check-grid label,
body.page-template-editar-plato .alergenos-grid label,
body.page-template-editar-plato .ingestas-grid label,
body.page-template-editar-plato .checkbox-grid label,
body.page-template-editar-plato label:has(input[type="checkbox"]) {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 38px;
  padding: 7px 10px;
  overflow: visible;
  white-space: normal;
  word-break: normal;
  overflow-wrap: anywhere;
}

/* Checkbox no debe empujar texto fuera */
body.page-template-editar-plato input[type="checkbox"] {
  flex: 0 0 17px;
}

/* Otros alergenos: sin desbordes */
body.page-template-editar-plato .tfv3-other-allergen-row,
body.page-template-editar-plato .tf-other-allergen-row,
body.page-template-editar-plato .otros-alergenos-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) auto;
  gap: 10px;
  width: 100%;
  max-width: 100%;
}

body.page-template-editar-plato .tfv3-other-allergen-row > *,
body.page-template-editar-plato .tf-other-allergen-row > *,
body.page-template-editar-plato .otros-alergenos-row > * {
  min-width: 0;
}

/* Acciones: secundario claro, sin competir */
body.page-template-editar-plato .tf-form-actions,
body.page-template-editar-plato .tfv3-form-actions,
body.page-template-editar-plato p:has(input[type="submit"]) {
  margin-top: 16px;
  gap: 14px;
}

body.page-template-editar-plato a[href*="mis-platos"],
body.page-template-editar-plato a[href*="mis-platos"] strong {
  font-size: 16px;
  font-weight: 760;
}

/* Desktop grande: no exagerar ancho; la prioridad es no cortar */
@media (min-width: 1500px) {
  body.page-template-editar-plato .site-main,
  body.page-template-editar-plato .inside-article,
  .tfv3-editar-plato-page,
  .tf-editar-plato-page,
  .tf-plato-editor-page {
    max-width: 1320px;
  }

  body.page-template-editar-plato form,
  .tfv3-editar-plato-page form,
  .tf-editar-plato-page form,
  .tf-plato-editor-page form {
    max-width: 1080px;
  }
}

/* Desktop medio y tablet */
@media (max-width: 1200px) {
  body.page-template-editar-plato .inside-article {
    padding-left: 42px;
    padding-right: 42px;
  }
}

/* Movil/tablet estrecho */
@media (max-width: 900px) {
  body.page-template-editar-plato .inside-article {
    padding: 24px 18px 34px;
  }

  body.page-template-editar-plato .tfv3-checkbox-grid,
  body.page-template-editar-plato .tf-checkbox-grid,
  body.page-template-editar-plato .tf-check-grid,
  body.page-template-editar-plato .alergenos-grid,
  body.page-template-editar-plato .ingestas-grid,
  body.page-template-editar-plato .checkbox-grid {
    grid-template-columns: 1fr !important;
  }

  body.page-template-editar-plato .tfv3-other-allergen-row,
  body.page-template-editar-plato .tf-other-allergen-row,
  body.page-template-editar-plato .otros-alergenos-row {
    grid-template-columns: 1fr;
  }
}

/* POINT6F - final micro polish editar plato
 * Ajuste visual final. Sin cambios funcionales.
 */

/* Menos aire entre H1, separador y primera card */
body.page-template-editar-plato h1,
.tfv3-editar-plato-page h1,
.tf-editar-plato-page h1,
.tf-plato-editor-page h1 {
  margin-bottom: 12px;
  padding-bottom: 7px;
}

body.page-template-editar-plato h1 + *,
.tfv3-editar-plato-page h1 + *,
.tf-editar-plato-page h1 + *,
.tf-plato-editor-page h1 + * {
  margin-top: 0;
}

/* Compactar especificamente la primera card de datos */
body.page-template-editar-plato fieldset:first-of-type,
.tfv3-editar-plato-page fieldset:first-of-type,
.tf-editar-plato-page fieldset:first-of-type,
.tf-plato-editor-page fieldset:first-of-type,
body.page-template-editar-plato .tfv3-card:first-of-type,
body.page-template-editar-plato .tf-card:first-of-type,
body.page-template-editar-plato .tf-form-section:first-of-type {
  padding-top: 18px;
  padding-bottom: 18px;
}

/* Reducir distancia label/input y entre campos dentro de Datos del plato */
body.page-template-editar-plato fieldset:first-of-type p,
.tfv3-editar-plato-page fieldset:first-of-type p,
.tf-editar-plato-page fieldset:first-of-type p,
.tf-plato-editor-page fieldset:first-of-type p,
body.page-template-editar-plato .tfv3-card:first-of-type p,
body.page-template-editar-plato .tf-card:first-of-type p,
body.page-template-editar-plato .tf-form-section:first-of-type p {
  margin-bottom: 10px;
}

body.page-template-editar-plato fieldset:first-of-type label,
.tfv3-editar-plato-page fieldset:first-of-type label,
.tf-editar-plato-page fieldset:first-of-type label,
.tf-plato-editor-page fieldset:first-of-type label,
body.page-template-editar-plato .tfv3-card:first-of-type label,
body.page-template-editar-plato .tf-card:first-of-type label,
body.page-template-editar-plato .tf-form-section:first-of-type label {
  margin-bottom: 3px;
}

/* Titulo de primera card mas cerca del contenido */
body.page-template-editar-plato fieldset:first-of-type h2,
.tfv3-editar-plato-page fieldset:first-of-type h2,
.tf-editar-plato-page fieldset:first-of-type h2,
.tf-plato-editor-page fieldset:first-of-type h2,
body.page-template-editar-plato .tfv3-card:first-of-type h2,
body.page-template-editar-plato .tf-card:first-of-type h2,
body.page-template-editar-plato .tf-form-section:first-of-type h2 {
  margin-bottom: 10px;
}

/* Otros alergenos: integrado, limpio, sin parecer una seccion aparte pesada */
body.page-template-editar-plato h3,
.tfv3-editar-plato-page h3,
.tf-editar-plato-page h3,
.tf-plato-editor-page h3 {
  font-size: clamp(21px, 1.45vw, 25px);
  margin-top: 16px;
  margin-bottom: 9px;
  color: #1f2937;
  letter-spacing: -0.018em;
}

body.page-template-editar-plato h3::before,
.tfv3-editar-plato-page h3::before,
.tf-editar-plato-page h3::before,
.tf-plato-editor-page h3::before {
  content: "";
  display: block;
  width: 46px;
  height: 3px;
  margin-bottom: 10px;
  border-radius: 999px;
  background: var(--tfv3-orange);
}

/* Inputs de otros alergenos mas alineados */
body.page-template-editar-plato .tfv3-other-allergen-row,
body.page-template-editar-plato .tf-other-allergen-row,
body.page-template-editar-plato .otros-alergenos-row {
  align-items: center;
  margin-top: 4px;
}

/* Hover/focus premium pero sutil */
body.page-template-editar-plato input[type="text"]:hover,
body.page-template-editar-plato input[type="number"]:hover,
body.page-template-editar-plato input[type="search"]:hover,
body.page-template-editar-plato textarea:hover,
body.page-template-editar-plato select:hover {
  border-color: rgba(31, 41, 55, 0.22);
}

body.page-template-editar-plato label:has(input[type="checkbox"]):hover {
  border-color: rgba(240, 75, 35, 0.34);
  background: #fffaf7;
}

body.page-template-editar-plato input[type="checkbox"]:focus-visible,
body.page-template-editar-plato input[type="text"]:focus-visible,
body.page-template-editar-plato input[type="number"]:focus-visible,
body.page-template-editar-plato input[type="search"]:focus-visible,
body.page-template-editar-plato textarea:focus-visible,
body.page-template-editar-plato select:focus-visible,
body.page-template-editar-plato button:focus-visible,
body.page-template-editar-plato a:focus-visible {
  outline: 3px solid rgba(240, 75, 35, 0.28);
  outline-offset: 2px;
}

/* Acciones: mas respiracion y secundaria menos dominante */
body.page-template-editar-plato .tf-form-actions,
body.page-template-editar-plato .tfv3-form-actions,
body.page-template-editar-plato p:has(input[type="submit"]) {
  margin-top: 14px;
}

body.page-template-editar-plato a[href*="mis-platos"],
body.page-template-editar-plato a[href*="mis-platos"] strong {
  font-size: 15.5px;
  font-weight: 740;
}

/* Respiracion antes del footer, para que el naranja no corte la composicion */
body.page-template-editar-plato .inside-article {
  margin-bottom: 92px;
}

/* En pantallas medianas mantener separacion proporcionada */
@media (max-width: 1200px) {
  body.page-template-editar-plato .inside-article {
    margin-bottom: 76px;
  }
}

/* En movil, evitar exceso de scroll final */
@media (max-width: 900px) {
  body.page-template-editar-plato .inside-article {
    margin-bottom: 48px;
  }

  body.page-template-editar-plato h3::before,
  .tfv3-editar-plato-page h3::before,
  .tf-editar-plato-page h3::before,
  .tf-plato-editor-page h3::before {
    width: 38px;
  }
}
