/* ============================================================
   jm-enhance.css — camada ADITIVA de UX/UI (transições e micro-interações)
   Sobre o tema Glax/jm original. Tudo sob prefers-reduced-motion: no-preference,
   e os estados "escondidos" do reveal são aplicados via JS (classe .jm-reveal),
   então se o JS falhar nada some.
   ============================================================ */

@media (prefers-reduced-motion: no-preference) {
    /* NOTA: scroll-reveal e fade de página REMOVIDOS — deixavam conteúdo em
       opacity:0 e podiam esconder o hero/seções no render real. Mantidas só
       micro-interações que NÃO escondem conteúdo. */

    /* Cards: elevação no hover */
    .jm-brand-card,
    .jm-category-card,
    .jm-featured-card,
    .jm-value-card,
    .jm-differential-card,
    .jm-cert-card,
    .jm-step-card,
    .jm-product-card,
    .jm-contact-info-card {
        transition:
            transform 0.32s cubic-bezier(0.22, 0.61, 0.36, 1),
            box-shadow 0.32s ease,
            border-color 0.32s ease;
    }
    .jm-brand-card:hover,
    .jm-category-card:hover,
    .jm-featured-card:hover,
    .jm-value-card:hover,
    .jm-differential-card:hover,
    .jm-cert-card:hover,
    .jm-step-card:hover,
    .jm-product-card:hover {
        transform: translateY(-7px);
        box-shadow: 0 20px 42px -16px rgba(26, 42, 74, 0.28);
    }

    /* Zoom sutil na imagem do produto/destaque */
    .jm-product-card-img,
    .jm-featured-card-img {
        overflow: hidden;
    }
    .jm-product-card-img img,
    .jm-featured-card-img img {
        transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
    }
    .jm-product-card:hover .jm-product-card-img img,
    .jm-featured-card:hover .jm-featured-card-img img {
        transform: scale(1.07);
    }

    /* Botões: micro-interação */
    .jm-btn,
    .jm-btn-cart,
    .jm-btn-filter {
        transition:
            transform 0.16s ease,
            box-shadow 0.28s ease,
            background-color 0.28s ease,
            color 0.28s ease;
    }
    .jm-btn:hover,
    .jm-btn-cart:hover,
    .jm-btn-filter:hover {
        transform: translateY(-2px);
    }
    .jm-btn:active,
    .jm-btn-cart:active,
    .jm-btn-filter:active {
        transform: translateY(0);
    }

    /* WhatsApp flutuante: respiração sutil */
    .jm-whatsapp-btn {
        animation: jmPulse 2.6s ease-in-out infinite;
    }
    .jm-whatsapp-btn:hover {
        animation-play-state: paused;
    }
    @keyframes jmPulse {
        0%,
        100% {
            box-shadow: 0 8px 24px -6px rgba(37, 211, 102, 0.5), 0 0 0 0 rgba(37, 211, 102, 0.4);
        }
        50% {
            box-shadow: 0 8px 24px -6px rgba(37, 211, 102, 0.5), 0 0 0 12px rgba(37, 211, 102, 0);
        }
    }

    /* Brand initials / arrows deslizam no hover do card */
    .jm-brand-card:hover .jm-brand-arrow {
        transform: translateX(4px);
    }
    .jm-brand-arrow,
    .jm-category-card-arrow {
        transition: transform 0.28s ease;
    }
    .jm-category-card:hover .jm-category-card-arrow {
        transform: translateX(4px);
    }
}

/* Foco acessível consistente (independe de motion) */
.jm-btn:focus-visible,
.jm-btn-cart:focus-visible,
.jm-btn-filter:focus-visible,
.jm-filter-bar input:focus-visible,
.jm-filter-bar select:focus-visible,
.jm-login-form input:focus-visible,
.jm-registration-form input:focus-visible,
.jm-registration-form select:focus-visible {
    outline: 2px solid var(--jm-primary, #e8761e);
    outline-offset: 2px;
}

/* ============================================================
   Correções de layout / responsivo (aditivas, 2026-07-04)
   ============================================================ */

/* (1) "Skeleton" fantasma: as duas barras cinza decorativas do breadcrumb do
   tema pareciam um loader. Removidas. */
.builify_tm_breadcrumbs::before,
.builify_tm_breadcrumbs::after {
    display: none !important;
}

/* (2) Cabeçalho de página do tema tem espaçamento gigante (94px/101px) —
   enxuga no mobile e reduz o título. */
@media (max-width: 768px) {
    .glax_tm_main_title_holder .title_holder {
        padding: 34px 0 6px !important;
    }
    .glax_tm_main_title_holder .title_holder h3 {
        font-size: 30px !important;
    }
    .builify_tm_breadcrumbs {
        padding-bottom: 22px !important;
        margin-bottom: 0 !important;
    }
}

/* (3) Mini-carrinho: nunca mais largo que a tela (era 380px fixo). */
@media (max-width: 420px) {
    .jm-minicart {
        width: 100% !important;
        right: -100% !important;
    }
}

/* (4) Botões flutuantes no mobile: some com o "voltar ao topo" (redundante,
   há a barra inferior) e sobe o WhatsApp para não colar na barra. */
@media (max-width: 1024px) {
    .glax_tm_totop {
        display: none !important;
    }
    .jm-whatsapp-btn {
        bottom: 74px;
    }
}

/* (5) Brand initials: caixa/centralização idênticas em todos os cards. */
.jm-brand-initial,
.jm-brand-initial-lg {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    line-height: 1;
}

/* (6) Ícones inline unificados: garante tamanho quando um SVG vier sem
   dimensão (evita o 0x0 que quebrava ícones do tema). */
.glax_tm_topbar_wrap .right_part_wrap svg,
.office .icon svg {
    width: 18px;
    height: 18px;
}
.jm-topbar-social svg,
.jm-footer-social svg {
    width: 15px;
    height: 15px;
}

/* (6b) TAMANHO DOS ÍCONES DAS SEÇÕES — correção geral.
   CAUSA: `style.css` do tema tem `svg { width:15px; height:15px }` GLOBAL, e o
   CSS vence o atributo width/height inline do SVG. Resultado: TODO ícone das
   seções JManfro (definidos 28/32/40px no markup) era esmagado para 15px e
   ficava minúsculo dentro das bolinhas. Como este arquivo carrega por último e
   os seletores abaixo têm classe (specificity > `svg`), eles vencem e devolvem
   o tamanho de design a cada ícone. */
.jm-trust-icon svg {
    width: 30px;
    height: 30px;
}
.jm-step-icon svg,
.jm-value-icon svg {
    width: 36px;
    height: 36px;
}
.jm-differential-icon svg {
    width: 32px;
    height: 32px;
}
.jm-contact-info-icon svg {
    width: 26px;
    height: 26px;
}
.jm-step-connector svg {
    width: 26px;
    height: 26px;
}
.jm-category-card-thumb svg {
    width: 40px;
    height: 40px;
}
.jm-login-icon svg {
    width: 30px;
    height: 30px;
}
.jm-empty-icon svg,
.jm-empty-state svg {
    width: 56px;
    height: 56px;
}
/* setas e ícones dentro de links/botões: um pouco maiores que os 15px do tema */
.jm-brand-arrow svg,
.jm-category-card-arrow svg,
.jm-featured-link svg,
.jm-section-footer-cta .jm-btn svg,
.jm-steps-cta .jm-btn svg,
.jm-btn-lg svg {
    width: 18px;
    height: 18px;
}

/* (6c) Categorias da home agora exibem uma FOTO de produto no thumb: preenche
   o quadrado (cover), diferente do tratamento de logo (contain, 48px). */
.jm-category-card-thumb img {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    object-fit: cover;
}

/* (7) BUG CRÍTICO dos ícones: o style.css do tema tem
   `svg { fill: currentcolor; width:15px; height:15px }` GLOBAL, que transformava
   TODOS os ícones de contorno (fill="none") em blocos sólidos no site inteiro.
   Respeita o atributo fill="none" (!important para vencer sempre). Ícones sólidos
   (facebook/whatsapp) usam fill="currentColor" e seguem preenchidos, corretos. */
svg[fill='none'] {
    fill: none !important;
}

/* (8) Hero da home: era 100vh (alto demais e conteúdo colando sob o header
   transparente). Altura controlada + folga no topo p/ o conteúdo não subir demais. */
.jm-hero {
    height: 86vh;
    min-height: 560px;
    max-height: 780px;
}
.jm-hero-slide .container {
    padding-top: 64px;
}
@media (max-width: 768px) {
    .jm-hero {
        height: 82vh;
        min-height: 500px;
    }
    .jm-hero-slide .container {
        padding-top: 52px;
    }
}

/* (9) Modal de produto rico: corpo rolável + rodapé fixo, galeria com
   thumbnails, chips de metadados, seções com hierarquia (Descrição /
   Especificações / Manuais) e skeleton de carregamento. */

/* -- casca: coluna com scroll interno; rodapé nunca sai da tela -- */
.jm-modal.jm-modal-rich {
    display: flex;
    flex-direction: column;
    max-width: 880px;
    max-height: calc(100vh - 80px);
    overflow: hidden;
}
.jm-modal-rich .jm-modal-scroll {
    flex: 1 1 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.jm-modal-rich .jm-modal-inner {
    align-items: stretch;
}

/* -- galeria (imagem principal + thumbnails) -- */
.jm-modal-rich .jm-modal-gallery {
    width: 45%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    background: var(--jm-bg-light);
    border-radius: var(--jm-radius-lg) 0 0 0;
}
.jm-modal-rich .jm-modal-gallery .jm-modal-image {
    width: 100%;
    min-height: 300px;
    border-radius: 0;
    background: transparent;
}
.jm-modal-thumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 20px 20px;
}
.jm-thumb {
    width: 56px;
    height: 56px;
    padding: 4px;
    background: #fff;
    border: 2px solid var(--jm-border);
    border-radius: var(--jm-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}
.jm-thumb:hover {
    border-color: var(--jm-primary);
}
.jm-thumb.active {
    border-color: var(--jm-primary);
    box-shadow: 0 0 0 2px rgba(232, 118, 30, 0.18);
}
.jm-thumb img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* -- coluna de detalhes -- */
.jm-modal-rich .jm-modal-details {
    padding: 30px 32px 26px;
}
.jm-modal-rich .jm-modal-details .pm-name {
    margin-bottom: 12px;
}

/* -- chips de metadados (código/categoria/representada/unidade/embalagem) -- */
.jm-modal-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 6px;
}
.jm-chip {
    display: inline-flex;
    flex-direction: column;
    padding: 6px 12px;
    border-radius: 8px;
    line-height: 1.3;
}
.jm-chip-label {
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    opacity: 0.72;
    font-family: var(--jm-font-heading);
}
.jm-chip-value {
    font-size: 12.5px;
    font-weight: 600;
    font-family: var(--jm-font-body);
}
.jm-chip-code {
    background: rgba(232, 118, 30, 0.13);
    color: #a5520a;
}
.jm-chip-cat {
    background: rgba(26, 42, 74, 0.09);
    color: var(--jm-heading);
}
.jm-chip-rep,
.jm-chip-unit {
    background: var(--jm-bg-light);
    color: var(--jm-text);
    border: 1px solid var(--jm-border);
}
.jm-chip-pack {
    background: rgba(61, 214, 138, 0.16);
    color: #147a48;
}

/* -- seções com heading pequeno uppercase laranja -- */
.jm-modal-section {
    margin-top: 20px;
}
.jm-modal-section-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--jm-font-heading);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.3px;
    color: var(--jm-primary);
    margin-bottom: 10px;
}
.jm-modal-section-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--jm-border);
}

/* -- descrição rica (description_html) -- */
.jm-modal-details .jm-rich-desc {
    max-height: 300px;
    overflow-y: auto;
    scroll-behavior: smooth;
    padding-right: 8px;
    font-family: var(--jm-font-body);
    font-size: 14px;
    line-height: 1.65;
    color: var(--jm-text);
}
.jm-modal-details .jm-rich-desc h3,
.jm-modal-details .jm-rich-desc h4 {
    font-family: var(--jm-font-heading);
    font-size: 14px;
    font-weight: 700;
    color: var(--jm-heading);
    border-bottom: 1px solid var(--jm-border);
    padding-bottom: 5px;
    margin: 16px 0 10px;
    line-height: 1.3;
}
.jm-modal-details .jm-rich-desc h3:first-child,
.jm-modal-details .jm-rich-desc h4:first-child {
    margin-top: 0;
}
.jm-rich-desc p {
    margin: 0 0 10px;
}
.jm-rich-desc ul {
    list-style: none;
    margin: 0 0 12px;
    padding: 0;
}
.jm-rich-desc li {
    position: relative;
    padding-left: 16px;
    margin-bottom: 6px;
}
.jm-rich-desc li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--jm-primary);
}
.jm-rich-desc img {
    max-width: 100%;
    height: auto;
    border-radius: var(--jm-radius);
}
.jm-rich-desc figure {
    margin: 12px 0;
}
.jm-rich-desc figcaption {
    font-size: 12px;
    color: var(--jm-text-muted);
    margin-top: 4px;
}
.jm-rich-desc::-webkit-scrollbar {
    width: 6px;
}
.jm-rich-desc::-webkit-scrollbar-thumb {
    background: var(--jm-border);
    border-radius: 3px;
}

/* -- tabela de especificações (zebra sutil) -- */
.jm-specs-table {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--jm-font-body);
    font-size: 13.5px;
}
.jm-specs-table th {
    text-align: left;
    font-weight: 600;
    color: var(--jm-text-muted);
    padding: 9px 12px;
    width: 42%;
    vertical-align: top;
}
.jm-specs-table td {
    padding: 9px 12px;
    color: var(--jm-text);
}
.jm-specs-table tbody tr:nth-child(odd) {
    background: var(--jm-bg-light);
}

/* -- manuais e downloads -- */
.jm-manuals {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.jm-manuals a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--jm-secondary);
    text-decoration: none;
}
.jm-manuals a:hover {
    color: var(--jm-primary);
    text-decoration: underline;
}
.jm-manuals svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    color: var(--jm-primary);
}

/* -- rodapé fixo: login prompt + quantidade + adicionar -- */
.jm-modal-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    flex-wrap: wrap;
    padding: 14px 24px;
    border-top: 1px solid var(--jm-border);
    background: #fff;
    border-radius: 0 0 var(--jm-radius-lg) var(--jm-radius-lg);
}
.jm-modal-footer .jm-modal-login {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    font-size: 12.5px;
    margin: 0;
}
.jm-modal-footer .jm-modal-login a {
    margin-right: 3px;
}
.jm-modal-footer .jm-modal-login svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    color: var(--jm-primary);
}
.jm-modal-buy {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}
.jm-modal-qty-wrap {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.jm-pack-hint {
    font-size: 11px;
    color: var(--jm-text-muted);
    white-space: nowrap;
}
.jm-modal-buy .jm-btn-cart {
    flex: none;
    padding: 12px 28px;
    font-size: 14px;
}

/* -- skeleton de carregamento -- */
.jm-skel {
    height: 12px;
    border-radius: 6px;
    margin-bottom: 8px;
    background: linear-gradient(90deg, #ececec 25%, #f7f7f7 37%, #ececec 63%);
    background-size: 400% 100%;
    animation: jmSkel 1.2s ease infinite;
}
@keyframes jmSkel {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: 0 0;
    }
}

/* -- tablet: colunas empilham (segue o breakpoint do custom.css) -- */
@media (max-width: 991px) {
    .jm-modal-rich .jm-modal-gallery {
        width: 100%;
        border-radius: var(--jm-radius-lg) var(--jm-radius-lg) 0 0;
    }
    .jm-modal-rich .jm-modal-gallery .jm-modal-image {
        min-height: 240px;
    }
}

/* -- mobile: sheet full-screen, galeria em cima, rodapé colado embaixo -- */
@media (max-width: 640px) {
    .jm-modal-overlay {
        padding: 0;
    }
    .jm-modal-overlay.active {
        align-items: stretch;
    }
    .jm-modal.jm-modal-rich {
        max-width: 100%;
        width: 100%;
        height: 100dvh;
        max-height: 100dvh;
        border-radius: 0;
    }
    .jm-modal-rich .jm-modal-gallery {
        border-radius: 0;
    }
    .jm-modal-rich .jm-modal-gallery .jm-modal-image {
        min-height: 200px;
        padding: 18px;
    }
    .jm-modal-rich .jm-modal-details {
        padding: 20px;
    }
    .jm-modal-details .jm-rich-desc {
        max-height: none;
        overflow-y: visible;
    }
    .jm-modal-footer {
        padding: 12px 16px;
        padding-bottom: calc(12px + env(safe-area-inset-bottom));
        border-radius: 0;
    }
    .jm-modal-footer .jm-modal-login {
        width: 100%;
        justify-content: center;
    }
    .jm-modal-buy {
        width: 100%;
        margin-left: 0;
        justify-content: space-between;
    }
}
