/* Estilos adicionales para mejorar la experiencia móvil */
* {
    -webkit-tap-highlight-color: transparent;
}

input, select, textarea, button {
    font-size: 16px;
}

@media (max-width: 600px) {
    .container {
        padding: 15px;
    }
    
    .stats-grid {
        gap: 10px;
    }
    
    .btn {
        padding: 12px 20px;
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.3s ease-out;
}

::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: #4F46E5;
    border-radius: 5px;
}

/* Estilos para paginación y búsqueda */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.pagination a {
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 8px;
    background: #e5e7eb;
    color: #374151;
    transition: all 0.2s;
}

.pagination a:hover {
    background: #4F46E5;
    color: white;
    transform: translateY(-2px);
}

.pagination a.active {
    background: #4F46E5;
    color: white;
}

.search-box {
    transition: all 0.3s;
}

.search-box:focus {
    transform: scale(1.02);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Animación para resultados de búsqueda */
.producto-card {
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll suave */
html {
    scroll-behavior: smooth;
}
/* Estilos Responsive para productos */
.productos-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.producto-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #4F46E5;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
}

.producto-card.adulto {
    border-left-color: #ef4444;
}

.producto-card.pediatrico {
    border-left-color: #10b981;
}

.producto-card:hover {
    transform: translateX(4px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* Badges responsive */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Para móviles muy pequeños */
@media (max-width: 480px) {
    .container {
        padding: 12px;
    }
    
    .producto-card {
        padding: 10px;
    }
    
    .producto-card h3 {
        font-size: 0.9rem;
    }
    
    .badge {
        font-size: 0.65rem;
        padding: 3px 6px;
    }
    
    .btn {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
    
    .card {
        padding: 15px;
    }
}

/* Para tablets */
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        padding: 16px;
    }
    
    .producto-card h3 {
        font-size: 1rem;
    }
}

/* Para desktop */
@media (min-width: 769px) {
    .productos-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 15px;
    }
    
    .producto-card {
        margin-bottom: 0;
    }
}

/* Ajustes para textos largos */
.producto-card h3 {
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.producto-card p {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Mejorar touch targets en móviles */
@media (max-width: 768px) {
    .btn, 
    .bottom-nav a,
    .producto-card a {
        min-height: 44px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
    
    .producto-card a {
        min-height: auto;
    }
}
/* Estilos para manejar textos largos en productos */
.producto-card {
    background: white;
    border-radius: 12px;
    padding: 12px;
    border-left: 4px solid #4F46E5;
    transition: all 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.producto-titulo {
    font-size: 1rem;
    margin-bottom: 5px;
    font-weight: 600;
    color: #1f2937;
    
    /* Para textos largos */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    line-height: 1.4;
    max-height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.producto-presentacion {
    color: #6b7280;
    font-size: 0.75rem;
    line-height: 1.3;
    
    /* Para textos largos */
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Badges responsive */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Para móviles - badges más pequeños y flexibles */
@media (max-width: 480px) {
    .producto-titulo {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
    
    .producto-presentacion {
        font-size: 0.7rem;
        -webkit-line-clamp: 2;
    }
    
    .badge {
        font-size: 0.6rem;
        padding: 2px 5px;
        white-space: normal;
        word-break: break-all;
    }
}

/* Botones de acción */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    padding: 6px 10px;
    background: #e5e7eb;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: all 0.2s;
    min-width: 32px;
}

.btn-icon:hover {
    background: #d1d5db;
    transform: scale(1.05);
}

.btn-icon.delete:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* Tooltip para ver texto completo */
.producto-titulo:hover,
.producto-presentacion:hover {
    cursor: help;
}

/* Muestra el texto completo en hover (para escritorio) */
@media (min-width: 769px) {
    .producto-titulo:hover,
    .producto-presentacion:hover {
        position: relative;
        background: #1f2937;
        color: white;
        padding: 4px 8px;
        border-radius: 6px;
        z-index: 10;
        white-space: normal;
        word-break: normal;
        max-height: none;
        overflow: visible;
        margin: -4px -8px;
    }
}

/* Para desktop - grid más amplio */
@media (min-width: 769px) {
    .productos-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
        gap: 15px;
    }
    
    .producto-titulo {
        font-size: 1rem;
    }
}