/* =========================================================
   VISTA DE CATEGORÍAS - INVENTARIO L&S
   Archivo: VISTA/CSS/categorias.css
   ========================================================= */


/* =========================================================
   FONDO GENERAL
   ========================================================= */

.categorias-fondo {
    min-height: 100vh;
    background: linear-gradient(135deg, #111111, #2d2d2d, #7a0000);
    padding: 40px 20px 120px 20px;
    font-family: Arial, Helvetica, sans-serif;
}

.categorias-contenedor {
    width: 95%;
    max-width: 1150px;
    margin: 0 auto;
}


/* =========================================================
   ENCABEZADO DEL MÓDULO
   ========================================================= */

.categorias-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    background-color: rgba(255, 255, 255, 0.96);
    padding: 28px;
    border-radius: 22px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.30);
    border-bottom: 6px solid #b30000;
    margin-bottom: 25px;
}

.categorias-header h2 {
    color: #b30000;
    font-weight: bold;
    margin-bottom: 8px;
}

.categorias-header p {
    margin-bottom: 0;
    color: #444444;
}

.btn-rojo-categoria {
    border: none;
    background-color: #b30000;
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 12px;
    font-weight: bold;
    transition: 0.3s ease;
    white-space: nowrap;
}

.btn-rojo-categoria:hover {
    background-color: #8f0000;
    color: #ffffff;
    transform: translateY(-2px);
}


/* =========================================================
   ALERTAS
   ========================================================= */

.alerta-categoria {
    border-radius: 14px;
    margin-bottom: 20px;
    box-shadow: 0 5px 18px rgba(0, 0, 0, 0.20);
}


/* =========================================================
   PANEL PRINCIPAL
   ========================================================= */

.panel-categoria {
    background-color: rgba(255, 255, 255, 0.96);
    padding: 25px;
    border-radius: 22px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.30);
}


/* =========================================================
   BUSCADOR
   ========================================================= */

.busqueda-categoria {
    display: flex;
    gap: 12px;
    margin-bottom: 22px;
    flex-wrap: wrap;
}

.campo-busqueda-categoria {
    flex: 1;
    min-width: 230px;
    position: relative;
}

.campo-busqueda-categoria i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #777777;
}

.campo-busqueda-categoria input {
    width: 100%;
    padding: 12px 12px 12px 40px;
    border: 1px solid #cccccc;
    border-radius: 12px;
    outline: none;
}

.campo-busqueda-categoria input:focus {
    border-color: #b30000;
    box-shadow: 0 0 0 3px rgba(179, 0, 0, 0.12);
}

.btn-buscar-categoria,
.btn-limpiar-categoria {
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    text-decoration: none;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease;
}

.btn-buscar-categoria {
    background-color: #222222;
    color: #ffffff;
}

.btn-buscar-categoria:hover {
    background-color: #b30000;
    color: #ffffff;
}

.btn-limpiar-categoria {
    background-color: #777777;
    color: #ffffff;
}

.btn-limpiar-categoria:hover {
    background-color: #555555;
    color: #ffffff;
}


/* =========================================================
   TABLA DE CATEGORÍAS
   ========================================================= */

.tabla-contenedor {
    width: 100%;
    overflow-x: auto;
}

.tabla-categorias {
    width: 100%;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 16px;
}

.tabla-categorias thead {
    background-color: #b30000;
    color: #ffffff;
}

.tabla-categorias th,
.tabla-categorias td {
    padding: 14px;
    text-align: left;
    border-bottom: 1px solid #eeeeee;
    vertical-align: middle;
}

.tabla-categorias tbody tr:hover {
    background-color: #f8f8f8;
}

.sin-registros {
    text-align: center !important;
    color: #666666;
    font-weight: bold;
    padding: 25px !important;
}


/* =========================================================
   COLUMNA DE SUBCATEGORÍAS
   ========================================================= */

.columna-subcategorias,
.tabla-categorias .columna-subcategorias {
    text-align: center !important;
}


/* Botón nuevo */
.btn-ver-subcategorias-ls,
.btn-ver-subcategorias {
    border: none !important;
    outline: none !important;
    background-color: #222222 !important;
    color: #ffffff !important;
    padding: 12px 18px !important;
    border-radius: 15px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    min-width: 255px !important;
    max-width: 100% !important;
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.22) !important;
    transition: 0.25s ease !important;
    white-space: nowrap !important;
    cursor: pointer !important;
}

.btn-ver-subcategorias-ls:hover,
.btn-ver-subcategorias:hover {
    background-color: #b30000 !important;
    color: #ffffff !important;
    transform: translateY(-2px) !important;
}

.btn-ver-subcategorias-ls i,
.btn-ver-subcategorias i {
    color: #ffffff !important;
    font-size: 18px !important;
}

.texto-ver-subcategorias,
.texto-boton-subcategoria {
    color: #ffffff !important;
    font-weight: 800 !important;
}

.numero-subcategorias,
.contador-subcategorias,
.btn-ver-subcategorias span:last-child {
    background-color: #ffffff !important;
    color: #b30000 !important;
    min-width: 28px !important;
    height: 24px !important;
    padding: 2px 8px !important;
    border-radius: 50px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

.subcategoria-vacia {
    display: inline-block;
    color: #777777;
    font-style: italic;
    font-size: 14px;
}


/* =========================================================
   ACCIONES DE LA TABLA
   ========================================================= */

.acciones-categoria {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.btn-tabla {
    border: none;
    padding: 8px 12px;
    border-radius: 10px;
    color: #ffffff;
    font-weight: bold;
    font-size: 14px;
    transition: 0.3s ease;
}

.btn-editar {
    background-color: #444444;
}

.btn-editar:hover {
    background-color: #222222;
    color: #ffffff;
}

.btn-eliminar {
    background-color: #b30000;
}

.btn-eliminar:hover {
    background-color: #8f0000;
    color: #ffffff;
}


/* =========================================================
   MODALES GENERALES
   ========================================================= */

.modal-ls {
    border-radius: 18px;
    overflow: hidden;
    border: none;
}

.modal-header-ls {
    background-color: #b30000;
    color: #ffffff;
}

.btn-guardar {
    background-color: #b30000;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: bold;
}

.btn-guardar:hover {
    background-color: #8f0000;
    color: #ffffff;
}

.btn-cancelar {
    background-color: #444444;
    color: #ffffff;
    border: none;
    border-radius: 10px;
    padding: 10px 18px;
    font-weight: bold;
}

.btn-cancelar:hover {
    background-color: #222222;
    color: #ffffff;
}

.mensaje-modal {
    font-size: 16px;
    color: #333333;
}

.texto-advertencia {
    color: #b30000;
    font-size: 14px;
    margin-bottom: 0;
    font-weight: bold;
}


/* =========================================================
   TABS DEL MODAL CATEGORÍA / SUBCATEGORÍA
   ========================================================= */

.tabs-categorias .nav-link {
    color: #333333;
    font-weight: bold;
}

.tabs-categorias .nav-link.active {
    background-color: #b30000;
    color: #ffffff;
    border-color: #b30000;
}


/* =========================================================
   MODAL VISUAL DE SUBCATEGORÍAS
   ========================================================= */

.modal-subcategorias .modal-dialog {
    max-width: 650px;
}

.modal-subcategorias .modal-content {
    border: none;
    border-radius: 0 0 18px 18px;
    overflow: hidden;
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.35);
}

.modal-subcategorias .modal-header {
    background-color: #c00000;
    color: #ffffff;
    border-bottom: none;
    padding: 18px 22px;
}

.modal-subcategorias .modal-title {
    font-size: 24px;
    font-weight: 800;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-subcategorias .modal-title i {
    font-size: 25px;
}

.modal-subcategorias .btn-close {
    filter: invert(1);
    opacity: 0.75;
    transform: scale(1.15);
}

.modal-subcategorias .modal-body {
    background-color: #f4f4f4;
    padding: 26px 14px 20px 14px;
}

.info-categoria-modal {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    background-color: #ffffff;
    border-left: 6px solid #c00000;
    border-radius: 16px;
    padding: 20px 18px;
    margin-bottom: 24px;
    color: #333333;
    font-size: 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.info-categoria-modal span {
    font-weight: 500;
}

.info-categoria-modal strong {
    font-weight: 900;
}

.lista-subcategorias-modal {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.item-subcategoria-modal {
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: #ffffff;
    border-left: 6px solid #c00000;
    border-radius: 16px;
    padding: 16px 18px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.10);
}

.codigo-subcategoria-modal {
    background-color: #c00000;
    color: #ffffff;
    min-width: 70px;
    height: 48px;
    padding: 8px 12px;
    border-radius: 12px;
    font-size: 18px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.nombre-subcategoria-modal {
    color: #222222;
    font-size: 17px;
    font-weight: 900;
    text-transform: uppercase;
}

.modal-subcategorias .modal-footer {
    background-color: #f4f4f4;
    border-top: 1px solid #dddddd;
    padding: 20px;
}

.modal-subcategorias .btn-cancelar {
    background-color: #5a5a5a;
    color: #ffffff;
    border: none;
    padding: 12px 30px;
    border-radius: 14px;
    font-weight: 800;
    font-size: 17px;
}

.modal-subcategorias .btn-cancelar:hover {
    background-color: #333333;
    color: #ffffff;
}


/* =========================================================
   RESPONSIVE TABLET
   ========================================================= */

@media screen and (max-width: 768px) {
    .categorias-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .btn-rojo-categoria {
        width: 100%;
    }

    .busqueda-categoria {
        flex-direction: column;
    }

    .btn-buscar-categoria,
    .btn-limpiar-categoria {
        width: 100%;
    }

    .acciones-categoria {
        flex-direction: column;
    }

    .btn-ver-subcategorias-ls,
    .btn-ver-subcategorias {
        min-width: 210px !important;
        padding: 11px 14px !important;
        font-size: 14px !important;
        gap: 8px !important;
    }

    .texto-ver-subcategorias,
    .texto-boton-subcategoria {
        font-size: 14px !important;
    }

    .modal-subcategorias .modal-dialog {
        max-width: 95%;
        margin: 16px auto;
    }

    .modal-subcategorias .modal-title {
        font-size: 22px;
    }

    .info-categoria-modal {
        grid-template-columns: 1fr;
        font-size: 17px;
        padding: 18px;
    }

    .item-subcategoria-modal {
        padding: 15px;
        gap: 14px;
    }

    .codigo-subcategoria-modal {
        min-width: 68px;
        height: 48px;
        font-size: 17px;
    }

    .nombre-subcategoria-modal {
        font-size: 16px;
    }
}


/* =========================================================
   RESPONSIVE CELULAR
   ========================================================= */

@media screen and (max-width: 480px) {
    .categorias-fondo {
        padding: 25px 10px 100px 10px;
    }

    .categorias-contenedor {
        width: 100%;
    }

    .categorias-header {
        padding: 22px;
    }

    .panel-categoria {
        padding: 18px;
    }

    .tabla-categorias th,
    .tabla-categorias td {
        padding: 12px;
        font-size: 14px;
    }

    .btn-ver-subcategorias-ls,
    .btn-ver-subcategorias {
        width: 100% !important;
        min-width: 170px !important;
        font-size: 13px !important;
        padding: 10px 12px !important;
    }

    .texto-ver-subcategorias,
    .texto-boton-subcategoria {
        font-size: 13px !important;
    }

    .numero-subcategorias,
    .contador-subcategorias,
    .btn-ver-subcategorias span:last-child {
        min-width: 24px !important;
        height: 22px !important;
        font-size: 12px !important;
    }

    .modal-subcategorias .modal-dialog {
        max-width: 100%;
        margin: 0;
    }

    .modal-subcategorias .modal-content {
        min-height: 100vh;
        border-radius: 0;
    }

    .modal-subcategorias .modal-header {
        padding: 18px 16px;
    }

    .modal-subcategorias .modal-title {
        font-size: 20px;
    }

    .modal-subcategorias .modal-body {
        padding: 20px 12px;
    }

    .info-categoria-modal {
        border-radius: 14px;
        font-size: 16px;
    }

    .item-subcategoria-modal {
        border-radius: 14px;
        align-items: center;
    }

    .codigo-subcategoria-modal {
        min-width: 62px;
        height: 46px;
        font-size: 16px;
    }

    .nombre-subcategoria-modal {
        font-size: 15px;
    }

    .modal-subcategorias .modal-footer {
        padding: 18px;
    }

    .modal-subcategorias .btn-cancelar {
        width: 120px;
    }
    /* =========================================================
   MODAL EDITAR CATEGORÍA Y SUBCATEGORÍAS
   ========================================================= */

.bloque-edicion-categoria,
.bloque-edicion-subcategorias {
    background-color: #f7f7f7;
    border-left: 6px solid #b30000;
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 20px;
}

.bloque-edicion-categoria h6,
.bloque-edicion-subcategorias h6 {
    color: #b30000;
    font-weight: 900;
    margin-bottom: 18px;
}

.item-editar-subcategoria {
    background-color: #ffffff;
    border: 1px solid #dddddd;
    border-left: 5px solid #b30000;
    border-radius: 14px;
    padding: 15px;
    margin-bottom: 14px;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.item-editar-subcategoria:last-child {
    margin-bottom: 0;
}

.item-editar-subcategoria .form-label {
    font-weight: bold;
    color: #333333;
}

.item-editar-subcategoria input[readonly],
.bloque-edicion-categoria input[readonly] {
    background-color: #eeeeee;
    font-weight: bold;
    color: #555555;
}

@media screen and (max-width: 480px) {
    .bloque-edicion-categoria,
    .bloque-edicion-subcategorias {
        padding: 14px;
    }

    .item-editar-subcategoria {
        padding: 12px;
    }
}

}