/* ===================================
   AGROES - COMPONENTES ESPECÍFICOS
   components.css
   ================================= */

/* Categories Grid */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.category-card {
    background: white;
    border-radius: var(--radius-2xl);
    padding: var(--spacing-xl);
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--gradient-primary);
    transform: translateX(-100%);
    transition: all var(--transition-base);
}

.category-card:hover::before {
    transform: translateX(0);
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-light);
}

.category-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.category-title {
    font-size: 1.5rem;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
    font-weight: 600;
}

.category-description {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.category-count {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
}

/* Catalog Section */
.catalog {
    background: var(--gray-50);
}

/* Filtros del catálogo */
.catalog-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-xl);
    background: white;
    padding: var(--spacing-lg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.filter-label {
    font-weight: 600;
    color: var(--gray-700);
    white-space: nowrap;
}

.filter-select {
    padding: var(--spacing-xs) var(--spacing-md);
    border: 2px solid var(--gray-300);
    border-radius: var(--radius-md);
    background: white;
    font-size: 0.875rem;
    color: var(--gray-700);
    min-width: 200px;
    transition: all var(--transition-base);
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.filter-results {
    color: var(--gray-600);
    font-size: 0.875rem;
}

/* Skeleton loaders para imágenes */
.image-skeleton {
    width: 100%;
    height: 200px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.image-skeleton::before {
    content: "Cargando...";
    color: #999;
    font-size: 0.875rem;
}

.image-skeleton.loaded {
    background: none;
    animation: none;
}

.image-skeleton.loaded::before {
    display: none;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.image-skeleton.loaded .product-img {
    opacity: 1;
}

.no-image {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    color: #6c757d;
    font-size: 0.875rem;
}

@keyframes skeleton-loading {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Optimizar la grid para evitar reflows */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
    contain: layout; /* Optimización de rendimiento */
}

.product-card {
    width: 100%;
    max-width: 350px;
    min-height: 420px; /* ALTURA FIJA */
    display: flex;
    flex-direction: column;
    background: white;
    border-radius: var(--radius-2xl);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    transition: all var(--transition-base);
    position: relative;
        contain: layout style; /* Optimización de rendimiento */
    will-change: transform; /* Optimización para animaciones */
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
    border-color: var(--primary-light);
}

.product-image {
    height: 180px;
    position: relative;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* CAMBIAR de 'cover' a 'contain' */
    background: #f9fafb;
}

.products-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    padding: var(--spacing-2xl); /* Se agrega el padding horizontal */
    box-sizing: border-box; /* Asegura que el padding se incluya en el ancho total */
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--accent-color);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
}

.product-content {
    padding: var(--spacing-lg);
}

.product-category {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: var(--spacing-sm);
}

.product-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--gray-900);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.product-description {
    color: var(--gray-600);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: var(--spacing-md);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.product-price .currency {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-500);
}

.product-actions {
    display: flex;
    gap: var(--spacing-sm);
}

.btn-outline {
    background: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-outline:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-ghost {
    background: rgba(107, 114, 128, 0.1);
    color: var(--gray-600);
    border: none;
    padding: var(--spacing-xs) var(--spacing-md);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: var(--radius-md);
    transition: all var(--transition-base);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-ghost:hover {
    background: rgba(107, 114, 128, 0.2);
    color: var(--gray-700);
}

/* Contact Section */
.contact {
    background: var(--gray-900);
    color: white;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-2xl);
    align-items: start;
}

.contact-info h2 {
    color: white;
    margin-bottom: var(--spacing-md);
}

.contact-info p {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: var(--spacing-xl);
    font-size: 1.125rem;
    line-height: 1.6;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    color: rgba(255, 255, 255, 0.9);
}

.contact-icon {
    font-size: 1.25rem;
    width: 24px;
}

/* Contact Form */
.contact-form {
    background: rgba(255, 255, 255, 0.05);
    padding: var(--spacing-xl);
    border-radius: var(--radius-2xl);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.form-group {
    position: relative;
    margin-bottom: var(--spacing-lg);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: var(--spacing-sm) var(--spacing-md);
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-md);
    color: white;
    font-size: 1rem;
    transition: all var(--transition-base);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-light);
    background: rgba(255, 255, 255, 0.15);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.form-group label {
    position: absolute;
    top: var(--spacing-sm);
    left: var(--spacing-md);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    transition: all var(--transition-base);
    pointer-events: none;
    background: transparent;
    padding: 0 var(--spacing-xs);
}

.form-group input:focus + label,
.form-group input:not(:placeholder-shown) + label,
.form-group textarea:focus + label,
.form-group textarea:not(:placeholder-shown) + label {
    top: -8px;
    left: var(--spacing-sm);
    font-size: 0.75rem;
    color: var(--primary-light);
    background: var(--gray-900);
}

/* Footer */
.footer {
    background: var(--gray-900);
    color: white;
    padding: var(--spacing-2xl) 0 var(--spacing-lg);
}

.footer-content {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-xl);
}

.footer-brand .brand-text {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-light);
    margin-bottom: var(--spacing-sm);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: var(--spacing-xl);
}

.footer-column h4 {
    color: white;
    font-size: 1.125rem;
    margin-bottom: var(--spacing-md);
}

.footer-column a {
    display: block;
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    margin-bottom: var(--spacing-xs);
    transition: color var(--transition-base);
}

.footer-column a:hover {
    color: var(--primary-light);
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: var(--spacing-lg);
    text-align: center;
}

.footer-bottom p {
    color: rgba(255, 255, 255, 0.5);
    margin: 0;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(4px);
}

.modal.active {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.modal-content {
    position: relative;
    background: white;
    margin: 5% auto;
    padding: 0;
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    animation: slideIn 0.3s ease-out;
     max-height: 90vh;
    overflow-y: auto;
}

.pdf-modal .modal-content {
    width: 85vw;
    height: 90vh;
    max-width: none;
    margin: 5vh auto;
    display: flex;
    flex-direction: column;
}

.pdf-modal .modal-header {
    flex-shrink: 0;
    height: 60px;
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: var(--spacing-lg) var(--spacing-xl);
    border-radius: var(--radius-2xl) var(--radius-2xl) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #666;
    cursor: pointer;
    z-index: 10;
    background: white;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.modal-close:hover {
    background: #f1f1f1;
    color: #333;
}

.modal-body {
    padding: var(--spacing-xl);
}

.pdf-modal .modal-body {
    flex: 1;
    padding: 0;
    margin: 0;
    height: calc(90vh - 60px);
    display: block;
}

.product-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
    align-items: start;
}

.modal-product-image {
    width: 100%;
    height: 200px;          /* CAMBIAR de 250px a 200px */
    object-fit: contain;    /* CAMBIAR de 'cover' a 'contain' */
    border-radius: var(--radius-lg);
    background: #f9fafb;    /* AGREGAR fondo */
}

.modal-product-info h3 {
    color: var(--gray-900);
    font-size: 1.5rem;
    margin-bottom: var(--spacing-sm);
}

.modal-product-category {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-md);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: var(--spacing-md);
}

.modal-product-price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: var(--spacing-md);
}

.modal-product-description {
    color: var(--gray-600);
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
}

.modal-product-actions {
    display: flex;
    gap: var(--spacing-sm);
}

/* ===================================
   AGROES - CSS ADICIONAL PARA MYSQL
   Estilos para los nuevos componentes de la API
   ================================= */

/* Estados de carga */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f4f6;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensajes de error y éxito */
.error-message,
.success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    max-width: 400px;
    z-index: 10000;
    animation: slideInRight 0.3s ease-out;
}

.error-content,
.success-content {
    background: white;
    border-radius: 8px;
    padding: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #ef4444;
    display: flex;
    align-items: center;
    gap: 12px;
}

.success-content {
    border-left-color: #10b981;
}

.error-icon,
.success-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.error-text,
.success-text {
    flex: 1;
    color: #374151;
    font-weight: 500;
}

.error-close,
.success-close {
    background: none;
    border: none;
    font-size: 18px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s;
}

.error-close:hover,
.success-close:hover {
    background: #f3f4f6;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Estado vacío */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6b7280;
    grid-column: 1 / -1; /* Ocupa toda la grilla */
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: #374151;
    margin-bottom: 0.5rem;
}

.empty-state p {
    margin-bottom: 2rem;
    font-size: 1rem;
}

/* Modal de producto actualizado */
.product-modal-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.modal-product-image-container {
    position: relative;
}

.modal-product-image {
    width: 100%;
    height: 300px;
    object-fit: contain;
    border-radius: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
}

.modal-product-info h3 {
    color: #111827;
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.modal-product-category {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 1rem;
}

.modal-product-price {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.modal-product-description {
    color: #4b5563;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.modal-product-description h4 {
    color: #111827;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

.modal-product-description ul {
    margin: 1rem 0;
    padding-left: 1.5rem;
}

.modal-product-description li {
    margin-bottom: 0.5rem;
}

.modal-product-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.modal-product-actions .btn {
    flex: 1;
    min-width: 140px;
}

/* Filtros mejorados */
.catalog-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 12px;
}

.filter-label {
    font-weight: 600;
    color: #374151;
    white-space: nowrap;
}

.filter-select {
    appearance: none;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 8px 16px 8px 12px;
    font-size: 0.875rem;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px;
    padding-right: 32px;
    min-width: 200px;
}

.filter-select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.filter-results {
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Productos con mejor diseño */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: var(--primary-color);
}

.product-image {
    position: relative;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    background: #f9fafb;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    box-shadow: 0 2px 4px rgba(16, 185, 129, 0.3);
}

.product-content {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    display: inline-block;
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

.product-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    margin-bottom: 0.5rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1rem;
    flex: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.product-actions {
    display: flex;
    gap: 8px;
}

.product-actions .btn {
    flex: 1;
    font-size: 0.875rem;
    padding: 8px 12px;
}

/* Responsive mejorado */
@media (max-width: 768px) {
    .catalog-filters {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .filter-group {
        flex-direction: column;
        gap: 8px;
        align-items: stretch;
    }
    
    .filter-select {
        min-width: auto;
        width: 100%;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-modal-content {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .modal-product-image {
        height: 250px;
    }
    
    .error-message,
    .success-message {
        position: relative;
        top: auto;
        right: auto;
        margin: 1rem;
        max-width: none;
    }
}

/* Animaciones adicionales */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fadeInUp {
    animation: fadeInUp 0.6s ease-out;
}

/* Mejoras de accesibilidad */
.btn:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

.filter-select:focus-visible {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Estados de carga más sutiles */
.products-grid.loading {
    opacity: 0.6;
    pointer-events: none;
}

.product-card.loading {
    opacity: 0.5;
    transform: none !important;
}


.no-image-text {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px; /* Ajusta según tu diseño */
    background: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
    text-align: center;
    border-radius: 8px;
}

.product-image {
    position: relative;
    min-height: 180px;
}

.product-image img {
    width: 100%;
    height: 180px;
    object-fit: contain;
    background: white;
}

#pdf-viewer {
    width: 100% !important;
    height: 100% !important;
    min-height: calc(90vh - 60px) !important;
    border: none !important;
    margin: 0 !important;
    padding: 0 !important;
    display: block !important;
}

/* FORZAR TAMAÑO EN CONTENEDOR */
.pdf-modal .modal-body iframe {
    width: 100% !important;
    height: 100% !important;
}

/* AGREGAR ESTA NUEVA REGLA: 
.pdf-modal .modal-body {
    padding: 0;
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: stretch;
}*/

/* Animaciones para modales */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Estados de carga y vacío */
.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-2xl);
    color: var(--gray-500);
}

.empty-state {
    text-align: center;
    padding: var(--spacing-2xl);
    color: var(--gray-500);
}

.empty-state-icon {
    font-size: 3rem;
    margin-bottom: var(--spacing-md);
    opacity: 0.5;
}

.empty-state h3 {
    color: var(--gray-700);
    margin-bottom: var(--spacing-sm);
}

.empty-state p {
    margin: 0;
}

/* Efectos hover adicionales */
.hover-scale {
    transition: transform var(--transition-base);
}

.hover-scale:hover {
    transform: scale(1.02);
}

.hover-lift {
    transition: all var(--transition-base);
}

.hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Indicadores de estado */
.badge {
    display: inline-block;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-lg);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.badge-success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--primary-color);
}

.badge-warning {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-color);
}

.badge-info {
    background: rgba(59, 130, 246, 0.1);
    color: var(--secondary-color);
}

/* Utilidades específicas de componentes */
.glass-effect {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.gradient-text {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-glow {
    box-shadow: 0 0 30px rgba(16, 185, 129, 0.3);
}