/* Reset y fuentes del sistema */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Variables de color para tema claro y oscuro */
:root {
    /* Tema claro (Apple) */
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-tertiary: #fafafa;
    --text-primary: #1d1d1f;
    --text-secondary: #86868b;
    --border-color: rgba(0, 0, 0, 0.05);
    --nav-bg: rgba(255, 255, 255, 0.8);
    --nav-bg-scrolled: rgba(255, 255, 255, 0.95);
    --card-bg: #fafafa;
    --card-bg-hover: #ffffff;
    --shadow-light: rgba(0, 0, 0, 0.1);
    --shadow-medium: rgba(0, 0, 0, 0.15);
    --accent-green: #FFD700;
    --accent-blue: #007aff;
}

[data-theme="dark"] {
    /* Tema oscuro (Apple) */
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-tertiary: #2c2c2e;
    --text-primary: #ffffff;
    --text-secondary: #98989d;
    --border-color: rgba(255, 255, 255, 0.1);
    --nav-bg: rgba(0, 0, 0, 0.8);
    --nav-bg-scrolled: rgba(0, 0, 0, 0.95);
    --card-bg: #1c1c1e;
    --card-bg-hover: #2c2c2e;
    --shadow-light: rgba(0, 0, 0, 0.3);
    --shadow-medium: rgba(0, 0, 0, 0.5);
    --accent-green: #FFD700;
    --accent-blue: #0a84ff;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Navegación */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
}

.logo span {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 32px;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--text-primary);
    background-color: var(--border-color);
}

/* Botón de toggle de tema */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theme-toggle:hover {
    background: var(--card-bg-hover);
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow-light);
}

.theme-toggle svg {
    color: var(--text-primary);
    transition: all 0.3s ease;
    position: absolute;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.moon-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .sun-icon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Layout principal */
main {
    padding-top: 64px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
    overflow: hidden;
    position: relative;
}

.hero-content {
    padding: 48px 48px 48px 64px;
    z-index: 2;
}

.hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
    color: var(--text-primary);
    line-height: 1.1;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    font-weight: 400;
    line-height: 1.5;
}

.hero-image {
    position: relative;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-image img {
    width: 80%;
    height: 80%;
    object-fit: cover;
    object-position: center center;
    border-radius: 20px;
    box-shadow: 0 20px 40px var(--shadow-medium);
    transition: transform 0.1s ease-out;
}

.cta-button {
    display: inline-block;
    background: var(--accent-green);
    color: black;
    text-decoration: none;
    padding: 16px 32px;
    border-radius: 24px;
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    background: var(--accent-green);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(52, 199, 89, 0.3);
    filter: brightness(1.1);
}

/* Animaciones de entrada */
.fade-in-up {
    opacity: 0;
    transform: translateY(60px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-left {
    opacity: 0;
    transform: translateX(-60px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fade-in-right {
    opacity: 0;
    transform: translateX(60px);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.scale-in {
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* Estados visibles */
.fade-in-up.visible,
.fade-in-left.visible,
.fade-in-right.visible {
    opacity: 1;
    transform: translate(0, 0);
}

.scale-in.visible {
    opacity: 1;
    transform: scale(1);
}

/* Retrasos escalonados */
.fade-in-left {
    transition-delay: 0.1s;
}

.fade-in-right {
    transition-delay: 0.2s;
}

/* Secciones */
section {
    padding: 120px 0;
}

section:nth-child(even) {
    background: var(--bg-primary);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 64px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

/* Valores Section */
.valores {
    background: var(--bg-primary);
}

.valor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 48px;
}

.valor-card {
    background: var(--card-bg);
    padding: 48px 40px;
    border-radius: 20px;
    text-align: center;
    transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.valor-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: left 0.6s ease;
}

[data-theme="dark"] .valor-card::before {
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
}

.valor-card:hover::before {
    left: 100%;
}

.valor-card:hover {
    transform: translateY(-12px);
    box-shadow: 0 25px 50px var(--shadow-medium);
    background: var(--card-bg-hover);
}

.valor-card h3 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.valor-card p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    line-height: 1.6;
}

/* Historia Section */
.historia {
    background: var(--bg-tertiary);
}

.historia-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: center;
}

.historia-text h2 {
    font-size: 2.75rem;
    font-weight: 700;
    margin-bottom: 32px;
    color: var(--text-primary);
    letter-spacing: -0.01em;
    line-height: 1.2;
}

.historia-text p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
    line-height: 1.7;
}

.historia-text p:last-child {
    margin-bottom: 0;
}

.historia-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.floating-card {
    background: var(--bg-primary);
    padding: 48px;
    border-radius: 24px;
    box-shadow: 0 20px 40px var(--shadow-light);
    text-align: center;
    animation: float 6s ease-in-out infinite;
    border: 1px solid var(--border-color);
}

.stat h3 {
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-green);
    margin-bottom: 8px;
    letter-spacing: -0.02em;
}

.stat p {
    color: var(--text-secondary);
    font-size: 1.125rem;
    font-weight: 500;
}

/* Producto Preview */
.producto-preview {
    background: var(--bg-primary);
}

.preview-content {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.producto-preview h2 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 24px;
    color: var(--accent-green);
    letter-spacing: -0.02em;
}

.producto-preview p {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
    line-height: 1.6;
}

.link-arrow {
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 1.125rem;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.link-arrow:hover {
    color: var(--accent-blue);
    transform: translateX(4px);
    filter: brightness(1.2);
}

/* Footer */
footer {
    background: var(--bg-secondary);
    padding: 48px 0;
    border-top: 1px solid var(--border-color);
}

footer p {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .hero {
        grid-template-columns: 1fr;
        min-height: 80vh;
    }
    
    .hero-content {
        padding: 48px 32px;
        text-align: center;
        order: 2;
    }
    
    .hero-image {
        height: 50vh;
        order: 1;
    }
    
    .historia-layout {
        grid-template-columns: 1fr;
        gap: 48px;
        text-align: center;
    }
    
    .valor-grid {
        grid-template-columns: 1fr;
        gap: 32px;
    }
}

@media (max-width: 768px) {
    .nav-container {
        padding: 0 16px;
        height: 56px;
    }

    .nav-links {
        gap: 16px;
    }

    .nav-links a {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    main {
        padding-top: 56px;
    }

    .container {
        padding: 0 16px;
    }

    section {
        padding: 80px 0;
    }

    .hero {
        min-height: 70vh;
    }

    .hero-content {
        padding: 32px 16px;
    }

    .hero-image {
        height: 40vh;
    }

    .section-title {
        font-size: 2rem;
        margin-bottom: 48px;
    }

    .valor-card {
        padding: 32px 24px;
    }

    .historia-text h2 {
        font-size: 2rem;
    }

    .historia-text p {
        font-size: 1.125rem;
    }

    .floating-card {
        padding: 32px;
    }

    .stat h3 {
        font-size: 2.5rem;
    }

    .producto-preview h2 {
        font-size: 2.25rem;
    }

    /* Simplificar animaciones en móvil */
    .parallax-element {
        transform: none !important;
    }
}

@media (max-width: 480px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 12px 16px;
        gap: 12px;
    }

    .nav-links {
        gap: 12px;
    }

    main {
        padding-top: 80px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero p {
        font-size: 1.125rem;
    }

    .hero-image {
        height: 35vh;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .historia-text h2 {
        font-size: 1.75rem;
    }

    .producto-preview h2 {
        font-size: 2rem;
    }

    .valor-card {
        padding: 24px 20px;
    }

    .floating-card {
        padding: 24px;
    }

    .stat h3 {
        font-size: 2rem;
    }

    /* Deshabilitar animaciones complejas en móviles pequeños */
    .fade-in-up,
    .fade-in-left,
    .fade-in-right,
    .scale-in {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}

/* Optimización de performance */
@media (prefers-reduced-motion: reduce) {
    .fade-in-up,
    .fade-in-left,
    .fade-in-right,
    .scale-in,
    .floating-card {
        animation: none !important;
        transition: none !important;
        opacity: 1 !important;
        transform: none !important;
    }
    
    .parallax-element {
        transform: none !important;
    }
}

/* Mejoras adicionales para animaciones suaves */
* {
    will-change: auto;
}

.fade-in-up,
.fade-in-left,
.fade-in-right,
.scale-in {
    will-change: opacity, transform;
}

.parallax-element {
    will-change: transform;
}

/* Estados de focus mejorados */
.cta-button:focus,
.nav-links a:focus,
.link-arrow:focus,
.theme-toggle:focus {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* Animaciones */
@keyframes float {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg); 
    }
    50% { 
        transform: translateY(-20px) rotate(2deg); 
    }
}

/* Scroll suave y optimización */
@supports (scroll-behavior: smooth) {
    html {
        scroll-behavior: smooth;
    }
}

/* Optimización para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .valor-card:hover {
        transform: none;
    }
    
    .cta-button:hover {
        transform: none;
    }
    
    .theme-toggle:hover {
        transform: none;
    }
}