/* --- Extracted from 06_9_PANTALLA_DE_CARGA_LOGO_BRAND.css --- */
/* --- 9. PANTALLA DE CARGA (LOGO BRAND) --- */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100dvh;
    /* Use dynamic viewport height for mobile stability */
    background: #ffffff;
    z-index: 100000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.5s ease;
}

.loader-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 30px;
}

.loader-logo {
    width: 200px;
    height: auto;
    filter: none;
    /* Removed shadow artifact */
    animation: loader-logo-pulse 2s infinite ease-in-out;
    background: white;
    /* Force white background to prevent transparency */
    padding: 10px;
    /* Add some padding if background is added */
    border-radius: 12px;
    /* Smooth corners */
}

.loader-dots {
    display: flex;
    gap: 8px;
}

.loader-dots span {
    width: 10px;
    height: 10px;
    background: var(--primary, #D31628) !important;
    border-radius: 50%;
    animation: loader-dots-bounce 1.4s infinite ease-in-out both;
}

.loader-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loader-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes loader-logo-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

@keyframes loader-dots-bounce {

    0%,
    80%,
    100% {
        transform: scale(0);
    }

    40% {
        transform: scale(1.0);
    }
}

/* FIX: Dashboard Header Alignment */
.header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    flex-wrap: wrap;
    gap: 15px;
}

.loader-bar {
    width: 150px;
    height: 4px;
    background: #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    margin-top: 10px;
    opacity: 0;

    animation: fade-up 0.5s ease forwards 0.5s;
}

.loader-progress {
    width: 30%;
    height: 100%;
    background: var(--primary);
    border-radius: 10px;
    animation: progress-slide 1.5s infinite ease-in-out;
}

/* Animations */
@keyframes pulse-brand {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }

    100% {
        transform: scale(1);
    }
}

@keyframes bounce-in {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    60% {
        transform: scale(1.1);
        opacity: 1;
    }

    100% {
        transform: scale(1);
    }
}

@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes progress-slide {
    0% {
        transform: translateX(-100%);
    }

    50% {
        transform: translateX(100%);
        width: 50%;
    }

    100% {
        transform: translateX(200%);
    }
}

/* MEDIA QUERIES ORIGINALES + ADAPTACIONES PARA MODAL */
@media (max-width: 1024px) {
    .purchase-grid-inputs {
        grid-template-columns: repeat(2, 1fr);
    }

    .purchase-image-area,
    .btn-add-grid {
        grid-column: 1 / -1;
    }
}

@media (max-width: 768px) {
    .main-header {
        margin: 8px 10px 0 10px;
        top: 8px;
        min-height: 70px;
        border-radius: 15px;
        padding-top: 0;
        /* env handled by safe area below if needed */
    }

    /* Header Mobile Optimization */
    .logo span {
        display: none;
        /* Hide PRO */
    }

    .logo {
        font-size: 1.2rem;
        /* Smaller Logo */
        gap: 8px;
    }

    /* Compact Nav Buttons (Icon Only) */
    .nav-links .btn {
        font-size: 0 !important;
        /* Hide Text */
        padding: 8px 10px;
        /* Smaller Touch Target */
        gap: 0;
    }

    .nav-links .btn i {
        font-size: 1.3rem !important;
        /* Restore Icon Size */
        margin: 0;
    }

    .nav-links {
        gap: 5px;
        /* Tighter spacing */
    }

    /* Ensure Cart Badge is visible */
    #cart-count {
        font-size: 0.7rem;
        top: -5px;
        right: -5px;
        width: 16px;
        height: 16px;
        line-height: 16px;
    }

    .search-container {
        display: flex !important;
        flex-direction: column !important;
        gap: 10px !important;
        background: transparent !important;
        border: none !important;
        padding: 0 !important;
        box-shadow: none !important;
        margin: 5px 0 10px 0 !important;
        width: 100% !important;
    }

    .search-container .control-search {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
    }

    .search-container .search-divider,
    .search-container .view-toggle-wrapper,
    .search-container .search-filter-btn {
        display: none !important;
    }

    /* Harmonic Spacing Fixes */
    .bcv-rate-container {
        margin-bottom: 2px !important;
        margin-left: 2px !important;
        margin-top: 0 !important;
    }

    .stories-rail {
        margin-bottom: 2px !important;
        padding-bottom: 1px !important;
    }

    .grid {
        gap: 12px !important;
    }

    .purchase-grid-inputs {
        grid-template-columns: 1fr;
    }

    .purchase-image-area,
    .btn-add-grid {
        grid-column: 1 / -1;
    }

    /* Adaptación móvil para header de facturas */
    .invoice-header {
        flex-direction: column;
        gap: 15px;
    }

    .invoice-meta {
        text-align: left;
    }
}

/* =========================================
   NUEVOS ESTILOS PARA TARJETAS DE PRODUCTO 
   (Incluye botones de cantidad y precios detallados)
   ========================================= */

/* Contenedor de Precios */
.price-container {
    margin-bottom: 10px;
}

.price-admin-row {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    padding: 5px;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
}

.price-tag-small {
    font-size: 0.85rem;
    color: var(--text-light);
    display: flex;
    justify-content: space-between;
}

.price-tag-small strong {
    color: var(--text-main);
}

.price-client-main {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

/* Control de Cantidad y Botón */
.action-row {
    display: flex;
    gap: 8px;
    margin-top: auto;
    /* Empuja al fondo */
}

.qty-input {
    width: 60px;
    padding: 5px;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-weight: 700;
    font-size: 1rem;
}

.btn-add-cart {
    flex-grow: 1;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 88px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
}

.btn-add-cart:hover {
    background: var(--primary-dark);
}

.btn-add-cart:disabled {
    background: #cbd5e1;
    cursor: not-allowed;
}

/* Etiquetas de Estado */
.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-top: 5px;
}

.status-ok {
    background: #dcfce7;
    color: #166534;
}

.status-low {
    background: #fef9c3;
    color: #854d0e;
}

.status-no {
    background: #fee2e2;
    color: #991b1b;
}

.status-info {
    background: #dbeafe;
    color: #1e40af;
}

.status-purple {
    background: #f3e8ff;
    color: #6b21a8;
}



/* --- Extracted from 14_SKELETON_LOADING.css --- */
/* === SKELETON LOADING === */
.skeleton {
    background-color: #e2e8f0;
    background-image: linear-gradient(90deg, #e2e8f0 0px, #f1f5f9 40px, #e2e8f0 80px);
    background-size: 300px;
    animation: skeleton-shimmer 1.5s infinite linear;
    border-radius: 4px;
    color: transparent !important;
}

@keyframes skeleton-shimmer {
    0% {
        background-position: -100px;
    }

    40%,
    100% {
        background-position: 200px;
    }
}

.skeleton-row td {
    padding: 15px;
}

.skeleton-text {
    display: inline-block;
    height: 14px;
    width: 80%;
    background: #e2e8f0;
    border-radius: 4px;
}

.skeleton-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e2e8f0;
}

/* Media queries para modo oscuro y responsive */
@media (max-width: 480px) {
    .swal-glass-container {
        padding: 1.5rem !important;
    }
}



/* --- Extracted from 15_SKELETON_LOADER_Modern_UX.css --- */
/* =========================================
   SKELETON LOADER (Modern UX)
   ========================================= */
.skeleton-box,
.skeleton-text,
.skeleton-circle {
    background: #e2e8f0;
    background: linear-gradient(90deg, #e2e8f0 25%, #f1f5f9 50%, #e2e8f0 75%);
    background-size: 400% 100%;
    animation: shimmer 1.5s infinite linear;
    border-radius: 4px;
}

[data-theme="dark"] .skeleton-box,
[data-theme="dark"] .skeleton-text,
[data-theme="dark"] .skeleton-circle {
    background: #334155;
    background: linear-gradient(90deg, #334155 25%, #475569 50%, #334155 75%);
    background-size: 400% 100%;
}

.skeleton-box {
    width: 100%;
    height: 100%;
    border-radius: 12px;
}

.skeleton-text {
    height: 14px;
    width: 100%;
    margin-bottom: 8px;
    border-radius: 6px;
}

.skeleton-circle {
    border-radius: 50%;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

.skeleton-generic-layout {
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    width: 100%;
}

.skeleton-dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

/* Mobile Drawer Responsive */
@media (max-width: 480px) {
    .params-drawer {
        width: 90%;
    }
}



