/* =========================================================
   FRIMARC réplica — correções (ícones, slider, cookies, vídeo)
   ========================================================= */

/* ---------- 1. ÍCONES SOCIAIS (Font Awesome/ElegantIcons em falta) ----------
   Os ficheiros de fonte não existem localmente, por isso desenhamos os
   ícones com SVG via CSS mask. A cor segue o "color" do elemento, pelo
   que o efeito de hover do tema continua a funcionar.                        */
.mkdf-social-icon-widget.fa-facebook-f,
.mkdf-social-icon-widget.social_facebook,
.mkdf-social-icon-widget.fa-instagram,
.mkdf-social-icon-widget.social_instagram,
.mkdf-social-icon-widget.fa-linkedin-in,
.mkdf-social-icon-widget.social_linkedin {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat;
            mask-repeat: no-repeat;
    -webkit-mask-position: center;
            mask-position: center;
    -webkit-mask-size: contain;
            mask-size: contain;
}
/* esconde qualquer ::before vazio das classes de fonte originais */
.mkdf-social-icon-widget.fa-facebook-f::before,
.mkdf-social-icon-widget.social_facebook::before,
.mkdf-social-icon-widget.fa-instagram::before,
.mkdf-social-icon-widget.social_instagram::before,
.mkdf-social-icon-widget.fa-linkedin-in::before,
.mkdf-social-icon-widget.social_linkedin::before { content: "" !important; display: none !important; }

.mkdf-social-icon-widget.fa-facebook-f,
.mkdf-social-icon-widget.social_facebook {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20320%20512%27%3E%3Cpath%20d%3D%27M279.14%20288l14.22-92.66h-88.91v-60.13c0-25.35%2012.42-50.06%2052.24-50.06h40.42V6.26S260.43%200%20225.36%200c-73.22%200-121.08%2044.38-121.08%20124.72v70.62H22.89V288h81.39v224h100.17V288z%27%2F%3E%3C%2Fsvg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20320%20512%27%3E%3Cpath%20d%3D%27M279.14%20288l14.22-92.66h-88.91v-60.13c0-25.35%2012.42-50.06%2052.24-50.06h40.42V6.26S260.43%200%20225.36%200c-73.22%200-121.08%2044.38-121.08%20124.72v70.62H22.89V288h81.39v224h100.17V288z%27%2F%3E%3C%2Fsvg%3E");
}
.mkdf-social-icon-widget.fa-instagram,
.mkdf-social-icon-widget.social_instagram {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20448%20512%27%3E%3Cpath%20d%3D%27M224.1%20141c-63.6%200-114.9%2051.3-114.9%20114.9s51.3%20114.9%20114.9%20114.9S339%20319.5%20339%20255.9%20287.7%20141%20224.1%20141zm0%20189.6c-41.1%200-74.7-33.5-74.7-74.7s33.5-74.7%2074.7-74.7%2074.7%2033.5%2074.7%2074.7-33.6%2074.7-74.7%2074.7zm146.4-194.3c0%2014.9-12%2026.8-26.8%2026.8-14.9%200-26.8-12-26.8-26.8s12-26.8%2026.8-26.8%2026.8%2012%2026.8%2026.8zm76.1%2027.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9%200-35.8%201.7-67.6%209.9-93.9%2036.1s-34.4%2058-36.2%2093.9c-2.1%2037-2.1%20147.9%200%20184.9%201.7%2035.9%209.9%2067.7%2036.2%2093.9s58%2034.4%2093.9%2036.2c37%202.1%20147.9%202.1%20184.9%200%2035.9-1.7%2067.7-9.9%2093.9-36.2%2026.2-26.2%2034.4-58%2036.2-93.9%202.1-37%202.1-147.8%200-184.8zM398.8%20388c-7.8%2019.6-22.9%2034.7-42.6%2042.6-29.5%2011.7-99.5%209-132.1%209s-102.7%202.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7%209-132.1c7.8-19.6%2022.9-34.7%2042.6-42.6%2029.5-11.7%2099.5-9%20132.1-9s102.7-2.6%20132.1%209c19.6%207.8%2034.7%2022.9%2042.6%2042.6%2011.7%2029.5%209%2099.5%209%20132.1s2.7%20102.7-9%20132.1z%27%2F%3E%3C%2Fsvg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20448%20512%27%3E%3Cpath%20d%3D%27M224.1%20141c-63.6%200-114.9%2051.3-114.9%20114.9s51.3%20114.9%20114.9%20114.9S339%20319.5%20339%20255.9%20287.7%20141%20224.1%20141zm0%20189.6c-41.1%200-74.7-33.5-74.7-74.7s33.5-74.7%2074.7-74.7%2074.7%2033.5%2074.7%2074.7-33.6%2074.7-74.7%2074.7zm146.4-194.3c0%2014.9-12%2026.8-26.8%2026.8-14.9%200-26.8-12-26.8-26.8s12-26.8%2026.8-26.8%2026.8%2012%2026.8%2026.8zm76.1%2027.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9%200-35.8%201.7-67.6%209.9-93.9%2036.1s-34.4%2058-36.2%2093.9c-2.1%2037-2.1%20147.9%200%20184.9%201.7%2035.9%209.9%2067.7%2036.2%2093.9s58%2034.4%2093.9%2036.2c37%202.1%20147.9%202.1%20184.9%200%2035.9-1.7%2067.7-9.9%2093.9-36.2%2026.2-26.2%2034.4-58%2036.2-93.9%202.1-37%202.1-147.8%200-184.8zM398.8%20388c-7.8%2019.6-22.9%2034.7-42.6%2042.6-29.5%2011.7-99.5%209-132.1%209s-102.7%202.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7%209-132.1c7.8-19.6%2022.9-34.7%2042.6-42.6%2029.5-11.7%2099.5-9%20132.1-9s102.7-2.6%20132.1%209c19.6%207.8%2034.7%2022.9%2042.6%2042.6%2011.7%2029.5%209%2099.5%209%20132.1s2.7%20102.7-9%20132.1z%27%2F%3E%3C%2Fsvg%3E");
}
.mkdf-social-icon-widget.fa-linkedin-in,
.mkdf-social-icon-widget.social_linkedin {
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20448%20512%27%3E%3Cpath%20d%3D%27M100.28%20448H7.4V148.9h92.88zM53.79%20108.1C24.09%20108.1%200%2083.5%200%2053.8a53.79%2053.79%200%200%201%20107.58%200c0%2029.7-24.1%2054.3-53.79%2054.3zM447.9%20448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29%200-55.69%2037.7-55.69%2076.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5%2042.69-48.3%2087.88-48.3%2094%200%20111.28%2061.9%20111.28%20142.3V448z%27%2F%3E%3C%2Fsvg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20448%20512%27%3E%3Cpath%20d%3D%27M100.28%20448H7.4V148.9h92.88zM53.79%20108.1C24.09%20108.1%200%2083.5%200%2053.8a53.79%2053.79%200%200%201%20107.58%200c0%2029.7-24.1%2054.3-53.79%2054.3zM447.9%20448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29%200-55.69%2037.7-55.69%2076.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5%2042.69-48.3%2087.88-48.3%2094%200%20111.28%2061.9%20111.28%20142.3V448z%27%2F%3E%3C%2Fsvg%3E");
}

/* ---------- 1b. ÍCONE LINEA "info" (fonte em falta -> aparecia um "0") ---------- */
.mkdf-icon-linea-icon.icon-basic-info {
    display: inline-block;
    width: 1em;
    height: 1em;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20512%20512%27%3E%3Cpath%20fill%3D%27none%27%20stroke%3D%27currentColor%27%20stroke-width%3D%2724%27%20d%3D%27M256%2020a236%20236%200%20100%20472%20236%20236%200%20000-472z%27%2F%3E%3Ccircle%20cx%3D%27256%27%20cy%3D%27168%27%20r%3D%2726%27%2F%3E%3Crect%20x%3D%27236%27%20y%3D%27224%27%20width%3D%2740%27%20height%3D%27180%27%20rx%3D%278%27%2F%3E%3C%2Fsvg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%20512%20512%27%3E%3Cpath%20fill%3D%27none%27%20stroke%3D%27currentColor%27%20stroke-width%3D%2724%27%20d%3D%27M256%2020a236%20236%200%20100%20472%20236%20236%200%20000-472z%27%2F%3E%3Ccircle%20cx%3D%27256%27%20cy%3D%27168%27%20r%3D%2726%27%2F%3E%3Crect%20x%3D%27236%27%20y%3D%27224%27%20width%3D%2740%27%20height%3D%27180%27%20rx%3D%278%27%2F%3E%3C%2Fsvg%3E");
}
/* content:none evita que o navegador vá buscar a fonte Linea (404) */
.mkdf-icon-linea-icon.icon-basic-info::before { content: none !important; }

/* ---------- 1b.2 ÍCONE "X" de fechar o menu lateral (fonte Linearicons em falta -> 404) ---------- */
.mkdf-close-side-menu .lnr-cross {
    display: inline-block;
    width: 26px;
    height: 26px;
    color: #001c4c;
    background-color: currentColor;
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: center; mask-position: center;
    -webkit-mask-size: contain; mask-size: contain;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20fill%3D%27none%27%20stroke%3D%27currentColor%27%20stroke-width%3D%272.4%27%20stroke-linecap%3D%27round%27%20d%3D%27M5%205%20L19%2019%20M19%205%20L5%2019%27%2F%3E%3C%2Fsvg%3E");
            mask-image: url("data:image/svg+xml,%3Csvg%20xmlns%3D%27http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%27%20viewBox%3D%270%200%2024%2024%27%3E%3Cpath%20fill%3D%27none%27%20stroke%3D%27currentColor%27%20stroke-width%3D%272.4%27%20stroke-linecap%3D%27round%27%20d%3D%27M5%205%20L19%2019%20M19%205%20L5%2019%27%2F%3E%3C%2Fsvg%3E");
}
/* content:none evita o pedido da fonte Linearicons (404) */
.mkdf-close-side-menu .lnr-cross::before { content: none !important; }

/* ---------- 1c. "Powered by CookieYes" escondido ---------- */
[data-cky-tag="detail-powered-by"] { display: none !important; }

/* ---------- 2. SLIDER (hero) substituto responsivo ---------- */
.frimarc-hero {
    position: relative;
    width: 100%;
    height: 868px;
    max-height: 100vh;
    overflow: hidden;
    background: #04438a;
}
.frimarc-hero .fh-slide {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.9s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.frimarc-hero .fh-slide.is-active { opacity: 1; pointer-events: auto; }
.frimarc-hero .fh-caption {
    position: relative;
    z-index: 2;
    max-width: 80%;
    text-align: center;
    color: #fff;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
    transform: translateY(10px);
    opacity: 0;
    transition: transform 0.8s ease 0.2s, opacity 0.8s ease 0.2s;
}
.frimarc-hero .fh-slide.is-active .fh-caption { transform: translateY(0); opacity: 1; }
.frimarc-hero .fh-caption h2 {
    font-family: "Source Sans Pro", sans-serif;
    text-transform: uppercase;
    letter-spacing: 8px;
    font-weight: 600;
    font-size: 50px;
    line-height: 1.15;
    margin: 0 0 18px;
    color: #fff;
}
.frimarc-hero .fh-caption p {
    font-family: "Source Sans Pro", sans-serif;
    font-weight: 300;
    font-size: 24px;
    line-height: 1.4;
    margin: 0;
    color: #fff;
}
.frimarc-hero .fh-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    width: 54px;
    height: 54px;
    border: none;
    background: rgba(255, 255, 255, 0.0);
    color: #fff;
    font-size: 54px;
    line-height: 1;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: Arial, sans-serif;
}
.frimarc-hero .fh-arrow:hover { opacity: 1; }
.frimarc-hero .fh-prev { left: 25px; }
.frimarc-hero .fh-next { right: 25px; }
.frimarc-hero .fh-dots {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    display: flex;
    gap: 10px;
}
.frimarc-hero .fh-dot {
    width: 12px;
    height: 12px;
    border-radius: 0; /* quadrados, como no slider original */
    border: none;
    padding: 0;
    background: rgba(125, 125, 125, 0.5);
    cursor: pointer;
    transition: background 0.3s;
}
.frimarc-hero .fh-dot:hover,
.frimarc-hero .fh-dot.is-active { background: rgb(125, 125, 125); }

@media only screen and (max-width: 1024px) {
    .frimarc-hero { height: 70vh; }
    .frimarc-hero .fh-caption h2 { font-size: 38px; letter-spacing: 5px; }
    .frimarc-hero .fh-caption p { font-size: 20px; }
}
@media only screen and (max-width: 768px) {
    .frimarc-hero { height: 60vh; min-height: 380px; }
    .frimarc-hero .fh-caption { max-width: 88%; }
    .frimarc-hero .fh-caption h2 { font-size: 27px; letter-spacing: 3px; margin-bottom: 12px; }
    .frimarc-hero .fh-caption p { font-size: 16px; }
    .frimarc-hero .fh-arrow { width: 40px; height: 40px; font-size: 40px; }
    .frimarc-hero .fh-prev { left: 6px; }
    .frimarc-hero .fh-next { right: 6px; }
}

/* ---------- 2b. NAVEGAÇÃO POR ÂNCORAS (menu da própria página) ----------
   O scroll suave é feito APENAS nos cliques do menu, via JavaScript
   (assets/frimarc-fixes.js). Não usamos scroll-behavior global para não
   afetar o resto da navegação da página.                                   */
#sobre, #história, #clientes, #produtos, #biofrimarc, #text-13 { scroll-margin-top: 90px; }

/* ---------- 3. VÍDEO YOUTUBE responsivo ---------- */
.wpb_video_wrapper .fluidvids { position: relative; width: 100%; }
.wpb_video_wrapper .fluidvids iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

/* ---------- 4. BANNER DE COOKIES (ajuste responsivo do nosso script) ---------- */
.cky-consent-container.frimarc-cky-show { display: block !important; }
@media (max-width: 480px) {
    .cky-consent-container { width: calc(100% - 20px) !important; left: 10px !important; right: 10px !important; }
    .cky-box-bottom-left, .cky-box-bottom-right { bottom: 10px !important; }
}

/* =========================================================
   5. MELHORIAS MOBILE  (apenas <= 768px — o desktop fica intacto)
   ========================================================= */
@media only screen and (max-width: 768px) {

    /* 5.1 Botões descentrados: têm "margin-left" fixo em % (ex.: 28%),
           feito para desktop. Em mobile centramo-los.                     */
    .mkdf-btn[style*="0px 0px 0px 28%"],
    .mkdf-btn[style*="0px 0px 0px 27%"],
    .mkdf-btn[style*="0px 0px 0px 26%"],
    .mkdf-btn[style*="0px 0px 0px 29%"],
    .mkdf-btn[style*="0px 0px 0px 30%"] {
        display: block !important;
        width: -moz-fit-content !important;
        width: fit-content !important;
        margin: 14px auto 0 !important;
        float: none !important;
    }

    /* 5.2 Espaços verticais grandes criam vazios enormes em mobile;
           reduzimo-los (só os maiores).                                   */
    .vc_empty_space[style*="height: 250px"] { height: 60px !important; }
    .vc_empty_space[style*="height: 200px"] { height: 55px !important; }
    .vc_empty_space[style*="height: 150px"] { height: 45px !important; }
    .vc_empty_space[style*="height: 120px"] { height: 40px !important; }
    .vc_empty_space[style*="height: 100px"] { height: 40px !important; }

    /* 5.3 Colunas lado a lado (parceiros, etc.) deixam de ficar cortadas:
           as linhas passam a quebrar e as colunas de 1/4 ficam a 2 por linha. */
    .wpb_row.vc_row-fluid { flex-wrap: wrap !important; }
    .vc_col-sm-3 { width: 50% !important; }

    /* 5.4 Imagens e separadores nunca ultrapassam a largura do ecrã */
    .mkdf-content img,
    .wpb_single_image img,
    .mkdf-single-image-holder img { max-width: 100% !important; height: auto !important; }

    /* 5.5 Hero: evitar que as setas sobreponham o texto e afinar o título */
    .frimarc-hero .fh-caption { max-width: 82% !important; }
    .frimarc-hero .fh-prev { left: 2px !important; }
    .frimarc-hero .fh-next { right: 2px !important; }
}

@media only screen and (max-width: 480px) {
    .frimarc-hero { height: 58vh; min-height: 360px; }
    .frimarc-hero .fh-caption h2 { font-size: 23px; letter-spacing: 2px; }
    .frimarc-hero .fh-caption p { font-size: 15px; }

    /* Modal de cookies ocupa a largura toda do ecrã no telemóvel */
    .cky-preference-center { width: 100% !important; max-width: 100% !important; }
}
