/* ============================================================
   ACREDITACIONES — INDUSTRIAS ANCE
   Grid dinámico vía acred-global.js (con respaldo CSS)
   Acento: #00049E único para todo el sitio
   ============================================================ */
.ance-acred {
  background: #f8f8f8;
  padding: 7rem 5rem;
  width: 100%;
  max-width: 1400px;
  margin-left: auto;
  margin-right: auto;
  box-sizing: border-box;
}
.ance-acred-titulo {
  font-size: 28px;
  font-weight: 700;
  color: #111;
  margin-bottom: 3rem;
  text-transform: uppercase;
}
.ance-acred-titulo span {
  font-weight: 300;
  color: #a0a0a0;
}

/* Respaldo: si el JS no corre, el grid se acomoda solo en columnas */
.ance-acred-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0;
  max-width: 1200px;
  margin: 0 auto;
}
.ance-acred-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 0 2.5rem;
  position: relative;
}
.ance-acred-item:not(:last-child)::after {
  content: '';
  position: absolute;
  right: 0; top: 10%;
  height: 80%; width: 1px;
  background: rgba(0, 4, 158, 0.2);
}
.ance-acred-icon { margin-bottom: 1.2rem; }
.ance-acred-nombre {
  font-size: 16px;
  font-weight: 700;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.8rem;
}

/* Texto descriptivo: ocupa el espacio libre y se centra
   verticalmente (badge/botones quedan abajo) */
.ance-acred-dato {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  font-size: 12px;
  color: #666;
  line-height: 1.8;
}
.ance-acred-badge {
  display: inline-block;
  margin-top: 0.8rem;
  background: rgba(0, 4, 158, 0.08);
  border: 1px solid rgba(0, 4, 158, 0.3);
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  color: #00049e;
  letter-spacing: 0.5px;
}
.ance-acred-item > p:last-child { margin-top: auto; }
@media (max-width: 1024px) {
  .ance-acred-item:not(:last-child)::after { display: none; }
  .ance-acred-item { border-bottom: 1px solid rgba(0,4,158,0.15); padding-bottom: 2rem; }
  .ance-acred-item:last-child { border-bottom: none; }
}
@media (max-width: 768px) {
  .ance-acred { padding: 3rem 1.5rem; }
  .ance-acred-item { padding: 0 0 2rem; border-bottom: 1px solid rgba(0,4,158,0.15); }
  .ance-acred-item:not(:last-child)::after { display: none; }
  .ance-acred-item:last-child { border-bottom: none; }
}

/* AJUSTE: fuerza azul de marca en los iconos SVG */
.ance-acred-icon svg {
  stroke: #00049e !important;
}
.ance-acred-icon svg [fill]:not([fill="none"]) {
  fill: #00049e !important;
}

/* ===== Botones de documentos (Diploma / Anexo) ===== */
.ance-acred-docs {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 0.8rem;
}
.ance-acred-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 100px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-decoration: none !important;
  color: #00049e !important;
  background: rgba(0, 4, 158, 0.08);
  border: 1px solid rgba(0, 4, 158, 0.3);
  border-radius: 4px;
  transition: background .2s, color .2s, border-color .2s;
}
.ance-acred-btn:hover,
.ance-acred-btn:focus {
  background: #00049e;
  border-color: #00049e;
  color: #fff !important;
}
.ance-acred-btn svg {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

/* ============================================================
   PRIMUSGFS v3.2 — detalle (Aladino en escritorio / acordeón
   en móvil). Solo aplica a .ance-acred-item--primus (Alimentos)
   ============================================================ */
.ance-acred-item--primus {
  --acred-pop-min: 400px;   /* ancho mínimo del panel (escritorio) */
  --acred-prod-w: 150px;    /* ancho de la columna Productos */
}

/* Iconos SVG sin atributos en el HTML */
.ance-acred-item--primus .ance-acred-icon svg,
.ance-acred-item--primus .ance-acred-btn svg {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ance-acred-item--primus .ance-acred-icon svg { width: 48px; height: 48px; stroke-width: 1.4; }
.ance-acred-item--primus .ance-acred-btn svg  { stroke-width: 2; }

/* Título: "PRIMUSGFS v3.2" respeta minúscula */
.ance-acred-item--primus .ance-acred-nombre { text-transform: none; }

/* Botón "Ver alcances" (táctil / tablet / móvil) */
.ance-acred-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.9rem;
  padding: 4px 8px;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #00049e;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.ance-acred-toggle::after {
  content: '';
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .3s ease;
}
.ance-acred-toggle:hover,
.ance-acred-toggle:focus-visible { text-decoration: underline; }
.ance-acred-item--primus.is-open .ance-acred-toggle::after {
  transform: translateY(1px) rotate(-135deg);
}

/* Detalle — base móvil/tablet: acordeón con altura animada */
.ance-acred-pop {
  width: 100%;
  max-height: 0;
  margin-top: 0;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  text-align: left;
  transition: max-height .45s ease, opacity .3s ease, margin-top .3s ease, visibility 0s linear .45s;
}
.ance-acred-item--primus.is-open .ance-acred-pop {
  max-height: 1400px;
  margin-top: 1rem;
  opacity: 1;
  visibility: visible;
  transition-delay: 0s;
}
.ance-acred-pop-head { display: none; }
.ance-acred-pop .ance-acred-docs { display: none; }

/* Documento normativo */
.ance-acred-norma {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.8rem 0;
  border-top: 1px solid rgba(0, 4, 158, 0.12);
}
.ance-acred-norma-icon {
  flex: 0 0 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 4, 158, 0.08);
  border-radius: 10px;
}
.ance-acred-norma-icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #00049e;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.ance-acred-norma-label {
  display: block;
  margin-bottom: 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: #00049e;
}
.ance-acred-norma-nombre {
  display: block;
  font-size: 15px;
  line-height: 1.25;
  color: #111;
}

/* Alcances BI / BII / BIII — tarjetas con tag cuadrado */
.ance-acred-alcances-head { display: none; }
.ance-acred-alcances { list-style: none; margin: 0; padding: 0; }
.ance-acred-alcance {
  display: grid;
  grid-template-columns: 60px 1fr;
  align-items: stretch;
  margin: 0 0 8px;
  padding: 0;
  background: #fff;
  border: 1px solid rgba(0, 4, 158, 0.14);
  border-radius: 10px;
  overflow: hidden;
}

/* Tag: cuadrado, mismo tamaño en BI, BII y BIII */
.ance-acred .ance-acred-alcance .ance-acred-alcance-tag {
  display: flex !important;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 44px !important;
  height: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  margin: 0 0 0 8px !important;
  padding: 0 !important;
  align-self: center;
  justify-self: start;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
  hyphens: none;
  word-break: normal;
  color: #00049e;
  background: rgba(0, 4, 158, 0.08);
  border-radius: 8px;
}
.ance-acred-alcance-desc {
  align-self: center;
  margin: 0;
  padding: 12px 12px 12px 4px;
  font-size: 13px;
  line-height: 1.35;
  color: #111;
}
.ance-acred-alcance-desc small {
  display: block;
  font-size: 10.5px;
  line-height: 1.3;
  color: #888;
}

/* Productos: sin recuadro de color, productos en línea separados por "·" */
.ance-acred-alcance-prod {
  grid-column: 1 / -1;
  padding: 10px 12px;
  background: none;
  border-top: 1px solid rgba(0, 4, 158, 0.12);
}
.ance-acred-alcance-prod::before {
  content: 'Productos';
  display: block;
  margin-bottom: 2px;
  font-size: 11px;
  font-weight: 700;
  color: #00049e;
}
.ance-acred-alcance-prod p {
  margin: 0;
  font-size: 11px;
  line-height: 1.5;
  color: #444;
}
.ance-acred-alcance-prod span:not(:last-child)::after { content: ' ·'; }

/* Escritorio con mouse: panel flotante, Aladino desde el escudo */
@media (hover: hover) and (min-width: 1025px) {
  .ance-acred-toggle { display: none; }

  .ance-acred-item--primus:hover,
  .ance-acred-item--primus:focus-within { z-index: 30; }

  .ance-acred-item--primus .ance-acred-pop {
    position: absolute;
    z-index: 1;
    top: -24px;                       /* el escudo del panel cae sobre el de la tarjeta */
    left: 50%;
    width: max(100%, var(--acred-pop-min));
    max-height: none;
    margin: 0;
    padding: 24px 20px 18px;
    overflow: visible;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 18px 50px rgba(0, 4, 158, 0.18), 0 2px 8px rgba(0, 0, 0, 0.06);
    pointer-events: none;
    transform-origin: 50% 48px;       /* centro del escudo */
    transform: translateX(-50%) scale(.12);
    transition: transform .2s ease-in, opacity .15s ease, visibility 0s linear .2s;
  }
  .ance-acred-item--primus:hover .ance-acred-pop,
  .ance-acred-item--primus:focus-within .ance-acred-pop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateX(-50%) scale(1);
    transition: transform .5s cubic-bezier(.34, 1.45, .64, 1), opacity .2s ease, visibility 0s;
    transition-delay: .06s, .06s, 0s;
  }

  /* Encabezado idéntico al de la tarjeta: escudo y título centrados */
  .ance-acred-pop-head {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin-bottom: 0.8rem;
  }
  .ance-acred-pop-head .ance-acred-nombre { margin-bottom: 0; }

  /* Encabezado de la columna Productos */
  .ance-acred-alcances-head {
    display: grid;
    grid-template-columns: 1fr var(--acred-prod-w);
    margin: 0 0 6px;
  }
  .ance-acred-alcances-head span {
    grid-column: 2;
    padding: 5px 8px;
    text-align: center;
    font-size: 11px;
    font-weight: 700;
    color: #00049e;
    background: rgba(0, 4, 158, 0.08);
    border-radius: 6px;
  }

  .ance-acred-alcance { grid-template-columns: 60px 1fr var(--acred-prod-w); }
  .ance-acred-alcance-prod {
    grid-column: auto;
    display: flex;
    align-items: center;
    border-top: 0;
    border-left: 1px solid rgba(0, 4, 158, 0.12);
  }
  .ance-acred-alcance-prod::before { content: none; }

  .ance-acred-pop .ance-acred-docs {
    display: flex;
    flex-direction: row;
    justify-content: center;
    gap: 12px;
    margin-top: 6px;
    padding-top: 14px;
    border-top: 1px solid rgba(0, 4, 158, 0.12);
  }
  .ance-acred-pop .ance-acred-btn {
    min-width: 120px;
    padding: 8px 14px;
    font-size: 12px;
  }
}

/* Accesibilidad: sin animaciones si el usuario lo prefiere */
@media (prefers-reduced-motion: reduce) {
  .ance-acred-pop,
  .ance-acred-toggle::after { transition: none !important; }
}