/* ==========================================
   IF SERVICIOS GENERALES - ESTILOS PERSONALIZADOS
   ========================================== */

/* Importar fuente Poppins */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

/* ==========================================
   VARIABLES CSS PERSONALIZADAS
   ========================================== */

:root {
    /* Colores principales */
    --color-primary: #1e40af;
    --color-secondary: #25d366;
    --color-accent: #f59e0b;
    --color-dark: #1f2937;
    --color-light: #f8fafc;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    --gradient-secondary: linear-gradient(135deg, #25d366 0%, #22c55e 100%);
    
    /* Sombras */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Transiciones */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================
   RESET Y BASE
   ========================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--color-dark);
    background-color: #ffffff;
    overflow-x: hidden;
}

/* ==========================================
   UTILIDADES PERSONALIZADAS
   ========================================== */

.gradient-bg {
    background: var(--gradient-primary);
}

.hero-pattern {
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='7' cy='7' r='1'/%3E%3Ccircle cx='53' cy='7' r='1'/%3E%3Ccircle cx='7' cy='53' r='1'/%3E%3Ccircle cx='53' cy='53' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

/* Combinar gradiente + patrón cuando ambos se usan juntos */
.gradient-bg.hero-pattern {
    background-image: var(--gradient-primary), url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.1'%3E%3Ccircle cx='7' cy='7' r='1'/%3E%3Ccircle cx='53' cy='7' r='1'/%3E%3Ccircle cx='7' cy='53' r='1'/%3E%3Ccircle cx='53' cy='53' r='1'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    background-size: cover, auto;
    background-repeat: no-repeat, repeat;
    background-position: center, center;
}

.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ==========================================
   COMPONENTES PRINCIPALES
   ========================================== */

/* Header mejorado */
.header-blur {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background-color: rgba(255, 255, 255, 0.95);
}

/* Service Cards */
.service-card {
    transition: all var(--transition-normal);
    border: 1px solid transparent;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: left 0.5s;
}

.service-card:hover::before {
    left: 100%;
}

.service-card:hover {
    transform: translateY(-12px);
    box-shadow: var(--shadow-xl);
    border-color: rgba(30, 64, 175, 0.1);
}

.service-card:hover .service-icon {
    transform: scale(1.1) rotate(5deg);
    color: var(--color-primary);
}

/* Service Images - relación uniforme 16:9 */
.service-image {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border-radius: 1rem;
    object-fit: cover;
    object-position: center;
    transition: all var(--transition-normal);
    border: 3px solid transparent;
    display: block;
}

.service-image:hover {
    transform: scale(1.3);
    border-color: var(--color-primary);
    box-shadow: var(--shadow-lg);
}

/* WhatsApp Float Button */
.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background: var(--gradient-secondary);
    color: #ffffff;
    border-radius: 50px;
    text-align: center;
    font-size: 28px;
    line-height: 60px;
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    transition: all var(--transition-normal);
    animation: whatsapp-pulse 2s infinite;
    border: 3px solid #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Ajuste para móviles - evitar superposición */
@media (max-width: 640px) {
    .whatsapp-float {
        bottom: 90px;
        right: 20px;
        width: 55px;
        height: 55px;
        font-size: 24px;
        line-height: 55px;
    }
}

@keyframes whatsapp-pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.7);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(37, 211, 102, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(37, 211, 102, 0);
    }
}

/* ==========================================
   ANIMACIONES PERSONALIZADAS
   ========================================== */

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-left {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fade-in-right {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scale-in {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.animate-fade-in-up {
    animation: fade-in-up 0.6s var(--transition-normal) forwards;
}

.animate-fade-in-left {
    animation: fade-in-left 0.6s var(--transition-normal) forwards;
}

.animate-fade-in-right {
    animation: fade-in-right 0.6s var(--transition-normal) forwards;
}

.animate-scale-in {
    animation: scale-in 0.5s var(--transition-normal) forwards;
}

/* ==========================================
   BOTONES PERSONALIZADOS
   ========================================== */

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    color: white;
}

.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    filter: brightness(1.1);
    color: white;
}

.btn-outline {
    background: transparent;
    color: white;
    padding: 0.75rem 2rem;
    border: 2px solid white;
    border-radius: 9999px;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-normal);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.btn-outline:hover {
    background: white;
    color: var(--color-primary);
    transform: translateY(-2px);
}

/* ==========================================
   FORMULARIOS
   ========================================== */

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 0.75rem;
    font-size: 1rem;
    transition: all var(--transition-normal);
    background: white;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
    transform: translateY(-1px);
}

.form-input::placeholder {
    color: #9ca3af;
}

/* ==========================================
   TESTIMONIOS
   ========================================== */

.testimonial-card {
    background: white;
    border-radius: 1rem;
    padding: 2rem;
    box-shadow: var(--shadow-md);
    transition: all var(--transition-normal);
    position: relative;
    border: 1px solid rgba(229, 231, 235, 0.5);
}

.testimonial-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.testimonial-card::before {
    content: '"';
    position: absolute;
    top: -10px;
    left: 20px;
    font-size: 3rem;
    color: var(--color-primary);
    font-family: serif;
    opacity: 0.3;
}

/* ==========================================
   ESTRELLAS DE RATING
   ========================================== */

.rating-stars {
    display: flex;
    gap: 0.25rem;
    justify-content: center;
    margin: 1rem 0;
}

.rating-stars i {
    font-size: 1.25rem;
    transition: all var(--transition-fast);
}

.rating-stars .fa-star {
    color: #fbbf24;
}

.rating-stars .fa-star:hover {
    transform: scale(1.2);
}

/* ==========================================
   SECCIONES MEJORADAS
   ========================================== */

.section-padding {
    padding: 5rem 0;
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-dark);
    text-align: center;
    margin-bottom: 1rem;
}

.section-subtitle {
    font-size: 1.25rem;
    color: #6b7280;
    text-align: center;
    max-width: 42rem;
    margin: 0 auto 3rem;
    line-height: 1.7;
}

/* ==========================================
   ESTADÍSTICAS ANIMADAS
   ========================================== */

.stat-number {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 0.5rem;
    transition: all var(--transition-normal);
}

.stat-label {
    font-size: 1rem;
    color: #6b7280;
    font-weight: 500;
}

.stat-item:hover .stat-number {
    transform: scale(1.1);
}

/* ==========================================
   RESPONSIVE MEJORADO
   ========================================== */

@media (max-width: 768px) {
    .section-title {
        font-size: 2rem;
    }
    
    .section-subtitle {
        font-size: 1.125rem;
        margin-bottom: 2rem;
    }
    
    .stat-number {
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .section-padding {
        padding: 3rem 0;
    }
    
    .service-card {
        padding: 1.5rem;
    }
    
    .testimonial-card {
        padding: 1.5rem;
    }
}

/* ==========================================
   LOADING Y ESTADOS
   ========================================== */

.loading {
    opacity: 0.7;
    pointer-events: none;
}

.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

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

/* ==========================================
   ACCESIBILIDAD
   ========================================== */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    html {
        scroll-behavior: auto;
    }
}

/* Focus visible para navegación por teclado */
.focus-visible:focus {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
    .whatsapp-float,
    .no-print {
        display: none !important;
    }
    
    body {
        color: black !important;
        background: white !important;
    }
    
    .gradient-bg {
        background: white !important;
        color: black !important;
    }
}

/* ==========================================
   DARK MODE PREPARATION
   ========================================== */

/* Utilidad para asegurar contraste en el hero */
.hero-title {
    color: #ffffff !important;
}

@media (prefers-color-scheme: dark) {
    .dark-mode-auto {
        /* Estilos para modo oscuro automático */
        background-color: #1f2937;
        color: #f9fafb;
    }
}
