/*
Theme Name: Mavicort
Theme URI: https://mavicort.cl
Author: Héctor Vielma
Description: Tema a medida para MAVICORT Estructuras SpA. Sin constructores visuales, sin jQuery.
Version: 1.0.1
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: mavicort
*/

:root {
  --navy: #073358;
  --navy-900: #04203a;
  --navy-050: #eaf0f6;
  --red: #d42027;
  --red-600: #b3171d;
  --steel: #f2f4f7;
  --line: #dde3ea;
  --ink: #0e1a26;
  --muted: #566577;
  --white: #fff;
  --radius: 10px;
  --shadow: 0 18px 40px -18px rgba(4, 32, 58, .35);
  --wrap: 1200px;
  --head: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "Barlow", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.22, .61, .36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 17px/1.65 var(--body); color: var(--ink); background: var(--white); overflow-x: hidden; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; line-height: 1.05; margin: 0 0 .5em; letter-spacing: .005em; }
p { margin: 0 0 1em; }
.wrap { width: min(var(--wrap), 100% - 32px); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 16px; top: -60px; background: var(--navy); color: #fff; padding: 10px 16px; z-index: 100; border-radius: 6px; }
.skip:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .55em; font: 600 16px/1 var(--body); text-decoration: none; padding: 15px 24px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn:active { transform: translateY(1px); }
.btn--red { background: var(--red); color: #fff; }
.btn--red:hover { background: var(--red-600); }
.btn--ghost { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn--ghost:hover { background: #fff; color: var(--navy); border-color: #fff; }
.btn--navy { background: var(--navy); color: #fff; }
.btn--navy:hover { background: var(--navy-900); }
.btn--white { background: #fff; color: var(--red); }
.btn--white:hover { background: var(--navy-900); color: #fff; }

.eyebrow { display: inline-flex; align-items: center; gap: 10px; font: 600 14px/1 var(--body); letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: 18px; }
.eyebrow::before { content: ""; width: 28px; height: 3px; background: currentColor; }
.section { padding: clamp(72px, 9vw, 120px) 0; }
.section-head { max-width: 720px; margin-bottom: clamp(36px, 5vw, 56px); }
.section-head h2 { font-size: clamp(36px, 5vw, 56px); text-transform: uppercase; color: var(--navy); }
.section-head p { color: var(--muted); font-size: 18px; }

/* ---------- Header ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid transparent; transition: border-color .2s, box-shadow .2s; }
.site-header.is-scrolled { border-color: var(--line); box-shadow: 0 6px 20px -14px rgba(4, 32, 58, .4); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 76px; }
.brand img { width: 190px; height: auto; }
.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 30px; }
.nav a { font: 500 16px/1 var(--body); text-decoration: none; color: var(--ink); padding: 8px 0; position: relative; }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: 0; height: 2px; background: var(--red); transition: right .25s var(--ease); }
.nav a:hover::after, .nav a.is-active::after { right: 0; }
.header-cta { display: flex; align-items: center; gap: 18px; }
.header-phone { font: 600 16px/1 var(--body); color: var(--navy); text-decoration: none; display: inline-flex; gap: 8px; align-items: center; }
.header-phone svg { width: 18px; height: 18px; color: var(--red); }
.header-cta .btn { padding: 12px 20px; }
.nav-toggle { display: none; background: none; border: 0; padding: 10px; margin-right: -10px; cursor: pointer; color: var(--navy); }
.nav-toggle svg { width: 28px; height: 28px; }

@media (max-width: 1080px) {
  .header-phone span { display: none; }
}
@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .header-cta { display: none; }
  .nav { position: fixed; inset: 76px 0 auto 0; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); transform: translateY(-8px); opacity: 0; visibility: hidden; transition: .25s var(--ease); }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav ul { flex-direction: column; gap: 0; padding: 8px 16px 20px; }
  .nav li a { display: block; padding: 16px 4px; border-bottom: 1px solid var(--steel); font-size: 18px; }
  .nav a::after { display: none; }
  .nav .nav-mobile-cta { display: flex; gap: 10px; padding-top: 16px; }
  .nav .nav-mobile-cta a { display: inline-flex; border: 0; flex: 1; justify-content: center; padding: 15px; font-size: 16px; }
}
@media (min-width: 921px) { .nav-mobile-cta { display: none !important; } }

/* ---------- Hero ---------- */
.hero { position: relative; color: #fff; background: var(--navy-900); overflow: hidden; }
.hero-bg { position: absolute; inset: 0; background: url("assets/img/image-hero.webp") center/cover no-repeat; opacity: .55; }
.hero::before { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(100deg, var(--navy-900) 0%, rgba(4, 32, 58, .92) 38%, rgba(7, 51, 88, .55) 75%, rgba(212, 32, 39, .35) 100%); }
.hero-inner { position: relative; z-index: 2; display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 56px; padding: clamp(64px, 9vw, 120px) 0 clamp(96px, 11vw, 150px); }
.hero .eyebrow { color: #ff8a8e; }
.hero h1 { font-size: clamp(46px, 7.2vw, 92px); text-transform: uppercase; line-height: .95; margin-bottom: 26px; }
.hero h1 em { font-style: normal; color: var(--red); }
@media (max-width: 480px) { .eyebrow { letter-spacing: .08em; font-size: 13px; } }
.hero-lead { font-size: clamp(18px, 1.6vw, 21px); max-width: 560px; color: rgba(255, 255, 255, .86); margin-bottom: 34px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; }
.hero-media { position: relative; justify-self: end; width: 100%; max-width: 380px; }
.hero-media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; border-radius: var(--radius); box-shadow: 0 30px 60px -20px rgba(0, 0, 0, .6); }
.hero-media::before { content: ""; position: absolute; inset: 18px -18px -18px 18px; border: 2px solid var(--red); border-radius: var(--radius); z-index: -1; }
.hero-badge { position: absolute; left: -34px; bottom: 34px; background: #fff; color: var(--navy); border-radius: 8px; padding: 16px 20px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.hero-badge strong { font: 700 44px/1 var(--head); color: var(--red); }
.hero-badge span { font: 600 14px/1.25 var(--body); }

@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero-media { justify-self: start; max-width: 320px; margin-left: 18px; }
  .hero-badge { left: -18px; }
}

/* ---------- Trust strip ---------- */
.trust { position: relative; z-index: 3; margin-top: -64px; }
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.trust-item { padding: 28px 26px; border-right: 1px solid var(--line); }
.trust-item:last-child { border-right: 0; }
.trust-item strong { display: block; font: 700 40px/1 var(--head); color: var(--navy); margin-bottom: 6px; }
.trust-item strong b { color: var(--red); font-weight: 700; }
.trust-item span { color: var(--muted); font-size: 15px; line-height: 1.4; display: block; }
@media (max-width: 860px) {
  .trust-grid { grid-template-columns: 1fr 1fr; }
  .trust-item:nth-child(2) { border-right: 0; }
  .trust-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 420px) { .trust-item { padding: 22px 18px; } .trust-item strong { font-size: 34px; } }

/* ---------- Services ---------- */
.services-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.service { position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; text-decoration: none; transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s; }
.service:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: transparent; }
.service-img { aspect-ratio: 16/11; overflow: hidden; background: var(--steel); }
.service-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.service:hover .service-img img { transform: scale(1.05); }
.service-body { position: relative; padding: 38px 22px 24px; flex: 1; display: flex; flex-direction: column; }
.service-icon { position: absolute; top: -30px; left: 20px; width: 60px; height: 60px; border-radius: 8px; background: #fff; box-shadow: 0 8px 20px -8px rgba(4, 32, 58, .35); padding: 8px; }
.service h3 { font-size: 24px; text-transform: uppercase; color: var(--navy); margin-bottom: 8px; }
.service p { color: var(--muted); font-size: 16px; margin-bottom: 18px; }
.service-link { margin-top: auto; font: 600 15px/1 var(--body); color: var(--red); display: inline-flex; gap: 6px; align-items: center; }
.service-link svg { width: 16px; height: 16px; transition: transform .2s var(--ease); }
.service:hover .service-link svg { transform: translateX(4px); }
.service--featured { grid-column: span 2; grid-row: span 1; flex-direction: row; background: var(--navy); border-color: var(--navy); color: #fff; }
.service--featured .service-img { flex: 1 1 50%; aspect-ratio: auto; }
.service--featured .service-body { flex: 1 1 50%; padding: 32px 30px; justify-content: center; }
.service--featured .service-icon { position: static; margin-bottom: 18px; }
.service--featured h3 { color: #fff; font-size: 32px; }
.service--featured p { color: rgba(255, 255, 255, .8); }
.service--featured .service-link { color: #ff8a8e; }
.service-tag { display: inline-block; align-self: flex-start; font: 600 12px/1 var(--body); letter-spacing: .12em; text-transform: uppercase; background: var(--red); color: #fff; padding: 7px 10px; border-radius: 4px; margin-bottom: 14px; }
@media (max-width: 1080px) { .services-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) {
  .services-grid { grid-template-columns: 1fr; }
  .service--featured { grid-column: auto; flex-direction: column; }
  .service--featured .service-img { aspect-ratio: 16/11; }
}

/* ---------- About ---------- */
.about { background: var(--steel); }
.about-grid { display: grid; grid-template-columns: 1fr 1.05fr; gap: clamp(40px, 6vw, 80px); align-items: center; }
.about-media { position: relative; padding: 0 40px 60px 0; }
.about-media .img-main { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: var(--radius); }
.about-media .img-sub { position: absolute; right: 0; bottom: 0; width: 46%; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius); border: 6px solid var(--steel); }
.about-media .stamp { position: absolute; left: 22px; top: 22px; background: var(--red); color: #fff; font: 700 15px/1.1 var(--head); text-transform: uppercase; letter-spacing: .06em; padding: 12px 14px; border-radius: 6px; }
.about-text h2 { font-size: clamp(36px, 5vw, 56px); text-transform: uppercase; color: var(--navy); }
.about-text p { color: #33424f; }
.about-text .lead { font-size: 20px; color: var(--ink); font-weight: 500; }
.mvv { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: clamp(48px, 6vw, 72px); }
.mvv-card { background: #fff; border-radius: var(--radius); padding: 30px 28px; border-top: 4px solid var(--navy); }
.mvv-card:nth-child(2) { border-top-color: var(--red); }
.mvv-card h3 { font-size: 26px; text-transform: uppercase; color: var(--navy); }
.mvv-card p { color: var(--muted); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chips li { background: var(--navy-050); color: var(--navy); font: 600 14px/1 var(--body); padding: 9px 12px; border-radius: 99px; }
@media (max-width: 900px) { .about-grid, .mvv { grid-template-columns: 1fr; } }

/* ---------- Why ---------- */
.why { position: relative; background: var(--navy-900); color: #fff; overflow: hidden; }
.why::before { content: ""; position: absolute; inset: 0; background: url("assets/img/construction-34.webp") center/cover; opacity: .18; }
.why::after { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 0 0, rgba(7, 51, 88, .9), transparent 60%), radial-gradient(circle at 100% 100%, rgba(212, 32, 39, .35), transparent 55%); }
.why > .wrap { position: relative; z-index: 1; }
.why .section-head h2 { color: #fff; }
.why .section-head p { color: rgba(255, 255, 255, .75); }
.why .eyebrow { color: #ff8a8e; }
.why-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius); overflow: hidden; }
.why-item { background: rgba(4, 32, 58, .82); padding: 34px 30px; transition: background .3s; }
.why-item:hover { background: rgba(7, 51, 88, .95); }
.why-item .num { font: 700 18px/1 var(--head); color: var(--red); letter-spacing: .08em; display: block; margin-bottom: 18px; }
.why-item h3 { font: 600 21px/1.35 var(--body); margin: 0; }
.why-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px; margin-top: 44px; }
.why-foot p { max-width: 620px; margin: 0; font-size: 19px; color: rgba(255, 255, 255, .85); }
@media (max-width: 900px) { .why-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 580px) { .why-grid { grid-template-columns: 1fr; } }

/* ---------- Projects ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter { font: 600 15px/1 var(--body); padding: 11px 16px; border-radius: 99px; border: 1px solid var(--line); background: #fff; color: var(--ink); cursor: pointer; transition: .2s; }
.filter:hover { border-color: var(--navy); }
.filter[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: #fff; }
.gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.gallery-item { position: relative; margin: 0; border-radius: 8px; overflow: hidden; background: var(--steel); aspect-ratio: 1; }
.gallery-item[hidden] { display: none; }
.gallery-item button { all: unset; cursor: zoom-in; display: block; width: 100%; height: 100%; }
.gallery-item button:focus-visible { outline: 3px solid var(--red); outline-offset: -3px; }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.gallery-item figcaption { position: absolute; inset: auto 0 0 0; padding: 30px 14px 12px; font: 600 14px/1.2 var(--body); color: #fff; background: linear-gradient(transparent, rgba(4, 32, 58, .85)); opacity: 0; transform: translateY(6px); transition: .3s var(--ease); pointer-events: none; }
.gallery-item:hover img { transform: scale(1.06); }
.gallery-item:hover figcaption, .gallery-item:focus-within figcaption { opacity: 1; transform: none; }
@media (max-width: 900px) { .gallery { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 600px) { .gallery { grid-template-columns: repeat(2, 1fr); gap: 8px; } .gallery-item figcaption { opacity: 1; transform: none; font-size: 12px; } }
@media (hover: none) { .gallery-item figcaption { opacity: 1; transform: none; } }

.lightbox { border: 0; padding: 0; background: transparent; max-width: min(1000px, 94vw); max-height: 92vh; overflow: visible; }
.lightbox::backdrop { background: rgba(4, 18, 32, .92); }
.lightbox img { max-width: 100%; max-height: 80vh; margin: 0 auto; border-radius: 8px; }
.lightbox p { color: #fff; text-align: center; margin: 14px 0 0; font-weight: 600; }
.lb-btn { position: fixed; top: 50%; transform: translateY(-50%); width: 52px; height: 52px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, .12); color: #fff; cursor: pointer; display: grid; place-items: center; transition: background .2s; }
.lb-btn:hover { background: var(--red); }
.lb-btn svg { width: 24px; height: 24px; }
.lb-prev { left: 16px; } .lb-next { right: 16px; }
.lb-close { top: 16px; right: 16px; transform: none; }

/* ---------- Emergency band ---------- */
.band { background: var(--red); color: #fff; }
.band .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding: 44px 0; }
.band h2 { font-size: clamp(28px, 3.6vw, 42px); text-transform: uppercase; margin: 0; }
.band p { margin: 6px 0 0; color: rgba(255, 255, 255, .88); }

/* ---------- Contact ---------- */
.contact-grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(32px, 5vw, 64px); align-items: start; }
.contact-list { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 18px; }
.contact-list li { display: flex; gap: 16px; align-items: flex-start; }
.contact-list .ico { flex: none; width: 46px; height: 46px; border-radius: 8px; background: var(--navy-050); color: var(--navy); display: grid; place-items: center; }
.contact-list .ico svg { width: 22px; height: 22px; }
.contact-list small { display: block; color: var(--muted); font-size: 14px; }
.contact-list a, .contact-list strong { font-weight: 600; color: var(--ink); text-decoration: none; font-size: 17px; }
.contact-list a:hover { color: var(--red); }
.map { border: 0; width: 100%; height: 260px; border-radius: var(--radius); filter: grayscale(.3); }
.form-card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow); }
.form-card h3 { font-size: 32px; text-transform: uppercase; color: var(--navy); }
.form-card > p { color: var(--muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { margin-bottom: 16px; }
.field label { display: block; font: 600 14px/1 var(--body); margin-bottom: 8px; color: var(--ink); }
.field label .req { color: var(--red); }
.field input, .field select, .field textarea { width: 100%; font: 400 16px/1.4 var(--body); color: var(--ink); background: var(--steel); border: 1px solid var(--line); border-radius: 6px; padding: 13px 14px; transition: border-color .2s, background .2s; }
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); background: #fff; box-shadow: 0 0 0 3px rgba(7, 51, 88, .12); }
.hp { position: absolute; left: -9999px; }
.form-card .btn { width: 100%; justify-content: center; padding: 17px; font-size: 17px; }
.form-note { font-size: 13px; color: var(--muted); margin: 12px 0 0; text-align: center; }
.alert { padding: 14px 16px; border-radius: 6px; margin-bottom: 18px; font-weight: 500; }
.alert--ok { background: #e6f5ec; color: #11613a; }
.alert--err { background: #fdecec; color: #9b1419; }
@media (max-width: 900px) { .contact-grid { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .form-row { grid-template-columns: 1fr; gap: 0; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-900); color: rgba(255, 255, 255, .75); padding: 64px 0 28px; font-size: 15px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255, 255, 255, .12); }
.footer-logo { width: 190px; filter: brightness(0) invert(1); margin-bottom: 18px; }
.site-footer h4 { font-size: 18px; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin-bottom: 16px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; }
.social { display: flex; gap: 10px; margin-top: 18px; }
.social a { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .08); color: #fff; transition: background .2s; }
.social a:hover { background: var(--red); }
.social svg { width: 20px; height: 20px; }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; padding-top: 24px; font-size: 14px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }

/* ---------- WhatsApp ---------- */
.wa-float { position: fixed; right: 20px; bottom: 20px; z-index: 60; width: 60px; height: 60px; border-radius: 50%; background: #25d366; color: #fff; display: grid; place-items: center; box-shadow: 0 10px 24px -6px rgba(0, 0, 0, .35); transition: transform .2s var(--ease); }
.wa-float:hover { transform: scale(1.07); }
.wa-float svg { width: 32px; height: 32px; }
.wa-float::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #25d366; animation: pulse 2.4s infinite; z-index: -1; }
@keyframes pulse { 0% { transform: scale(1); opacity: .6; } 100% { transform: scale(1.6); opacity: 0; } }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.js .reveal.is-in { opacity: 1; transform: none; }

/* ---------- Basic pages (index.php) ---------- */
.page-content { padding: 80px 0; max-width: 820px; }
.page-content h1 { font-size: 48px; color: var(--navy); text-transform: uppercase; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
