/* ============================================================
   ElectroMart Footer — Fiel à referência Electromix Pro
   Técnica bg-shape: painel azul absoluto dentro de .em-pos-relative
   ============================================================ */

/* ── Ocultar footer do tema ─────────────────────────────── */
body.em-footer-hide-theme #colophon,
body.em-footer-hide-theme .site-footer:not(.em-site-footer),
body.em-footer-hide-theme .theme-footer,
body.em-footer-hide-theme .main-footer,
body.em-footer-hide-theme .footer-area,
body.em-footer-hide-theme .footer-wrapper,
body.em-footer-hide-theme footer.footer-section,
body.em-footer-hide-theme footer.footer:not(.em-site-footer) {
    display: none !important;
}

/* ── Root ───────────────────────────────────────────────── */
.em-site-footer {
    /* Fundo escuro com textura footer_bg.png — idêntico à referência */
    background-color: var(--em-footer-bg, #222529);
    background-image: var(--em-footer-bg-image, none);
    background-size: cover;
    background-position: center center;
    color: var(--em-footer-color, #cccccc);
    font-family: var(--em-font-primary, "Poppins", sans-serif);
    margin-top: 0;       /* era 34px — criava gap branco antes do rodapé (BUG-04) */
    position: relative;
    z-index: 30;         /* necessário para renderizar acima das seções Elementor */
    overflow-x: clip;
}

.em-site-footer a {
    color: #ffffff;
    text-decoration: none;
    transition: color .2s;
}
.em-site-footer a:hover { color: var(--em-primary, #0088cc); }

/* ── BG-SHAPE: painel azul (col-lg-4 width, full height) ── */
/*
   Funciona assim:
   - .em-pos-relative é position:relative e height:0 — fica "invisível"
   - .em-bg-shape é position:absolute, top:0, left:0, height:100% do footer,
     width≈33.33% do container
   - Todo o conteúdo das seções fica sobre o bg-shape via z-index:1
*/
.em-pos-relative {
    position: relative;
    height: 0;          /* sem altura própria — só serve de âncora ao bg-shape */
    overflow: visible;
}

.em-bg-shape {
    position: absolute;
    top: -10px;         /* igual à referência: sobe levemente acima do footer */
    left: 12px;         /* alinhamento do folder com a referência */
    width: calc(33.33333% - 24px);  /* col-lg-4 menos gutters */
    height: 100vh;      /* fallback; será corrigido pelo JS abaixo */
    background-color: var(--em-primary, #0088cc);
    z-index: 0;
}

/* ── Layout geral: row = col-lg-4 + col-lg-8 ──────────── */
.em-footer-row {
    display: grid;
    grid-template-columns: calc(33.33333% - 12px) 1fr;
    gap: 0;
    position: relative;
    z-index: 1;         /* acima do bg-shape */
}

/* Coluna esquerda (sobre o painel azul) */
.em-footer-col-left {
    padding: 30px 28px 30px 12px;
    color: #ffffff;
}
.em-footer-col-left a { color: #ffffff; }
.em-footer-col-left a:hover { color: rgba(255,255,255,.75); }

/* Coluna direita (sobre o fundo escuro) */
.em-footer-col-right {
    padding: 30px 0 30px 40px;
}

/* ── SEÇÃO 1: footer-content ─────────────────────────── */
.em-footer-content { padding: 20px 0; }

/* Logo */
.em-footer-logo { margin-bottom: 16px; }
.em-footer-logo img {
    max-height: 60px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}
.em-footer-logo a {
    font-size: 26px;
    font-weight: 800;
    color: #fff;
    display: inline-block;
}

/* Descrição */
.em-footer-desc {
    margin: 0 0 16px;
    font-size: 14px;
    line-height: 1.8;
    color: rgba(255,255,255,.92);
}

/* Endereço */
.em-footer-address {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    line-height: 1.6;
    color: rgba(255,255,255,.9);
    margin-bottom: 0;
}
.em-footer-address-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background: rgba(255,255,255,.15);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1rem;
}

/* Transportadoras */
.em-footer-shipping {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,.22);
}
.em-footer-shipping h4,
.em-footer-label-title {
    margin: 0 0 10px;
    font-size: 13px;
    font-weight: 700;
    color: #ffffff;
    text-transform: uppercase;
    letter-spacing: .06em;
}

/* Badges de logo (transportadoras + marcas) */
.em-footer-brand-row {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.em-footer-logo-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 6px;
    padding: 5px 10px;
    min-height: 37px;
    transition: opacity .2s;
}
.em-footer-logo-badge:hover { opacity: .85; }
.em-footer-logo-badge img {
    max-height: 25px;
    max-width: 85px;
    object-fit: contain;
}

/* Grid de widgets (direita da seção 1) */
.em-footer-widgets-wrap { padding: 0; }
.em-footer-widgets-row {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

/* Título de widget com sublinhado colorido */
.em-footer-widget-title {
    font-size: 15px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 14px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--em-primary, #0088cc);
    line-height: 1.3;
}

/* Links do footer */
.em-footer-link-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.em-footer-link-list li { margin-bottom: 12px; } /* Aumentado para 12px (sub etapa 15.5) */
.em-footer-link-list li:last-child { margin-bottom: 0; }
.em-footer-link-list a {
    color: var(--em-footer-color, #cccccc);
    font-size: 14px;
    line-height: 1.4;
}
.em-footer-link-list a:hover { color: var(--em-primary, #0088cc); }

/* Newsletter */
.em-footer-newsletter-text {
    font-size: 13px;
    color: var(--em-footer-color, #ccc);
    margin: 0 0 10px;
}
.em-footer-newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.em-footer-newsletter-form input[type="email"] {
    height: 38px;
    border-radius: 4px;
    border: 1px solid rgba(255,255,255,.25);
    background: rgba(255,255,255,.07);
    color: #fff;
    padding: 0 10px;
    font-size: 13px;
    width: 100%;
}
.em-footer-newsletter-form input[type="email"]::placeholder { color: rgba(255,255,255,.55); }
.em-footer-newsletter-form button {
    height: 38px;
    border: 0;
    border-radius: 4px;
    background: var(--em-primary, #0088cc);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s;
}
.em-footer-newsletter-form button:hover { background: var(--em-accent, #0070a8); }
.em-footer-news-status { font-size: 12px; font-weight: 600; margin: 0 0 8px; }
.em-footer-news-status.ok   { color: #8ee58e; }
.em-footer-news-status.invalid,
.em-footer-news-status.fail { color: #ffb7b7; }

/* ── SEÇÃO 2: footer-middle ──────────────────────────── */
.em-footer-middle {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 0;
}
.em-footer-middle .em-footer-col-left { padding: 20px 28px 20px 0; }
.em-footer-middle .em-footer-col-right { padding: 20px 0 20px 40px; }

/* Contatos (direita do footer-middle) */
.em-footer-contacts-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
}
.em-footer-contact {
    display: flex;
    align-items: center;
    gap: 14px;
}

/* Ícone circular VERMELHO — idêntico à referência */
.em-footer-contact-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--em-secondary, #db5555);  /* VERMELHO como na referência */
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: #ffffff;
    flex-shrink: 0;
}
.em-footer-contact-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.em-footer-contact-info span {
    font-size: .75rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--em-footer-color, #ccc);
    opacity: .8;
}
.em-footer-contact-info a {
    font-size: .9rem;
    font-weight: 700;
    color: var(--em-primary, #0088cc);
}
.em-footer-contact-info a:hover { color: #ffffff; }

/* ── SEÇÃO 3: footer-above ───────────────────────────── */
.em-footer-above {
    border-top: 1px solid rgba(255,255,255,.08);
}
.em-footer-above .em-footer-col-left { padding: 20px 28px 20px 0; }
.em-footer-above .em-footer-col-right { padding: 20px 0 20px 40px; }

/* App badges */
.em-footer-app-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}
.em-footer-app-badge img {
    height: 39px;
    width: auto;
    border-radius: 6px;
    display: block;
}

/* Links úteis inline com pipe */
.em-footer-useful {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    flex-wrap: wrap;
}
.em-footer-useful-label {
    color: var(--em-primary, #0088cc);
    font-weight: 700;
    font-size: .9rem;
    white-space: nowrap;
    line-height: 1.7;
}
.em-footer-useful-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}
.em-footer-useful-list li { display: inline-flex; align-items: center; }
.em-footer-useful-list li::after {
    content: '|';
    margin: 0 8px;
    color: rgba(255,255,255,.25);
    font-size: .8rem;
}
.em-footer-useful-list li:last-child::after { display: none; }
.em-footer-useful-list a {
    font-size: .85rem;
    color: var(--em-footer-color, #ccc);
    line-height: 1.7;
}
.em-footer-useful-list a:hover { color: #fff; }

/* ── SEÇÃO 4: footer-copyright ───────────────────────── */
.em-footer-copyright {
    border-top: 1px solid rgba(255,255,255,.08);
    background: rgba(0,0,0,.2);
}
.em-footer-row-copyright {
    min-height: 70px;
    align-items: center;
}
.em-footer-copyright-left {
    padding: 10px 28px 10px 0;
    border-right: 1px solid rgba(57,57,57,.5);
}
.em-footer-copyright-right {
    padding: 10px 0 10px 40px;
}
.em-footer-copyright-text {
    margin: 0;
    font-size: 14px;
    color: var(--em-footer-color, #ccc);
}
.em-footer-copyright-text a { font-weight: 700; }

/* Pagamentos */
.em-footer-payments {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.em-footer-payments li { display: inline-flex; align-items: center; }
.em-footer-payments a { display: inline-flex; }
.em-footer-payments i { font-size: 28px; color: #f1f1f1; }
.em-footer-payments a:hover i { color: var(--em-primary, #0088cc); }
.em-pay-pill {
    border-radius: 20px;
    border: 1px solid rgba(255,255,255,.24);
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 800;
    color: #fff;
    line-height: 1;
    letter-spacing: .2px;
}
.em-pay-pix    { background: rgba(44,202,186,.18); border-color: rgba(44,202,186,.45); }
.em-pay-boleto { background: rgba(255,191,61,.14);  border-color: rgba(255,191,61,.45); }

/* ── Responsivo ─────────────────────────────────────── */
@media (max-width: 1199px) {
    .em-footer-widgets-row { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 991px) {
    .em-footer-row,
    .em-footer-row-copyright {
        grid-template-columns: 1fr;
    }
    .em-bg-shape { display: none; }   /* remove bg-shape em mobile */
    .em-footer-col-left,
    .em-footer-col-right,
    .em-footer-copyright-left,
    .em-footer-copyright-right,
    .em-footer-middle .em-footer-col-left,
    .em-footer-middle .em-footer-col-right,
    .em-footer-above .em-footer-col-left,
    .em-footer-above .em-footer-col-right {
        padding: 20px 0;
        border-right: none;
    }
    .em-footer-col-left {
        background: var(--em-primary, #0088cc);  /* substitui bg-shape */
        padding: 30px 16px;
        margin: 0 -15px 20px; /* full-width no mobile com respiro inferior */
        text-align: center;   /* Centraliza logo e desc no mobile */
    }
    .em-footer-contacts-row { justify-content: center; }
    .em-footer-brand-row { justify-content: center; }
    .em-footer-address { justify-content: center; }
}

@media (max-width: 700px) {
    .em-footer-widgets-row { grid-template-columns: 1fr; gap: 24px; text-align: center; }
    .em-footer-widget-title { border-bottom: none; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 15px; }
    .em-footer-newsletter-form { flex-direction: column; width: 100%; max-width: 320px; margin: 0 auto; }
    .em-footer-newsletter-form button { width: 100%; }
    .em-footer-payments { justify-content: center; }
    .em-footer-copyright-text { text-align: center; }
    .em-footer-useful { flex-direction: column; gap: 6px; align-items: center; text-align: center; }
    .em-footer-contact { flex-direction: column; text-align: center; width: 100%; }
    .em-footer-useful-list { justify-content: center; }
}
