/* ======== VARIABLES CSS ======== */
:root {
    /* Colores principales */
    --primary-blue: #2563eb;
    --primary-blue-dark: #1d4ed8;
    --primary-green: #22c55e;
    --primary-green-dark: #16a34a;
    
    /* Colores de acento */
    --accent-purple: #8b5cf6;
    --accent-orange: #f97316;
    
    /* Colores neutros */
    --dark: #0f172a;
    --dark-light: #1e293b;
    --gray-900: #111827;
    --gray-700: #374151;
    --gray-600: #4b5563;
    --gray-500: #6b7280;
    --gray-400: #9ca3af;
    --gray-200: #e5e7eb;
    --gray-100: #f3f4f6;
    --gray-50: #f9fafb;
    --white: #ffffff;
    
    /* Gradientes */
    --gradient-primary: linear-gradient(135deg, var(--primary-blue) 0%, var(--primary-green) 100%);
    --gradient-hero: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #0f172a 100%);
    
    /* Tipografía */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    
    /* Espaciado */
    --section-padding: 6rem;
    --container-max: 1200px;
    
    /* Bordes y sombras */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    
    /* Transiciones */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
    
    /* Z-index */
    --z-header: 100;
    --z-menu: 200;
}

/* ======== RESET & BASE ======== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    line-height: 1.6;
    color: var(--gray-700);
    background-color: var(--white);
}

h1, h2, h3, h4, h5, h6 {
    color: var(--dark);
    font-weight: 700;
    line-height: 1.2;
}

ul {
    list-style: none;
}

a {
    text-decoration: none;
    color: inherit;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ======== UTILITIES ======== */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 1.5rem;
}

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

/* ======== HEADER & NAV ======== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: var(--z-header);
    background-color: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-200);
    transition: var(--transition-normal);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

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

.nav__logo img {
    height: 40px;
    width: auto;
}

.nav__list {
    display: flex;
    gap: 2rem;
}

.nav__link {
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--gray-600);
    transition: var(--transition-fast);
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-primary);
    transition: var(--transition-normal);
}

.nav__link:hover {
    color: var(--primary-blue);
}

.nav__link:hover::after {
    width: 100%;
}

.nav__actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav__toggle {
    display: none;
    font-size: 1.5rem;
    color: var(--dark);
    cursor: pointer;
}

.nav__close {
    display: none;
}

/* ======== BUTTONS ======== */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-family: var(--font-family);
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    white-space: nowrap;
}

.button--nav {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 0.6rem 1.25rem;
    font-size: 0.875rem;
}

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

.button--primary {
    background: var(--gradient-primary);
    color: var(--white);
    padding: 1rem 2rem;
    font-size: 1rem;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.4);
}

.button--primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.5);
}

.button--outline {
    background: transparent;
    color: var(--white);
    border: 2px solid rgba(255, 255, 255, 0.3);
    padding: 0.95rem 1.95rem;
}

.button--outline:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
}

.button--cta-large {
    background: var(--white);
    color: var(--primary-blue);
    padding: 1.25rem 2.5rem;
    font-size: 1.1rem;
    box-shadow: var(--shadow-xl);
}

.button--cta-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

/* ======== HERO SECTION ======== */
.hero {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding: 8rem 0 4rem;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    z-index: -1;
}

.hero__gradient {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
}

.hero__pattern {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 40px 40px;
    opacity: 0.5;
}

.hero__container {
    position: relative;
    z-index: 1;
}

.hero__content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.hero__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 50px;
    color: var(--white);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.hero__title {
    font-size: clamp(2.25rem, 5vw, 3.5rem);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.hero__subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

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

.hero__stats {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-top: 4rem;
    padding-top: 3rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.stat {
    text-align: center;
}

.stat__number {
    display: block;
    font-size: 2rem;
    font-weight: 800;
    color: var(--white);
    line-height: 1;
}

.stat__label {
    display: block;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    margin-top: 0.5rem;
}

/* ======== SECTIONS ======== */
.section {
    padding: var(--section-padding) 0;
}

.section--gray {
    background-color: var(--gray-50);
}

.section__header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 4rem;
}

.section__tag {
    display: inline-block;
    padding: 0.375rem 1rem;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(34, 197, 94, 0.1) 100%);
    color: var(--primary-blue);
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 50px;
    margin-bottom: 1rem;
}

.section__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    letter-spacing: -0.02em;
}

.section__title--left {
    text-align: left;
}

.section__subtitle {
    color: var(--gray-500);
    font-size: 1.1rem;
}

/* ======== SERVICES ======== */
.services__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.service-card {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-xl);
    padding: 2rem;
    transition: var(--transition-normal);
    display: flex;
    flex-direction: column;
}

.service-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

.service-card__icon-wrapper {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);
    border-radius: var(--radius-lg);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    color: var(--primary-blue);
}

.service-card__icon-wrapper--green {
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.1) 0%, rgba(34, 197, 94, 0.05) 100%);
    color: var(--primary-green);
}

.service-card__icon-wrapper--purple {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    color: var(--accent-purple);
}

.service-card__icon-wrapper--orange {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1) 0%, rgba(249, 115, 22, 0.05) 100%);
    color: var(--accent-orange);
}

.service-card__title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.service-card__description {
    color: var(--gray-500);
    font-size: 0.95rem;
    line-height: 1.7;
    flex-grow: 1;
}

.service-card__footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--gray-100);
}

.service-card__tag {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary-blue);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ======== PROCESS ======== */
.process__timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.process__line {
    position: absolute;
    left: 30px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: linear-gradient(to bottom, var(--primary-blue), var(--primary-green));
}

.process-step {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    position: relative;
}

.process-step:last-child {
    margin-bottom: 0;
}

.process-step__number {
    width: 60px;
    height: 60px;
    min-width: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gradient-primary);
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 700;
    border-radius: 50%;
    z-index: 1;
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

.process-step__content {
    background: var(--white);
    padding: 1.5rem 2rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    flex-grow: 1;
}

.process-step__title {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.process-step__text {
    color: var(--gray-500);
    font-size: 0.95rem;
}

/* ======== WHY US ======== */
.why-us__wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 4rem;
    align-items: center;
}

.why-us__content {
    order: 1;
}

.why-us__intro {
    font-size: 1.1rem;
    color: var(--gray-600);
    margin-bottom: 2.5rem;
    line-height: 1.8;
}

.features__list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.feature-item {
    display: flex;
    gap: 1.25rem;
    padding: 1.5rem;
    background: var(--gray-50);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--primary-green);
    transition: var(--transition-normal);
}

.feature-item:hover {
    transform: translateX(8px);
    box-shadow: var(--shadow-md);
}

.feature-item__icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    border-radius: var(--radius-md);
    color: var(--primary-green);
    font-size: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.feature-item__text h4 {
    font-size: 1.1rem;
    margin-bottom: 0.375rem;
}

.feature-item__text p {
    color: var(--gray-500);
    font-size: 0.95rem;
    margin: 0;
}

.why-us__image {
    display: flex;
    justify-content: center;
    order: 2;
}

.why-us__image-wrapper {
    position: relative;
    max-width: 300px;
}

.why-us__image-wrapper img {
    position: relative;
    z-index: 1;
}

.why-us__image-decoration {
    position: absolute;
    inset: -20px;
    background: var(--gradient-primary);
    border-radius: var(--radius-xl);
    opacity: 0.1;
    z-index: 0;
}

/* ======== CLIENTS ======== */
.clients__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.client-card {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    padding: 2rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--gray-200);
    transition: var(--transition-normal);
    overflow: hidden;
    min-height: 140px;
}

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

.client-card__logo {
    max-width: 160px;
    max-height: 80px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.7;
    transition: var(--transition-normal);
}

.client-card__logo--large {
    max-width: 200px;
    max-height: 110px;
}

.client-card:hover .client-card__logo {
    filter: grayscale(0%);
    opacity: 1;
}

.client-card__overlay {
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: var(--transition-normal);
}

.client-card__overlay span {
    color: var(--white);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.client-card:hover .client-card__overlay {
    opacity: 0.95;
}

/* ======== PORTFOLIO ======== */
.portfolio__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.portfolio-item {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-md);
    transition: var(--transition-normal);
}

.portfolio-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
}

.portfolio-item__image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.portfolio-item__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-slow);
}

.portfolio-item:hover .portfolio-item__image img {
    transform: scale(1.05);
}

.portfolio-item__content {
    padding: 1.25rem 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--white);
}

.portfolio-item__title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--dark);
}

.portfolio-item__cta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-blue);
    font-weight: 600;
    font-size: 0.875rem;
    transition: var(--transition-fast);
}

.portfolio-item:hover .portfolio-item__cta {
    gap: 0.75rem;
}

/* ======== CTA SECTION ======== */
.cta-section {
    position: relative;
    padding: 6rem 0;
    overflow: hidden;
}

.cta-section__bg {
    position: absolute;
    inset: 0;
    background: var(--gradient-hero);
    z-index: -1;
}

.cta-section__content {
    text-align: center;
    max-width: 600px;
    margin: 0 auto;
}

.cta-section__title {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--white);
    margin-bottom: 1rem;
}

.cta-section__text {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
}

/* ======== FOOTER ======== */
.footer {
    background: var(--dark);
    color: var(--gray-400);
    padding: 4rem 0 2rem;
}

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

.footer__logo {
    height: 45px;
    width: auto;
    margin-bottom: 1rem;
}

.footer__tagline {
    color: var(--gray-400);
    font-size: 0.95rem;
}

.footer__links h4,
.footer__contact h4 {
    color: var(--white);
    font-size: 1rem;
    margin-bottom: 1.25rem;
}

.footer__links ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer__links a {
    color: var(--gray-400);
    transition: var(--transition-fast);
}

.footer__links a:hover {
    color: var(--white);
}

.footer__contact p {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.footer__contact i {
    color: var(--primary-blue);
    width: 16px;
}

.footer__bottom {
    padding-top: 2rem;
    border-top: 1px solid var(--dark-light);
    text-align: center;
}

.footer__copyright {
    font-size: 0.875rem;
}

/* ======== ANIMATIONS ======== */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

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

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

/* Tablets */
@media screen and (min-width: 768px) {
    .why-us__wrapper {
        grid-template-columns: 1.2fr 0.8fr;
    }
    
    .why-us__content {
        order: 1;
    }
    
    .why-us__image {
        order: 2;
    }
    
    .footer__content {
        grid-template-columns: 1.5fr 1fr 1fr;
    }
    
    .process__line {
        left: 30px;
    }
}

/* Desktop */
@media screen and (min-width: 1024px) {
    :root {
        --section-padding: 7rem;
    }
    
    .services__grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .hero__stats {
        gap: 5rem;
    }
}

/* Mobile */
@media screen and (max-width: 767px) {
    .nav__menu {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 350px;
        height: 100vh;
        background: var(--white);
        box-shadow: -4px 0 20px rgba(0, 0, 0, 0.1);
        padding: 6rem 2rem 2rem;
        transition: var(--transition-normal);
        z-index: var(--z-menu);
    }
    
    .nav__menu.show-menu {
        right: 0;
    }
    
    .nav__list {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .nav__link {
        font-size: 1.1rem;
    }
    
    .nav__close {
        display: block;
        position: absolute;
        top: 1.5rem;
        right: 1.5rem;
        font-size: 1.5rem;
        color: var(--dark);
        cursor: pointer;
    }
    
    .nav__toggle {
        display: block;
    }
    
    .button--nav span {
        display: none;
    }
    
    .button--nav {
        padding: 0.6rem;
        font-size: 1.25rem;
    }
    
    .hero {
        min-height: auto;
        padding: 7rem 0 4rem;
    }
    
    .hero__stats {
        flex-direction: column;
        gap: 1.5rem;
    }
    
    .stat {
        display: flex;
        align-items: center;
        gap: 1rem;
        text-align: left;
    }
    
    .stat__number {
        font-size: 1.5rem;
    }
    
    .stat__label {
        margin-top: 0;
    }
    
    .process__line {
        left: 20px;
    }
    
    .process-step {
        gap: 1.25rem;
    }
    
    .process-step__number {
        width: 40px;
        height: 40px;
        min-width: 40px;
        font-size: 1rem;
    }
    
    .process-step__content {
        padding: 1.25rem;
    }
    
    .portfolio__grid {
        grid-template-columns: 1fr;
    }
    
    .section__header {
        margin-bottom: 3rem;
    }
    
    :root {
        --section-padding: 4rem;
    }
}

/* Overlay for mobile menu */
.nav__overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
    z-index: calc(var(--z-menu) - 1);
}

.nav__overlay.show {
    opacity: 1;
    visibility: visible;
}
