/* Estilos adicionales para SOFTHARD PERU */

/* Variables CSS */
:root {
    --primary-color: #3b82f6;
    --secondary-color: #1e40af;
    --accent-color: #10b981;
    --background-color: #0f172a;
    --surface-color: #1e293b;
    --card-color: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1);
}

/* Estilos base */
* {
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, var(--background-color) 0%, #1a202c 100%);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    overflow-x: hidden;
}

/* Scrollbar personalizado */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--surface-color);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--primary-color);
}

/* Header mejorado */
.header-gradient {
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(30, 41, 59, 0.8) 100%);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

/* Botones mejorados */
.btn {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
    transform: translateZ(0);
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    pointer-events: none;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

/* Tarjetas de productos */
.product-card {
    background: linear-gradient(145deg, var(--card-color), var(--surface-color));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(59, 130, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-card:hover {
    transform: translateY(-8px) scale(1.02);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-color);
}

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

.product-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, var(--surface-color), var(--card-color));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
    transform: scale(1.1);
}

.product-icon {
    font-size: 4rem;
    opacity: 0.6;
}

.featured-badge {
    display: inline-block;
    width: auto;
    white-space: nowrap;
}

/* Asegurar que el contenido de la tarjeta sea interactivo */
.product-info {
    position: relative;
    z-index: 1;
}

.product-actions {
    position: relative;
    z-index: 2;
}

.product-actions button {
    cursor: pointer;
    position: relative;
    z-index: 3;
}

.whatsapp-btn {
    cursor: pointer !important;
    pointer-events: auto !important;
}

/* Modal mejorado */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    background: linear-gradient(145deg, var(--surface-color), var(--card-color));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalSlideIn 0.3s ease;
}

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

/* Carrito */
.cart-item {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--background-color);
    border-radius: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.cart-item:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.cart-item-image {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    background: var(--surface-color);
    display: flex;
    align-items: center;
    justify-content: center;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-icon {
    font-size: 1.5rem;
    opacity: 0.6;
}

.cart-item-details {
    flex: 1;
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0 15px;
}

.cart-item-quantity button {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: var(--surface-color);
    color: var(--text-primary);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.cart-item-quantity button:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

/* Toast notifications */
.toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(400px);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-lg);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    background: linear-gradient(135deg, var(--success-color), #059669);
}

.toast-warning {
    background: linear-gradient(135deg, var(--warning-color), #d97706);
}

.toast-error {
    background: linear-gradient(135deg, var(--error-color), #dc2626);
}

/* Panel de administración */
.admin-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.admin-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.admin-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.admin-tab.active,
.admin-tab:hover {
    color: var(--text-primary);
}

.admin-tab.active::after {
    transform: scaleX(1);
}

/* Panel de cliente - Reutiliza estilos de admin */
.client-tabs {
    display: flex;
    border-bottom: 2px solid var(--border-color);
    margin-bottom: 20px;
}

.client-tab {
    padding: 12px 24px;
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.client-tab::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--primary-color);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.client-tab.active,
.client-tab:hover {
    color: var(--text-primary);
}

.client-tab.active::after {
    transform: scaleX(1);
}

.client-content {
    animation: fadeIn 0.3s ease;
}

.admin-item {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: all 0.3s ease;
}

.admin-item:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.admin-item-info h4 {
    color: var(--primary-color);
    margin-bottom: 8px;
}

.admin-item-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

/* Formularios */
.form-input {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 12px 16px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input::placeholder {
    color: var(--text-secondary);
}

/* Hero section mejorado */
.hero-gradient {
    background: linear-gradient(135deg, 
        var(--surface-color) 0%, 
        rgba(30, 41, 59, 0.9) 50%, 
        rgba(15, 23, 42, 0.8) 100%);
    position: relative;
    overflow: hidden;
}

.hero-gradient::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.05)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
    opacity: 0.3;
}

/* Categorías */
.category-card {
    background: linear-gradient(145deg, var(--card-color), var(--surface-color));
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent, rgba(59, 130, 246, 0.1));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-color);
    box-shadow: var(--shadow-lg);
}

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

.category-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    display: block;
    transition: transform 0.3s ease;
}

.category-card:hover .category-icon {
    transform: scale(1.2);
}

/* Footer mejorado */
.footer-gradient {
    background: linear-gradient(135deg, var(--surface-color) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-top: 1px solid var(--border-color);
}

/* WhatsApp flotante */
.whatsapp-float {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: all 0.3s ease;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-xl);
}

/* Animaciones */
@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

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

.animate-pulse {
    animation: pulse 2s infinite;
}

.animate-slideInUp {
    animation: slideInUp 0.6s ease;
}

/* Responsive */
@media (max-width: 768px) {
    .modal-content {
        margin: 10px;
        max-width: calc(100vw - 20px);
    }
    
    .admin-tabs {
        flex-wrap: wrap;
    }
    
    .admin-tab {
        flex: 1;
        min-width: 100px;
        text-align: center;
    }
    
    .cart-item {
        flex-direction: column;
        text-align: center;
    }
    
    .cart-item-image {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .cart-item-quantity {
        margin: 10px 0;
    }
}

/* Loading spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Efectos de glassmorphism */
.glass {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-error {
    background: var(--error-color);
    color: white;
}

/* Optimización de rendimiento */
.product-card,
.cart-item,
.admin-item,
.category-card {
    will-change: transform;
}

/* Transiciones suaves */
* {
    transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}