diff --git a/contacto.html b/contacto.html index a3cdaac..935d26f 100644 --- a/contacto.html +++ b/contacto.html @@ -116,56 +116,7 @@ - + diff --git a/css/styles.css b/css/styles.css index ac36365..e0f7b05 100644 --- a/css/styles.css +++ b/css/styles.css @@ -182,7 +182,7 @@ section { padding-block: var(--space-6); position: relative; } .gap-3 { gap: var(--space-3); } .gap-4 { gap: var(--space-4); } -.grid { display: grid; gap: var(--space-3); } +.grid { display: grid; gap: var(--space-3); border-radius: 24px; } @media (min-width: 860px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } @@ -200,7 +200,7 @@ section { padding-block: var(--space-6); position: relative; } font-family: var(--font-small); font-size: var(--step--1); font-weight: 500; - padding: 0.5rem 1.6rem; + padding: 0.2rem 1.6rem; border-radius: 999px; border: 1px solid transparent; transition: transform 0.25s ease, background 0.25s ease, border-color 0.25s ease, color 0.25s ease; @@ -210,15 +210,15 @@ section { padding-block: var(--space-6); position: relative; } .btn:focus-visible { outline: 3px solid var(--accent-roma-bright); outline-offset: 3px; } .btn-primary { - background: linear-gradient(135deg, var(--c-magenta), var(--c-teal-web)); + background: color-mix(in srgb, var(--accent-amor) 85%, black); color: #fff; } .btn-primary:hover { background: color-mix(in srgb, var(--accent-amor) 85%, black); } .btn-secondary { background: transparent; - color: var(--text); - border-color: var(--border-strong); + color: var(--accent-roma-bright); + border-color: var(--accent-roma-bright); } .btn-secondary:hover { border-color: var(--accent-roma-bright); color: var(--accent-roma-bright); } @@ -283,10 +283,13 @@ section { padding-block: var(--space-6); position: relative; } .nav-actions { display: flex; align-items: center; gap: var(--space-2); } .theme-toggle { - width: 42px; height: 42px; border-radius: 50%; + width: 42px; + height: 42px; + border-radius: 50%; border: 1px solid var(--border-strong); background: var(--bg-raised); - display: grid; place-items: center; + display: grid; + place-items: center; color: var(--text); } .theme-toggle svg { width: 18px; height: 18px; } @@ -481,7 +484,7 @@ html[data-theme="dark"] .theme-toggle .icon-moon { display: block; } .plan-card { border: 1px solid var(--border); - border-radius: 24px 24px 12px 12px; + border-radius: 24px 24px 24px 24px; padding: var(--space-3); background: var(--bg-raised); display: flex; flex-direction: column; gap: var(--space-2); diff --git a/diagnostico.html b/diagnostico.html index afc6a85..1c2c972 100644 --- a/diagnostico.html +++ b/diagnostico.html @@ -140,56 +140,7 @@ - + diff --git a/index.html b/index.html index f7b9c20..702a7d5 100644 --- a/index.html +++ b/index.html @@ -9,46 +9,8 @@ - +
+
@@ -155,7 +117,7 @@
- Explorar servicios + Explorar servicios
@@ -237,71 +199,19 @@ -
+

Tu próximo tiene que ser una estratégico.

- + diff --git a/js/main.js b/js/main.js index a9eb99a..2d7c0ca 100644 --- a/js/main.js +++ b/js/main.js @@ -4,38 +4,109 @@ (function () { "use strict"; - /* ---------- Tema claro / oscuro ---------- */ - const root = document.documentElement; - const stored = localStorage.getItem("ar-theme"); - const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches; - const initial = stored || (prefersDark ? "dark" : "light"); - root.setAttribute("data-theme", initial); + /* ---------- Función central para cambiar tema ---------- */ + function setTheme(theme) { + const root = document.documentElement; + root.setAttribute("data-theme", theme); + localStorage.setItem("ar-theme", theme); + } - document.querySelectorAll("[data-theme-toggle]").forEach((btn) => { - btn.addEventListener("click", () => { - const current = root.getAttribute("data-theme"); - const next = current === "dark" ? "light" : "dark"; - root.setAttribute("data-theme", next); - localStorage.setItem("ar-theme", next); + function toggleTheme() { + const root = document.documentElement; + const current = root.getAttribute("data-theme"); + const next = current === "dark" ? "light" : "dark"; + setTheme(next); + } + + function getPreferredTheme() { + const stored = localStorage.getItem("ar-theme"); + if (stored) return stored; + return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light"; + } + + /* ---------- Inicializar tema ---------- */ + setTheme(getPreferredTheme()); + + /* ---------- Inicializar toggle (se puede llamar varias veces) ---------- */ + function initThemeToggle() { + document.querySelectorAll("[data-theme-toggle]").forEach((btn) => { + // Remover listeners duplicados + btn.removeEventListener("click", toggleTheme); + btn.addEventListener("click", toggleTheme); }); - }); + } /* ---------- Menú móvil ---------- */ - const navToggle = document.querySelector("[data-nav-toggle]"); - const mobileMenu = document.querySelector("[data-mobile-menu]"); - if (navToggle && mobileMenu) { - navToggle.addEventListener("click", () => { - mobileMenu.classList.toggle("open"); - const expanded = mobileMenu.classList.contains("open"); - navToggle.setAttribute("aria-expanded", String(expanded)); - }); - mobileMenu.querySelectorAll("a").forEach((a) => - a.addEventListener("click", () => mobileMenu.classList.remove("open")) - ); + function initMobileMenu() { + const navToggle = document.querySelector("[data-nav-toggle]"); + const mobileMenu = document.querySelector("[data-mobile-menu]"); + if (navToggle && mobileMenu) { + // Remover listeners duplicados + const newToggle = navToggle.cloneNode(true); + navToggle.parentNode.replaceChild(newToggle, navToggle); + + newToggle.addEventListener("click", function () { + mobileMenu.classList.toggle("open"); + const expanded = mobileMenu.classList.contains("open"); + this.setAttribute("aria-expanded", String(expanded)); + }); + + mobileMenu.querySelectorAll("a").forEach((a) => + a.addEventListener("click", () => { + mobileMenu.classList.remove("open"); + const toggle = document.querySelector("[data-nav-toggle]"); + if (toggle) toggle.setAttribute("aria-expanded", "false"); + }) + ); + } } + /* ---------- Inicializar todo al cargar ---------- */ + initThemeToggle(); + initMobileMenu(); + /* ---------- Año dinámico en footer ---------- */ document.querySelectorAll("[data-year]").forEach((el) => { el.textContent = new Date().getFullYear(); }); + + /* ============================================ + EMBED PARCIALS (header + footer) + ============================================ */ + document.addEventListener('DOMContentLoaded', function () { + const headerPlaceholder = document.getElementById('header-placeholder'); + const footerPlaceholder = document.getElementById('footer-placeholder'); + + if (headerPlaceholder) { + fetch('partials/header.html') + .then(res => { + if (!res.ok) throw new Error('HTTP ' + res.status); + return res.text(); + }) + .then(html => { + headerPlaceholder.outerHTML = html; + // Re-inicializar componentes después del fetch + initThemeToggle(); + initMobileMenu(); + }) + .catch(err => console.warn('Header no cargado:', err)); + } + + if (footerPlaceholder) { + fetch('partials/footer.html') + .then(res => { + if (!res.ok) throw new Error('HTTP ' + res.status); + return res.text(); + }) + .then(html => { + footerPlaceholder.outerHTML = html; + // Actualizar año automático + document.querySelectorAll("[data-year]").forEach((el) => { + el.textContent = new Date().getFullYear(); + }); + }) + .catch(err => console.warn('Footer no cargado:', err)); + } + }); + })(); \ No newline at end of file diff --git a/metodo.html b/metodo.html index 372037d..e3e32e1 100644 --- a/metodo.html +++ b/metodo.html @@ -131,58 +131,7 @@ - + diff --git a/nosotros.html b/nosotros.html index 5977052..9fbb057 100644 --- a/nosotros.html +++ b/nosotros.html @@ -126,58 +126,7 @@ - + diff --git a/partials/footer.html b/partials/footer.html new file mode 100644 index 0000000..776b85d --- /dev/null +++ b/partials/footer.html @@ -0,0 +1,53 @@ + \ No newline at end of file diff --git a/partials/header.html b/partials/header.html new file mode 100644 index 0000000..4d4c0db --- /dev/null +++ b/partials/header.html @@ -0,0 +1,40 @@ + \ No newline at end of file diff --git a/planes.html b/planes.html index 48408e9..1ea6eb7 100644 --- a/planes.html +++ b/planes.html @@ -151,58 +151,7 @@ - + diff --git a/portfolio.html b/portfolio.html index 2492297..277eb63 100644 --- a/portfolio.html +++ b/portfolio.html @@ -163,58 +163,7 @@ - + diff --git a/servicios.html b/servicios.html index 652ffa6..1257e9c 100644 --- a/servicios.html +++ b/servicios.html @@ -194,58 +194,7 @@ - +