/*
Theme Name: Flexipro
Theme URI: https://pro.flexicasas.es
Author: Crescita
Description: Tema propio del marketplace de profesionales de la red Flexicasas. Sin constructores ni dependencias externas.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 8.0
Text Domain: flexipro
*/

*, *::before, *::after { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Jost, "Segoe UI", system-ui, -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.65;
    color: var(--fx-body, #55606E);
    background: var(--fx-bg, #F6F9FC);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { color: var(--fx-ink, #1F2A37); line-height: 1.25; font-weight: 700; }
a { color: var(--fx-blue, #2C8AD6); }
img { max-width: 100%; height: auto; }

.fx-wrap { width: min(1140px, 92vw); margin: 0 auto; }
.fx-section { padding: 72px 0; }
.fx-section-tight { padding: 46px 0; }
.fx-section-alt { background: #fff; }
.fx-eyebrow { display: inline-block; font-size: .82rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--fx-blue, #2C8AD6); margin-bottom: 12px; }
.fx-h2 { font-size: clamp(1.6rem, 3.4vw, 2.3rem); margin: 0 0 14px; }
.fx-lead { font-size: 1.08rem; color: var(--fx-body); max-width: 640px; margin: 0 0 34px; }
.fx-center { text-align: center; }
.fx-center .fx-lead { margin-left: auto; margin-right: auto; }

/* Cabecera */
.fx-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-bottom: 1px solid var(--fx-line, #E2E8F0); }
.fx-header-in { display: flex; align-items: center; gap: 22px; padding: 14px 0; }
.fx-logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.18rem; color: var(--fx-ink); text-decoration: none; }
.fx-logo-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, #2C8AD6, #1863DC); color: #fff; }
.fx-logo b { color: var(--fx-blue); font-weight: 700; }
.fx-nav { display: flex; gap: 22px; margin-left: auto; }
.fx-nav a { color: var(--fx-ink); text-decoration: none; font-weight: 600; font-size: .96rem; }
.fx-nav a:hover { color: var(--fx-blue); }
.fx-header-cta { display: flex; gap: 10px; align-items: center; }
.fx-burger { display: none; background: none; border: 1px solid var(--fx-line); border-radius: 9px; padding: 9px 11px; cursor: pointer; }

/* Héroe con fotografía */
.fx-hero { position: relative; padding: 84px 0 92px; color: #fff; overflow: hidden; isolation: isolate; }
.fx-hero-bg {
    position: absolute; inset: 0; z-index: -2;
    background-image: var(--fx-hero-img); background-size: cover; background-position: center 55%;
    transform: scale(1.04);
    filter: saturate(1.1) contrast(1.05);
}
.fx-hero::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: linear-gradient(100deg, rgba(7, 32, 56, .93) 0%, rgba(11, 58, 100, .86) 38%, rgba(20, 88, 145, .55) 66%, rgba(44, 138, 214, .22) 100%);
}
.fx-hero-in { position: relative; display: grid; grid-template-columns: 1.02fr .98fr; gap: 52px; align-items: center; }
.fx-hero-flag {
    display: inline-flex; align-items: center; gap: 7px; padding: 7px 15px; margin-bottom: 20px;
    background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .26);
    border-radius: 999px; font-size: .84rem; font-weight: 600; backdrop-filter: blur(4px);
}
.fx-hero h1 { color: #fff; font-size: clamp(2rem, 4.4vw, 3.05rem); margin: 0 0 18px; text-wrap: balance; text-shadow: 0 2px 22px rgba(6, 28, 48, .35); }
.fx-hero p { font-size: 1.12rem; color: rgba(255, 255, 255, .93); margin: 0 0 26px; max-width: 38ch; }
.fx-hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.fx-hero-points li { display: flex; align-items: center; gap: 11px; color: rgba(255, 255, 255, .96); font-weight: 500; }
.fx-hero-points .fxp-i { flex: none; background: rgba(255, 255, 255, .2); border-radius: 50%; padding: 5px; }
.fx-hero-stats { display: flex; gap: 30px; margin-top: 32px; padding-top: 24px; border-top: 1px solid rgba(255, 255, 255, .22); }
.fx-hero-stats strong { display: block; font-size: 1.9rem; line-height: 1; }
.fx-hero-stats span { font-size: .86rem; color: rgba(255, 255, 255, .8); }
.fx-hero-card { background: #fff; border-radius: 20px; padding: 28px; box-shadow: 0 28px 70px rgba(6, 28, 48, .34); }
.fx-hero-card h2 { font-size: 1.28rem; margin: 0 0 4px; }
.fx-hero-card p { color: var(--fx-body); font-size: .95rem; margin: 0 0 18px; }

/* Franja de marcas del grupo */
.fx-marcas { background: linear-gradient(180deg, #0B1B2B, #102A40); padding: 34px 0 38px; }
.fx-marcas-title { text-align: center; margin: 0 0 24px; color: #8FA6BC; font-size: .82rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.fx-marcas-row { display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; justify-items: center; gap: 22px 30px; }
.fx-marcas-row img { height: 38px; width: auto; opacity: 1; transition: transform .2s; }
.fx-marcas-row img:hover { transform: translateY(-2px); }

/* Rejillas */
.fx-grid { display: grid; gap: 18px; }
.fx-grid-3 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.fx-grid-4 { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }

.fx-card { background: #fff; border: 1px solid var(--fx-line); border-radius: 14px; padding: 26px; box-shadow: 0 1px 2px rgba(17,38,62,.06), 0 4px 12px rgba(17,38,62,.05); }
.fx-card h3 { margin: 14px 0 8px; font-size: 1.12rem; }
.fx-card p { margin: 0; font-size: .95rem; }
.fx-card-icon { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 12px; background: #E8F4FB; color: var(--fx-blue); }

.fx-svc { display: flex; align-items: center; gap: 13px; padding: 15px 18px; background: #fff; border: 1px solid var(--fx-line); border-radius: 12px; text-decoration: none; color: var(--fx-ink); font-weight: 600; font-size: .96rem; transition: all .16s ease; }
.fx-svc:hover { border-color: var(--fx-blue); transform: translateY(-2px); box-shadow: 0 10px 24px rgba(17,38,62,.09); }
.fx-svc .fxp-i { color: var(--fx-blue); }
.fx-svc small { display: block; font-weight: 400; color: var(--fx-muted); font-size: .82rem; }

.fx-steps-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 26px; counter-reset: n; }
.fx-step-c { position: relative; padding-top: 12px; }
.fx-step-c::before { counter-increment: n; content: counter(n); display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; background: var(--fx-blue); color: #fff; font-weight: 700; margin-bottom: 14px; }
.fx-step-c h3 { margin: 0 0 8px; font-size: 1.1rem; }
.fx-step-c p { margin: 0; font-size: .96rem; }

.fx-cta { background: linear-gradient(135deg, #0F4C81, #2C8AD6); color: #fff; border-radius: 20px; padding: 46px; display: flex; flex-wrap: wrap; gap: 26px; align-items: center; justify-content: space-between; }
.fx-cta h2 { color: #fff; margin: 0 0 8px; font-size: 1.7rem; }
.fx-cta p { margin: 0; color: rgba(255,255,255,.9); max-width: 52ch; }

.fx-trust { display: flex; flex-wrap: wrap; gap: 30px; justify-content: center; padding: 26px 0; color: var(--fx-muted); font-size: .92rem; }
.fx-trust span { display: inline-flex; align-items: center; gap: 8px; }
.fx-trust .fxp-i { color: var(--fx-green, #37B863); }

/* Ficha de profesional */
.fx-profile { display: grid; grid-template-columns: 1.6fr 1fr; gap: 30px; align-items: start; }
.fx-profile-head { display: flex; gap: 20px; align-items: center; margin-bottom: 22px; }
.fx-profile-logo { width: 88px; height: 88px; border-radius: 16px; overflow: hidden; background: #E8F4FB; display: grid; place-items: center; flex: none; }
.fx-profile-logo img { width: 100%; height: 100%; object-fit: cover; }
.fx-profile-logo span { font-size: 2.2rem; font-weight: 700; color: var(--fx-blue); }
.fx-profile h1 { margin: 0 0 6px; font-size: 2rem; }
.fx-side-card { position: sticky; top: 92px; }
.fx-review { border-top: 1px solid var(--fx-line); padding: 18px 0; }
.fx-review:first-of-type { border-top: 0; }
.fx-review h4 { margin: 6px 0 6px; font-size: 1rem; }
.fx-review p { margin: 0; font-size: .95rem; }
.fx-review-meta { font-size: .85rem; color: var(--fx-muted); }

/* Contenido de páginas */
.fx-page { padding: 52px 0 72px; }
.fx-page-head { margin-bottom: 30px; }
.fx-page-head h1 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); margin: 0 0 8px; }
.fx-prose { background: #fff; border: 1px solid var(--fx-line); border-radius: 14px; padding: 34px; }
.fx-prose :is(h2, h3) { margin-top: 1.6em; }
.fx-prose > *:first-child { margin-top: 0; }

/* Pie */
.fx-footer { background: #0F2438; color: #A9BACB; padding: 54px 0 26px; margin-top: 60px; }
.fx-footer a { color: #D6E4F0; text-decoration: none; }
.fx-footer a:hover { color: #fff; }
.fx-footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; margin-bottom: 34px; }
.fx-footer h4 { color: #fff; font-size: .95rem; margin: 0 0 14px; letter-spacing: .04em; text-transform: uppercase; }
.fx-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 9px; font-size: .93rem; }
.fx-footer-brand p { font-size: .93rem; max-width: 34ch; }
.fx-footer-bottom { border-top: 1px solid rgba(255,255,255,.12); padding-top: 20px; display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between; font-size: .86rem; }

@media (max-width: 980px) {
    .fx-hero-in, .fx-profile { grid-template-columns: 1fr; }
    .fx-footer-grid { grid-template-columns: 1fr 1fr; }
    .fx-side-card { position: static; }
}
@media (max-width: 780px) {
    .fx-nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: #fff; border-bottom: 1px solid var(--fx-line); padding: 8px 5vw 18px; display: none; }
    .fx-nav.is-open { display: flex; }
    .fx-nav a { padding: 12px 0; border-bottom: 1px solid var(--fx-line); }
    .fx-burger { display: block; margin-left: auto; }
    .fx-header-cta .fx-hide-sm { display: none; }
    .fx-section { padding: 52px 0; }
    .fx-cta { padding: 32px 24px; }
}


/* Tarjetas de categoría con foto */
.fx-cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 42px; }
.fx-cat {
    position: relative; display: block; overflow: hidden; border-radius: 16px; min-height: 210px;
    text-decoration: none; color: #fff; box-shadow: 0 2px 8px rgba(17, 38, 62, .1);
    transition: transform .22s ease, box-shadow .22s ease;
}
.fx-cat img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.fx-cat::after {
    content: ""; position: absolute; inset: 0;
    background: linear-gradient(180deg, rgba(9, 30, 50, .05) 20%, rgba(9, 30, 50, .55) 58%, rgba(7, 24, 40, .92) 100%);
}
.fx-cat:hover { transform: translateY(-3px); box-shadow: 0 18px 38px rgba(17, 38, 62, .18); }
.fx-cat:hover img { transform: scale(1.06); }
.fx-cat-body { position: absolute; left: 18px; right: 18px; bottom: 16px; z-index: 1; display: grid; gap: 3px; }
.fx-cat-icon {
    display: grid; place-items: center; width: 36px; height: 36px; margin-bottom: 6px;
    border-radius: 10px; background: rgba(255, 255, 255, .2); backdrop-filter: blur(4px); color: #fff;
}
.fx-cat-name { font-weight: 700; font-size: 1rem; line-height: 1.25; text-shadow: 0 1px 12px rgba(0, 0, 0, .5); }
.fx-cat-brand { font-size: .8rem; color: rgba(255, 255, 255, .8); }
.fx-cat-more-title { font-weight: 600; color: var(--fx-muted); margin: 0 0 14px; }

/* Sección oscura con obras */
.fx-section-dark { background: linear-gradient(165deg, #0B1B2B, #123A5C); color: #C3D3E2; }
.fx-eyebrow-light { color: var(--fx-sky, #9AD9EA); }
.fx-h2-light { color: #fff; }
.fx-lead-light { color: #B9CBDB; }
.fx-ba-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 34px; }
.fx-ba { margin: 0; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .12); border-radius: 16px; overflow: hidden; }
.fx-ba img { display: block; width: 100%; height: auto; }
.fx-ba figcaption { padding: 15px 18px; display: grid; gap: 2px; }
.fx-ba figcaption strong { color: #fff; }
.fx-ba figcaption span { font-size: .85rem; color: #93AABF; }

/* Bloque partido foto + contenido */
.fx-split { display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: center; }
.fx-split-media { position: relative; }
.fx-split-media img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 20px 50px rgba(17, 38, 62, .16); }
.fx-split-badge {
    position: absolute; right: -14px; bottom: -20px; display: flex; align-items: center; gap: 12px;
    background: #fff; border: 1px solid var(--fx-line); border-radius: 14px; padding: 14px 18px;
    box-shadow: 0 14px 34px rgba(17, 38, 62, .16); max-width: 260px;
}
.fx-split-badge .fxp-i { color: var(--fx-blue); flex: none; }
.fx-split-badge strong { display: block; font-size: 1.15rem; color: var(--fx-ink); }
.fx-split-badge span { font-size: .84rem; color: var(--fx-muted); line-height: 1.4; }

.fx-steps-list { list-style: none; counter-reset: fx; padding: 0; margin: 26px 0 30px; display: grid; gap: 22px; }
.fx-steps-list li { position: relative; padding-left: 58px; }
.fx-steps-list li::before {
    counter-increment: fx; content: counter(fx); position: absolute; left: 0; top: 0;
    display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
    background: var(--fx-sky-soft, #E8F4FB); color: var(--fx-blue); font-weight: 700;
}
.fx-steps-list h3 { margin: 6px 0 6px; font-size: 1.1rem; }
.fx-steps-list p { margin: 0; font-size: .96rem; }

/* Llamada final con foto recortada */
.fx-cta-photo { position: relative; overflow: hidden; padding: 52px 52px 56px; min-height: 400px; align-items: center; }
.fx-cta-text { max-width: 56%; position: relative; z-index: 1; }
.fx-cta-photo h2 { margin: 0 0 12px; }
.fx-cta-photo p { margin: 0 0 18px; }
.fx-cta-points { list-style: none; padding: 0; margin: 0 0 26px; display: grid; gap: 9px; }
.fx-cta-points li { display: flex; align-items: center; gap: 9px; color: rgba(255, 255, 255, .95); font-size: .95rem; }
.fx-cta-points .fxp-i { flex: none; background: rgba(255, 255, 255, .2); border-radius: 50%; padding: 3px; }
.fx-cta-img {
    position: absolute; right: 30px; bottom: 0; height: 90%; width: auto; max-width: 46%;
    object-fit: contain; object-position: bottom right;
    filter: drop-shadow(0 18px 30px rgba(4, 22, 40, .35));
}
.fx-btn-white { background: #fff; color: #0F4C81; }
.fx-btn-white:hover { background: #EAF3FB; color: #0F4C81; }

/* Cabecera de página con foto (directorio de un servicio) */
.fx-page-hero { position: relative; overflow: hidden; border-radius: 18px; margin-bottom: 30px; min-height: 210px; display: flex; align-items: flex-end; }
.fx-page-hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.fx-page-hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, rgba(9, 40, 68, .9), rgba(15, 76, 129, .6) 65%, rgba(44, 138, 214, .3)); }
.fx-page-hero-body { position: relative; z-index: 1; padding: 28px 32px; color: #fff; }
.fx-page-hero-body h1 { color: #fff; margin: 0 0 6px; font-size: clamp(1.6rem, 3.2vw, 2.2rem); }
.fx-page-hero-body p { margin: 0; color: rgba(255, 255, 255, .9); }

/* Columna de apoyo del asistente */
.fx-aside { display: grid; gap: 16px; }
.fx-aside-photo { border-radius: 16px; overflow: hidden; box-shadow: var(--fx-shadow-sm, 0 4px 12px rgba(17,38,62,.05)); }
.fx-aside-photo img { display: block; width: 100%; height: auto; }
.fx-aside-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.fx-aside-list li { display: flex; gap: 11px; font-size: .94rem; color: var(--fx-body); }
.fx-aside-list .fxp-i { color: var(--fx-green, #37B863); flex: none; margin-top: 2px; }
.fx-with-aside { display: grid; grid-template-columns: minmax(0, 1fr) 310px; gap: 34px; align-items: start; }

@media (max-width: 1080px) {
    .fx-cat-grid { grid-template-columns: repeat(3, 1fr); }
    .fx-with-aside { grid-template-columns: 1fr; }
    .fx-aside { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
    .fx-split { grid-template-columns: 1fr; gap: 40px; }
    .fx-split-badge { right: 12px; bottom: -16px; }
    .fx-cta-photo { padding: 34px 26px 0; min-height: 0; flex-direction: column; text-align: left; }
    .fx-cta-text { max-width: 100%; }
    .fx-cta-img { position: static; height: auto; max-width: 78%; margin: 6px auto -4px; display: block; }
}
@media (max-width: 860px) {
    .fx-marcas-row { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
    .fx-marcas-row { grid-template-columns: repeat(2, 1fr); gap: 18px; }
    .fx-cat-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .fx-cat { min-height: 158px; }
    .fx-hero-stats { gap: 18px; }
    .fx-hero-stats strong { font-size: 1.5rem; }
    .fx-aside { grid-template-columns: 1fr; }
    .fx-cta-photo > div { padding: 30px 24px; }
}

/* Ficha de profesional con portada */
.fx-profile-hero { min-height: 240px; margin-bottom: 26px; }
.fx-profile-hero-kicker { font-size: .88rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--fx-sky) !important; margin: 0 0 4px !important; }
.fx-profile-head.is-compact { margin-bottom: 18px; }
.fx-profile-head.is-compact .fx-profile-logo { width: 64px; height: 64px; margin-top: -46px; border: 3px solid #fff; box-shadow: 0 6px 18px rgba(17, 38, 62, .16); }
.fx-profile-name { margin: 0 0 4px; font-size: 1.3rem; font-weight: 700; color: var(--fx-ink); }
