
/* table > tbody > tr.selected {
  background-color: rgba(217, 116, 29) !important;
  
} */

/* table.dataTable > tbody > tr.selected > * {
  box-shadow: inset 0 0 0 9999px rgba(102, 108, 255, 0.1) !important;
  color: var(--bs-black-selected) !important;
} */

.table-light {
  --bs-table-bg: #F0F4F8 !important;
}

.fx-nowrap{
  flex-wrap: nowrap !important;
}

.rounded-r-0{
  border-top-right-radius: 0px !important;
  border-bottom-right-radius: 0px !important;
}

.custom-dropdown {
  z-index: 9999 !important;  /* Asegúrate de que el dropdown esté por encima de otros elementos */
}

.no-ucase {
  text-transform: none !important;
}

/* Fuerza al contenedor de Select2 a respetar el layout de Bootstrap */
.input-group .select2-container {
    flex: 1 1 auto !important;
    width: 1% !important;
    min-width: 0 !important;
}

/* Forzar que el contenedor de Typeahead ocupe todo el ancho del padre */
/* Corrección para que el input no se caiga a la siguiente línea */
.input-group .twitter-typeahead {
    position: relative !important;
    flex: 1 1 auto !important; /* Esto le dice: "Crece y ocupa todo el espacio disponible" */
    width: 1% !important; /* Truco de Bootstrap para que funcione el flex */
    margin-bottom: 0 !important;
}

/* Aseguramos que el input interno llene ese espacio */
.input-group .twitter-typeahead .tt-input,
.input-group .twitter-typeahead .tt-hint {
    width: 100% !important;
    border-top-right-radius: 0; /* Estética: para que pegue con el siguiente input */
    border-bottom-right-radius: 0;
}

/* ============================================================ */
/* 2. ARREGLO DEL MENÚ Y LA TABLA */
/* ============================================================ */
.tt-menu {
    min-width: 650px; /* Ancho mínimo para que quepa la tabla */
    max-width: 700px;
    width: 700px;
    background-color: #fff;
    border: 1px solid #ccc;
    box-shadow: 0 5px 10px rgba(0,0,0,.2);
    margin-top: 0px;
    padding: 0;
}

/* --- CLAVE DEL ÉXITO: EL CONTENEDOR FLEXIBLE --- */
/* Forzamos a que tanto la cabecera como cada fila sean Flexbox */
.resultado-header, 
.tt-suggestion,        /* Clase que pone Typeahead automáticamente */
.resultado-item {      /* Tu clase personalizada */
    display: flex !important;    /* <--- ESTO PONE LOS ELEMENTOS EN FILA */
    flex-direction: row !important;
    align-items: center;
    width: 100%;
    padding: 8px 10px;
    border-bottom: 1px solid #eee;
    box-sizing: border-box;
}

.resultado-header {
    background-color: #f1f3f5;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10;
}

/* Efecto Hover */
.tt-suggestion:hover {
    cursor: pointer;
    background-color: #e9ecef;
}

/* ============================================================ */
/* ESTILOS RESPONSIVOS (SOLO PARA MÓVILES) */
/* ============================================================ */
@media (max-width: 767px) {
    /* 1. Ajustar el contenedor del menú para que quepa en el celular */
    .tt-menu {
        min-width: 100% !important; /* Ya no 650px, sino el ancho del input */
        width: 100%;
    }
    /* 2. Ocultar la cabecera (Títulos) porque en móvil estorba */
    .resultado-header {
        display: none !important;
    }
    /* 3. Permitir que los elementos salten de línea (Wrap) */
    .tt-suggestion, .resultado-item {
        flex-wrap: wrap !important; /* Clave para el salto de línea */
        padding: 10px 5px !important;
    }
    /* --- REORDENAMIENTO VISUAL CON FLEXBOX --- */
    /* A) La Descripción: Pasa a ser la protagonista arriba */
    .col-nombre {
        width: 100% !important; /* Ocupa todo el ancho */
        order: 1; /* Forzamos que aparezca primero visualmente */
        white-space: normal !important; /* Permitir que el texto baje si es largo */
        margin-bottom: 5px;
        font-size: 14px;
        padding-right: 0;
    }
    /* B) El Código: Pequeño abajo a la izquierda */
    .col-codigo {
        width: 30% !important;
        order: 2;
        font-size: 11px;
        color: #999;
    }
    /* C) El Stock: Abajo al centro */
    .col-stock {
        width: 30% !important;
        order: 3;
        font-size: 12px;
        text-align: center;
    }  
    /* Agregamos una etiqueta "Stock:" solo en móvil mediante CSS */
    .col-stock::before {
        content: "Stock: ";
        font-size: 10px;
        color: #aaa;
    }
    /* D) El Precio: Abajo a la derecha, resaltado */
    .col-precio {
        width: 40% !important;
        order: 4;
        text-align: right;
        font-size: 14px;
    }
}

/* .wizard-paso { cursor: pointer; transition: all 0.3s; }
.wizard-paso.active .wizard-circulo { background: #696cff; color: white; }
.wizard-paso.completado .wizard-circulo { background: #71dd37; color: white; }
.wizard-circulo {
    width: 32px; height: 32px; border-radius: 50%;
    background: #e7e7ff; color: #696cff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 600; font-size: 14px;
    transition: all 0.3s;
}
.resultado-item {
    padding: 10px; border: 1px solid #e0e0e0; border-radius: 6px;
    cursor: pointer; transition: all 0.2s; margin-bottom: 8px;
}
.resultado-item:hover { background: #f5f5f5; border-color: #696cff; } */

/* Forzar que el menú lateral esté deshabilitado cuando hay modales */
body.modal-open .sidebar,
body.modal-open .menu-lateral,
body.modal-open nav {
    pointer-events: none !important;
    user-select: none !important;
}

/* Asegurar que el body no tenga scroll cuando hay modal */
/* body.modal-open {
    overflow: hidden !important;
} */

/* Asegurar que los backdrops cubran todo */
.modal-backdrop {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
}


@media (min-width: 769px) {
    .modal {
        z-index: 1060 !important;
    }
    
    .modal-backdrop {
        z-index: 1055 !important;
    }
}

/* Móvil - Modal debajo del navbar */
@media (max-width: 768px) {
    /* Navbar siempre arriba */
    .layout-navbar,
    #layout-navbar,
    nav.navbar {
        z-index: 9999 !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
    }
    
    /* Modal debajo del navbar */
    .modal {
        z-index: 1060 !important;
        padding-top: 60px !important; /* Altura del navbar */
    }
    
    .modal-backdrop {
        z-index: 1055 !important;
        top: 60px !important; /* Empieza debajo del navbar */
        height: calc(100vh - 60px) !important;
    }
    
    /* Dialog del modal */
    .modal-dialog {
        margin: 0.5rem;
        max-height: calc(100vh - 60px - 1rem);
        margin-top: 0 !important;
    }
    
    /* Content del modal */
    .modal-content {
        max-height: calc(100vh - 60px - 1rem);
        display: flex;
        flex-direction: column;
    }
    
    /* Header sticky dentro del modal */
    .modal-header {
        position: sticky !important;
        top: 0 !important;
        z-index: 1061 !important;
        background-color: inherit !important;
        flex-shrink: 0;
    }
    
    /* Body con scroll */
    .modal-body {
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        flex: 1 1 auto;
    }
}

/* Prevenir scroll del body cuando modal está abierto */
body.modal-open {
    overflow: hidden !important;
    position: fixed;
    width: 100%;
}

/* Contenedor principal */
.app-brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(0.5rem, 2vw, 1rem);
  padding: clamp(0.75rem, 2vw, 1rem);
  min-height: auto;
  flex-wrap: nowrap;
  width: 100%;
}

/* Link de la marca */
.app-brand-link {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1.5vw, 0.75rem);
  flex: 1;
  min-width: 0;
}

/* Logo - SIEMPRE VISIBLE */
.app-brand-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  min-width: 30px;
  min-height: 30px;
}

.app-brand-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Texto de la marca - SE COMPRIME */
.app-brand-text {
  font-size: clamp(0.75rem, 2.5vw, 1rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 50px;
}

/* Botón toggle */
.layout-menu-toggle {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(0.25rem, 1vw, 0.5rem);
  cursor: pointer;
  transition: all 0.3s ease;
}

.layout-menu-toggle svg {
  width: clamp(18px, 3vw, 22px);
  height: clamp(18px, 3vw, 22px);
}

/* Pantallas muy pequeñas */
@media (max-width: 480px) {
  .app-brand {
    padding: 0.5rem;
    gap: 0.25rem;
  }

  .app-brand-text {
    font-size: 0.7rem;
    min-width: 40px;
  }

  .app-brand-logo {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
  }

  .layout-menu-toggle svg {
    width: 18px;
    height: 18px;
  }
}






/**** PAGE SIZE */

page {
  background: white;
  display: block;
  margin: 0 auto;
  margin-bottom: 0.5cm;
  box-shadow: 0 0 0.5cm rgba(0,0,0,0.5);
}
page[size="A4"][layout="VERTICAL"] {  
  width: 21cm;
  height: 29.7cm; 
}
page[size="A4"][layout="HORIZONTAL"] {
  width: 29.7cm;
  height: 21cm;  
}
page[size="A3"][layout="VERTICAL"] {
  width: 29.7cm;
  height: 42cm;
}
page[size="A3"][layout="HORIZONTAL"] {
  width: 42cm;
  height: 29.7cm;  
}
page[size="A5"][layout="VERTICAL"] {
  width: 14.8cm;
  height: 21cm;
}
page[size="A5"][layout="HORIZONTAL"] {
  width: 21cm;
  height: 14.8cm;  
}