/*
Theme Name: Funrios
Theme URI: https://fundicionfr.local/
Author: Fundición FR
Author URI: https://fundicionfr.local/
Description: Tema personalizado para Fundición FR. Carga elementos WPBakery propios desde inc/vc-elements/.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: funrios
*/

:root {
    --fr-red: #e21f26;
    --fr-red-dark: #b81a20;
    --fr-dark: #1a1a1a;
    --fr-dark-2: #232323;
    --fr-gray-100: #f5f5f5;
    --fr-gray-200: #ececec;
    --fr-gray-500: #888;
    --fr-text: #2b2b2b;
    --fr-white: #ffffff;
    --fr-container: 1200px;
    --fr-font: "Montserrat", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

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

body {
    margin: 0;
    font-family: var(--fr-font);
    color: var(--fr-text);
    line-height: 1.55;
    background: #fff;
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--fr-red); text-decoration: none; }
a:hover { color: var(--fr-red-dark); }

.fr-container {
    max-width: var(--fr-container);
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header ===== */
.fr-site-header {
    position: absolute;
    top: 0; left: 0; right: 0;
    z-index: 50;
    padding: 18px 0;
}
.fr-site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}
.fr-site-header__logo img { max-height: 38px; width: auto; }
.fr-site-header__nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 28px;
}
.fr-site-header__nav a {
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: .03em;
    text-transform: none;
    transition: color .2s;
}
.fr-site-header__nav a:hover,
.fr-site-header__nav .current-menu-item > a { color: var(--fr-red); }

/* ===== Submenús ===== */
.fr-site-header__nav .menu-item-has-children { position: relative; }
/* Flecha indicadora (no clickeable) en el item padre. */
.fr-site-header__nav .menu-item-has-children > a::after {
    content: '▾';
    display: inline-block;
    margin-left: 6px;
    font-size: 11px;
    line-height: 1;
    transition: transform .2s;
}
.fr-site-header__nav .menu-item-has-children:hover > a::after,
.fr-site-header__nav .menu-item-has-children:focus-within > a::after { transform: rotate(180deg); }
/* Puente invisible para no perder el hover al pasar del item al submenu. */
.fr-site-header__nav .menu-item-has-children::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 14px;
    pointer-events: none;
}
.fr-site-header__nav .menu-item-has-children:hover::after,
.fr-site-header__nav .menu-item-has-children:focus-within::after { pointer-events: auto; }
.fr-site-header__nav .sub-menu {
    list-style: none;
    margin: 14px 0 0;
    padding: 8px 0;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 160px;
    max-width: 240px;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    flex-direction: column;
    gap: 0;
    display: none;
    z-index: 100;
}
.fr-site-header__nav .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin: 0 0 0 8px;
}
.fr-site-header__nav .sub-menu li { width: 100%; }
.fr-site-header__nav .sub-menu a {
    display: block;
    padding: 8px 14px;
    font-size: 13px;
    color: #1a1a1a;
    white-space: normal;
    line-height: 1.35;
}
.fr-site-header__nav .sub-menu a::after { content: none; }
.fr-site-header__nav .sub-menu a:hover,
.fr-site-header__nav .sub-menu .current-menu-item > a { color: var(--fr-red); }
.fr-site-header__nav .menu-item-has-children:hover > .sub-menu,
.fr-site-header__nav .menu-item-has-children:focus-within > .sub-menu {
    display: flex;
}

.fr-burger {
    display: none;
    background: none;
    border: 0;
    width: 36px; height: 36px;
    color: #fff;
    cursor: pointer;
    padding: 0;
}
.fr-burger span {
    display: block;
    width: 22px; height: 2px;
    background: #fff;
    margin: 5px auto;
}

/* ===== Social rail (fijo a la derecha) ===== */
.fr-social-rail {
    position: fixed;
    top: 50%;
    right: 12px;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 10px;
    z-index: 60;
}
.fr-social-rail a {
    width: 48px; height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: #fff;
    transition: transform .2s, opacity .2s;
}
.fr-social-rail a:hover { transform: scale(1.08); opacity: .9; }
.fr-social-rail svg { width: 100%; height: 100%; fill: currentColor; }
.fr-social-rail img { width: 100%; height: 100%; object-fit: contain; display: block; }

/* ===== Hero (slider) — botón CTA ===== */
/* !important porque los estilos base del botón están inline en el shortcode. */
.fr-hero__btn:hover,
.fr-hero__btn:focus-visible {
    background: var(--fr-red) !important;
    color: #fff !important;
}

/* ===== Hero (slider) — altura mínima responsive ===== */
/* La altura la dicta la imagen del primer slide (width:100%; height:auto), que
   en pantallas estrechas queda demasiado baja. Forzamos un mínimo en .fr-hero,
   convertimos todos los slides a posición absoluta y la imagen a object-fit
   cover para que llenen el contenedor sin importar la proporción. */
.fr-hero { min-height: 80vh; }
.fr-hero .fr-hero__slide {
    position: absolute !important;
    inset: 0 !important;
}
.fr-hero .fr-hero__slide > .fr-hero__img {
    position: absolute !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center center !important;
}

/* ===== Hero (slider) — flecha "ir hacia abajo" ===== */
/* Se renderiza dentro del bloque de contenido, justo debajo del CTA. */
.fr-hero__scroll {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 22px auto 0;
    width: 44px;
    height: 44px;
    background: transparent;
    border: 0;
    padding: 0;
    color: #fff;
    cursor: pointer;
    animation: fr-hero-bounce 1.8s ease-in-out infinite;
    transition: color .2s, opacity .2s;
}
.fr-hero__scroll svg { width: 28px; height: 28px; display: block; }
.fr-hero__scroll:hover,
.fr-hero__scroll:focus-visible { color: var(--fr-red); outline: none; }

@keyframes fr-hero-bounce {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(10px); }
}
@media (prefers-reduced-motion: reduce) {
    .fr-hero__scroll { animation: none; }
}

/* ===== Footer ===== */
.fr-site-footer { background: #000; color: #c7c7c7; }
.fr-site-footer__top {
    padding: 56px 20px 40px;
    display: grid;
    grid-template-columns: 1.3fr 1fr 1.2fr .9fr;
    gap: 40px;
}
.fr-site-footer__col h4 {
    color: var(--fr-red);
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 18px;
    letter-spacing: .03em;
}
.fr-site-footer__col p { margin: 0; font-size: 13px; line-height: 1.7; color: #a8a8a8; }
.fr-site-footer__col ul { list-style: none; margin: 0; padding: 0; }
.fr-site-footer__col ul li { margin-bottom: 8px; }
.fr-site-footer__col ul a { color: #c7c7c7; font-size: 13px; }
.fr-site-footer__col ul a:hover { color: #fff; }

.fr-site-footer__logo img { max-height: 38px; margin-bottom: 18px; }

.fr-site-footer__contact-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 13px;
    color: #c7c7c7;
}
.fr-site-footer__contact-item svg {
    width: 14px; height: 14px;
    fill: var(--fr-red);
    margin-top: 4px;
    flex-shrink: 0;
}

.fr-site-footer__cert {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 12px;
}
.fr-site-footer__cert img {
    max-width: 140px;
    height: auto;
    flex: 0 1 auto;
}

.fr-site-footer__bottom {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 16px 0;
    font-size: 12px;
    color: #8a8a8a;
}
.fr-site-footer__bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}
.fr-site-footer__bottom a { color: #c7c7c7; }
.fr-site-footer__bottom a:hover { color: #fff; }

/* ===== Botones reutilizables ===== */
.fr-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    border-radius: 2px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
    text-decoration: none;
}
.fr-btn--red { background: var(--fr-red); color: #fff; }
.fr-btn--red:hover { background: var(--fr-red-dark); color: #fff; }
.fr-btn--outline-light { background: transparent; color: #fff; border-color: #fff; }
.fr-btn--outline-light:hover { background: #fff; color: var(--fr-dark); }
.fr-btn--outline-dark { background: transparent; color: var(--fr-dark); border-color: var(--fr-dark); }
.fr-btn--outline-dark:hover { background: var(--fr-dark); color: #fff; }

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .fr-site-footer__top { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
    .fr-burger { display: block; }
    .fr-site-header__nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: rgba(0,0,0,.92);
        padding: 18px 20px;
        display: none;
    }
    .fr-site-header__nav.is-open { display: block; }
    .fr-site-header__nav ul { flex-direction: column; gap: 14px; }
    .fr-site-header__nav .menu-item-has-children::after { content: none; }
    .fr-site-header__nav .sub-menu {
        position: static;
        display: flex;
        background: transparent;
        box-shadow: none;
        border-radius: 0;
        margin: 10px 0 0;
        padding: 0 0 0 16px;
        width: 100%;
        min-width: 0;
        max-width: none;
    }
    .fr-site-header__nav .sub-menu .sub-menu { left: 0; margin: 6px 0 0; padding-left: 16px; }
    .fr-site-header__nav .sub-menu a { color: #fff; padding: 6px 0; }
    .fr-site-header__nav .sub-menu a:hover { color: var(--fr-red); }
    .fr-social-rail { display: none; }
}
@media (max-width: 560px) {
    .fr-site-footer__top { grid-template-columns: 1fr; gap: 32px; }
}

/* ===== Helpers WPBakery ===== */
/* Añade la clase "no-pt" a una columna (Design Options → Extra class name)
   para quitar el padding-top por defecto del .vc_column-inner. */
.vc_column_container.no-pt > .vc_column-inner { padding-top: 0 !important; }

/* ===== Libro de reclamaciones (Contact Form 7) ===== */
/* Se aplica solo dentro de .fr-libro (wrapper del shortcode del form CF7). */
.fr-libro {
    max-width: 820px;
    margin: 0 auto;
    font-family: var(--fr-font);
    color: var(--fr-text);
}
.fr-libro__section {
    color: var(--fr-red);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin: 28px 0 14px;
}
.fr-libro__section:first-child { margin-top: 0; }

.fr-libro label,
.fr-libro__radio-label {
    display: block;
    font-size: 12px;
    font-weight: 500;
    color: #2b2b2b;
    margin: 0 0 14px;
}

.fr-libro input[type="text"],
.fr-libro input[type="tel"],
.fr-libro input[type="email"],
.fr-libro select,
.fr-libro textarea {
    width: 100%;
    margin-top: 6px;
    padding: 9px 11px;
    border: 1px solid #b8b8b8;
    background: #fff;
    font-family: inherit;
    font-size: 14px;
    color: #2b2b2b;
    box-sizing: border-box;
    border-radius: 0;
    line-height: 1.4;
}
.fr-libro textarea { min-height: 110px; resize: vertical; }
.fr-libro input:focus,
.fr-libro select:focus,
.fr-libro textarea:focus {
    outline: none;
    border-color: var(--fr-red);
    box-shadow: 0 0 0 2px rgba(226, 31, 38, .12);
}

/* Radios QUEJA / RECLAMO */
.fr-libro__radio-label { margin-bottom: 6px; }
.fr-libro .wpcf7-radio { display: inline-flex; gap: 22px; margin-top: 2px; }
.fr-libro .wpcf7-radio .wpcf7-list-item { margin: 0; }
.fr-libro .wpcf7-radio label { display: inline-flex; align-items: center; gap: 6px; }
.fr-libro .wpcf7-radio .wpcf7-list-item-label { font-size: 13px; font-weight: 500; }

/* Aceptación */
.fr-libro__accept {
    text-align: center;
    font-size: 12px;
    color: #2b2b2b;
    margin: 22px 0 14px;
    line-height: 1.5;
}
.fr-libro__accept .wpcf7-list-item { margin: 0; }
.fr-libro__accept a { color: var(--fr-red); text-decoration: underline; }

/* Botón Enviar */
.fr-libro__submit {
    display: block;
    width: 100%;
    padding: 13px 16px;
    background: #d9d9d9;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    text-transform: uppercase;
    border: 1px solid #b8b8b8;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}
.fr-libro__submit:hover,
.fr-libro__submit:focus-visible {
    background: var(--fr-red);
    border-color: var(--fr-red);
    color: #fff;
    outline: none;
}

/* ===== Mensajes de error / respuesta de CF7 ===== */
/* El response-output puede caer fuera de .fr-libro (CF7 lo agrega como sibling
   dentro del <form>). Por eso usamos :has() además del descendant selector. */

.fr-libro .wpcf7-spinner { margin: 10px auto 0; display: block; }

/* Error inline debajo de cada campo */
.fr-libro .wpcf7-not-valid-tip {
    display: block;
    font-size: 11px;
    font-weight: 500;
    color: var(--fr-red-dark);
    margin-top: 4px;
}

/* Borde rojo en campos marcados como inválidos */
.fr-libro .wpcf7-not-valid,
.fr-libro input.wpcf7-not-valid,
.fr-libro select.wpcf7-not-valid,
.fr-libro textarea.wpcf7-not-valid {
    border-color: var(--fr-red) !important;
    background: #fff8f8;
}

/* Mensaje del form (response output): base común */
.fr-libro .wpcf7-response-output,
.wpcf7-form:has(.fr-libro) .wpcf7-response-output {
    display: block;
    max-width: 820px;
    margin: 18px auto 0 !important;
    padding: 12px 16px !important;
    border-width: 1px !important;
    border-style: solid !important;
    border-radius: 0 !important;
    font-size: 13px;
    line-height: 1.5;
    background: #fdecec;
    color: var(--fr-red-dark);
    border-color: var(--fr-red) !important;
}

/* Estado: validación fallida / no aceptación / spam / fallo de envío / aborto */
.wpcf7-form.invalid:has(.fr-libro) .wpcf7-response-output,
.wpcf7-form.unaccepted:has(.fr-libro) .wpcf7-response-output,
.wpcf7-form.spam:has(.fr-libro) .wpcf7-response-output,
.wpcf7-form.failed:has(.fr-libro) .wpcf7-response-output,
.wpcf7-form.aborted:has(.fr-libro) .wpcf7-response-output,
.wpcf7-form.payment-required:has(.fr-libro) .wpcf7-response-output {
    background: #fdecec;
    color: var(--fr-red-dark);
    border-color: var(--fr-red) !important;
}

/* Estado: envío exitoso */
.wpcf7-form.sent:has(.fr-libro) .wpcf7-response-output {
    background: #e8f5e9;
    color: #1b5e20;
    border-color: #2e7d32 !important;
}

/* Acceptance no marcada (cuando se intenta enviar) */
.fr-libro .wpcf7-acceptance.wpcf7-not-valid + .wpcf7-not-valid-tip,
.fr-libro__accept .wpcf7-not-valid-tip {
    text-align: center;
}
