/* =====================================================================
   Tienda POS - Estilos
   ===================================================================== */

:root {
    --brand:        #0d6efd;
    --brand-dark:   #0a4fc4;
    --navbar-bg:    #1f2937;
    --pos-gap:      .75rem;
}

body {
    background: #f4f5f7;
}

/* ---- Barra de navegación ------------------------------------------- */
.app-navbar {
    background: var(--navbar-bg);
}
.app-navbar .nav-link.active {
    font-weight: 600;
    color: #fff !important;
    border-bottom: 2px solid var(--brand);
}

/* ---- Login ---------------------------------------------------------- */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f2937, #0d6efd);
    padding: 1rem;
}
.login-card {
    width: 100%;
    max-width: 400px;
    border: 0;
    border-radius: .75rem;
}

/* ---- Tarjetas de estadística --------------------------------------- */
.stat-card .stat-label {
    color: #6b7280;
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.stat-card .stat-value {
    font-size: 1.6rem;
    font-weight: 700;
}

/* ---- Pantalla POS --------------------------------------------------- */
.pos-wrap {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}
.pos-products {
    flex: 1 1 60%;
    min-width: 0;
}
.pos-cart {
    flex: 0 0 340px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: .75rem;
    padding: 1rem;
    position: sticky;
    top: 80px;
}

.pos-cat-title {
    font-size: .9rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: #6b7280;
    margin: 1rem 0 .5rem;
}
.pos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: var(--pos-gap);
}

/* Botones grandes de producto, pensados para tocar con el dedo */
.pos-product {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 92px;
    padding: .75rem;
    border: 1px solid #d1d5db;
    border-radius: .6rem;
    background: #fff;
    text-align: left;
    cursor: pointer;
    transition: transform .05s ease, box-shadow .1s ease;
}
.pos-product:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
}
.pos-product:active {
    transform: scale(.97);
    background: #eef4ff;
}
.pos-product-name {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.2;
}
.pos-product-price {
    margin-top: .4rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--brand);
}

/* Carrito */
.pos-cart-items {
    max-height: 38vh;
    overflow-y: auto;
    margin-bottom: .75rem;
}
.cart-row {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .5rem 0;
    border-bottom: 1px solid #eee;
}
.cart-row-info { flex: 1 1 auto; min-width: 0; }
.cart-row-name { font-weight: 600; font-size: .95rem; }
.cart-row-price { color: #6b7280; font-size: .85rem; }
.cart-qty-btn {
    width: 34px; height: 34px;
    border: 1px solid #d1d5db;
    background: #f9fafb;
    border-radius: .4rem;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
}
.cart-qty-val { min-width: 28px; text-align: center; font-weight: 600; }
.cart-row-subtotal { width: 78px; text-align: right; font-weight: 600; }
.cart-row-remove {
    border: 0; background: none; color: #dc3545;
    font-size: 1.2rem; cursor: pointer; padding: 0 .25rem;
}

.pos-total-box,
.pos-change-box {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: .6rem .25rem;
}
.pos-total-box {
    border-top: 2px solid #e5e7eb;
    font-size: 1.05rem;
}
.pos-total-box span:last-child {
    font-size: 1.9rem;
    font-weight: 800;
    color: #111;
}
.pos-change-box span:last-child {
    font-size: 1.3rem;
    font-weight: 700;
    color: #198754;
}

/* Reintegros */
.reimb-thumb {
    width: 54px; height: 54px;
    object-fit: cover;
    border-radius: .35rem;
    border: 1px solid #ddd;
}

/* Tabla de cierre */
.closing-table td { padding: .65rem .75rem; }

/* ---- Adaptación a tablet / pantallas pequeñas ---------------------- */
@media (max-width: 991px) {
    .pos-wrap { flex-direction: column; }
    .pos-cart {
        flex-basis: auto;
        width: 100%;
        position: static;
    }
    .pos-cart-items { max-height: none; }
}

@media (max-width: 575px) {
    .pos-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
}
