/* ===== BASE COMÚN: navbar fijo arriba + contenido que llena el resto de la pantalla ===== */
html, body.app-body {
    height: 100vh;
    margin: 0;
    padding: 0;
}

body.app-body {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background-color: #f4f6f9;
}

.app-navbar {
    background-color: #1f2937;
}

.app-logo {
    height: 34px;
    width: auto;
}

.app-navbar .nav-link.active {
    color: #fff;
    font-weight: 600;
    box-shadow: inset 0 -2px 0 #0d6efd;
}

.page-header {
    background-color: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #e3e6f0;
    flex-shrink: 0;
}

.app-main {
    flex-grow: 1;
    overflow-y: auto;
}

/* ===== TIENDA NUBE (inyección de imágenes) ===== */
.workspace-card {
    height: calc(100vh - 320px);
    min-height: 400px;
    display: flex;
    flex-direction: column;
}

.workspace-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 1.25rem;
}

.image-item {
    border: 1px solid #dee2e6;
    padding: .75rem;
    border-radius: .375rem;
    background-color: #fff;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    position: relative;
    text-align: center;
}

.image-item:hover {
    border-color: #0d6efd;
    box-shadow: 0 0 8px rgba(13, 110, 253, 0.25);
}

.image-item.selected {
    border: 3px solid #198754 !important;
    box-shadow: 0 0 10px rgba(25, 135, 84, 0.4);
    background-color: #f8fff9;
}

.image-item img.thumbnail {
    max-height: 140px;
    object-fit: contain;
    width: 100%;
    margin-bottom: 8px;
}

.image-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1060;
}

/* ===== EXTERNOS (consulta de catálogo) ===== */
.product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background-color: #fff;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.product-image {
    width: 100%;
    height: 150px;
    object-fit: contain;
    border-bottom: 1px solid #eee;
    margin-bottom: 10px;
}

.product-details {
    margin-top: 5px;
    text-align: center;
}

.product-code {
    font-size: 0.8rem;
}

.product-article {
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.2;
    height: 38px;
    overflow: hidden;
    text-align: center;
}

.price-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.original-price {
    font-size: 0.9rem;
    color: #888;
    text-decoration: line-through;
}

.offer-price {
    font-size: 1.5rem;
    font-weight: bold;
    color: #dc3545;
}

.badge-container {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 10px;
    right: 10px;
    gap: 5px;
}

.badge-oferta, .badge-diferencia {
    font-size: 0.75rem;
}

.modal-price-container {
    display: flex;
    flex-direction: column;
}

.modal-price-original {
    font-size: 1.2rem;
    color: #888;
    text-decoration: line-through;
}

.modal-price-oferta {
    font-size: 2rem;
    font-weight: bold;
    color: #dc3545;
}

/* ===== REPORTES (ventas y stock) ===== */
.table-wrap {
    max-height: calc(100vh - 430px);
    min-height: 300px;
    overflow: auto;
}

.table-wrap thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background-color: #fff;
    color: #6c757d;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}

.table-wrap td {
    white-space: nowrap;
}