
/* Reset y configuracion basica */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* body con el color de Figma */
body {
    font-family: 'Arial', sans-serif;
    background-color: #D5DBCE;
    height: 100vh;
    width: 100vw;
    overflow: hidden;
}

/* Container principal que ocupa toda la pantalla */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    width: 100vw;
}

/* Formulario de login centrado */
.login-form {
    background: transparent;
    text-align: center;
    width: 100%;
    max-width: 400px;
    padding: 40px 20px;
}

/* Titulo MARIOSHOP */
.login-title {
    font-size: 48px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 40px;
    letter-spacing: 2px;
    text-transform: uppercase;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 25px;
    text-align: left;
}

/* Etiquetas de los campos */
.form-label {
    display: block;
    font-size: 16px;
    font-weight: bold;
    color: #000000;
    margin-bottom: 8px;
    text-transform: uppercase;
}

/* Campos de entrada */
.form-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 16px;
    border: 2px solid #999999;
    border-radius: 25px;
    background-color: #FFFFFF;
    outline: none;
    transition: border-color 0.3s ease;
}

/* Efecto focus en los campos */
.form-input:focus {
    border-color: #666666;
}

/* Grupo de botones */
.button-group {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

/* Estilos base para botones */
.btn-register,
.btn-login {
    padding: 12px 30px;
    font-size: 16px;
    font-weight: bold;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    text-transform: uppercase;
    transition: all 0.3s ease;
    min-width: 120px;
}

/* Boton REGISTRAR - color gris/azul claro */
.btn-register {
    background-color: #8FA5B0;
    color: #FFFFFF;
}

.btn-register:hover {
    background-color: #7A959F;
    transform: translateY(-2px);
}

/* Boton INGRESAR - color azul mas intenso */
.btn-login {
    background-color: #5A8CAE;
    color: #FFFFFF;
}

.btn-login:hover {
    background-color: #4A7B9A;
    transform: translateY(-2px);
}

/* Efectos adicionales para los botones */
.btn-register:active,
.btn-login:active {
    transform: translateY(0);
}

/* Estilos para las credenciales de ejemplo */
.credenciales-ejemplo {
    margin-top: 30px;
    padding: 20px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    text-align: center;
}

.credenciales-ejemplo h4 {
    color: #302E2E;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.credenciales-ejemplo p {
    color: #4E4E4E;
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.credenciales-ejemplo p strong {
    color: #302E2E;
    font-weight: bold;
}

/* Responsive para pantallas pequeñas */
@media (max-width: 480px) {
    .login-form {
        padding: 20px 15px;
        max-width: 320px;
    }
    
    .login-title {
        font-size: 36px;
        margin-bottom: 30px;
    }
    
    .button-group {
        flex-direction: column;
        gap: 10px;
    }
    
    .btn-register,
    .btn-login {
        width: 100%;
    }
}

/* Animacion suave para el formulario */
.login-form {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Body para paginas principales */
body.main-page {
    background-color: #F7FEEF;
    overflow: auto;
    height: 100vh;
    margin: 0;
    padding: 0;
}

/* FRANJA 1 - Header con MARIOSHOP */
.top-header {
    background-color: #302E2E;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 30px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: relative;
}

/* Titulo MARIOSHOP en la franja superior */
.header-title {
    color: white;
    font-size: 24px;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 0;
}

/* Boton cerrar sesion en header */
.logout-btn-header {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    font-size: 14px;
    transition: background-color 0.3s ease;
    position: absolute;
    right: 30px;
}

.logout-btn-header:hover {
    background-color: #c82333;
}

/* FRANJA 2 - Navbar con navegacion */
.main-navbar {
    background-color: #4E4E4E;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Nombre de la pagina actual a la izquierda */
.navbar-left {
    color: white;
    font-size: 18px;
    font-weight: 600;
}

/* Navegacion a la derecha */
.navbar-right {
    display: flex;
    gap: 20px;
}

/* Enlaces de navegacion */
.nav-link {
    color: white;
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 5px;
    transition: background-color 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: white;
    text-decoration: none;
}

/* Contenido principal */
.main-content {
    background-color: #F7FEEF;
    min-height: calc(100vh - 100px);
    padding: 20px;
}

/* Boton cerrar sesion (temporal) */
.logout-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-weight: bold;
    z-index: 1000;
}

.logout-btn:hover {
    background-color: #c82333;
}

/* === ESTILOS PARA PRODUCTOS === */

/* Contenido principal de productos */
.main-content {
    padding: 20px;
    height: calc(100vh - 120px);
    overflow-y: auto;
    background-color: #F7FEEF;
}

/* Controles superiores */
.productos-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

/* Contenedor derecho para ordenar y buscar */
.controles-derecha {
    display: flex;
    align-items: center;
    gap: 15px;
}

/* Boton agregar producto */
.btn-agregar-producto {
    background-color: #D4C5A9;
    color: #333;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-agregar-producto:hover {
    background-color: #C4B599;
    transform: translateY(-2px);
}

/* Barra de busqueda */
.busqueda-container {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 0 0 300px; /* Ancho fijo de 300px */
}

.input-busqueda {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 25px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.input-busqueda:focus {
    border-color: #4E4E4E;
}

.btn-buscar {
    background-color: #4E4E4E;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.btn-buscar:hover {
    background-color: #3E3E3E;
}

/* Boton ordenar */
.ordenar-container {
    position: relative;
}

.btn-ordenar {
    background-color: #D4C5A9;
    color: #333;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}

.btn-ordenar:hover {
    background-color: #C4B599;
}

.menu-ordenar {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 1000;
    min-width: 150px;
    margin-top: 5px;
}

.ordenar-option {
    padding: 12px 16px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.ordenar-option:hover {
    background-color: #f5f5f5;
}

.ordenar-option:last-child {
    border-bottom: none;
}

.hidden {
    display: none !important;
}

/* Grid de productos */
.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 20px;
    padding: 20px 0;
}

/* Card de producto */
.producto-card {
    background: #E8F5E8;
    border-radius: 12px;
    padding: 15px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #ddd;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.1);
}

.producto-imagen {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 15px;
}

.producto-info {
    width: 100%;
    text-align: left;
    margin-bottom: 15px;
}

.producto-nombre {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 8px;
}

.producto-precio {
    font-size: 18px;
    font-weight: bold;
    color: #2E7D32;
    margin-bottom: 8px;
}

.producto-disponibilidad {
    font-size: 14px;
    color: #666;
    margin-bottom: 8px;
}

.producto-categoria {
    background-color: #4E4E4E;
    color: white;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 12px;
    display: inline-block;
}

.producto-botones {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.btn-editar, .btn-eliminar {
    padding: 8px 16px;
    border: none;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-editar {
    background-color: #4E4E4E;
    color: white;
}

.btn-editar:hover {
    background-color: #3E3E3E;
}

.btn-eliminar {
    background-color: #dc3545;
    color: white;
}

.btn-eliminar:hover {
    background-color: #c82333;
}

/* Modal estilos */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-content {
    background: #4E4E4E;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    overflow: hidden;
}

.modal-title {
    background: #4E4E4E;
    color: white;
    font-size: 18px;
    font-weight: bold;
    text-align: left;
    margin: 0;
    padding: 20px 30px;
    border-bottom: 2px solid #666;
}

.modal-form-container {
    background: white;
    padding: 25px 30px;
    max-height: 60vh;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.form-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
}

.form-input:focus {
    border-color: #4E4E4E;
}

.vista-previa {
    margin-top: 10px;
    text-align: center;
}

.vista-previa img {
    max-width: 150px;
    max-height: 150px;
    border-radius: 8px;
    border: 2px solid #ddd;
}

.modal-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 25px;
}

.btn-cancelar, .btn-agregar {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    min-width: 120px;
    transition: all 0.3s ease;
}

.btn-cancelar {
    background-color: #dc3545;
    color: white;
}

.btn-cancelar:hover {
    background-color: #c82333;
}

.btn-agregar {
    background-color: #D4C5A9;
    color: #333;
}

.btn-agregar:hover {
    background-color: #C4B599;
}

/* === ESTILOS PARA CARRITO === */

/* Botón ver carrito */
.btn-ver-carrito {
    background-color: #4E4E4E;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    margin-left: 10px;
}

.btn-ver-carrito:hover {
    background-color: #3E3E3E;
    transform: scale(1.1);
}

/* Modal carrito específico */
.modal-carrito {
    max-width: 600px;
    max-height: 70vh;
}

/* Lista de productos en el carrito */
.lista-productos-carrito {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
}

.producto-carrito {
    display: flex;
    align-items: center;
    padding: 15px;
    margin-bottom: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.producto-carrito-imagen {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
    margin-right: 15px;
}

.producto-carrito-info {
    flex: 1;
}

.producto-carrito-nombre {
    font-weight: bold;
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
}

.producto-carrito-precio {
    color: #2E7D32;
    font-weight: bold;
    margin-bottom: 5px;
}

.producto-carrito-controles {
    display: flex;
    align-items: center;
    gap: 10px;
}

.cantidad-control {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-cantidad {
    background-color: #4E4E4E;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
}

.btn-cantidad:hover {
    background-color: #3E3E3E;
}

.cantidad-numero {
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.btn-eliminar-item {
    background-color: #dc3545;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
}

.btn-eliminar-item:hover {
    background-color: #c82333;
}

/* Total del carrito */
.carrito-total {
    text-align: right;
    padding: 15px 0;
    border-top: 2px solid #ddd;
    margin-top: 15px;
}

.carrito-total h4 {
    color: #2E7D32;
    margin: 0;
    font-size: 20px;
}

/* Líneas de totales */
.linea-total {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    color: #4E4E4E;
    font-size: 16px;
}

.linea-total.total-final {
    border-top: 1px solid #ddd;
    margin-top: 10px;
    padding-top: 10px;
    color: #2E7D32;
    font-size: 18px;
}

/* Estilos para productos sin stock */
.producto-card.sin-stock {
    opacity: 0.6;
    background-color: #f8f9fa;
}

.producto-disponibilidad.sin-stock {
    color: #dc3545;
    font-weight: bold;
}

.btn-comprar-directo:disabled,
.btn-carrito-pequeño:disabled {
    background-color: #6c757d;
    color: #fff;
    cursor: not-allowed;
    opacity: 0.7;
}

.btn-comprar-directo:disabled:hover,
.btn-carrito-pequeño:disabled:hover {
    background-color: #6c757d;
    transform: none;
}

/* Z-index para SweetAlert por encima del modal del carrito */
.swal2-container {
    z-index: 3000 !important;
}

.swal2-backdrop-show {
    z-index: 2999 !important;
}

/* Mensaje carrito vacío */
.carrito-vacio {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.carrito-vacio p {
    font-size: 18px;
    margin: 0;
}

/* Botones del carrito */
.btn-cerrar-carrito, .btn-comprar {
    padding: 12px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    min-width: 120px;
    transition: all 0.3s ease;
}

.btn-cerrar-carrito {
    background-color: #6c757d;
    color: white;
}

.btn-cerrar-carrito:hover {
    background-color: #5a6268;
}

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

.btn-comprar:hover {
    background-color: #218838;
}

/* Título específico para catálogo */
.catalogo-titulo {
    color: #333;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

/* Botón comprar directo */
.btn-comprar-directo {
    background-color: #4E4E4E;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
    margin-right: 8px;
}

.btn-comprar-directo:hover {
    background-color: #3E3E3E;
    transform: translateY(-2px);
}

/* Botón carrito pequeño (solo icono) */
.btn-carrito-pequeño {
    background-color: #5A8CAE;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
    width: 38px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-carrito-pequeño:hover {
    background-color: #4A7A9E;
    transform: translateY(-2px);
}

/* Responsive */
@media (max-width: 768px) {
    .productos-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .busqueda-container {
        max-width: none;
    }
    
    .productos-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }
    
    .producto-carrito {
        flex-direction: column;
        text-align: center;
    }
    
    .producto-carrito-imagen {
        margin-right: 0;
        margin-bottom: 10px;
    }
}

/* === ESTILOS ADICIONALES PARA CATÁLOGO === */

/* Titulo de catálogo */
.catalogo-titulo {
    font-size: 24px;
    font-weight: bold;
    color: #333;
    margin: 0;
}

/* Boton ver carrito (azul) */
.btn-ver-carrito {
    background-color: #5A8CAE;
    color: white;
    border: none;
    padding: 12px 16px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
}

.btn-ver-carrito:hover {
    background-color: #4A7B9A;
    transform: scale(1.1);
}

/* Boton COMPRAR */
.btn-comprar {
    background-color: #D4C5A9;
    color: #333;
    border: none;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-comprar:hover {
    background-color: #C4B599;
    transform: translateY(-2px);
}

/* Boton CARRITO (azul circular) */
.btn-carrito {
    background-color: #5A8CAE;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
}

.btn-carrito:hover {
    background-color: #4A7B9A;
    transform: scale(1.1);
}

/* Ajuste para los botones de catálogo */
.producto-card .producto-botones {
    display: flex;
    gap: 10px;
    justify-content: center;
    align-items: center;
}

/* Responsive para catálogo */
@media (max-width: 768px) {
    .catalogo-titulo {
        font-size: 20px;
        text-align: center;
    }
    
    .btn-ver-carrito {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }
}

/* 
   == ESTILOS SIMPLES PARA DASHBOARD ==
   */

/* Contenedor de cada gráfica */
.grafica-container {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Título de cada gráfica */
.grafica-container h5 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 15px;
    color: #333;
}

/* Espaciado para el título de pedidos */
.container h3 {
    margin-top: 30px;
    margin-bottom: 20px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .grafica-container {
        margin-bottom: 20px;
    }
}

/* 
   == ESTILOS PARA INPUT DE CANTIDAD == */

/* Input numérico de cantidad en el carrito */
.input-cantidad {
    width: 60px;
    height: 30px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    font-weight: bold;
    outline: none;
    transition: border-color 0.3s ease;
    margin: 0 5px;
}

/* Efecto focus en el input */
.input-cantidad:focus {
    border-color: #4E4E4E;
}

/* Quitar las flechas del input number en Chrome, Safari, Edge */
.input-cantidad::-webkit-outer-spin-button,
.input-cantidad::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Quitar las flechas del input number en Firefox */
.input-cantidad[type=number] {
    -moz-appearance: textfield;
}

/* Ajustar el control de cantidad para que todo esté alineado */
.cantidad-control {
    display: flex;
    align-items: center;
    gap: 0; /* Sin espacio porque el input ya tiene margin */
}

/* Asegurar que los botones +/- estén bien alineados */
.btn-cantidad {
    background-color: #4E4E4E;
    color: white;
    border: none;
    width: 30px;
    height: 30px;
    border-radius: 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
    transition: background-color 0.3s ease;
}

.btn-cantidad:hover {
    background-color: #3E3E3E;
}

.btn-cantidad:active {
    transform: scale(0.95);
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .input-cantidad {
        width: 50px;
        height: 28px;
        font-size: 13px;
    }
    
    .btn-cantidad {
        width: 28px;
        height: 28px;
        font-size: 14px;
    }
}