/**
 * Búho Smart ERP - Buzón de Novedades y Actualizaciones (Acordeón Horizontal)
 * Diseño Ultra-Compacto (100% Ancho, Mínima Altura)
 */

#block-buho-smart-novedades-erp,
.block-buho-smart-assistant-erp-updates-block {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box;
}

.buho-updates-container {
  width: 100% !important;
  max-width: 100% !important;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
  padding: 12px 18px;
  margin-bottom: 12px;
  font-family: inherit;
  color: #1e293b;
  box-sizing: border-box;
}

/* Header Ultra-Compacto */
.buho-updates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1f5f9;
  padding-bottom: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 10px;
}

.buho-updates-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.buho-updates-logo {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: #fff7ed;
  border: 1px solid #fed7aa;
  padding: 3px;
  object-fit: contain;
  box-shadow: 0 1px 4px rgba(249, 115, 22, 0.15);
  flex-shrink: 0;
}

.buho-updates-title-group h2 {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.2;
}

.buho-updates-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.buho-badge-count {
  display: inline-block;
  background: #f1f5f9;
  color: #475569;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 1px 7px;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.buho-updates-title-group p {
  margin: 2px 0 0 0;
  font-size: 0.76rem;
  color: #64748b;
  line-height: 1.2;
}

.buho-updates-header-right {
  display: flex;
  align-items: center;
}

.buho-updates-version-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
  padding: 2px 8px;
  border-radius: 12px;
  font-size: 0.74rem;
  font-weight: 600;
}

.buho-badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.3);
}

/* =========================================================
   Lista de Acordeones Horizontales (Ultra-Compacto)
   ========================================================= */
.buho-accordion-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 8px;
}

.buho-accordion-item {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.buho-accordion-item:hover {
  border-color: #cbd5e1;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.buho-accordion-item.is-open {
  border-color: #f97316;
  box-shadow: 0 2px 8px rgba(249, 115, 22, 0.06);
}

/* Header Horizontal del Acordeón (Mínima Altura) */
.buho-accordion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 12px;
  cursor: pointer;
  user-select: none;
  background: #ffffff;
  transition: background-color 0.15s ease;
  outline: none;
  min-height: 34px;
}

.buho-accordion-header:hover {
  background: #f8fafc;
}

.buho-accordion-item.is-open .buho-accordion-header {
  background: #fffaf5;
  border-bottom: 1px solid #fed7aa;
}

.buho-accordion-header:focus-visible {
  outline: 2px solid #f97316;
  outline-offset: -2px;
}

.buho-accordion-header-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buho-accordion-title {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: #1e293b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.buho-accordion-item.is-open .buho-accordion-title {
  color: #ea580c;
  font-weight: 700;
}

/* Badges y Tags Compactos */
.buho-card-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2px;
  white-space: nowrap;
  flex-shrink: 0;
}

.buho-tag-ai {
  background: #ffedd5;
  color: #c2410c;
  border: 1px solid #fed7aa;
}

.buho-tag-hotel {
  background: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.buho-tag-group {
  background: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.buho-tag-security {
  background: #fce7f3;
  color: #be185d;
  border: 1px solid #fbcfe8;
}

.buho-badge-new {
  display: inline-block;
  background: #ecfdf5;
  color: #047857;
  border: 1px solid #a7f3d0;
  padding: 1px 5px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}

/* Lado Derecho del Header */
.buho-accordion-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
  flex-shrink: 0;
}

.buho-accordion-date {
  font-size: 0.74rem;
  color: #94a3b8;
  font-weight: 500;
  white-space: nowrap;
}

.buho-accordion-arrow {
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #f1f5f9;
  color: #64748b;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.2s, color 0.2s;
}

.buho-accordion-header:hover .buho-accordion-arrow {
  background: #e2e8f0;
  color: #334155;
}

.buho-accordion-item.is-open .buho-accordion-arrow {
  transform: rotate(180deg);
  background: #ffedd5;
  color: #ea580c;
}

.buho-accordion-arrow svg {
  display: block;
  width: 12px;
  height: 12px;
  fill: currentColor;
}

/* =========================================================
   Cuerpo Desplegable del Acordeón: CERRADO POR DEFECTO
   ========================================================= */
.buho-accordion-body {
  display: none !important;
  background: #fafbfc;
  border-top: 1px solid transparent;
}

.buho-accordion-item.is-open .buho-accordion-body {
  display: block !important;
  border-top: 1px solid #f1f5f9;
  animation: buhoAccordionFade 0.2s ease-out;
}

@keyframes buhoAccordionFade {
  from {
    opacity: 0;
    transform: translateY(-3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.buho-accordion-body-inner {
  padding: 12px 16px;
}

.buho-accordion-desc {
  margin: 0 0 10px 0;
  font-size: 0.84rem;
  color: #475569;
  line-height: 1.45;
}

.buho-card-features {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 6px 14px;
}

.buho-card-features li {
  position: relative;
  padding-left: 18px;
  font-size: 0.8rem;
  color: #334155;
  line-height: 1.35;
}

.buho-card-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 0;
  color: #10b981;
  font-weight: 800;
  font-size: 0.82rem;
}

/* Fila Inferior del Acordeón Desplegado */
.buho-accordion-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 8px;
  border-top: 1px dashed #e2e8f0;
  margin-top: 4px;
}

.buho-card-menu-path {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 0.74rem;
  color: #475569;
}

.buho-card-menu-path strong {
  color: #0f172a;
}

.buho-card-btn {
  background: #fff7ed;
  color: #ea580c;
  border: 1px solid #fed7aa;
  padding: 3px 9px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s ease;
  outline: none;
}

.buho-card-btn:hover {
  background: #ea580c;
  color: #ffffff;
  border-color: #ea580c;
}

/* Footer Asistido del Bloque de Novedades Ultra-Compacto */
.buho-updates-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 5px 10px;
  margin-top: 6px;
  flex-wrap: wrap;
  gap: 8px;
}

.buho-updates-footer-text {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  color: #475569;
  flex: 1;
}

.buho-updates-footer-text span {
  font-size: 1.1rem;
  line-height: 1;
}

.buho-updates-footer-text code {
  background: #e2e8f0;
  padding: 1px 4px;
  border-radius: 3px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #0f172a;
}

.buho-updates-footer-actions {
  flex-shrink: 0;
}

.buho-btn-primary-assistant {
  background: linear-gradient(135deg, #ea580c, #c2410c);
  color: #ffffff;
  border: none;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(234, 88, 12, 0.2);
  transition: all 0.15s ease;
  outline: none;
}

.buho-btn-primary-assistant:hover {
  background: linear-gradient(135deg, #c2410c, #9a3412);
}

/* Responsividad Móvil */
@media (max-width: 768px) {
  .buho-updates-container {
    padding: 10px 12px;
  }

  .buho-accordion-header {
    padding: 8px 10px;
  }

  .buho-accordion-header-left {
    flex-wrap: wrap;
    white-space: normal;
  }

  .buho-accordion-date {
    display: none;
  }

  .buho-updates-footer {
    flex-direction: column;
    text-align: center;
  }

  .buho-btn-primary-assistant {
    width: 100%;
  }
}
