:root {
    --bg: #ffffff;
    --text: #0f0f0f;
    --text-light: #6b6b6b;
    --border: #e2e2e2;
    --accent: #0f0f0f;
    --spacing: clamp(1.5rem, 5vw, 4rem);
    --font-main: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --transition: 0.25s ease;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html { scroll-behavior: smooth; scroll-padding-top: 5rem; }

body {
    font-family: var(--font-main);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; transition: opacity var(--transition); }
a:hover { opacity: 0.7; }
img { max-width: 100%; display: block; height: auto; }

/* Header */
header {
    position: fixed; top: 0; left: 0; width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
    padding: 1rem var(--spacing);
    display: flex; justify-content: space-between; align-items: center;
    z-index: 1000;
}

.logo-container { display: flex; align-items: center; gap: 1rem; }
.logo-img { height: 50px; width: auto; object-fit: contain; }
.logo-text { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.03em; }

nav ul { display: flex; gap: 2rem; list-style: none; font-size: 0.9rem; font-weight: 500; letter-spacing: 0.02em; }

/* Slider Hero */
.hero { position: relative; min-height: 100vh; display: flex; align-items: center; justify-content: center; overflow: hidden; padding: var(--spacing); }
.slider-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.slider-bg img { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.5s ease-in-out; }
.slider-bg img.active { opacity: 0.4; }
.overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.3); z-index: 1; }
.hero-content { position: relative; z-index: 2; text-align: center; max-width: 900px; color: var(--bg); }
.hero-content h1 { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 300; line-height: 1.15; letter-spacing: -0.04em; margin-bottom: 1.5rem; text-shadow: 0 2px 10px rgba(0,0,0,0.3); }
.hero-content .lead { font-size: 1.2rem; line-height: 1.7; opacity: 0.95; text-shadow: 0 1px 5px rgba(0,0,0,0.3); }

/* Secciones generales */
section { padding: 6rem var(--spacing); min-height: 100vh; display: flex; flex-direction: column; justify-content: center; }
h2 { font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 400; letter-spacing: -0.03em; margin-bottom: 3rem; position: relative; display: inline-block; align-self: center; }
h2::after { content: ""; display: block; width: 40px; height: 1px; background: var(--text); margin-top: 1rem; margin-left: auto; margin-right: auto; }

/* Portfolio Grid */
.portfolio-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 3rem; max-width: 1200px; margin: 0 auto; width: 100%; }
.project { display: flex; flex-direction: column; cursor: pointer; transition: transform var(--transition); }
.project:hover { transform: translateY(-5px); }
.project-media { aspect-ratio: 4 / 3; background: #f4f4f4; overflow: hidden; position: relative; }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.project:hover .project-media img { transform: scale(1.05); }
.project-meta { padding-top: 1.5rem; text-align: center; }
.project-meta h3 { font-size: 1.25rem; font-weight: 500; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.project-meta p { font-size: 0.85rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.05em; }

/* Servicios */
.services-section { padding: 6rem var(--spacing); background-color: #f8f8f8; }
.services-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; max-width: 1200px; margin: 0 auto; }
.service-card { background: var(--bg); padding: 2.5rem 2rem; text-align: center; border: 1px solid var(--border); transition: transform var(--transition), box-shadow var(--transition); }
.service-card:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,0.05); }
.service-icon { width: 48px; height: 48px; margin-bottom: 1.5rem; color: var(--text); }
.service-card h3 { font-size: 1.1rem; font-weight: 500; margin-bottom: 0.75rem; letter-spacing: -0.01em; }
.service-card p { font-size: 0.9rem; color: var(--text-light); line-height: 1.6; }

/* Galería */
.gallery-header { padding: 8rem var(--spacing) 3rem; text-align: center; border-bottom: 1px solid var(--border); }
.gallery-header h1 { font-size: clamp(2rem, 4vw, 3rem); font-weight: 300; letter-spacing: -0.03em; margin-bottom: 1rem; }
.gallery-header p { color: var(--text-light); font-size: 1.1rem; }
.gallery-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 2rem; padding: var(--spacing); max-width: 1400px; margin: 0 auto; }
.gallery-item { position: relative; overflow: hidden; aspect-ratio: 4/3; background: #f4f4f4; cursor: pointer; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.gallery-item:hover img { transform: scale(1.03); }

/* Lightbox */
.lightbox { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.95); z-index: 2000; justify-content: center; align-items: center; }
.lightbox.active { display: flex; }
.lightbox-content { position: relative; max-width: 90%; max-height: 90%; display: flex; justify-content: center; align-items: center; }
.lightbox-img { max-width: 100%; max-height: 90vh; object-fit: contain; box-shadow: 0 10px 40px rgba(0,0,0,0.5); }
.lightbox-close { position: absolute; top: 20px; right: 40px; font-size: 3rem; color: white; cursor: pointer; z-index: 2001; transition: opacity var(--transition); line-height: 1; }
.lightbox-close:hover { opacity: 0.7; }
.lightbox-nav { position: absolute; top: 50%; transform: translateY(-50%); font-size: 3rem; color: white; cursor: pointer; padding: 1rem; z-index: 2001; transition: opacity var(--transition); user-select: none; }
.lightbox-nav:hover { opacity: 0.7; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
.lightbox-counter { position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); color: white; font-size: 0.9rem; background: rgba(0,0,0,0.5); padding: 0.5rem 1rem; border-radius: 4px; }

/* Contacto */
.contact-section { position: relative; padding: 6rem var(--spacing); min-height: 100vh; display: flex; flex-direction: column; justify-content: center; overflow: hidden; }
.contact-bg { position: absolute; top: 0; left: 0; width: 100%; height: 100%; z-index: 0; }
.contact-bg img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.7) blur(2px); }
.contact-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.88); z-index: 1; }
.contact-content { position: relative; z-index: 2; max-width: 1100px; margin: 0 auto; width: 100%; display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.contact-content h2 { grid-column: 1 / -1; margin-bottom: 3rem; align-self: flex-start; margin-left: 0; }
.contact-content h2::after { margin-left: 0; }
.contact-form { display: grid; grid-template-columns: 1fr; gap: 1.5rem; }
.success-message, .error-message { padding: 1rem; margin-bottom: 1.5rem; font-size: 0.95rem; line-height: 1.5; display: none; }
.success-message { background: #e8f5e9; color: #2e7d32; border-left: 4px solid #4caf50; }
.error-message { background: #ffebee; color: #c62828; border-left: 4px solid #ef5350; }
.contact-info { padding-top: 0.5rem; }
.contact-info-item { margin-bottom: 2.5rem; }
.contact-info-item:last-child { margin-bottom: 0; }
.contact-info-item h3 { font-size: 0.95rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.6rem; color: var(--text); }
.contact-info-item p, .contact-info-item a { font-size: 1.05rem; color: var(--text-light); line-height: 1.6; display: block; }
.contact-info-item a:hover { color: var(--text); }
.form-group { display: flex; flex-direction: column; }
label { font-size: 0.85rem; font-weight: 500; margin-bottom: 0.5rem; letter-spacing: 0.03em; }
input, textarea { padding: 0.9rem 1rem; border: 1px solid var(--border); background: rgba(255, 255, 255, 0.9); font-family: inherit; font-size: 1rem; transition: border-color var(--transition), box-shadow var(--transition); border-radius: 0; -webkit-appearance: none; }
input:focus, textarea:focus { outline: none; border-color: var(--text); box-shadow: 0 0 0 3px rgba(15, 15, 15, 0.05); }
textarea { resize: vertical; min-height: 140px; }
button { background: var(--accent); color: var(--bg); border: none; padding: 1rem 2.5rem; font-size: 0.95rem; font-weight: 500; cursor: pointer; transition: opacity var(--transition); justify-self: start; margin-top: 0.5rem; }
button:hover { opacity: 0.85; }
.back-link { display: inline-block; margin: 3rem auto; padding: 0.75rem 2rem; border: 1px solid var(--text); text-align: center; transition: all var(--transition); cursor: pointer; }
.back-link:hover { background: var(--text); color: var(--bg); }

/* Footer */
footer { padding: 3rem var(--spacing); border-top: 1px solid var(--border); text-align: center; font-size: 0.85rem; color: var(--text-light); position: relative; z-index: 10; }
.footer-credit { margin-top: 1rem; font-size: 0.8rem; color: #999; }

/* Responsive */
@media (max-width: 900px) {
    .services-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    header { flex-direction: column; gap: 1rem; padding: 1rem; }
    nav ul { gap: 1.25rem; font-size: 0.85rem; }
    section { padding: 5rem var(--spacing); }
    h2::after { width: 30px; }
    .contact-content { grid-template-columns: 1fr; }
    .contact-content h2 { margin-bottom: 2rem; }
    button { width: 100%; justify-self: stretch; }
    .gallery-grid, .portfolio-grid { grid-template-columns: 1fr; }
    .services-grid { grid-template-columns: 1fr; }
    .lightbox-nav { font-size: 2rem; padding: 0.5rem; }
    .lightbox-prev { left: 10px; } .lightbox-next { right: 10px; }
    .lightbox-close { top: 10px; right: 20px; font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .project-media img, a, input, textarea, button, .slider-bg img, .gallery-item img, .service-card { transition: none; }
}
/* ========== WHATSAPP LINK ========== */
.whatsapp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #25D366;
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.whatsapp-link:hover {
    opacity: 0.85;
    transform: translateX(2px);
}

.whatsapp-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: inline-block;
}

/* Asegurar que el texto del enlace herede el color */
.whatsapp-link span {
    color: inherit;
}