:root {
    --accent: #0a7c4a;
    --accent-dark: color-mix(in srgb, var(--accent) 62%, #000);
    --dark: #111111;
    --text: #1a1a1a;
    --muted: #64748b;
    --bg: #f5f7fa;
    --logo-h: 55px;
    --header-h: calc(var(--logo-h) + 30px);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: 'Poppins', sans-serif; color: var(--text); background: var(--bg); line-height: 1.6; }
img { max-width: 100%; height: auto; }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; left: -999px; top: 0; background: #fff; color: var(--text); padding: 8px 14px; z-index: 3000; }
.skip:focus { left: 8px; top: 8px; }

/* Encabezado fijo con menú */
.topbar { position: fixed; top: 0; left: 0; width: 100%; z-index: 1000; display: flex; justify-content: space-between; align-items: center; padding: 15px 60px; background: rgba(255,255,255,.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.brand { display: flex; align-items: center; }
.brand img { height: var(--logo-h); width: auto; display: block; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; }
.nav li { position: relative; }
.nav a { display: block; margin-left: 25px; text-decoration: none; color: #333; font-weight: 500; padding: 6px 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--accent); }
.nav .has-sub > a::after { content: "▾"; margin-left: 6px; font-size: .8em; }
.nav .sub { display: none; position: absolute; right: 0; top: 100%; min-width: 230px; background: #fff; border-radius: 10px; padding: 8px 0; box-shadow: 0 10px 25px rgba(0,0,0,.12); flex-direction: column; align-items: stretch; }
.nav li:hover > .sub, .nav li:focus-within > .sub { display: flex; }
.nav .sub a { margin: 0; padding: 8px 20px; white-space: nowrap; }
.nav-toggle { display: none; background: none; border: 1px solid #cbd5e1; color: #333; width: 44px; height: 44px; border-radius: 8px; font-size: 1.2rem; cursor: pointer; }

/* Portada */
.hero-full { min-height: 100vh; min-height: 100svh; background-size: cover; background-position: center; display: flex; align-items: center; justify-content: center; text-align: center; color: #fff; padding: calc(var(--header-h) + 30px) 24px 60px; }
.hero-band { background: var(--dark); color: #fff; text-align: center; padding: calc(var(--header-h) + 50px) 24px 60px; }
.hero-in { max-width: 800px; }
.hero-full h1, .hero-band h1 { font-size: 48px; line-height: 1.2; margin: 0; font-weight: 700; }
.hero-full p, .hero-band p { margin: 15px 0 0; font-size: 20px; }

/* Botón */
.btn { display: inline-block; margin-top: 25px; background: var(--accent); color: #fff; padding: 12px 28px; border-radius: 30px; text-decoration: none; font-weight: 500; transition: .3s; }
.btn:hover { transform: scale(1.05); background: var(--accent-dark); }

/* Secciones */
main.no-hero { padding-top: var(--header-h); }
.sec { padding: 100px 60px; scroll-margin-top: var(--header-h); }
.sec-in { max-width: 1200px; margin: 0 auto; }
.sec.is-center .sec-in, .sec-in.is-center { text-align: center; }
.section-title { text-align: center; margin: 0 0 50px; font-size: 2rem; line-height: 1.25; }
.section-sub { text-align: center; color: var(--muted); max-width: 640px; margin: -30px auto 40px; }
.sec-cta { margin: 0; text-align: center; }

/* Servicios */
.services { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 25px; }
.card { background: #fff; padding: 30px; border-radius: 15px; box-shadow: 0 10px 25px rgba(0,0,0,.05); transition: .3s; }
.card:hover { transform: translateY(-10px); }
.card > i { font-size: 1.8rem; color: var(--accent); margin-bottom: 12px; display: block; }
.card h3 { margin: 0 0 10px; font-size: 1.2rem; }
.card p { margin: 0; color: #475569; }
.card-link { display: inline-block; margin-top: 14px; color: var(--accent); font-weight: 600; text-decoration: none; }
.card-link:hover { text-decoration: underline; }

/* Proyectos */
.portfolio { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.project { position: relative; overflow: hidden; border-radius: 15px; background: #e2e8f0; }
.project a { display: block; color: inherit; text-decoration: none; }
.project img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; transition: .4s; }
.project:hover img { transform: scale(1.1); }
.overlay { position: absolute; bottom: 0; left: 0; width: 100%; padding: 15px; background: rgba(0,0,0,.7); color: #fff; }

/* Sección con imagen de fondo */
.sec-dark { background-size: cover; background-position: center; color: #fff; text-align: center; }
.sec-dark .section-title { color: #fff; }
.sec-dark .text-block { background: none; box-shadow: none; padding: 0; }
.sec-dark .text-body a { color: #fff; }

/* Texto libre */
.text-block { display: grid; gap: 30px; align-items: center; }
.text-block.layout-right:not(.no-img) { grid-template-columns: 1.4fr 1fr; }
.text-block.layout-left:not(.no-img) { grid-template-columns: 1fr 1.4fr; }
.text-img { margin: 0; }
.text-img img { width: 100%; border-radius: 12px; display: block; }
.text-body { max-width: 75ch; }
.is-center .text-body { margin-left: auto; margin-right: auto; }
.text-body > * + * { margin-top: 1em; }
.text-body > :first-child { margin-top: 0; }
.text-body p { margin-bottom: 0; }
.text-body h2, .text-body h3, .text-body h4 { line-height: 1.3; }
.text-body a { color: var(--accent); }
.text-body ul, .text-body ol { padding-left: 1.4em; text-align: left; }
.text-body blockquote { border-left: 4px solid var(--accent); margin-left: 0; padding-left: 16px; color: var(--muted); text-align: left; }
.text-body table { border-collapse: collapse; width: 100%; }
.text-body th, .text-body td { border: 1px solid #e2e8f0; padding: 8px 10px; text-align: left; }
.text-body iframe { width: 100%; min-height: 320px; border: 0; border-radius: 10px; }
.text-body img { border-radius: 10px; }

/* Profesionales y tarjetas con lista (se pueden seguir usando) */
.profesionales-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.prof-card { background: #fff; border-radius: 12px; padding: 25px; box-shadow: 0 4px 15px rgba(0,0,0,.05); display: flex; align-items: center; gap: 20px; transition: transform .3s; text-align: left; }
.prof-card:hover { transform: translateY(-5px); }
.prof-icon { width: 60px; height: 60px; flex: none; border-radius: 50%; background: #e2e8f0; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; color: var(--dark); overflow: hidden; }
.prof-icon img { width: 100%; height: 100%; object-fit: cover; }
.prof-info h3 { margin: 0; font-size: 1.1rem; }
.prof-role { margin: 0; font-size: .85rem; color: var(--muted); }
.prof-info a { display: inline-block; margin-top: 5px; color: var(--accent); text-decoration: none; font-weight: 600; font-size: .9rem; }
.business-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 25px; }
.biz-card { background: #fff; border-radius: 12px; padding: 30px; box-shadow: 0 4px 15px rgba(0,0,0,.05); display: flex; flex-direction: column; justify-content: space-between; border-top: 4px solid var(--accent); text-align: left; }
.biz-img { width: 100%; height: 160px; object-fit: cover; border-radius: 8px; margin-bottom: 16px; }
.biz-header { display: flex; align-items: center; gap: 15px; margin-bottom: 15px; }
.biz-header i { font-size: 1.8rem; color: var(--accent); }
.biz-header h3 { margin: 0; font-size: 1.25rem; }
.biz-desc { color: var(--muted); font-size: .95rem; margin: 0 0 20px; }
.biz-services { list-style: none; margin: 0 0 20px; padding: 0; }
.biz-services li { font-size: .88rem; margin-bottom: 8px; padding-left: 18px; position: relative; color: #475569; }
.biz-services li::before { content: "•"; color: var(--accent); font-weight: bold; position: absolute; left: 0; }
.btn-visit { display: inline-block; align-self: flex-start; background: var(--dark); color: #fff; text-decoration: none; padding: 10px 20px; border-radius: 6px; font-weight: 600; font-size: .9rem; transition: background .3s; }
.btn-visit:hover { background: var(--accent); }

/* Pie */
.site-footer { background: var(--dark); color: #fff; text-align: center; padding: 30px 20px; }
.site-footer p { margin: 0; }
.foot-contact { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 22px; margin-bottom: 16px; }
.foot-contact a, .foot-contact span { color: #e2e8f0; text-decoration: none; font-size: .9rem; }
.foot-contact a:hover { color: #fff; text-decoration: underline; }
.foot-contact i { margin-right: 4px; color: var(--accent); }
.foot-social { display: flex; justify-content: center; gap: 10px; margin-bottom: 16px; }
.foot-social a { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,.12); color: #fff; display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.foot-social a:hover { background: var(--accent); }

/* Barra para el administrador (solo con sesión abierta) */
.adminbar { position: fixed; left: 14px; bottom: 14px; z-index: 2000; background: #111827; color: #fff; font-size: .8rem; padding: 8px 14px; border-radius: 99px; display: flex; gap: 16px; box-shadow: 0 6px 20px rgba(0,0,0,.3); }
.adminbar a { color: #fff; text-decoration: none; }
.adminbar a:hover { text-decoration: underline; }
.adminbar i { margin-right: 4px; }

/* Aparición al desplazarse (solo si hay JavaScript) */
.js .fade { opacity: 0; transform: translateY(30px); transition: 1s; }
.js .fade.visible { opacity: 1; transform: translateY(0); }

@media (min-width: 900px) {
    .hero-full { background-attachment: fixed; }
}

@media (max-width: 900px) {
    .topbar { flex-wrap: wrap; padding: 15px 20px; max-height: 100vh; overflow-y: auto; }
    .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
    .nav { display: none; width: 100%; }
    .nav.open { display: block; padding-bottom: 8px; }
    .nav ul { flex-direction: column; align-items: stretch; }
    .nav a { margin: 0; padding: 12px 4px; }
    .nav .sub { display: block; position: static; box-shadow: none; padding: 0 0 0 14px; min-width: 0; background: none; }
    .nav .has-sub > a::after { display: none; }
}

@media (max-width: 768px) {
    .sec { padding: 80px 20px; }
    .hero-full h1, .hero-band h1 { font-size: 32px; }
    .hero-full p, .hero-band p { font-size: 18px; }
    .section-title { font-size: 1.6rem; margin-bottom: 36px; }
    .text-block.layout-right:not(.no-img), .text-block.layout-left:not(.no-img) { grid-template-columns: 1fr; }
    .portfolio { grid-template-columns: 1fr; }
    .business-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .js .fade { opacity: 1; transform: none; transition: none; }
    .card, .btn, .project img, .prof-card { transition: none; }
    .card:hover, .btn:hover, .project:hover img, .prof-card:hover { transform: none; }
}
