/* ========================================
   ECOSISTIA STYLES v2.0
   Enhanced with Design System
   ======================================== */

/* Legacy support - these variables are now sourced from design-system.css */
:root {
    /* Keeping for backwards compatibility */
    --primary-color: var(--color-primary-500);
    --primary-dark: var(--color-primary-600);
    --secondary-color: var(--color-secondary-500);
    --dark-color: var(--color-gray-900);
    --light-color: var(--color-gray-50);
    --text-color: var(--color-text-secondary);
    --border-color: var(--color-border-primary);
    --gradient-primary: var(--gradient-hero);
    --gradient-secondary: var(--gradient-secondary);
    --shadow-sm: var(--shadow-sm);
    --shadow-md: var(--shadow-md);
    --shadow-lg: var(--shadow-lg);
    --shadow-xl: var(--shadow-xl);
}

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

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

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* Header y Navegación */
#header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

.navbar {
    padding: 1rem 0;
}

.nav-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-text {
    font-size: 1.75rem;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    align-items: center;
}

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-color);
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary-color);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

.cta-button {
    background: var(--gradient-primary);
    color: white !important;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.nav-toggle span {
    width: 25px;
    height: 3px;
    background: var(--dark-color);
    margin: 3px 0;
    transition: 0.3s;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 80px;
    overflow: hidden;
}

.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.geometric-shape {
    position: absolute;
    opacity: 0.1;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--gradient-primary);
    border-radius: 50%;
    top: -200px;
    right: -200px;
    animation: float 20s ease-in-out infinite;
}

.shape-2 {
    width: 300px;
    height: 300px;
    background: var(--gradient-secondary);
    border-radius: 30% 70% 70% 30% / 30% 30% 70% 70%;
    bottom: -150px;
    left: -150px;
    animation: float 15s ease-in-out infinite reverse;
}

.shape-3 {
    width: 200px;
    height: 200px;
    background: linear-gradient(135deg, #fa709a 0%, #fee140 100%);
    clip-path: polygon(50% 0%, 0% 100%, 100% 100%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation: rotate 30s linear infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0) translateX(0); }
    25% { transform: translateY(-30px) translateX(10px); }
    50% { transform: translateY(20px) translateX(-20px); }
    75% { transform: translateY(-10px) translateX(15px); }
}

@keyframes rotate {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hero-content {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--dark-color);
}

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

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 1rem 2rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
}

.btn-secondary {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.btn-secondary:hover {
    background: var(--primary-color);
    color: white;
}

.btn-white {
    background: white;
    color: var(--primary-color);
    box-shadow: var(--shadow-md);
}

/* Hero Visual */
.hero-visual {
    position: relative;
    height: 500px;
}

.floating-card {
    position: absolute;
    background: white;
    padding: 2rem;
    border-radius: 20px;
    box-shadow: var(--shadow-xl);
    transition: all 0.3s ease;
    cursor: pointer;
}

.floating-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 30px 40px -10px rgba(0, 0, 0, 0.2);
}

.card-1 {
    top: 0;
    right: 0;
    animation: float 4s ease-in-out infinite;
}

.card-2 {
    bottom: 100px;
    left: 50px;
    animation: float 5s ease-in-out infinite 0.5s;
}

.card-3 {
    top: 150px;
    left: 0;
    animation: float 6s ease-in-out infinite 1s;
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.floating-card h3 {
    font-size: 1.25rem;
    color: var(--dark-color);
}

/* Secciones */
section {
    padding: 5rem 0;
}

.section-header {
    text-align: center;
    margin-bottom: 4rem;
}

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

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-color);
}

/* Servicios */
.services {
    background: var(--light-color);
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
}

.service-card {
    background: white;
    padding: 3rem 2rem;
    border-radius: 20px;
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--gradient-primary);
    transform: translateX(-100%);
    transition: transform 0.5s ease;
}

.service-card:hover::before {
    transform: translateX(0);
}

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

.service-icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.icon-svg {
    width: 30px;
    height: 30px;
    color: white;
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.service-features {
    list-style: none;
    margin-top: 1.5rem;
}

.service-features li {
    padding: 0.5rem 0;
    padding-left: 1.5rem;
    position: relative;
}

.service-features li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--secondary-color);
    font-weight: bold;
}

/* Productos */
.products-showcase {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 3rem;
}

.product-item {
    text-align: center;
    transition: transform 0.3s ease;
}

.product-item:hover {
    transform: translateY(-10px);
}

.product-image {
    height: 250px;
    background: var(--gradient-primary);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
    transition: all 0.3s ease;
}

/* Gradientes específicos para cada producto */
.product-item:nth-child(1) .product-image {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.product-item:nth-child(2) .product-image {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.product-item:nth-child(3) .product-image {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.product-item:nth-child(4) .product-image {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.product-item:hover .product-image {
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.4);
    transform: scale(1.02);
}

.product-image::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

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

.product-icon-wrapper {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 12px;
    padding: 12px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.3s ease;
}

.product-icon {
    font-size: 32px;
    color: white;
    display: block;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-10px); }
}

.product-item:hover .product-icon-wrapper {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.product-item:hover .product-icon {
    animation-play-state: paused;
}

.product-mock {
    font-size: 1.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.product-info h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.product-info p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    min-height: 60px;
}

.link-arrow {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    border: 2px solid var(--primary-color);
    border-radius: 50px;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.link-arrow:hover {
    background: var(--primary-color);
    color: white;
    transform: translateX(5px);
    box-shadow: 0 5px 15px rgba(99, 102, 241, 0.3);
}

/* Tecnologías */
.technologies {
    background: var(--light-color);
}

.tech-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 3rem;
}

.tech-category h3 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
    color: var(--dark-color);
}

.tech-items {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.tech-badge {
    background: white;
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.875rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.tech-badge:hover {
    background: var(--gradient-primary);
    color: white;
    border-color: transparent;
    transform: translateY(-2px);
}

/* Portfolio */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
}

.portfolio-item {
    position: relative;
    height: 300px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
}

.portfolio-image {
    width: 100%;
    height: 100%;
    background: var(--gradient-primary);
    transition: all 0.3s ease;
}

.portfolio-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    padding: 2rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.portfolio-item:hover .portfolio-overlay {
    transform: translateY(0);
}

.portfolio-overlay h4 {
    color: white;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.portfolio-overlay p {
    color: rgba(255, 255, 255, 0.8);
}

/* CTA Section */
.cta-section {
    background: var(--gradient-primary);
    color: white;
    text-align: center;
    padding: 4rem 0;
}

.cta-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.cta-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
}

/* Contacto */
.contact {
    background: var(--light-color);
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
}

.info-item {
    margin-bottom: 2rem;
}

.info-item h3 {
    font-size: 1.25rem;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.contact-form {
    background: white;
    padding: 3rem;
    border-radius: 20px;
    box-shadow: var(--shadow-lg);
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

/* Footer */
.footer {
    background: var(--dark-color);
    color: white;
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 3rem;
    margin-bottom: 2rem;
}

.footer h3,
.footer h4 {
    margin-bottom: 1rem;
}

.footer ul {
    list-style: none;
}

.footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer a:hover {
    color: white;
}

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.6);
}

.legal-links {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.legal-links a {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    transition: color 0.3s ease;
}

.legal-links a:hover {
    color: white;
}

.legal-links span {
    color: rgba(255, 255, 255, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .nav-toggle {
        display: flex;
    }
    
    .nav-menu {
        position: fixed;
        top: 70px;
        right: -100%;
        width: 100%;
        height: calc(100vh - 70px);
        background: white;
        flex-direction: column;
        padding: 2rem;
        transition: right 0.3s ease;
        box-shadow: var(--shadow-xl);
    }
    
    .nav-menu.active {
        right: 0;
    }
    
    .hero-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .hero-visual {
        display: none;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .services-grid,
    .tech-grid,
    .portfolio-grid {
        grid-template-columns: 1fr;
    }
}

/* Banner de Cookies */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    padding: 2rem;
    z-index: 9999;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.cookie-banner.show {
    transform: translateY(0);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.cookie-text h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.cookie-text p {
    margin: 0;
    color: var(--text-color);
}

.cookie-text a {
    color: var(--primary-color);
    text-decoration: underline;
}

.cookie-buttons {
    display: flex;
    gap: 1rem;
    flex-shrink: 0;
}

.cookie-btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.cookie-accept-all {
    background: var(--gradient-primary);
    color: white;
}

.cookie-configure {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

.cookie-reject {
    background: #f3f4f6;
    color: var(--text-color);
}

.cookie-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Modal de Cookies */
.cookie-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.cookie-modal.show {
    display: flex;
}

.cookie-modal-content {
    background: white;
    border-radius: 20px;
    max-width: 450px;
    width: 90%;
    max-height: 65vh;
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
}

.cookie-modal-header {
    padding: 2rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cookie-modal-header h2 {
    margin: 0;
    color: var(--dark-color);
}

.cookie-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: var(--text-color);
    transition: color 0.3s ease;
}

.cookie-modal-close:hover {
    color: var(--dark-color);
}

.cookie-modal-body {
    padding: 1.5rem;
}

.cookie-category {
    margin-bottom: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: start;
    gap: 1rem;
}

.cookie-category h3 {
    margin-bottom: 0.5rem;
    color: var(--dark-color);
}

.cookie-category p {
    margin: 0;
    color: var(--text-color);
    font-size: 0.875rem;
}

/* Switch de cookies */
.cookie-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    flex-shrink: 0;
}

.cookie-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.cookie-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.cookie-slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .cookie-slider {
    background-color: var(--primary-color);
}

input:checked + .cookie-slider:before {
    transform: translateX(26px);
}

input:disabled + .cookie-slider {
    opacity: 0.6;
    cursor: not-allowed;
}

.cookie-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.cookie-save {
    background: white;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}

/* Responsive cookies */
@media (max-width: 768px) {
    .cookie-content {
        flex-direction: column;
        text-align: center;
    }
    
    .cookie-buttons {
        width: 100%;
        flex-direction: column;
    }
    
    .cookie-category {
        flex-direction: column;
    }
    
    .cookie-modal-content {
        max-width: 95%;
        max-height: 70vh;
        margin: 1rem;
    }
    
    .cookie-modal-body {
        padding: 1rem;
    }
    
    .cookie-modal-footer {
        flex-direction: column;
        padding: 1rem;
    }
    
    .cookie-modal-header {
        padding: 1.5rem;
    }
}

/* CRITICAL FIX: Hacer visible el texto del hero */
.hero {
  background: linear-gradient(135deg, #1a1a2e 0%, #0f0f1e 100%) !important;
}

.hero-title {
  color: #ffffff !important;
}

.hero-title .text-gradient {
  background: linear-gradient(135deg, #10B981 0%, #34D399 50%, #6EE7B7 100%) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  filter: brightness(1.5) !important;
  font-weight: 900 !important;
  display: inline-block !important;
  text-shadow: 0 0 30px rgba(16, 185, 129, 0.5);
}

.hero-subtitle {
  color: #e2e8f0 !important;
}

/* Fallback si el gradiente no funciona */
@supports not (-webkit-background-clip: text) {
  .text-gradient {
    background: none !important;
    color: #10B981 !important;
  }
}