/* ============================================================
   MEGA-MENU PROGLOBAL
   - Desktop: mega-menu por hover (4 colunas)
   - Mobile/Tablet (<=1024px): drawer off-canvas proprio (.pgb-mm)
   Carregado via wp_enqueue_style a partir do child theme.
   ============================================================ */

/* ============================================================
   DESKTOP — mega-menu (hover)
   ============================================================ */
.proglobal-megamenu-content-wrapper {
    font-family: inherit;          /* herda Montserrat do tema */
    text-align: left;
    padding: 10px;
    max-width: none;
    margin: 0 auto;
}

.megamenu-columns {
    display: flex;
}
.megamenu-column {
    padding: 0px 40px 0px 0px;
    flex-shrink: 0;
}
.megamenu-column h3 {
    font-size: 0.9rem !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
    padding-bottom: 10px !important;
    color: #0069a7 !important;
}
.grandparent-column {
    width: 15%;
}
.parent-column, .child-column {
    width: 25%;
    border-left: 1px solid #ddd;
    padding: 0px 40px;
}

.megamenu-column-featured {
    width: 28%;
    padding-left: 50px;
    border-left: none;
}

/* Listas de categorias */
.grandparent-list, .parent-list, .child-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.grandparent-list li a,
.parent-list .parent-item a,
.child-list li a {
    display: block;
    padding: 7px 0px;
    text-decoration: none;
    color: #222;
    border-radius: 4px;
    font-size: 0.8rem;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.grandparent-list li.active a,
.grandparent-list li:hover a,
.parent-list .parent-item.active a,
.parent-list .parent-item:hover a {
    background: #fff;
    color: #222;
    font-weight: bold;
}
.ver-todos {
    display: inline-block;
    margin-top: 15px;
    font-size: 0.75rem !important;
    font-weight: 500 !important;
    color: #737373 !important;
    text-decoration: none !important;
}
.ver-todos:hover {
    color: #0069a7 !important;
}

.grandparent-list li,
.parent-list .parent-item {
    position: relative;
}

.grandparent-list li a::after,
.parent-list .parent-item a::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 12px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 512'%3E%3Cpath fill='currentColor' d='M278.6 233.4c12.5 12.5 12.5 32.8 0 45.3l-160 160c-12.5 12.5-32.8 12.5-45.3 0s-12.5-32.8 0-45.3L210.7 256 73.4 118.6c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0l160 160z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
}

.grandparent-list li:hover a::after,
.grandparent-list li.active a::after,
.parent-list .parent-item:hover a::after,
.parent-list .parent-item.active a::after {
    opacity: 1;
}

/* Destaques */
.featured-link {
    display: block;
    text-decoration: none;
    color: inherit;
}
.featured-link img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin-bottom: 15px;
}
.featured-content h4 {
    margin: 0 0 5px 0;
    font-size: 0.9rem;
    color: #222;
    font-weight: 600;
}
.featured-content p {
    margin: 0;
    font-size: 0.8rem;
    color: #222;
    line-height: 1.5;
}
.featured-content p:hover {
    color: #0069A7 !important;
}

/* Display logic (JS controla via .active) */
.parent-wrapper, .child-wrapper, .featured-wrapper { display: none; }
.parent-wrapper.active, .child-wrapper.active, .featured-wrapper.active { display: block; }

/* Focus-visible para keyboard navigation */
.grandparent-list li a:focus-visible,
.parent-item a:focus-visible,
.child-list li a:focus-visible {
    outline: 2px solid #0069a7;
    outline-offset: -2px;
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Esconde o mega-menu desktop em mobile/tablet (usa-se o drawer) */
@media (max-width: 1024px) {
    .proglobal-megamenu-content-wrapper { display: none; }
}


/* ============================================================
   MOBILE/TABLET — drawer off-canvas (direita)
   Componente proprio, sem dependencia do Elementor.
   ============================================================ */
.pgb-mm { display: inline-block; font-family: inherit; }

/* Esconde tudo no desktop — so aparece <=1024px.
   O drawer e o overlay sao movidos para o <body> (portal), por isso
   tem de ser escondidos explicitamente (nao sao filhos de .pgb-mm). */
@media (min-width: 1025px) {
    .pgb-mm,
    .pgb-mm-drawer,
    .pgb-mm-overlay { display: none !important; }
}

/* --- Trigger (hamburger) --- */
/* !important + especificidade: o tema impoe o componente de botao
   (pill, padding, fundo) a todos os <button>; aqui neutralizamos. */
.pgb-mm .pgb-mm-trigger {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 44px !important;
    height: 44px !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #0069a7 !important;
    cursor: pointer;
}
.pgb-mm-burger,
.pgb-mm-burger::before,
.pgb-mm-burger::after {
    display: block;
    width: 24px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
}
.pgb-mm-burger { position: relative; }
.pgb-mm-burger::before,
.pgb-mm-burger::after { content: ''; position: absolute; left: 0; }
.pgb-mm-burger::before { top: -7px; }
.pgb-mm-burger::after  { top: 7px; }

/* --- Overlay --- */
.pgb-mm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.28s ease;
    z-index: 99998;
}
.pgb-mm-overlay.is-open { opacity: 1; }

/* --- Drawer --- */
.pgb-mm-drawer {
    position: fixed;
    top: 0;
    right: 0;
    height: 100%;
    width: min(86vw, 380px);
    background: #fff;
    z-index: 99999;
    transform: translateX(100%);
    transition: transform 0.28s ease;
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.18);
    font-family: inherit;
}
.pgb-mm-drawer.is-open { transform: translateX(0); }

/* --- Header do drawer --- */
.pgb-mm-head {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 12px 12px;
    background: #0069a7;
    color: #fff;
    flex: 0 0 auto;
}
.pgb-mm-title {
    flex: 1;
    min-width: 0;
    text-align: center;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pgb-mm-drawer .pgb-mm-back,
.pgb-mm-drawer .pgb-mm-close {
    flex: 0 0 auto;
    width: 40px !important;
    height: 40px !important;
    min-height: 0 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center !important;
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 6px !important;
    box-shadow: none !important;
    color: #fff !important;
    font-size: 1.5rem !important;
    font-weight: 400 !important;
    line-height: 1 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    cursor: pointer;
    transition: none !important;   /* evita interferencia de transitions globais do tema */
}
.pgb-mm-drawer .pgb-mm-back:hover,
.pgb-mm-drawer .pgb-mm-close:hover { background: rgba(255, 255, 255, 0.14) !important; }
.pgb-mm-drawer .pgb-mm-back[hidden] { display: none !important; }

/* --- Viewport + paineis --- */
.pgb-mm-viewport {
    position: relative;
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.pgb-mm-panel {
    list-style: none !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    display: none;
}
.pgb-mm-panel.is-active {
    display: block;
    animation: pgbmmFwd 0.26s ease;
}
.pgb-mm-viewport[data-dir="back"] .pgb-mm-panel.is-active {
    animation: pgbmmBack 0.26s ease;
}
.pgb-mm-panel li { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.pgb-mm-panel li::before, .pgb-mm-panel li::marker { content: none !important; }

/* --- Linhas (escala de letra equilibrada para mobile) --- */
.pgb-mm-drawer .pgb-mm-link,
.pgb-mm-drawer .pgb-mm-drill,
.pgb-mm-drawer .pgb-mm-all {
    display: flex !important;
    align-items: center;
    width: 100% !important;
    max-width: none !important;
    box-sizing: border-box !important;
    min-height: 50px !important;
    margin: 0 !important;
    padding: 13px 18px !important;
    font-family: inherit !important;
    font-size: 0.9rem !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: #222 !important;
    text-decoration: none !important;
    text-align: left !important;
    background: transparent !important;
    border: 0 !important;
    border-bottom: 1px solid #f0f0f0 !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    cursor: pointer;
}
.pgb-mm-drawer .pgb-mm-drill { justify-content: space-between !important; font-weight: 500 !important; }
.pgb-mm-drawer .pgb-mm-link:hover,
.pgb-mm-drawer .pgb-mm-link:focus-visible,
.pgb-mm-drawer .pgb-mm-drill:hover,
.pgb-mm-drawer .pgb-mm-drill:focus-visible {
    background: #f5f9fc !important;
    color: #0069a7 !important;
    outline: none;
}

/* Chevron (drill) */
.pgb-mm-chev {
    flex: 0 0 auto;
    width: 8px;
    height: 8px;
    margin-left: 12px;
    border-right: 2px solid #b3b3b3;
    border-bottom: 2px solid #b3b3b3;
    transform: rotate(-45deg);
}
.pgb-mm-drill:hover .pgb-mm-chev,
.pgb-mm-drill:focus-visible .pgb-mm-chev {
    border-color: #0069a7;
}

/* Indicador de link externo */
.pgb-mm-ext {
    flex: 0 0 auto;
    width: 11px;
    height: 11px;
    margin-left: 8px;
    background: currentColor;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h50.7L201.4 233.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 109.3V160c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z'/%3E%3C/svg%3E") center/contain no-repeat;
            mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h50.7L201.4 233.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L416 109.3V160c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z'/%3E%3C/svg%3E") center/contain no-repeat;
    opacity: .55;
}

/* "Ver tudo em..." */
.pgb-mm-drawer .pgb-mm-all {
    min-height: 44px !important;
    color: #737373 !important;
    font-size: 0.78rem !important;
    font-weight: 500 !important;
    border-bottom: 0 !important;
}
.pgb-mm-drawer .pgb-mm-all:hover,
.pgb-mm-drawer .pgb-mm-all:focus-visible { color: #0069a7 !important; outline: none; }

/* Bloqueio de scroll do body quando o drawer esta aberto */
body.pgb-mm-lock { overflow: hidden; }

/* Animacoes */
@keyframes pgbmmFwd  { from { transform: translateX(22px);  opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes pgbmmBack { from { transform: translateX(-22px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
    .pgb-mm-panel.is-active { animation: none; }
    .pgb-mm-drawer, .pgb-mm-overlay { transition: none; }
}
