/* ===== RESET Y VARIABLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Colores principales */
    --primary-color: #dc2626;
    --secondary-color: #b91c1c;
    --accent-color: #ef4444;
    --text-color: #1f2937;
    --text-light: #6b7280;
    --background-color: #ffffff;
    --background-light: #fef2f2;
    --border-color: #fecaca;
    
    /* Tipografía */
    --font-primary: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    --font-heading: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    
    /* Espaciado */
    --section-padding: 4rem 0;
    --container-padding: 0 1rem;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    
    /* Transiciones */
    --transition: all 0.3s ease;
}

/* ===== TIPOGRAFÍA BASE ===== */
body {
    font-family: var(--font-primary);
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--background-color);
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 600;
    line-height: 1.2;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }

p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* ===== UTILIDADES ===== */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: var(--container-padding);
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
    color: var(--text-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    font-size: 1rem;
}

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

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

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

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

/* ===== HEADER Y NAVEGACIÓN ===== */
.header {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    z-index: 1000;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar {
    padding: 1rem 0;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-logo {
    display: flex;
    align-items: center;
}

.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-color);
    transition: var(--transition);
}

.logo-link:hover {
    transform: scale(1.05);
}

.logo-img {
    width: 180px;
    margin-right: -20px;
    height: auto;
}

.logo-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    display: none;
}

@media (min-width: 768px) {
    .logo-text {
        display: block;
    }
}

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

.nav-link {
    text-decoration: none;
    color: var(--text-color);
    font-weight: 500;
    transition: var(--transition);
    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: var(--transition);
}

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

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

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-color);
    margin: 3px 0;
    transition: var(--transition);
}

/* ===== HERO SECTION ===== */
.hero {
    min-height: 75vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.65) 0%, rgba(255, 255, 255, 0.65) 100%), url('../images/slide_2.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    padding-top: 80px;
    position: relative;
    overflow: hidden;
    filter: contrast(1.15) brightness(1.15);
}

/* Efecto de parallax suave */
@media (prefers-reduced-motion: no-preference) {
    .hero {
        background-attachment: fixed;
    }
}

/* Fallback para dispositivos móviles */
@media (max-width: 768px) {
    .hero {
        background-attachment: scroll;
    }
}

.hero::before {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.55);
    z-index: 1;
}

.hero-container {
    position: relative;
    z-index: 2;
}

.hero-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    text-align: center;
}

.hero-logo {
    margin-bottom: 1rem;
    animation: fadeInUp 1s ease;
}

.hero-logo-img {
    max-width: 400px;
    width: 100%;
    height: auto;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

.hero-subtitle {
    font-size: 1.5rem;
    color: var(--text-color);
    margin-bottom: 1.5rem;
    animation: fadeInUp 1s ease 0.2s both;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.highlight-red {
    color: #dc2626;
    font-weight: bold;
}

.hero-description {
    font-size: 1.1rem;
    color: var(--text-color);
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    animation: fadeInUp 1s ease 0.4s both;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    font-weight: 500;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    animation: fadeInUp 1s ease 0.6s both;
}

.hero-buttons .btn {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* ===== SECCIONES GENERALES ===== */
.about, .services, .projects, .contact {
    padding: var(--section-padding);
}

.about {
    background: var(--background-light);
}

.services {
    background: var(--background-color);
}

.projects {
    background: var(--background-light);
}

.contact {
    background: var(--background-color);
}

/* ===== SOBRE MÍ ===== */
.about-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.about-text p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.skills h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.skills-list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    justify-content: center;
}

.skills-list li {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
}

/* ===== SERVICIOS ===== */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.service-card {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    text-align: center;
    transition: var(--transition);
    border: 1px solid var(--border-color);
}

.service-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.service-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.service-card h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.service-card p {
    color: var(--text-light);
}

/* ===== PROYECTOS ===== */
.projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.project-card {
    background: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.project-year {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

.project-image {
    height: 200px;
    background: var(--background-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.project-content {
    padding: 1.5rem;
}

.project-content h3 {
    color: var(--text-color);
    margin-bottom: 1rem;
}

.project-content p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.project-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag {
    background: var(--background-light);
    color: var(--primary-color);
    padding: 0.25rem 0.75rem;
    border-radius: 15px;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
}

/* ===== CONTACTO ===== */
.contact-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 3rem;
    padding: 0 1rem;
}

.contact-intro p {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.contact-intro p:last-child {
    margin-bottom: 0;
}

.contact-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-top: 3rem;
}

/* Cuando hay formulario, usar dos columnas */
.contact-content:has(.contact-form) {
    grid-template-columns: 1fr 1fr;
}

.contact-info h3,
.contact-form h3 {
    color: var(--text-color);
    margin-bottom: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.contact-item:hover {
    background: white;
    box-shadow: var(--box-shadow);
    transform: translateX(5px);
}

.contact-link {
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition);
}

.contact-link:hover {
    color: var(--primary-color);
    text-decoration: underline;
}

.contact-item i {
    color: var(--primary-color);
    font-size: 1.2rem;
    width: 20px;
    flex-shrink: 0;
}

.contact-item span {
    color: var(--text-color);
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    text-decoration: none;
    transition: var(--transition);
}

.social-link:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

.contact-form {
    background: white;
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    border: 1px solid var(--border-color);
}

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

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

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.whatsapp-contact {
    text-align: center;
    margin-top: 3rem;
}

.whatsapp-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: #25d366;
    color: white;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    box-shadow: var(--box-shadow);
}

.whatsapp-btn:hover {
    background: #128c7e;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(37, 215, 102, 0.3);
}

.whatsapp-btn i {
    font-size: 1.2rem;
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.footer-logo-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.footer-logo-img {
    width: 140px;
    height: auto;
    filter: brightness(0) invert(1);
}

.footer-logo h3 {
    color: white;
    margin-bottom: 0.5rem;
}

.footer-logo p {
    color: #9ca3af;
    margin: 0;
}

.footer-links {
    display: flex;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-links a {
    color: #9ca3af;
    text-decoration: none;
    transition: var(--transition);
}

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

.footer-bottom {
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid #374151;
    color: #9ca3af;
}

.powered-by {
    margin-top: 0.5rem;
    font-size: 0.9rem;
}

.powered-by a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.powered-by a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    /* Logo */
    .logo-img {
        width: 180px;
        margin-right: -20px;
    }
    .footer-logo-content {
        flex-flow: column;
    }
    
    .footer-logo-img {
        width: 140px;
        filter: brightness(0) invert(1);
    }
    
    /* Navegación */
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: white;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .hamburger {
        display: flex;
    }

    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active .bar:nth-child(1) {
        transform: translateY(8px) rotate(45deg);
    }

    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-8px) rotate(-45deg);
    }

    /* Hero */
    .hero-logo-img {
        max-width: 300px;
    }

    .hero-subtitle {
        font-size: 1.25rem;
        margin-bottom: 1.25rem;
    }

    .hero-description {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
        padding: 0 1rem;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .hero-buttons .btn {
        min-width: 160px;
        padding: 0.875rem 1.75rem;
    }

    /* Contacto */
    .contact-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Footer */
    .footer-content {
        flex-direction: column;
        text-align: center;
    }

    .footer-links {
        justify-content: center;
    }
}

/* ===== PANTALLAS MEDIANAS ===== */
@media (max-width: 600px) and (min-width: 481px) {
    .hero-logo-img {
        max-width: 280px;
    }
    
    .hero-subtitle {
        font-size: 1.35rem;
    }
    
    .hero-description {
        font-size: 1.05rem;
        padding: 0 1.5rem;
    }
    
    .hero-buttons .btn {
        min-width: 150px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.5rem;
    }

    .hero {
        min-height: 55vh;
        padding: 8rem 0 2rem;
    }
    
    .hero-container {
        padding: 0 1rem;
    }

    .hero-logo-img {
        max-width: 250px;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
        margin-bottom: 1.25rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
        line-height: 1.5;
        margin-bottom: 2rem;
        padding: 0 0.75rem;
    }
    
    .hero-buttons {
        gap: 0.875rem;
    }
    
    .hero-buttons .btn {
        min-width: 145px;
        padding: 0.8rem 1.6rem;
        font-size: 0.95rem;
    }

    .section-title {
        font-size: 1.75rem;
    }

    .services-grid,
    .projects-grid {
        grid-template-columns: 1fr;
    }

    .project-card {
        margin: 0 0.5rem;
    }
}

/* ===== MOBILE FIRST - PANTALLAS MUY PEQUEÑAS ===== */
@media (max-width: 375px) {
    /* Hero section optimizado para iPhone SE */
    .hero {
        min-height: 50vh;
        padding: 8rem 0 2rem;
    }
    
    .hero-container {
        padding: 0 0.75rem;
    }
    
    .hero-logo {
        margin-bottom: 0.75rem;
    }
    
    .hero-logo-img {
        max-width: 200px;
        margin: 0 auto;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
        margin-bottom: 1rem;
        line-height: 1.3;
    }
    
    .hero-description {
        font-size: 0.9rem;
        line-height: 1.4;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .hero-buttons {
        gap: 0.75rem;
    }
    
    .hero-buttons .btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        min-width: 140px;
    }
    
    /* Ajustes generales para pantallas muy pequeñas */
    .container {
        padding: 0 0.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .section-intro {
        font-size: 0.9rem;
        line-height: 1.4;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for accessibility */
.btn:focus,
.nav-link:focus,
.social-link:focus,
.whatsapp-btn:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* ===== ESTILOS PARA JAVASCRIPT ===== */
.nav-link.active {
    color: var(--primary-color);
    font-weight: 600;
}

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

/* Estados de carga del formulario */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Animaciones para elementos que aparecen al scroll */
.service-card,
.project-card,
.contact-item {
    opacity: 1 !important; /* Forzar visibilidad */
    transform: translateY(0) !important; /* Sin transformación */
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.service-card.animate,
.project-card.animate,
.contact-item.animate {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Para elementos que se cargan dinámicamente, asegurar que sean visibles */
.service-card:not(.animate),
.project-card:not(.animate),
.contact-item:not(.animate) {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* FORZAR VISIBILIDAD - Reglas con mayor especificidad */
.services-grid .service-card,
.projects-grid .project-card,
.contact-info .contact-item {
    opacity: 1 !important;
    transform: translateY(0) !important;
    visibility: visible !important;
    display: block !important;
}

/* Asegurar que los contenedores también sean visibles */
.services-grid,
.projects-grid {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Estilos para mensajes de formulario */
.form-error,
.form-success {
    margin-top: 0.5rem;
    padding: 0.75rem;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
}

.form-error {
    color: #dc2626;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
}

.form-success {
    color: #059669;
    background-color: #d1fae5;
    border: 1px solid #a7f3d0;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    :root {
        --primary-color: #000080;
        --text-color: #000000;
        --background-color: #ffffff;
    }
} 

/* ===== SOBRE NOSOTROS FLEX ===== */
.about-flex {
    display: flex;
    align-items: stretch;
    gap: 3rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.about-photo-block {
    background: #fef2f2;
    border-radius: 24px;
    padding: 2.5rem 2rem 2rem 2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 260px;
    max-width: 320px;
    box-shadow: 0 4px 24px rgba(220, 38, 38, 0.07);
    margin: 0 auto;
}

.about-photo {
    width: 140px;
    height: 140px;
    object-fit: cover;
    border-radius: 50%;
    border: 5px solid #fff;
    box-shadow: 0 2px 12px rgba(220, 38, 38, 0.10);
    margin-bottom: 1.5rem;
}

.about-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.25rem;
    text-align: center;
}

.about-role {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 0.5rem;
    text-align: center;
}

.about-content {
    flex: 1 1 350px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 300px;
}

@media (max-width: 900px) {
    .about-flex {
        flex-direction: column;
        align-items: center;
        gap: 2rem;
    }
    .about-content {
        min-width: 0;
    }
    .about-photo-block {
        max-width: 100%;
    }
}

@media (max-width: 600px) {
    .about-photo {
        width: 100px;
        height: 100px;
    }
    .about-photo-block {
        padding: 1.5rem 1rem 1rem 1rem;
    }
} 