/* Estilos existentes */
body {
    font-family: Arial, sans-serif;
    background-color: #e6f2ff;
    color: #333;
    line-height: 1.6;
    padding: 20px;
}
/* Estilos para el header */
.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f8f9fa; /* Color de fondo del header */
}
.header-container img {
    height: 50px; /* Ajusta el tamaño del logo según sea necesario */
}
.nav-menu,
.submenu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    padding: 10px;
    background-color: #0066cc;
}

/* Estilos comunes para todos los enlaces del menú */
.nav-menu a,
.nav-menu .categoria-titulo {
    color: white;
    text-decoration: none;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: Arial, sans-serif;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    border-radius: 4px;
}

/* Iconos en los enlaces */
.nav-menu a i,
.nav-menu .categoria-titulo i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.menu-categoria {
    position: relative;
    display: flex;
    flex-direction: column;
}

.categoria-titulo {
    cursor: pointer;
    height: 100%;
    display: flex;
    align-items: center;
}

.categoria-titulo:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.submenu {
    display: none;
    position: absolute;
    top: calc(100% - 5px);
    left: 0;
    background-color: #0066cc;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    min-width: 200px;
    z-index: 1000;
    margin: 0;
    padding: 0;
    border-top: 1px solid #0066cc;
}

.menu-categoria:hover .submenu {
    display: block;
}

/* Ajuste para eliminar cualquier espacio entre el botón y el submenú */
.menu-categoria:hover .categoria-titulo {
    background-color: #0066cc;
    border-radius: 4px 4px 0 0;
    position: relative;
    z-index: 1001; /* Asegura que esté por encima del submenu */
}

.submenu li {
    margin: 0;
    padding: 0;
}

.submenu li:first-child {
    margin-top: 0;
    border-top: none;
}

.submenu li:last-child {
    border-radius: 0 0 4px 4px; /* Redondea solo las esquinas inferiores */
}

/* Enlaces en el submenú */
.submenu li a {
    color: white;
    padding: 10px 15px;
    white-space: nowrap;
    display: block;
    margin: 0;
}

/* Efecto hover para todos los enlaces */
.nav-menu a:hover,
.submenu li a:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

/* Estilo para enlaces activos */
.nav-menu a.active,
.submenu li a.active {
    background-color: rgba(255, 255, 255, 0.2);
}

/* Ajuste específico para el enlace de cerrar sesión */
.nav-menu > li:last-child {
    margin-left: auto;
}

/* Asegurar que los submenús no se desborden */
.menu-categoria {
    position: relative;
}

.submenu {
    margin-top: 5px;
}

/* Estilos para el menú hamburguesa */
.hamburger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
}
.hamburger-menu div {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 4px 0;
}

/* Estilos para el dashboard en events.php */
.dashboard-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    text-align: center;
}
.dashboard-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}
.dashboard-widget-wrapper {
    width: calc(33.333% - 10px); /* Tres columnas con espacio entre ellas */
    margin-bottom: 20px;
}
.dashboard-widget {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    height: 100%;
}
.dashboard-widget h2,
.dashboard-widget h3 {
    background-color: #007bff;
    color: #fff;
    font-size: 18px;
    font-weight: bold;
    margin: 0;
    padding: 15px;
}
.dashboard-widget-content {
    padding: 15px;
}
.dashboard-number {
    font-size: 36px;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0;
}
.dashboard-widget table {
    width: 100%;
    border-collapse: collapse;
}
.dashboard-widget th,
.dashboard-widget td {
    text-align: left;
    padding: 10px;
    border-bottom: 1px solid #e0e0e0;
}
.dashboard-widget th {
    background-color: #f8f9fa;
    font-weight: bold;
}
.dashboard-widget-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.dashboard-widget-link:hover .dashboard-widget {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}
/* Responsive design */
@media (max-width: 992px) {
    .dashboard-widget-wrapper {
        width: calc(50% - 10px); /* Dos columnas en pantallas medianas */
    }
}
@media (max-width: 768px) {
    .dashboard-widget-wrapper {
        width: 100%; /* Una columna en pantallas pequeñas */
    }
    .nav-menu {
        display: none;
        flex-direction: column;
        width: 100%;
    }
    .nav-menu li {
        margin: 0;
    }
    .nav-menu a {
        padding: 15px; /* Reducir el padding para evitar la superposición */
        border-bottom: 1px solid #fff;
        display: block; /* Asegurar que cada enlace ocupe toda la línea */
    }
    .hamburger-menu {
        display: flex;
    }
}
/* Botones */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 5px;
    transition: background-color 0.3s;
}
.btn:hover {
    background-color: #0056b3;
}
/* Formularios */
.form-group {
    margin-bottom: 15px;
}
.form-control {
    display: block;
    width: 100%;
    padding: 10px;
    font-size: 16px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 5px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.form-control:focus {
    border-color: #80bdff;
    outline: 0;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
/* Estilos para páginas interiores */
.interior-page {
    max-width: 90%;
    margin: 0 auto;
    padding: 20px;
}
.interior-title {
    font-size: 28px;
    color: #007bff;
    margin-bottom: 20px;
    text-align: center;
}
.interior-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    padding: 20px;
}
.interior-section h2 {
    font-size: 22px;
    color: #333;
    margin-bottom: 15px;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}
.interior-section h3 {
    font-size: 20px;
    color: #0056b3;
    margin-bottom: 15px;
    border-bottom: 1px solid #0056b3;
    padding-bottom: 5px;
}

/* Estilos para formularios en páginas interiores */
.interior-form .form-group {
    margin-bottom: 20px;
}

.interior-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}
.interior-form .form-control {
    width: 100%;
    padding: 8px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.interior-form .checkbox-group {
    display: flex;
    align-items: center;
}

.interior-form .checkbox-group input[type="checkbox"] {
    margin-right: 10px;
}

/* Estilos para tablas en páginas interiores */
.interior-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
}

.interior-table th,
.interior-table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.interior-table th {
    background-color: #f0f8ff;
    font-weight: bold;
    color: #333;
}

.interior-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.interior-table tr:hover {
    background-color: #f5f5f5;
}

/* Estilos para botones en páginas interiores */
.interior-btn {
    display: inline-block;
    padding: 8px 15px;
    background-color: #007bff;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    transition: background-color 0.3s;
    border: none;
    cursor: pointer;
}

.interior-btn:hover {
    background-color: #0056b3;
}

.interior-btn-secondary {
    background-color: #6c757d;
}

.interior-btn-secondary:hover {
    background-color: #545b62;
}

/* Estilos para mensajes y errores */
.interior-message,
.interior-error {
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.interior-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.interior-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Estilos adicionales para los campos de producto */
.producto {
    margin-bottom: 15px;
    padding: 15px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #f9f9f9;
}

.producto input,
.producto select {
    margin-bottom: 10px;
}

.producto button {
    margin-top: 10px;
}

/* Ajuste para el botón de agregar producto */
#productos {
    margin-bottom: 15px;
}

button[onclick="agregarProducto()"] {
    margin-bottom: 20px;
}

/* Ajuste global para todos los campos de texto */
input[type="text"],
input[type="number"],
input[type="date"],
input[type="email"],
input[type="password"],
select,
textarea {
    box-sizing: border-box;
    width: 100%;
    padding: 8px;
    margin-bottom: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

/* Ajuste específico para los contenedores de formularios */
.form-group {
    margin-bottom: 15px;
}

/* Ajuste para los campos dentro de .producto */
.producto input,
.producto select {
    width: 100%;
    margin-bottom: 10px;
}

/* Ajuste para botones dentro de .producto */
.producto button {
    width: auto;
}

/* Asegurarse de que los checkboxes no se expandan */
input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

/* Ajuste para el contenedor de checkboxes */
.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.checkbox-group label {
    margin-bottom: 0;
    margin-left: 5px;
}

/* Estilos para la página de login */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    background-color: #e6f2ff;
}

.login-box {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    max-width: 400px;
    width: 100%;
    text-align: center;
}

.login-box h1 {
    font-size: 24px;
    color: #007bff;
    margin-bottom: 20px;
}

.login-box .form-group {
    margin-bottom: 15px;
    text-align: left;
}

.login-box .form-control {
    width: 100%;
    padding: 10px;
    border: 1px solid #ced4da;
    border-radius: 4px;
}

.login-box .btn {
    width: 100%;
    padding: 10px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.login-box .btn:hover {
    background-color: #0056b3;
}

.login-box .error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    padding: 10px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.paginas-checkbox-container {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    margin: 10px 0;
}

.checkbox-item {
    margin: 5px 0;
}

/* Estilos responsive para el header y navegación */
@media (max-width: 768px) {
    .header-container {
        flex-direction: column;
        padding: 10px;
    }

    .header-container img {
        margin-bottom: 10px;
    }

    .nav-menu {
        display: none;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #0066cc;
        z-index: 1000;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
    }

    .nav-menu a, 
    .nav-menu .categoria-titulo {
        width: 100%;
        padding: 15px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .submenu {
        position: static;
        width: 100%;
        box-shadow: none;
        background-color: #005bb7;
    }

    .menu-categoria:hover .submenu {
        display: none;
    }

    .menu-categoria.active .submenu {
        display: block;
    }

    .hamburger-menu {
        display: flex;
        position: absolute;
        top: 20px;
        right: 20px;
    }
}

/* Estilos responsive para las tablas */
@media (max-width: 768px) {
    .interior-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    .interior-table th,
    .interior-table td {
        min-width: 120px;
    }
}

/* Estilos responsive para los formularios */
@media (max-width: 768px) {
    .form-group {
        margin-bottom: 20px;
    }

    .form-control {
        font-size: 16px; /* Previene el zoom en iOS */
    }

    .interior-section {
        padding: 15px;
    }

    .modal-content {
        width: 95%;
        margin: 10px auto;
    }
}

/* Estilos responsive para el dashboard */
@media (max-width: 992px) {
    .dashboard-widget-wrapper {
        width: calc(50% - 10px);
    }
}

@media (max-width: 768px) {
    .dashboard-widget-wrapper {
        width: 100%;
    }

    .dashboard-number {
        font-size: 28px;
    }
}

/* Mejoras en la accesibilidad táctil */
@media (max-width: 768px) {
    button,
    .btn,
    .interior-btn {
        min-height: 44px; /* Altura mínima recomendada para elementos táctiles */
        padding: 12px 20px;
    }

    input[type="checkbox"] + label {
        padding: 12px 0;
    }

    select {
        height: 44px;
    }
}

/* Estilos para estados en panel de entregas */
.estado-pendiente {
    color: orange;
}

.estado-entregado {
    color: green;
}

.estado-listo_para_entrega {
    color: #0066cc;
}

/* Estilos para botones de acción */
.accion-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    height: 40px;
    font-size: 14px;
    min-width: 120px;
    margin-right: 5px;
    margin-bottom: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Estilos específicos para cada tipo de botón */
.preparacion-btn {
    background: #ffc107;
    color: black;
}

.preparacion-btn:hover {
    background: #e0a800;
}

.listo-btn {
    background: #007bff;
    color: white;
}

.listo-btn:hover {
    background: #0056b3;
}

.entregar-btn {
    background: #28a745;
    color: white;
}

.entregar-btn:hover {
    background: #218838;
}

.pendiente-btn {
    background: #ffc107;
    color: black;
}

.pendiente-btn:hover {
    background: #e0a800;
}

/* Estilos para el menú móvil */
@media (max-width: 768px) {
    .header-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        background-color: white;
        z-index: 1000;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    }

    main {
        margin-top: 70px; /* Espacio para el header fijo */
    }

    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background-color: #0066cc;
        flex-direction: column;
        overflow-y: auto;
        margin: 0;
        padding: 0;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        width: 100%;
        margin: 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .nav-menu a, 
    .nav-menu .categoria-titulo {
        padding: 15px 20px;
        width: 100%;
        justify-content: flex-start;
    }

    .menu-categoria {
        background-color: #0055b3;
    }

    .submenu {
        position: static;
        width: 100%;
        display: none;
        background-color: #004999;
        box-shadow: none;
        padding: 0;
    }

    .menu-categoria.active .submenu {
        display: block;
    }

    .submenu li a {
        padding-left: 50px;
    }

    /* Estilos para el botón hamburguesa */
    .hamburger-menu {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        width: 30px;
        height: 30px;
        position: absolute;
        right: 20px;
        top: 20px;
        cursor: pointer;
        z-index: 1001;
    }

    .hamburger-menu div {
        width: 25px;
        height: 3px;
        background-color: #0066cc;
        margin: 3px 0;
        transition: 0.4s;
    }

    /* Animación del botón hamburguesa */
    .hamburger-menu.active div:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }

    .hamburger-menu.active div:nth-child(2) {
        opacity: 0;
    }

    .hamburger-menu.active div:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    /* Ajustes para el logo */
    .header-container img {
        height: 40px;
        margin: 5px 0;
    }
}

#qr-reader {
    width: 100% !important;
    max-width: 640px;
    margin: 0 auto;
}

#qr-reader video {
    width: 100% !important;
    height: auto !important;
}

#qr-reader__scan_region {
    position: relative !important;
    min-height: 300px !important;
}

#qr-reader__scan_region > img {
    display: none !important;
}

@media (max-width: 768px) {
    #qr-reader {
        width: 100% !important;
        max-width: 100%;
    }
    
    #qr-reader__scan_region {
        min-height: 250px !important;
    }
}