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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #2D3748;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

.container {
    width: 100vw;
    margin: 0;
    background: white;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ============================================
   CONTENIDO PRINCIPAL
   ============================================ */

.main-content {
    flex: 1;
    padding: 3rem 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(247, 250, 252, 0.8) 100%);
}

.hero-section,
.services-section,
.contact-form-section,
.faq-section {
    max-width: 1400px;
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

/* ============================================
   SECCIÓN HERO
   ============================================ */

.hero-section {
    text-align: center;
    margin-bottom: 6rem;
    padding: 4rem 2rem;
    background: linear-gradient(135deg, rgba(66, 153, 225, 0.05) 0%, rgba(255, 255, 255, 0.9) 50%, rgba(99, 179, 237, 0.05) 100%);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(66, 153, 225, 0.08);
    border: 1px solid rgba(66, 153, 225, 0.1);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(66, 153, 225, 0.3), transparent);
}

.hero-section h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    color: #1A365D;
    margin-bottom: 2rem;
    font-weight: 800;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.1);
    background: linear-gradient(135deg, #1A365D 0%, #2C5282 50%, #4299E1 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.2;
}

.hero-section p {
    font-size: clamp(1.1rem, 2.5vw, 1.4rem);
    color: #4A5568;
    max-width: 900px;
    margin: 0 auto;
    line-height: 1.8;
    font-weight: 400;
}

/* ============================================
   SECCIÓN DE SERVICIOS - SIMPLIFICADA
   ============================================ */

.services-section {
    margin: 6rem auto; 
    max-width: 1400px;
    padding: 0 2rem;
}

.section-title {
    font-size: clamp(2.2rem, 4vw, 3.2rem);
    text-align: center;
    color: #4A90E2;
    margin-bottom: 1rem;
    position: relative;
    font-weight: 700;
}

.services-subtitle {
    text-align: center;
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 4rem;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.8;
}

/* ============================================
              GRID DE SERVICIOS
   ============================================ */

.services-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
    z-index: 2;
    max-width: 1200px;
    margin: 0 auto 3rem auto;
}

/* ============================================
             TARJETAS DE SERVICIOS - SIMPLIFICADAS
   ============================================ */

.service-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.12);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid rgba(74, 144, 226, 0.1);
    position: relative;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    /* Estado inicial para animación */
    opacity: 0;
    transform: translateY(30px);
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #4A90E2, #5BA0F2, #4A90E2);
    background-size: 200% 100%;
    animation: shimmer 3s ease-in-out infinite;
}

/* Estados visibles de las cards */
.service-card-visible,
.service-card-animated {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Hover effect mejorado */
.service-card:hover {
    transform: translateY(-10px) scale(1.03) !important;
    box-shadow: 0 25px 50px rgba(74, 144, 226, 0.25);
    text-decoration: none;
    color: inherit;
}

/* ============================================
            IMAGEN DE SERVICIOS
   ============================================ */

.service-image {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    position: relative;
    overflow: hidden;
    transform: none !important;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* Overlay más elegante */
.service-image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(74, 144, 226, 0.4) 0%, rgba(91, 160, 242, 0.3) 100%);
    z-index: 1;
}

.service-image::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 30px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.3), transparent);
    z-index: 2;
}

/* Título sobre la imagen */
.service-image-title {
    position: relative;
    z-index: 3;
    color: white;
    font-size: 1.3rem;
    font-weight: 800;
    text-shadow: 2px 2px 6px rgba(0, 0, 0, 0.6);
    text-align: center;
    letter-spacing: 0.5px;
}

/* Fondos específicos para cada servicio */
.service-image.resinas {
    background-image: url('../images/categorias/resinas.webp');
}

.service-image.fibras {
    background-image: url('../images/categorias/fibras.webp');
}

.service-image.pastas {
    background-image: url('../images/categorias/pastas.webp');
}

.service-image.pigmentos {
    background-image: url('../images/categorias/pigmentos.webp');
}

.service-image.soluciones {
    background-image: url('../images/categorias/soluciones.webp');
}

.service-image.implementos {
    background-image: url('../images/categorias/implementos.webp');
}

/* ============================================
          CONTENIDO DE LAS TARJETAS - SIMPLIFICADO
   ============================================ */

.service-content {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex-grow: 1;
    text-align: center;
}

.service-title {
    font-size: 1.4rem;
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
}

/* Removemos descripción y features */
.service-description,
.service-features {
    display: none;
}

.service-cta-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #4A90E2 0%, #5BA0F2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    text-decoration: none;
    display: block;
    text-align: center;
    margin-top: auto;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.service-cta-btn:hover {
    background: linear-gradient(135deg, #357ABD 0%, #4A90E2 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(74, 144, 226, 0.4);
    color: white;
    text-decoration: none;
}

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

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

/* Animación de carga suave */
@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Aplicar animación progresiva a las cards */
.service-card:nth-child(1) {
    animation: fadeInScale 0.6s ease forwards;
    animation-delay: 0.1s;
}

.service-card:nth-child(2) {
    animation: fadeInScale 0.6s ease forwards;
    animation-delay: 0.2s;
}

.service-card:nth-child(3) {
    animation: fadeInScale 0.6s ease forwards;
    animation-delay: 0.3s;
}

.service-card:nth-child(4) {
    animation: fadeInScale 0.6s ease forwards;
    animation-delay: 0.4s;
}

.service-card:nth-child(5) {
    animation: fadeInScale 0.6s ease forwards;
    animation-delay: 0.5s;
}

.service-card:nth-child(6) {
    animation: fadeInScale 0.6s ease forwards;
    animation-delay: 0.6s;
}

/* ============================================
             RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1024px) {
    .services-grid-container {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .services-section {
        padding: 0 1rem;
        margin: 4rem auto;
    }
    
    .services-grid-container {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .service-image {
        height: 150px;
    }
    
    .service-content {
        padding: 1.5rem 1rem;
    }
    
    .service-title {
        font-size: 1.2rem;
        margin-bottom: 1rem;
    }
}

@media (max-width: 480px) {
    .services-grid-container {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .service-image {
        height: 130px;
    }
    
    .service-content {
        padding: 1.2rem;
    }
    
    .service-title {
        font-size: 1.1rem;
    }
    
    .service-cta-btn {
        padding: 0.8rem 1rem;
        font-size: 0.9rem;
    }
}

/* ============================================
   SECCIÓN CTA DE SERVICIOS
   ============================================ */

.services-cta {
    background: linear-gradient(135deg, #4A90E2 0%, #5BA0F2 100%);
    border-radius: 20px;
    padding: 3rem;
    text-align: center;
    color: white;
    margin-top: 4rem;
    position: relative;
    overflow: hidden;
}

.services-cta::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 30px 30px;
    animation: float 15s infinite linear;
}

.cta-content {
    position: relative;
    z-index: 1;
}

.cta-content h3 {
    font-size: 2rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.cta-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.cta-btn {
    padding: 1rem 2rem;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 180px;
    text-align: center;
}

.cta-btn.primary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.cta-btn.primary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
    color: white;
}

.cta-btn.secondary {
    background: white;
    color: #4A90E2;
    border: 2px solid white;
}

.cta-btn.secondary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    color: #357ABD;
}

@keyframes float {
    0% {
        transform: translateX(0) translateY(0) rotate(0deg);
    }
    33% {
        transform: translateX(30px) translateY(-30px) rotate(120deg);
    }
    66% {
        transform: translateX(-20px) translateY(20px) rotate(240deg);
    }
    100% {
        transform: translateX(0) translateY(0) rotate(360deg);
    }
}

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

@media (max-width: 1400px) {
    .hero-section,
    .services-section,
    .contact-form-section,
    .faq-section {
        padding-left: 2rem;
        padding-right: 2rem;
    }
}

@media (max-width: 1200px) {
    .main-content {
        padding: 2.5rem 0;
    }
    
    .hero-section,
    .services-section,
    .contact-form-section,
    .faq-section {
        padding-left: 1.5rem;
        padding-right: 1.5rem;
    }
    
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 2rem 0;
    }
    
    .hero-section,
    .services-section,
    .contact-form-section,
    .faq-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
    
    .hero-section {
        padding: 3rem 1.5rem;
        margin-bottom: 4rem;
    }
    
    .services-section {
        margin: 4rem auto;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .service-card {
        padding: 2rem 1.5rem;
    }
    
    .section-title::after {
        width: 80px;
        height: 3px;
    }
    
    .services-cta {
        padding: 2rem;
    }
    
    .cta-content h3 {
        font-size: 1.5rem;
    }
    
    .cta-buttons {
        flex-direction: column;
        align-items: center;
    }
}

@media (max-width: 480px) {
    .hero-section {
        padding: 2rem 1rem;
        border-radius: 16px;
    }
    
    .service-card {
        border-radius: 16px;
        min-height: 250px;
    }
    
    .services-cta {
        padding: 1.5rem;
        border-radius: 16px;
    }
}

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

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.hero-section {
    animation: fadeInUp 0.8s ease-out;
}

.service-card {
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.service-card:nth-child(1) { animation-delay: 0.1s; }
.service-card:nth-child(2) { animation-delay: 0.2s; }
.service-card:nth-child(3) { animation-delay: 0.3s; }
.service-card:nth-child(4) { animation-delay: 0.4s; }
.service-card:nth-child(5) { animation-delay: 0.5s; }
.service-card:nth-child(6) { animation-delay: 0.6s; }

/* Intersection Observer animations */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.6s ease-out;
}

.animate-on-scroll.animated {
    opacity: 1;
    transform: translateY(0);
}

/* Smooth transitions for better UX */
.service-card {
    will-change: transform;
}

/* Loading states */
.loading .service-card {
    animation-play-state: paused;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-section,
    .service-card {
        border: 2px solid #000;
    }
}

/* Reduced motion for accessibility */
@media (prefers-reduced-motion: reduce) {
    .service-card,
    .hero-section {
        animation: none;
        transition: none;
    }
    
    .service-card:hover {
        transform: none;
    }
}