/*
 * Styles for the BCP Simulator Javascript application
 */

/* -----------------------------------------------------
 * Global layout fix (viewport-controlled scrolling)
 * ----------------------------------------------------- */

html,
body {
  height: 100%;
  color: #333;
}

body {
  margin: 0;
  overflow: hidden; /* evita que el scroll lo tenga el documento */
}

/* fuerza el cursor de espera en toda la app, útil para indicar que se está procesando algo */
html.wait-cursor,
html.wait-cursor *,
body.wait-cursor,
body.wait-cursor * {
  cursor: wait !important;
}

a.anchor {
  display: block;
  position: relative;
  top: -180px; /* offset para que no quede bajo los menúes sticky */
  height: 12px;
  overflow: hidden;
  pointer-events: none;
}

/* Ajusta este selector si tu root no es #app */
#app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

/* -----------------------------------------------------
 * Sticky top menu styles
 * ----------------------------------------------------- */

.top-menu {
  position: sticky;
  top: 0;
  z-index: 200;
  padding: 0 16px 0 16px;
  background-color: #333;
  margin: 0;
  height: 40px;
}

.widget-menu {
  position: sticky;
  top: 40px;
  z-index: 300;
  padding: 0;
  background-color: inherit;
  margin: 0;
  flex: 0 0 auto;
}

.form-select-sm {
  padding-top: 0px;
  padding-bottom: 0px;
  font-size: 0.875rem;
  border-radius: 0.2rem;
}

/* -----------------------------------------------------
 * Simulation scroll container
 * ----------------------------------------------------- */

.simulation-body {
  flex: 1 1 auto;
  min-height: 0;
  min-width: 0;
  overflow: auto;
  padding: 0 0 32px 0;
}

/* el contenido puede ser más ancho que la pantalla */
.simulation-body > .simulation-body-inner {
  width: max-content;
}

/*
 * Group styles
 */

.group-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin: 0;
  padding: 0;
  background-color: rgba(0, 0, 0, var(--bg-alpha));
}

.group-col-darker {
  --bg-alpha: 0.06;
}

.group-block {
  display: flex;
  flex-direction: row;
  align-items: flex-start;

  margin: 0;
  padding: 8px 8px 8px 8px;

  background-color: rgba(0, 0, 0, var(--bg-alpha));

  min-height: 40px;
  height: auto;
}

.h-auto {
  min-height: auto !important;
  height: auto !important;
  overflow: visible !important;
}

.group-block-darker {
  --bg-alpha: 0.05;
}

.group-title {
  display: block;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0;

  text-align: center;
  font-size: 1.15em;
  font-family: HeadingFont;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;

  border-bottom: 1px solid #ebf8fa;
}

.erp {
  display: none;
  background-color: transparent;
  padding: 0;
  margin: 0;
  text-align: right;
  color: #999;
}

.cell,
.sep-cell,
.mid-cell,
.large-cell,
.extra-large-cell {
  padding: 0 8px 0 8px;
  margin: 0;
  box-sizing: border-box;
  white-space: nowrap;
  color: inherit;
}

.cell {
  width: 100px;
  max-width: 100px;
  min-width: 100px;
}

.sep-cell {
  width: 32px;
  max-width: 32px;
  min-width: 32px;
}

.mid-cell {
  width: 124px;
  max-width: 124px;
  min-width: 124px;
}

.large-cell {
  width: 152px;
  max-width: 152px;
  min-width: 152px;
}

.extra-large-cell {
  width: 360px;
  max-width: 360px;
  min-width: 360px;

  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.cell input {
  max-width: 90px;
  text-align: right;
  border: 1px solid #037380;
  border-radius: 0.15em;
  margin: 0;
  height: 20px;
  max-height: 20px;
  line-height: 20px;
  padding: 0 6px;
  box-sizing: border-box;
  color: inherit;
}

input:disabled {
  border-color: #b4eaed;
  background-color: inherit;
  color: inherit;
}

/* -----------------------------------------------------
 * FamilyWidget styles
 * ----------------------------------------------------- */

.family-header {
  width: max-content;
  overflow: visible;
  display: block;
  margin: 40px 0 0 0;
  position: relative;
  z-index: 1;
}

.family-identity {
  position: sticky;
  left: 0;
  z-index: 90;

  display: flex;
  align-items: center;
  gap: 8px;

  width: 512px;
  margin: 0;
  padding: 0 8px 6px 16px;
  background-color: #ebf8fa;
}

.family-bar {
  display: flex;
  flex-direction: row;
  align-items: flex-start;

  margin: 0;
  padding: 0;
  width: max-content;

  /* 
  user-select: none;
  -webkit-user-select: none;
  */

  background-color: #b4eaed;
  /*color: #333;*/
}

.family-bar > .group-col:first-child {
  position: sticky;
  left: 0;
  z-index: 30;
  border-right: 1px solid rgba(0, 0, 0, 0.25);
  background-color: #b4eaed;
  margin: 0;
}

/* -----------------------------------------------------
 * ProductWidget styles
 * ----------------------------------------------------- */

.product-exception {
  color: blue !important;
}

.product-bar {
  display: flex;
  flex-direction: row;
  align-items: flex-start;

  padding: 0;
  margin: 0;
  width: max-content;

  /*
  user-select: none;
  -webkit-user-select: none;
  */

  /*color: #333;*/
  color: inherit;
}

.product-bar:has(input:focus) {
  background-color: #ffff66;
}

.product-bar > .group-block:first-child {
  position: sticky;
  left: 0;
  z-index: 30;
  border-right: 1px solid rgba(0, 0, 0, 0.20);
  background-color: #ebf8fa;
  margin: 0;
}

.product-bar > .group-block:first-child,
.family-bar > .group-col:first-child {
  isolation: isolate;
}

