/* assets/css/style.css */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --color-navbar: #e4e4defb;
    --color-fondo: #1E1E24;
    --color-tarjeta: #FFFFFF;
    --color-texto: #E4E4E7;
    --color-texto-gris: #8b8b9d;
    --color-acento: #FFD700;
    --sombra-suave: 0 8px 32px rgba(0, 0, 0, 0.3);
    --sombra-hover: 0 12px 40px rgba(0, 0, 0, 0.5);
    --transicion: all 0.3s ease;
}

* { font-family: 'Inter', sans-serif; box-sizing: border-box; }

body {
    background-color: var(--color-fondo);
    color: var(--color-texto);
    font-size: 14px;
    margin: 0;
    position: relative;
}

/* MARCA DE AGUA Y FIX DE MODALES */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background-image: url('../img/logo.png');
    background-size: 500px;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.04;
    z-index: 0;
    pointer-events: none;
}

/* NAVBAR HORIZONTAL CLARO Y ELEGANTE */
.navbar-monsides {
    background-color: var(--color-navbar);
    padding: 15px 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed; /* Fija arriba */
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1001; /* Siempre por encima de todo */
    border-bottom: 1px solid #eaeaea;

}
.navbar-monsides .logo-nav { max-height: 40px; }
.navbar-monsides .nav-links { display: flex; gap: 10px; align-items: center; }
.navbar-monsides .nav-link-custom {
    color: #6c757d;
    padding: 8px 15px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transicion);
}
.navbar-monsides .nav-link-custom:hover { color: #14141A; background-color: #f4f6f9; }
.navbar-monsides .nav-link-custom.active { color: #14141A; background-color: var(--color-acento); font-weight: 600; }
.navbar-monsides .btn-logout {
    color: #dc3545; background: rgba(220, 53, 69, 0.1);
    padding: 8px 15px; border-radius: 8px; text-decoration: none;
    font-size: 13px; font-weight: 500; transition: var(--transicion);
}
.navbar-monsides .btn-logout:hover { background: rgba(220, 53, 69, 0.2); }

.mobile-toggle { display: none; background: none; border: none; color: #2d2d2d; font-size: 24px; }

@media (max-width: 992px) {
    .navbar-monsides { flex-wrap: wrap; padding: 15px 20px; }
    .navbar-monsides .logo-container { flex: 1; }
    .mobile-toggle { display: block; }
    .navbar-monsides .nav-links {
        display: none; flex-direction: column; width: 100%;
        margin-top: 15px; gap: 5px; background: #fff; padding-bottom: 15px;
    }
    .navbar-monsides .nav-links.active { display: flex; }
    .navbar-monsides .nav-link-custom { width: 100%; text-align: center; }
}

/* CONTENIDO PRINCIPAL */
.main-content {
    padding: 30px;
    max-width: 1400px;
    margin: 115px auto 0 auto; /* El margin-top de 115px empuja el contenido abajo del menú fijo */
    position: relative;
    z-index: auto;
}
.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 35px; }
.topbar h1 { font-size: 24px; font-weight: 600; color: #ffffff; margin: 0; }
.topbar .fecha { color: var(--color-texto-gris); font-size: 13px; }

/* TARJETAS KPI */
.card-kpi {
    background: var(--color-tarjeta);
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--sombra-suave);
    border: 1px solid rgba(255,255,255,0.05);
    transition: var(--transicion);
    position: relative;
}
.card-kpi:hover { box-shadow: var(--sombra-hover); transform: translateY(-3px); }
.card-kpi .icon-circle { width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; margin-bottom: 15px; font-size: 18px; }
.card-kpi h3 { font-size: 22px; font-weight: 700; margin-bottom: 5px; color: #2d2d2d; }
.card-kpi p { font-size: 12px; color: var(--color-texto-gris); margin: 0; text-transform: uppercase; letter-spacing: 0.5px; }
.chart-container { position: relative; height: 320px; width: 100%; }

/* BOTONES ELEGANTES */
.btn-monsides {
    font-size: 12px; font-weight: 600; padding: 8px 16px; border-radius: 8px;
    text-transform: uppercase; letter-spacing: 0.5px; transition: var(--transicion);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-monsides:hover { transform: translateY(-1px); box-shadow: 0 6px 15px rgba(0,0,0,0.2); }

.btn-import-export {
    background: #fff; color: #2d2d2d; border: 1px solid #eaeaea; padding: 8px 16px;
    border-radius: 8px; font-size: 12px; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px; cursor: pointer; transition: all 0.3s ease; text-decoration: none;
    display: inline-flex; align-items: center; box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}
.btn-import-export:hover { transform: translateY(-2px); box-shadow: 0 6px 15px rgba(0,0,0,0.15); border-color: var(--color-acento); color: #14141A; }
.btn-import-export.btn-yellow { background: var(--color-acento); color: #14141A; border: none; }
.btn-import-export.btn-yellow:hover { background: #ffca18; box-shadow: 0 6px 20px rgba(255, 215, 0, 0.4); }

/* TABLAS SOFISTICADAS */
.table-card { background: #fff; border-radius: 12px; padding: 20px; box-shadow: var(--sombra-suave); }
.table thead th { background-color: transparent; color: var(--color-texto-gris); font-size: 11px; text-transform: uppercase; letter-spacing: 1px; border-bottom: 1px solid #eee; font-weight: 600; }
.table tbody td { color: #4a4a4a; font-weight: 500; border-bottom: 1px solid #f4f4f4; padding: 15px 10px; }

/* AVATARES DE CLIENTES */
.avatar-circle { width: 40px; height: 40px; border-radius: 50%; background: #1E1E24; color: var(--color-acento); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }

/* MARQUESINA DE VENTAS */
.marquee-container {
    background-color: #65658d;
    color: #fff;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    position: fixed; /* Fija justo debajo del navbar */
    top: 70px; /* Altura exacta del navbar */
    left: 0;
    width: 100%;
    z-index: 1000;
}
.marquee-track { display: inline-block; padding: 10px 0; animation: marquee 35s linear infinite; font-size: 13px; font-weight: 500; letter-spacing: 0.5px; }
.marquee-track span { margin: 0 40px; }
.marquee-track i { color: var(--color-acento); margin-right: 10px; }
@keyframes marquee { 0% { transform: translateX(0%); } 100% { transform: translateX(-50%); } }

/* MODALES FIX */
.modal-backdrop { z-index: 1040 !important; }
.modal { z-index: 1055 !important; }
.modal-content, .modal-body, .modal-header, .modal-footer, .form-control, .form-select, button { pointer-events: auto !important; }

/* =========================================
   LAYOUT PUNTO DE VENTA (POS) FULL WIDTH
========================================= */
.pos-layout {
    max-width: none !important;
    width: 100vw;
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    padding: 20px;
    display: flex;
    flex-direction: row;
    height: calc(100vh - 145px) !important; /* Ajustado para que calcule debajo del menú fijo */
    box-sizing: border-box;
    overflow: hidden;
}
.pos-left { flex: 0 0 40%; max-width: 40%; display: flex; flex-direction: column; overflow: hidden; box-sizing: border-box; padding-right: 15px; }
.pos-left .product-grid { flex-grow: 1; overflow-y: auto; padding-right: 10px; padding-bottom: 20px; }
.pos-right { flex: 0 0 60%; max-width: 60%; flex-shrink: 0; box-sizing: border-box; display: flex; flex-direction: column; }
.pos-right .cart-panel { height: 100%; display: flex; flex-direction: column; }
.pos-right .cart-items { flex-grow: 1; overflow-y: auto; max-height: none !important; padding: 0 15px; }

@media (max-width: 992px) {
    .pos-layout { flex-direction: column; height: auto; margin: 0; width: 100%; padding: 20px; }
    .pos-left, .pos-right { max-width: 100%; flex: 0 0 100%; }
    .pos-right { margin-top: 30px; }
    .pos-right .cart-panel { position: static; height: auto; }
    .pos-right .cart-items { max-height: 300px !important; }
}

/* BUSCADOR ELEGANTE POS */
.search-bar { position: relative; }
.search-bar input { background: #fff; border: 1px solid #eaeaea; border-radius: 10px; padding: 12px 15px 12px 45px; width: 100%; font-size: 14px; transition: all 0.3s ease; box-shadow: 0 4px 20px rgba(0,0,0,0.05); }
.search-bar input:focus { outline: none; border-color: var(--color-acento); box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.15); }
.search-bar i { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #8b8b9d; font-size: 18px; }

/* GRID Y TARJETAS DE PRODUCTOS */
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; }
.product-card {
    background: #fff; border-radius: 12px; padding: 15px; text-align: center; cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1); border: 2px solid transparent;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05); position: relative; min-height: 250px;
    display: flex; flex-direction: column; padding-bottom: 20px; overflow: visible;
}
.product-card:hover { transform: translateY(-5px); border-color: var(--color-acento); box-shadow: 0 10px 25px rgba(0,0,0,0.1); }
.product-card .img-placeholder { width: 100%; height: 110px; background: #f4f6f9; border-radius: 8px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; font-size: 2rem; color: #d1d5db; overflow: hidden; }
.product-card .img-placeholder img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.product-card:hover .img-placeholder img { transform: scale(1.08); }
.product-card h6 { font-size: 13px; font-weight: 600; margin: 10px 0 5px 0; color: #2d2d2d; line-height: 1.3; }
.product-card .price-tag { color: #4a4a4a; font-weight: 700; font-size: 15px; margin-top: auto; padding-bottom: 5px; background: #fff; position: relative; z-index: 2; }
.product-card .stock-badge { position: absolute; top: 10px; right: 10px; background: #1E1E24; color: #fff; font-size: 10px; padding: 3px 8px; border-radius: 20px; font-weight: 600; }

/* PAGINACIÓN POS */
.pagination-controls { flex-shrink: 0; display: flex; justify-content: center; gap: 8px; padding: 15px 0 5px; border-top: 1px solid #eaeaea; margin-top: 10px; }
.btn-page { background: #fff; border: 1px solid #eaeaea; color: #2d2d2d; width: 35px; height: 35px; border-radius: 8px; font-weight: 600; cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.btn-page:hover:not(:disabled) { border-color: var(--color-acento); color: #14141A; }
.btn-page.active { background: var(--color-acento); color: #14141A; border: none; }
.btn-page:disabled { opacity: 0.4; cursor: not-allowed; }

/* PANEL DEL CARRITO */
.cart-panel { background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0,0,0,0.3); overflow: hidden; }
.cart-header { background: #1E1E24; color: #fff; padding: 15px 20px; display: flex; justify-content: space-between; align-items: center; }
.cart-header h5 { margin: 0; font-size: 16px; font-weight: 600; }
.cart-header .badge-cart { background: var(--color-acento); color: #1E1E24; font-weight: bold; border-radius: 50%; width: 25px; height: 25px; display: flex; align-items: center; justify-content: center; font-size: 12px; }

.cart-table-header, .cart-table-row {
    display: grid; grid-template-columns: 1fr 90px 90px 35px !important; align-items: center;
    gap: 15px; padding: 15px 0; border-bottom: 1px solid #f0f0f0;
}
.cart-table-header { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #8b8b9d; font-weight: 700; border-bottom: 2px solid #1E1E24; margin-top: 10px; }
.cart-table-row { animation: slideIn 0.3s ease; }
.cart-table-row:last-child { border-bottom: none; }
.cart-table-row .prod-info h6 { font-size: 14px; margin: 0; font-weight: 600; color: #2d2d2d; }
.cart-table-row .prod-info small { color: #8b8b9d; font-size: 12px; }
.cart-table-row .cart-item-price { font-weight: 700; color: #2d2d2d; font-size: 15px; text-align: right; }
.cart-table-row .remove-item { background: #fff0f0; border: none; color: #dc3545; cursor: pointer; font-size: 16px; width: 35px; height: 35px; border-radius: 8px; transition: 0.2s; display: flex; align-items: center; justify-content: center; }
.cart-table-row .remove-item:hover { background: #dc3545; color: #fff; }

@keyframes slideIn { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }

.qty-control { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.qty-control button { background: #f4f6f9; border: none; width: 25px; height: 25px; border-radius: 5px; cursor: pointer; font-weight: bold; color: #4a4a4a; transition: 0.2s; }
.qty-control button:hover { background: var(--color-acento); }
.qty-control span { font-weight: 600; min-width: 15px; text-align: center; }
.empty-cart { text-align: center; padding: 40px 20px; color: #d1d5db; }
.empty-cart i { font-size: 3rem; margin-bottom: 10px; }

/* FOOTER DEL CARRITO (SELECTS, INPUTS Y BOTON COBRAR) */
.cart-footer { padding: 20px; background: #fafafa; border-top: 1px solid #eee; flex-shrink: 0; }
.cart-footer label { color: #2d2d2d !important; font-weight: 700 !important; text-transform: uppercase; font-size: 11px !important; letter-spacing: 0.5px; margin-bottom: 5px; display: block; }

.form-select-monsides {
    background-color: #fff; border: 1px solid #eaeaea; border-radius: 8px; padding: 10px 15px;
    font-size: 13px; font-weight: 600; color: #2d2d2d; width: 100%; cursor: pointer;
    transition: all 0.3s ease; appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2314141A' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 1rem center; background-size: 16px 12px;
}
.form-select-monsides:focus { outline: none; border-color: var(--color-acento); box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15); }

/* ESTILO UNIFICADO PARA INPUTS DE NÚMERO/TEXTO EN EL CARRITO */
.cart-footer input.form-control,
.input-precio-carta {
    background-color: #fff !important;
    border: 1px solid #eaeaea !important;
    border-radius: 8px !important;
    padding: 10px 15px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    color: #2d2d2d !important;
    width: 100% !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    appearance: none !important;
    -moz-appearance: textfield !important;
}

.input-precio-carta {
    padding: 8px 5px !important;
    text-align: center !important;
    font-size: 14px !important;
    width: 90px !important;
    box-shadow: none !important;
}

.cart-footer input.form-control:focus,
.input-precio-carta:focus {
    outline: none !important;
    border-color: var(--color-acento) !important;
    box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.15) !important;
}

/* Ocultar flechas de input number */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none; margin: 0;
}
input[type=number] { -moz-appearance: textfield; }

/* BOTÓN COBRAR */
.btn-cobrar {
    background: var(--color-acento) !important; color: #14141A !important; border: none;
    width: 100%; padding: 15px; border-radius: 10px; font-weight: 800; font-size: 16px;
    text-transform: uppercase; letter-spacing: 1px; cursor: pointer; transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3); margin-top: 15px;
}
.btn-cobrar:hover { background: #ffca18 !important; transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5); }
.btn-cobrar:disabled { background: #e4e4e7 !important; color: #8b8b9d !important; cursor: not-allowed; transform: none; box-shadow: none; }

/* TICKET 80MM */
.qr-code { width: 90px; height: auto; margin: 5px auto; display: block; -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }
@media (max-width: 992px) {
    .marquee-container {
        display: none; /* Ocultamos la marquesina en móvil para ganar espacio */
    }
    .main-content {
        margin-top: 80px; /* El navbar en móvil es un poco más alto */
    }
    .pos-layout {
        height: calc(100vh - 110px) !important;
    }
}
        .ticket-pdf {
            width: 210mm;
            height: 296mm; /* Altura estricta para no pasar a la 2da hoja */
            background: #1E1E24;
            color: #fff;
            padding: 35px;
            box-sizing: border-box;
            display: flex;
            flex-direction: column;
            overflow: hidden; /* Oculta cualquier desbordamiento */
        }
        
        .header { text-align: center; border-bottom: 3px solid #FFD700; padding-bottom: 20px; margin-bottom: 20px; }
        .header h2 { margin: 0; font-size: 48px; text-transform: uppercase; letter-spacing: 3px; color: #FFD700; }
        .header p { margin: 10px 0 0 0; font-size: 18px; color: #ccc; }
        .header .ticket-num { font-size: 24px; margin-top: 10px; font-weight: bold; color: #fff; }
        
        .info { font-size: 18px; margin-bottom: 20px; color: #ddd; display: flex; justify-content: space-between; }
        .info-left div, .info-right div { margin-bottom: 6px; }
        .info span { font-weight: bold; color: #fff; }
        .info-right { text-align: right; }

        .divider { border-top: 1px dashed #555; margin: 15px 0; }
        
        .table-container { flex-grow: 1; }
        table { width: 100%; border-collapse: collapse; font-size: 16px; }
        th { text-align: left; border-bottom: 3px solid #FFD700; padding: 12px 0; color: #FFD700; font-size: 14px; text-transform: uppercase; }
        td { padding: 12px 0; border-bottom: 1px solid #333; color: #ddd; vertical-align: top; }
        .text-right { text-align: right; }
        
        .totals { margin-top: 20px; font-size: 18px; width: 300px; margin-left: auto; }
        .totals div { display: flex; justify-content: space-between; margin-bottom: 8px; color: #ccc; }
        .grand-total { font-size: 32px; font-weight: bold; color: #14141A; background: #FFD700; padding: 20px; border-radius: 8px; margin-top: 10px; }
        .grand-total div { display: flex; justify-content: space-between; color: #14141A !important; margin: 0 !important; }
        
        .footer { text-align: center; margin-top: auto; border-top: 1px dashed #555; padding-top: 25px; }
        .footer .qr { width: 120px; margin: 0 auto 15px; display: block; }
        .footer .thanks { color: #FFD700; font-weight: bold; font-size: 22px; display: block; margin-bottom: 8px; }
        .footer p { margin: 0; font-size: 16px; color: #ccc; }