/**
 * Footer Styles - Blog Parceiros iFood
 * 
 * Estilos customizados para o footer seguindo o design do Figma
 * Background totalmente branco conforme especificação
 * 
 * @version 1.0.0
 */

/* ========================================
   CONTAINER PRINCIPAL
   ======================================== */

.ifp-footer {
    background: #FFFFFF;
    color: var(--ifp-color-black);
    padding: 0;
    font-family: var(--ifp-font-primary);
}

/* Barra decorativa superior */
.ifp-footer__top-bar {
    height: 10px;
    width: 100%;
}

.ifp-footer__gradient-bar {
    background-image: linear-gradient(to left, rgb(242, 152, 192) 25%, rgb(246, 160, 42) 25%, rgb(246, 160, 42) 50%, rgb(238, 34, 78) 50%, rgb(238, 34, 78) 75%, rgb(153, 34, 56) 75%);
    background-clip: padding-box;
}

.ifp-footer__container {
    max-width: 1280px; /* Boxed em 1280px */
    margin: 0 auto;
    padding: 0 2rem;
}

/* ========================================
   SEÇÃO SUPERIOR - LAYOUT RESPONSIVO
   ======================================== */

/* Desktop: 4 colunas de 25% cada, lado a lado */
@media (min-width: 1025px) {
    .ifp-footer__top {
        display: flex;
        flex-wrap: nowrap;
        gap: 3rem;
        padding: 60px 0;
        align-items: flex-start;
    }
    
    /* Cada coluna individual dentro de row--links ocupa 50% do espaço do container */
    .ifp-footer__row--links .ifp-footer__column:nth-child(1) { /* iFood */
        flex: 0 0 calc(50% - 1rem); /* 50% do container links menos metade do gap */
    }
    
    .ifp-footer__row--links .ifp-footer__column:nth-child(2) { /* Descubra */
        flex: 0 0 calc(50% - 1rem); /* 50% do container links menos metade do gap */
    }
    
    .ifp-footer__row--social { /* Social */
        flex: 0 0 calc(25% - 2.25rem); /* 25% menos espaço do gap */
    }
    
    .ifp-footer__row--apps { /* Apps */
        flex: 0 0 calc(25% - 2.25rem); /* 25% menos espaço do gap */
    }
    
    /* Container de links vira flex para as duas colunas ficarem lado a lado */
    .ifp-footer__row--links {
        display: flex;
        gap: 2rem;
        flex: 0 0 calc(50% - 1.5rem); /* Ocupa 50% do espaço total para as duas sub-colunas */
    }
}

/* Mobile: Layout específico com porcentagens exatas */
@media (max-width: 1024px) {
    .ifp-footer__top {
        display: flex;
        flex-direction: column;
        gap: 2rem;
        padding: 60px 0;
    }
    
    /* Reset todas as propriedades de desktop */
    .ifp-footer__row--links,
    .ifp-footer__row--social, 
    .ifp-footer__row--apps {
        flex: none;
    }
    
    .ifp-footer__row--links .ifp-footer__column {
        flex: none;
    }
}

/* Títulos das colunas */
.ifp-footer .ifp-footer__title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: var(--ifp-color-black) !important;
    margin: 0 0 1.5rem 0 !important;
    font-family: "Tipo iFood Titulos", var(--ifp-font-primary) !important;
}

/* Links do footer */
.ifp-footer__links {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ifp-footer__links li {
    margin-bottom: 1rem;
}

.ifp-footer .ifp-footer__links a {
    color: #4A5568 !important;
    text-decoration: none !important;
    font-size: 16px !important;
    font-weight: 400 !important;
    transition: color 0.2s ease;
    display: inline-block;
}

.ifp-footer .ifp-footer__links a:hover {
    color: var(--ifp-color-primary) !important;
    text-decoration: underline !important;
}

/* ========================================
   REDES SOCIAIS
   ======================================== */

.ifp-footer__social {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.ifp-footer__social-link {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--ifp-color-gray);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
}

.ifp-footer__social-link:hover {
    background: #8A8A8A;
    transform: translateY(-2px);
}

.ifp-footer__social-link img {
    width: 20px;
    height: 20px;
    display: block;
}

/* ========================================
   BADGES DE APPS
   ======================================== */

.ifp-footer__apps {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
}

.ifp-footer__app-badge {
    display: inline-block;
    transition: opacity 0.2s ease;
}

.ifp-footer__app-badge:hover {
    opacity: 0.8;
}

.ifp-footer__app-badge img {
    display: block;
    height: 40px;
    width: 120px;
    object-position: left;
}

/* Ajuste específico para o badge do Google Play */
.ifp-footer__app-badge img[src*="baixe_google_play"] {
    width: 120px;
    height: auto;
    object-position: left;
}

/* ========================================
   LINHA DIVISÓRIA
   ======================================== */

.ifp-footer__divider {
    height: 1px;
    background: #E2E8F0;
    margin: 0;
}

/* ========================================
   SEÇÃO INFERIOR - COPYRIGHT
   ======================================== */

.ifp-footer__bottom {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 2rem;
    align-items: center;
    padding: 40px 0;
}

/* Logo iFood */
.ifp-footer__logo {
    flex-shrink: 0;
}

.ifp-footer__logo svg {
    display: block;
}

/* Informações legais */
.ifp-footer__legal {
    text-align: center;
}

.ifp-footer__copyright,
.ifp-footer__address {
    margin: 0;
    font-size: 14px;
    color: #6B7280;
    line-height: 1.6;
}

.ifp-footer__copyright {
    margin-bottom: 0.5rem;
}

/* Links de políticas */
.ifp-footer__policies {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.ifp-footer__policies a {
    color: #4A5568;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s ease;
    white-space: nowrap;
}

.ifp-footer__policies a:hover {
    color: var(--ifp-color-primary);
    text-decoration: underline;
}

/* Mobile: Coluna 1=50%, Coluna 2=50%, Coluna 3=100%, Coluna 4=100% */
@media (max-width: 1024px) {
    /* Primeira linha: iFood (50%) + Descubra (50%) */
    .ifp-footer__row--links {
        display: flex;
        gap: 2rem;
        width: 100%;
    }
    
    .ifp-footer__row--links .ifp-footer__column:nth-child(1) { /* iFood */
        flex: 0 0 calc(50% - 1rem); /* 50% menos metade do gap */
    }
    
    .ifp-footer__row--links .ifp-footer__column:nth-child(2) { /* Descubra */
        flex: 0 0 calc(50% - 1rem); /* 50% menos metade do gap */
    }
    
    /* Segunda linha: Social (100%) */
    .ifp-footer__row--social {
        width: 100%;
        flex: 0 0 100%;
    }
    
    /* Terceira linha: Apps (100%) */
    .ifp-footer__row--apps {
        width: 100%;
        flex: 0 0 100%;
    }
    
    .ifp-footer__bottom {
        display: grid;
        grid-template-columns: 1fr;
        text-align: center;
        gap: 1.5rem;
    }
    
    .ifp-footer__logo {
        margin: 0 auto;
    }
    
    .ifp-footer__policies {
        justify-content: center;
    }
}

/* ========================================
   AJUSTES ESPECÍFICOS PARA MOBILE MENOR
   ======================================== */

@media (max-width: 768px) {
    .ifp-footer {
        margin-top: 40px;
    }
    
    .ifp-footer__container {
        padding: 0 1rem;
    }
    
    .ifp-footer__top {
        padding: 40px 0;
        text-align: left;
    }
    
    .ifp-footer .ifp-footer__title {
        font-size: 16px !important;
        margin-bottom: 1rem !important;
    }
    
    .ifp-footer .ifp-footer__links a {
        font-size: 14px !important;
    }
    
    .ifp-footer__social {
        justify-content: flex-start;
        gap: 1rem;
    }
    
    .ifp-footer__apps {
        align-items: flex-start;
        flex-direction: row;
        gap: 1rem;
    }
    
    /* Garante que ambos os badges tenham a mesma altura */
    .ifp-footer__app-badge img {
        height: 40px;
        width: auto;
    }
    
    /* Override específico para Google Play manter altura padrão */
    .ifp-footer__app-badge img[src*="baixe_google_play"] {
        height: 40px;
        width: auto;
        object-position: left;
    }
    
    /* Oculta logo no mobile */
    .ifp-footer__logo {
        display: none;
    }
    
    .ifp-footer__bottom {
        padding: 80px 0;
        gap: 1rem;
    }
    
    .ifp-footer__copyright,
    .ifp-footer__address {
        font-size: 12px;
    }
    
    .ifp-footer__policies {
        flex-direction: row;
        gap: 1rem;
        justify-content: center;
    }
    
    .ifp-footer__policies a {
        font-size: 12px;
    }
}

/* ========================================
   AJUSTES PARA INTEGRAÇÃO COM TEMA
   ======================================== */

/* Remove margens indesejadas do tema pai */
body.home .ifp-footer {
    margin-top: 0;
}

/* Garante que o footer ocupe toda a largura */
.ifp-footer {
    width: 100%;
    position: relative;
    z-index: 10;
}

/* Ajusta espaçamento quando usado após conteúdo Elementor */
.elementor-location-footer + .ifp-footer {
    display: none; /* Oculta nosso footer se Elementor footer estiver ativo */
}