body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    height: 100vh;
    overflow: hidden;
    touch-action: manipulation;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: linear-gradient(145deg, #ffffff 0%, #f8f9fa 100%);
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.37);
    border-radius: 16px;
    padding: 20px;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

@media (max-width: 768px) {
    .container {
        margin: 0;
        padding: 10px;
        border-radius: 0;
        box-shadow: none;
        height: 100vh;
    }
}

.welcome-message {
    text-align: center;
    color: #2c5530;
    margin-bottom: 16px;
    flex-shrink: 0;
    padding: 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
    position: relative;
}

.welcome-message h1 {
    margin: 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 1.2rem;
}

@media (max-width: 768px) {
    .welcome-message h1 {
        font-size: 1.1rem;
    }
}

.table-container {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

.filters-container {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
    padding: 10px;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    box-shadow: 0 4px 15px rgba(168, 237, 234, 0.3);
}

.filter-group {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.filter-group label {
    font-weight: bold;
    color: #2c3e50;
    margin-bottom: 5px;
    font-size: 13px;
}

.filter-group select {
    padding: 8px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #495057;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.filter-group select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .filters-container {
        flex-direction: column;
        gap: 6px;
        padding: 10px;
    }

    .filter-group {
        margin-bottom: 0;
    }

    .filter-group label {
        margin-bottom: 2px;
    }

    /* Ocultar elementos individuales en móvil */
    .total-products-group,
    .clear-filters-group {
        display: none;
    }

    /* Mostrar contenedor combinado en móvil */
    .products-and-clear-container {
        display: flex !important;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        margin-top: 6px;
        padding: 8px 12px;
        background: linear-gradient(135deg, #f0f8f0 0%, #ffe8e8 100%);
        border-radius: 8px;
        border: 1px solid rgba(139, 195, 74, 0.3);
    }
}

/* Ocultar contenedor combinado en desktop */
.products-and-clear-container {
    display: none;
}

/* Layout específico para pantallas de escritorio grandes (>1000px) */
@media (min-width: 768px) {
    .filters-container {
        flex-wrap: wrap;
        gap: 16px;
        padding: 12px;
    }

    /* Primera fila: Buscar producto, Filtrar por Grupo, Filtrar por Categoría */
    .filter-group:nth-child(1),
    .filter-group:nth-child(2),
    .filter-group:nth-child(3) {
        flex: 1 1 calc(33.333% - 11px);
        min-width: 200px;
    }

    /* Segunda fila: Estado de compra, Total de productos, Limpiar filtros */
    .filter-group:nth-child(4),
    .total-products-group,
    .clear-filters-group {
        flex: 1 1 calc(33.333% - 11px);
        min-width: 180px;
        margin-top: 8px;
    }

    /* El estado de compra mantiene su estructura vertical */
    .filter-group:nth-child(4) {
        justify-content: flex-start;
    }

    /* El contador y botón se ajustan a la altura del estado de compra */
    .total-products-group,
    .clear-filters-group {
        align-items: flex-end;
    }

    .total-products-display,
    .clear-filters-button {
        height: fit-content;
    }
}

/* Responsive mejorado para pantallas medianas y escritorio */
@media (max-width: 1000px) and (min-width: 769px) {
    .filters-container {
        gap: 12px;
        padding: 8px;
    }

    .filter-group label {
        font-size: 12px;
        margin-bottom: 3px;
    }

    .filter-group select {
        font-size: 12px;
        padding: 6px 8px;
    }

    .total-products-text,
    .clear-filters-text {
        font-size: 11px;
    }

    .total-products-display,
    .clear-filters-button {
        padding: 6px 8px;
    }
}

@media (max-width: 768px) and (min-width: 601px) {
    .filters-container {
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px;
    }

    /* Los 4 filtros principales en 2 filas */
    .filter-group:nth-child(1),
    .filter-group:nth-child(2) {
        flex: 1 1 calc(50% - 4px);
        min-width: 160px;
    }

    .filter-group:nth-child(3),
    .filter-group:nth-child(4) {
        flex: 1 1 calc(50% - 4px);
        min-width: 160px;
    }

    /* Contador y botón en línea separada */
    .total-products-group,
    .clear-filters-group {
        flex: 0 0 auto;
        margin-top: 4px;
    }

    .filter-group label {
        font-size: 12px;
        margin-bottom: 2px;
    }

    .filter-group select {
        font-size: 12px;
        padding: 6px 8px;
    }

    .total-products-display,
    .clear-filters-button {
        padding: 6px 8px;
    }

    .total-products-text,
    .clear-filters-text {
        font-size: 11px;
    }
}

.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-container input {
    padding: 8px 36px 8px 12px;
    border: 2px solid #e0e6ed;
    border-radius: 8px;
    background: linear-gradient(145deg, #ffffff, #f0f0f0);
    color: #495057;
    font-size: 13px;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.search-input-container input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

.search-input-container input::placeholder {
    color: #adb5bd;
    font-style: italic;
}

#clearSearch {
    position: absolute;
    right: 6px;
    background: none;
    border: none;
    color: #6c757d;
    font-size: 14px;
    cursor: pointer;
    padding: 3px;
    border-radius: 4px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
}

#clearSearch:hover {
    background-color: #f8f9fa;
    color: #495057;
    transform: scale(1.1);
}

#clearSearch:active {
    transform: scale(0.95);
}

.items-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
    overflow-y: auto;
    padding-right: 8px;
    padding-bottom: 100px;
    /* Propiedades específicas para iOS */
    -webkit-overflow-scrolling: touch;
    overflow-scrolling: touch;
    transform: translateZ(0); /* Fuerza aceleración por hardware */
    will-change: scroll-position;
}

.items-container::-webkit-scrollbar {
    width: 8px;
}

.items-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.items-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.items-container::-webkit-scrollbar-thumb:hover {
    background: #a1a1a1;
}

.item-card {
    display: flex;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    padding: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease, transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    position: relative;
    overflow: hidden;
}

.item-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-card:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    border-color: rgba(102, 126, 234, 0.3);
}

.item-card:hover::before {
    opacity: 1;
}

.item-card.moving {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    z-index: 10;
}

.item-card.entering {
    animation: slideInFromSide 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    opacity: 0;
    transform: translateX(-50px);
}

@keyframes slideInFromSide {
    0% {
        opacity: 0;
        transform: translateX(-50px) scale(0.95);
    }

    50% {
        opacity: 0.5;
        transform: translateX(-10px) scale(0.98);
    }

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

.card-left {
    display: flex;
    align-items: flex-start;
    padding-right: 12px;
    margin-top: 1px;
}

.purchase-checkbox {
    width: 18px;
    height: 18px;
    cursor: pointer;
    margin: 0;
    accent-color: #667eea;
    border-radius: 4px;
}

.card-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.card-line {
    display: flex;
    align-items: center;
    gap: 12px;
}

.line-1 {
    justify-content: space-between;
}

.producto {
    font-weight: 600;
    font-size: 14px;
    color: #2c5530;
    flex: 1;
}

.cantidad-unidad {
    font-weight: 600;
    color: #ffffff;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 4px 10px;
    border-radius: 16px;
    font-size: 11px;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}

.line-2 {
    font-size: 12px;
}

.categoria {
    color: #6c757d;
    background-color: #e9ecef;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    border: 1px solid transparent;
    font-weight: 500;
}

.grupo {
    color: #6c757d;
    background-color: #e9ecef;
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 10px;
    border: 1px solid transparent;
    font-weight: 500;
}

.line-3 {
    margin-top: 4px;
}

.notas {
    font-style: italic;
    color: #8b4513;
    font-size: 11px;
    background: linear-gradient(135deg, #fff9c4 0%, #ffeaa7 100%);
    padding: 4px 8px;
    border-radius: 5px;
    border-left: 3px solid #fdcb6e;
    box-shadow: 0 2px 8px rgba(253, 203, 110, 0.2);
}

.item-card.purchased {
    opacity: 0.7;
    background: linear-gradient(145deg, #f8f9fa, #e9ecef);
    transform: scale(0.98);
}

.item-card.purchased .card-right {
    text-decoration: line-through;
}

.item-card.purchased:hover {
    background: linear-gradient(145deg, #e9ecef, #dee2e6);
    transform: scale(0.98);
}

.no-results {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(252, 182, 159, 0.2);
}

.no-results-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.6;
}

.no-results-message {
    font-size: 18px;
    font-weight: 600;
    color: #495057;
    margin-bottom: 8px;
}

.no-results-suggestion {
    font-size: 14px;
    color: #6c757d;
    font-style: italic;
}

@media (max-width: 768px) {
    .item-card {
        padding: 10px;
    }

    .card-left {
        padding-right: 10px;
    }

    .purchase-checkbox {
        width: 16px;
        height: 16px;
    }

    .producto {
        font-size: 13px;
    }

    .cantidad-unidad {
        font-size: 10px;
    }

    .line-2 {
        font-size: 11px;
    }

    .categoria,
    .grupo {
        font-size: 9px;
    }

    .notas {
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .line-1 {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
    }

    .cantidad-unidad {
        flex-shrink: 0;
    }
}

.loading {
    text-align: center;
    padding: 20px;
    color: #667eea;
    font-style: italic;
    font-weight: 500;
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(168, 237, 234, 0.2);
}

.error {
    color: #dc3545;
    background: linear-gradient(135deg, #ffb3ba 0%, #ffdfdf 100%);
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.2);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
}

.error-message {
    font-weight: 500;
}

.retry-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    margin-top: 10px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.retry-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

.help-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.help-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.help-icon {
    color: white;
    font-size: 18px;
    font-weight: bold;
}

.help-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.help-modal-content {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.2);
    display: flex;
    flex-direction: column;
}

.help-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    flex-shrink: 0;
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px 16px 0 0;
}

.help-modal-header h3 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.3rem;
}

.close-help {
    background: none;
    border: none;
    font-size: 28px;
    color: #6c757d;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-help:hover {
    background: #f8f9fa;
    color: #495057;
}

.help-modal-body {
    padding: 24px;
    overflow-y: auto;
    flex: 1;
}

.help-section {
    margin-bottom: 24px;
}

.help-section h4 {
    color: #2c3e50;
    font-size: 1.1rem;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #e9ecef;
}

.help-section ul {
    margin: 0;
    padding-left: 20px;
}

.help-section li {
    margin-bottom: 8px;
    line-height: 1.5;
    color: #495057;
}

.help-categoria {
    background: linear-gradient(135deg, #e3f2fd, #f3e5f5);
    color: #1565c0;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 0.9em;
}

.help-grupo {
    background: linear-gradient(135deg, #ffebee, #e8eaf6);
    color: #c62828;
    padding: 2px 6px;
    border-radius: 3px;
    font-weight: 500;
    font-size: 0.9em;
}

@media (max-width: 768px) {
    .help-modal {
        padding: 0;
    }

    .help-modal-content {
        max-height: 90vh;
    }

    .help-modal-header {
        padding: 16px 20px;
    }

    .help-modal-body {
        padding: 20px;
    }

    .help-section h4 {
        font-size: 1rem;
    }

    .help-button {
        width: 28px;
        height: 28px;
        top: 10px;
        right: 10px;
    }

    .help-icon {
        font-size: 16px;
    }
}

.radio-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    font-size: 12px;
    color: #495057;
    transition: all 0.2s ease;
    padding: 2px 4px;
    border-radius: 4px;
}

.radio-label:hover {
    background-color: rgba(102, 126, 234, 0.1);
    color: #667eea;
}

.radio-label input[type="radio"] {
    margin: 0;
    cursor: pointer;
    accent-color: #667eea;
}

.radio-label span {
    font-weight: 500;
}

@media (max-width: 600px) {
    .radio-group {
        gap: 6px;
    }

    .radio-label {
        font-size: 11px;
    }
}

/* Estilos para el contador de total de productos */
.total-products-group {
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
}

.total-products-display {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #e8f5e8 0%, #f1f8e9 100%);
    padding: 8px 12px;
    border-radius: 8px;
    border: 2px solid #8bc34a;
    box-shadow: 0 2px 8px rgba(139, 195, 74, 0.3);
    transition: all 0.3s ease;
}

.total-products-display:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 195, 74, 0.4);
}

.total-products-icon {
    font-size: 16px;
}

.total-products-text {
    font-weight: 600;
    color: #2e7d32;
    font-size: 12px;
    white-space: nowrap;
}

.total-products-count {
    font-weight: 700;
    color: #1b5e20;
    font-size: 14px;
    background: #ffffff;
    padding: 2px 8px;
    border-radius: 12px;
    min-width: 24px;
    text-align: center;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

@media (max-width: 600px) {
    .total-products-group {
        align-self: center;
        margin-top: 6px;
    }

    .total-products-display {
        padding: 6px 10px;
    }

    .total-products-icon {
        font-size: 14px;
    }

    .total-products-text {
        font-size: 11px;
    }

    .total-products-count {
        font-size: 12px;
        padding: 1px 6px;
    }
}

/* Estilos para el botón de limpiar filtros */
.clear-filters-group {
    flex: 0 0 auto;
    justify-content: center;
    align-items: center;
}

.clear-filters-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
    white-space: nowrap;
}

.clear-filters-button:hover {
    background: linear-gradient(135deg, #ee5a24 0%, #c44569 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 107, 107, 0.4);
}

.clear-filters-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.clear-filters-icon {
    font-size: 14px;
}

.clear-filters-text {
    font-size: 12px;
    font-weight: 600;
}

@media (max-width: 600px) {
    .clear-filters-group {
        align-self: center;
        margin-top: 6px;
    }

    .clear-filters-button {
        padding: 6px 10px;
    }

    .clear-filters-icon {
        font-size: 12px;
    }

    .clear-filters-text {
        font-size: 11px;
    }
}

/* Sección de peligro en la modal de ayuda */
.danger-section {
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    border: 2px solid #ffcdd2;
    border-radius: 12px;
    padding: 20px;
    margin-top: 20px;
    border-left: 5px solid #f44336;
}

.danger-section h4 {
    color: #d32f2f !important;
    margin-bottom: 12px;
    border-bottom: 2px solid #ffcdd2 !important;
}

.danger-section ul {
    color: #c62828;
    margin: 0 0 20px 0;
    padding-left: 20px;
}

.danger-section li {
    color: #c62828 !important;
    margin-bottom: 6px;
}

.reset-button {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
    display: flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
    width: 100%;
}

.reset-button:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.5);
}

.reset-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 10px rgba(244, 67, 54, 0.3);
}

/* Modal de confirmación */
.confirmation-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    z-index: 1001;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.confirmation-modal-content {
    background: linear-gradient(145deg, #ffffff, #f8f9fa);
    border-radius: 16px;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
    max-width: 450px;
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.2);
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(-20px);
    }

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

.confirmation-modal-header {
    padding: 24px 24px 16px 24px;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.confirmation-modal-header .warning-icon {
    font-size: 48px;
    color: #f44336;
    margin-bottom: 12px;
    display: block;
}

.confirmation-modal-header h3 {
    margin: 0;
    color: #d32f2f;
    font-size: 1.4rem;
    font-weight: 700;
}

.confirmation-modal-body {
    padding: 20px 24px;
    text-align: center;
}

.confirmation-modal-body p {
    margin: 0 0 16px 0;
    color: #495057;
    line-height: 1.6;
    font-size: 16px;
}

.confirmation-modal-body .warning-text {
    color: #d32f2f;
    font-weight: 600;
    background: linear-gradient(135deg, #ffebee 0%, #fce4ec 100%);
    padding: 12px;
    border-radius: 8px;
    border-left: 4px solid #f44336;
    margin-bottom: 20px;
}

.confirmation-modal-footer {
    display: flex;
    gap: 12px;
    padding: 16px 24px 24px 24px;
    justify-content: center;
}

.confirm-button {
    background: linear-gradient(135deg, #f44336 0%, #d32f2f 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.4);
    flex: 1;
    max-width: 140px;
}

.confirm-button:hover {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(244, 67, 54, 0.5);
}

.cancel-button {
    background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.4);
    flex: 1;
    max-width: 140px;
}

.cancel-button:hover {
    background: linear-gradient(135deg, #495057 0%, #343a40 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.5);
}

@media (max-width: 768px) {
    .confirmation-modal {
        padding: 10px;
    }

    .confirmation-modal-content {
        max-width: 100%;
    }

    .confirmation-modal-footer {
        flex-direction: column;
    }

    .confirm-button,
    .cancel-button {
        max-width: none;
    }
}

/* Pull to refresh styles */
.pull-to-refresh-indicator {
    position: fixed;
    top: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(-80px);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 25px;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    z-index: 1000;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.pull-to-refresh-indicator.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.pull-to-refresh-indicator.refreshing {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.pull-to-refresh-indicator.refreshing .pull-refresh-icon {
    animation: spin 1s linear infinite;
}

.pull-refresh-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.pull-refresh-text {
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Adjust container for pull to refresh */
.container {
    position: relative;
    overflow: hidden;
}

/* Ensure smooth scrolling for pull to refresh */
.items-container {
    overscroll-behavior: none;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 768px) {
    .pull-to-refresh-indicator {
        font-size: 13px;
        padding: 10px 16px;
        top: 60px;
    }

    .pull-refresh-icon {
        font-size: 14px;
        width: 18px;
        height: 18px;
    }
}

/* Estilos para el botón de toggle de filtros y resumen */
.toggle-filters-section {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    flex-wrap: wrap;
    gap: 12px;
}

.toggle-filters-button {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    text-decoration: none;
    user-select: none;
    flex: 0 0 auto;
    white-space: nowrap;
}

.toggle-filters-button:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.toggle-icon {
    font-size: 14px;
}

.toggle-text {
    font-size: 12px;
    font-weight: 600;
}

/* Contenedor de filtros - ahora siempre visible por defecto */
.filters-content {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .filters-content {
        flex-direction: column;
        gap: 6px;
    }

    .toggle-filters-button {
        font-size: 11px;
        padding: 6px 12px;
    }
    
    .toggle-icon {
        font-size: 12px;
    }
    
    .toggle-text {
        font-size: 11px;
    }
}

/* Layout específico para pantallas de escritorio grandes (>1000px) */
@media (min-width: 768px) {
    .filters-content {
        flex-wrap: wrap;
        gap: 16px;
    }

    /* Primera fila: Buscar producto, Filtrar por Grupo, Filtrar por Categoría */
    .filters-content .filter-group:nth-child(1),
    .filters-content .filter-group:nth-child(2),
    .filters-content .filter-group:nth-child(3) {
        flex: 1 1 calc(33.333% - 11px);
        min-width: 200px;
    }

    /* Segunda fila: Estado de compra, Total de productos, Limpiar filtros */
    .filters-content .filter-group:nth-child(4),
    .filters-content .total-products-group,
    .filters-content .clear-filters-group {
        flex: 1 1 calc(33.333% - 11px);
        min-width: 180px;
        margin-top: 8px;
    }

    /* El estado de compra mantiene su estructura vertical */
    .filters-content .filter-group:nth-child(4) {
        justify-content: flex-start;
    }

    /* El contador y botón se ajustan a la altura del estado de compra */
    .filters-content .total-products-group,
    .filters-content .clear-filters-group {
        align-items: flex-end;
    }
}

/* Responsive mejorado para pantallas medianas y escritorio */
@media (max-width: 1000px) and (min-width: 769px) {
    .filters-content {
        gap: 12px;
    }
}

@media (max-width: 768px) and (min-width: 601px) {
    .filters-content {
        flex-wrap: wrap;
        gap: 8px;
    }

    /* Los 4 filtros principales en 2 filas */
    .filters-content .filter-group:nth-child(1),
    .filters-content .filter-group:nth-child(2) {
        flex: 1 1 calc(50% - 4px);
        min-width: 160px;
    }

    .filters-content .filter-group:nth-child(3),
    .filters-content .filter-group:nth-child(4) {
        flex: 1 1 calc(50% - 4px);
        min-width: 160px;
    }

    /* Contador y botón en línea separada */
    .filters-content .total-products-group,
    .filters-content .clear-filters-group {
        flex: 0 0 auto;
        margin-top: 4px;
    }
}

.active-filters-summary {
    display: none;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    flex: 1;
}

.filter-tag {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 4px;
}

.filter-tag.search {
    background: linear-gradient(135deg, #fd7e14 0%, #e63946 100%);
    box-shadow: 0 2px 4px rgba(253, 126, 20, 0.3);
}

.filter-tag.group {
    background: linear-gradient(135deg, #6f42c1 0%, #d63384 100%);
    box-shadow: 0 2px 4px rgba(111, 66, 193, 0.3);
}

.filter-tag.category {
    background: linear-gradient(135deg, #0dcaf0 0%, #0d6efd 100%);
    box-shadow: 0 2px 4px rgba(13, 202, 240, 0.3);
}

.filter-tag.status {
    background: linear-gradient(135deg, #198754 0%, #20c997 100%);
    box-shadow: 0 2px 4px rgba(25, 135, 84, 0.3);
}

.filter-tag-icon {
    font-size: 8px;
}

.filter-tag-text {
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
}

@media (max-width: 600px) {
    .active-filters-summary {
        gap: 4px;
    }
    
    .filter-tag {
        font-size: 9px;
        padding: 3px 6px;
    }
    
    .filter-tag-text {
        max-width: 60px;
    }
}

/* ELIMINAR ESTILOS ANTIGUOS DE SCROLL AUTOMÁTICO */
/* Se mantienen algunos para compatibilidad pero sin funcionalidad */

/* Estilos para ocultar filtros durante scroll - DESHABILITADO */
.filters-container.collapsed {
    /* Sin funcionalidad - ahora se controla manualmente */
}

.filters-container.collapsed .hideable-filter {
    /* Sin funcionalidad - ahora se controla manualmente */
}

.show-filters-link {
    /* ELIMINADO - ya no se usa este estilo antiguo */
    display: none !important;
}

.filters-container.collapsed .show-filters-link {
    /* ELIMINADO - ya no se usa este estilo antiguo */
    display: none !important;
}

.filters-container.collapsed .active-filters-summary {
    /* ELIMINADO - ahora se controla con el nuevo sistema */
    display: none !important;
}