/* =========================================================================
   PARTE 1: RESET, CONFIGURAÇÕES E CABEÇALHO 
   ========================================================================= */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: system-ui, -apple-system, sans-serif;
}

body {
    background: #f3f4f6;
    color: #1f2937;
    padding-bottom: 0px;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    display: flex !important;
    flex-direction: column !important; /* adicionado essas 3 opções para testar rodapé*/
    min-height: 100vh !important;
    height: auto !important;
}

.modal-open,
body[style*="overflow: hidden"] {
    overflow: hidden !important;
    height: 100vh !important;
    touch-action: none !important;
}

.modal-card,
.modal-info,
#gallery-modal {
    touch-action: auto !important;
    -webkit-overflow-scrolling: touch;
}

header {
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 12px 20px;
    position: sticky;
    top: 0;
    z-index: 99990;
    width: 100%;
    box-sizing: border-box;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.header-container>div:first-child {
    display: inline-flex;
    align-items: center;
    gap: 14px;
}

.header-container>div:last-child {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 12px !important;
    white-space: nowrap !important;
}

.logo {
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.logo span {
    color: #2563eb;
}

.btn-sidebar-trigger {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.2s, transform 0.1s;
}

.btn-sidebar-trigger:hover {
    background-color: rgba(0, 0, 0, 0.05);
}

.btn-sidebar-trigger:active {
    transform: scale(0.95);
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 100000;
    display: none;
}

.sidebar-overlay.active {
    display: block !important;
}

.app-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    background: #ffffff !important;
    background-color: #ffffff !important;
    border-right: 1px solid #e5e7eb;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08);
    z-index: 100005;
    padding: 24px;
    display: flex;
    flex-direction: column;
    transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
}

.app-sidebar *,
.sidebar-menu-links li,
.sidebar-menu-links li a {
    background: transparent !important;
    background-color: transparent !important;
}

.app-sidebar.active {
    left: 0 !important;
}

.btn-sidebar-close {
    align-self: flex-end;
    background: transparent;
    border: none;
    color: #4b5563 !important;
    font-size: 1.75rem;
    cursor: pointer;
    line-height: 1;
    padding: 4px 8px;
    border-radius: 6px;
    transition: color 0.2s, background-color 0.2s;
}

.btn-sidebar-close:hover {
    color: #111827 !important;
    background-color: rgba(0, 0, 0, 0.05) !important;
}

.sidebar-menu-links {
    list-style: none;
    padding: 0;
    margin: 32px 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sidebar-menu-links li a {
    display: block;
    padding: 12px 16px;
    color: #374151 !important;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    border-radius: 8px;
    transition: background-color 0.2s, color 0.2s;
}

.sidebar-menu-links li a:hover {
    background-color: #f3f4f6 !important;
    color: #111827 !important;
}

.sidebar-menu-links li a[href*="processar_referencias"] {
    color: #2563eb !important;
}

.sidebar-menu-links li a[href*="processar_referencias"]:hover {
    background-color: #eff6ff !important;
    color: #1d4ed8 !important;
}

.user-dropdown {
    display: inline-block !important;
    position: relative;
}

.dropdown-trigger {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    padding: 8px 14px;
    border-radius: 6px;
    cursor: pointer;
    color: #1f2937;
    font-size: 0.875rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
    height: 38px;
}

.dropdown-trigger:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.dropdown-menu {
    display: none;
    position: absolute;
    right: 0;
    top: 100%;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 6px 0;
    min-width: 170px;
    z-index: 99995;
    margin-top: 8px;
    box-sizing: border-box;
}

.txt-ola-desktop,
.txt-clear-desktop,
.user-txt-desktop {
    display: inline;
}

.txt-ola-mobile,
.txt-clear-mobile {
    display: none;
}

.user-name-truncated {
    font-weight: 700;
}

.btn-filter-trigger {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #e5e7eb;
    padding: 8px 14px;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: relative;
    transition: all 0.2s;
    height: 38px;
    box-sizing: border-box;
}

.btn-filter-trigger:hover {
    background: #f9fafb;
    border-color: #d1d5db;
}

.btn-filter-trigger.active {
    background: #1f2937;
    color: white;
    border-color: #1f2937;
}

.filter-counter {
    background: #2563eb;
    color: white;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    min-width: 16px;
    height: 16px;
}

.search-panel {
    max-width: 100% !important;
    width: 100%;
    position: sticky;
    top: 62px;
    z-index: 9995;
    background-color: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    padding: 16px 20px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    box-sizing: border-box;
}

.search-form {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    display: grid;
    grid-template-columns: repeat(3, 1fr) auto;
    gap: 16px;
    align-items: end;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.filter-group label {
    font-size: 0.75rem;
    font-weight: 700;
    color: #4b5563;
    text-transform: uppercase;
}

.filter-group input[type="text"],
.filter-group input[list] {
    padding: 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.9rem;
    background: #f9fafb;
    height: 40px;
    box-sizing: border-box;
    width: 100%;
    max-width: 250px !important;
    transition: all 0.2s;
}

.filter-group input[type="text"]:focus,
.filter-group input[list]:focus {
    outline: none;
    border-color: #2563eb;
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-actions-group {
    display: flex !important;
    flex-direction: row;
    gap: 8px;
    align-items: end;
    min-width: 200px;
}

.btn-search {
    background: #1f2937;
    color: white;
    border: none;
    padding: 0 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    height: 40px;
    width: 100%;
    box-sizing: border-box;
    transition: background 0.2s;
}

.btn-search:hover {
    background: #111827;
}

.btn-quick-clear-novo {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fee2e2 !important;
    padding: 0 16px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    box-sizing: border-box;
    transition: all 0.2s ease;
    flex: 1;
}

.btn-quick-clear-novo:hover {
    background: #fee2e2 !important;
}

.fabricante-group {
    position: relative;
    max-width: 250px !important;
    width: 100%;
}

.fabricante-combo-container {
    display: flex;
    gap: 8px;
    width: 100%;
    align-items: center;
}

#filtro_rapido_fabricante,
#busca_fabricante {
    flex: 1;
    height: 40px !important;
    padding: 0 10px;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    box-sizing: border-box;
}

.fabricante-sugestoes-box {
    display: none;
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    width: 100%;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    max-height: 200px;
    overflow-y: auto;
    z-index: 99997;
}

.fabricante-sugestoes-box.active {
    display: block;
}

.sugestao-item {
    padding: 10px 14px;
    font-size: 0.88rem;
    color: #334155;
    cursor: pointer;
    transition: background 0.15s ease;
    font-weight: 500;
}

.sugestao-item:hover {
    background-color: #f1f5f9;
    color: #2563eb;
}

#lista_fabricantes {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    gap: 8px !important;
    max-height: 250px !important;
    overflow-y: auto !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 8px !important;
    padding: 12px !important;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1) !important;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
    box-sizing: border-box;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
    justify-content: start;
    align-items: stretch;
}

.card {
    background: white;
    border-radius: 16px;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    box-sizing: border-box;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05);
}

.img-container {
    aspect-ratio: 1/1;
    width: 100%;
    background: #f9fafb;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    overflow: hidden;
}

.img-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.card:hover .img-container img {
    transform: scale(1.03);
}

.card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.card-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin: 4px 0;
    cursor: pointer;
    line-height: 1.4;
}

.card-title:hover {
    color: #2563eb;
}

.card-meta {
    font-size: 0.8rem;
    font-weight: 600;
    color: #2563eb;
    text-transform: uppercase;
    margin-bottom: 2px;
}

.card-desc {
    font-size: 0.85rem;
    color: #6b7280;
    margin-bottom: 16px;
    line-height: 1.5;
    max-height: 4.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-footer {
    padding-top: 12px;
    border-top: 1px solid #f3f4f6;
    margin-top: auto;
}

.btn-view {
    background: #eff6ff;
    color: #2563eb;
    font-weight: 700;
    border: none;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 0.75rem;
    cursor: pointer;
    text-transform: uppercase;
    width: 100%;
    transition: all 0.2s;
}

.btn-view:hover {
    background: #2563eb;
    color: #ffffff;
}

/* 🚀 NOVO COMPONENTE: Selo Flutuante de Marketplace */
.selo-marketplace-vitrine {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 15 !important;
    cursor: pointer;
    width: 45px !important;
    /* Força a caixinha do selo a ter 45px fixos */
    height: 45px !important;
    /* Força a caixinha do selo a ter 45px fixos */
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: transparent !important;
    /* Garante que o fundo não herde blocos brancos */
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.selo-marketplace-vitrine:hover {
    transform: scale(1.15);
}

/* Redimensiona qualquer logotipo (redondo ou quadrado) para caber na caixinha */
.selo-marketplace-vitrine img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;
    /* Impede a imagem de esticar ou achatar */
    filter: drop-shadow(0px 3px 5px rgba(0, 0, 0, 0.18));
}

/* =========================================================================
   PARTE 3: PAGINAÇÃO, MODAL DE PRODUTO, MODAL MARKETPLACE E RESPONSIVIDADE
   ========================================================================= */
.pagination-container {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 40px;
    padding: 10px 15px;
}

.page-link {
    background: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
    padding: 8px 14px;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}

.page-link:hover {
    background: #f3f4f6;
    color: #111827;
    border-color: #9ca3af;
}

.page-link.active {
    background: #2563eb;
    color: white;
    border-color: #2563eb;
    cursor: default;
    pointer-events: none;
}

.modal,
#gallery-modal {
    position: fixed;
    inset: 0;
    background: rgba(3, 7, 18, 0.8);
    z-index: 500000 !important;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(8px);
    box-sizing: border-box;
}

.modal.flex {
    display: flex !important;
}

.modal-card {
    background: white;
    border-radius: 16px;
    max-width: 950px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden; 
    padding: 24px;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    gap: 24px;
    position: relative;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
}

.modal-gallery {
    width: 55%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    max-height: calc(90vh - 75px);
    box-sizing: border-box;
}


.main-display {
    flex: 1 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    width: 100% !important;
    max-height: calc(100% - 95px) !important; 
    overflow: hidden !important;
    box-sizing: border-box !important;
    background: #ffffff !important;
}

.main-display img,
#modal-main-img {
    max-width: 100% !important;
    max-height: 100% !important;
    width: auto !important;
    height: auto !important;
    object-fit: contain !important;
    display: block !important;
    margin: auto !important;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #cbd5e1;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s;
}

.nav-arrow:hover {
    background: #2563eb;
    color: #ffffff;
    border-color: #2563eb;
}

.arrow-prev {
    left: 12px;
}

.arrow-next {
    right: 12px;
}

.thumb-item {
    width: 64px;
    height: 64px;
    border-radius: 8px;
    border: 2px solid transparent;
    overflow: hidden;
    cursor: pointer;
    flex-shrink: 0;
    background: #f9fafb;
    transition: border-color 0.2s;
}

.thumb-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumb-item.active {
    border-color: #2563eb;
    background: #eff6ff;
}

.modal-info {
    flex: 1;
    width: 100%;
    max-height: calc(90vh - 60px);
    overflow-y: auto !important; 
    padding-right: 5px;
}

.modal-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin-top: 4px;
    margin-bottom: 4px;
    color: #1e3a8a;
}

.tech-spec-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    margin: 12px 0;
    background: #f9fafb;
    padding: 12px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.tech-item {
    font-size: 0.85rem;
    color: #4b5563;
}

.tech-item strong {
    color: #111827;
}

.divider {
    height: 1px;
    background: #f3f4f6;
    margin: 12px 0;
}

.modal-desc {
    font-size: 0.88rem;
    color: #4b5563;
    line-height: 1.5;
}

.close-modal {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    width: 34px !important;
    height: 34px !important;
    font-size: 22px !important;
    background: #1f2937 !important;
    color: #ffffff !important;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 500010 !important;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    line-height: 1;
}

.close-modal:hover {
    background: rgba(0, 0, 0, 0.8);
}

.close-modal:active {
    transform: scale(0.95);
}

/* 🚀 NOVO COMPONENTE: Novo Modal de Marketplaces */
.modal-mp-container {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 24, 39, 0.7);
    backdrop-filter: blur(4px);
    z-index: 600000;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.modal-mp-content {
    background: #ffffff;
    width: 100%;
    max-width: 460px;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
    position: relative;
    font-family: system-ui, -apple-system, sans-serif;
    animation: modalMpElastic 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    box-sizing: border-box;
}

.modal-mp-fechar {
    position: absolute;
    top: 16px;
    right: 20px;
    cursor: pointer;
    font-size: 1.6rem;
    font-weight: 700;
    color: #9ca3af;
    transition: color 0.2s ease;
    user-select: none;
}

.modal-mp-fechar:hover {
    color: #1f2937;
}

.modal-mp-titulo {
    font-size: 1.25rem;
    font-weight: 800;
    color: #111827;
    margin-bottom: 14px;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 10px;
}

.modal-mp-corpo {
    font-size: 0.95rem;
    color: #4b5563;
    line-height: 1.6;
    word-break: break-word;
}

@media(min-width: 480px) and (max-width: 800px) {
    .tech-spec-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(min-width: 800px) {
    .modal-card {
        flex-direction: row;
    }

    .modal-info {
        border-left: 1px solid #f3f4f6;
        padding-left: 24px;
        overflow-y: auto;
    }
}

@media (max-width: 1024px) {
    .search-form {
        grid-template-columns: repeat(3, 1fr);
    }

    .btn-search {
        grid-column: span 3;
    }
}

/* =========================================================================
   RESPONSIVIDADE SMARTPHONES (ATÉ 768px)
   ========================================================================= */
@media (max-width: 768px) {
    header {
        padding: 8px 10px !important;
    }

    .header-container {
        height: auto;
        padding: 0;
        gap: 4px !important;
    }

    .logo {
        font-size: 1.05rem !important;
    }

    .header-container>div:last-child {
        max-width: 65% !important;
        justify-content: flex-end;
        gap: 6px !important;
    }

    .btn-filter-trigger {
        padding: 6px 8px !important;
        font-size: 0.78rem !important;
        gap: 4px !important;
        height: 34px !important;
    }

    .btn-filter-trigger svg {
        width: 14px !important;
        height: 14px !important;
    }

    .filter-counter {
        font-size: 0.65rem !important;
        min-width: 14px !important;
        height: 14px !important;
        padding: 0 !important;
    }

    .txt-clear-desktop,
    .txt-ola-desktop,
    .user-txt-desktop {
        display: none !important;
    }

    .txt-clear-mobile {
        display: inline-block !important;
        font-size: 1.1rem !important;
        line-height: 1 !important;
        color: #b91c1c;
        font-weight: bold;
    }

    .txt-ola-mobile {
        display: inline !important;
    }

    .dropdown-trigger {
        max-width: 75px !important;
        padding: 6px 6px !important;
        font-size: 0.78rem !important;
        white-space: nowrap !important;
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        box-sizing: border-box !important;
        height: 34px !important;
    }

    .dropdown-trigger span.arrow {
        font-size: 0.55rem !important;
        margin-left: 2px !important;
    }

    .app-sidebar {
        width: 85%;
        max-width: 300px;
    }

    .search-panel {
        top: 60px;
        max-height: 80vh;
        overflow-y: auto;
    }

    .search-form {
        display: block !important;
        width: 100% !important;
        padding: 0 !important;
    }

    .filter-group {
        width: 100% !important;
        margin-bottom: 14px !important;
        max-width: 100% !important;
    }

    .filter-group input[type="text"],
    .filter-group input[list],
    .fabricante-group,
    #filtro_rapido_fabricante,
    #busca_fabricante,
    #fabricante_input_busca,
    .fabricante-sugestoes-box {
        max-width: 100% !important;
        width: 100% !important;
    }

    .fabricante-combo-container {
        flex-direction: column;
        align-items: stretch;
        gap: 6px;
        width: 100% !important;
    }

    .btn-search {
        width: 100% !important;
        margin-top: 8px !important;
        height: 42px !important;
    }

    .products-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .page-link {
        padding: 6px 10px;
        font-size: 0.8rem;
    }

    .modal {
        padding: 10px !important;
    }

    .modal-card {
        flex-direction: column !important;
        max-height: 95vh !important;
        overflow-y: auto !important;
        padding: 16px !important;
    }

    .modal-gallery {
        width: 100% !important;
        height: auto !important;
        max-height: none !important; /* Remove o bloqueio que cortava a base */
        margin-bottom: 20px !important;
    }

    .modal-info {
        width: 100% !important;
        height: auto !important;
        max-height: none !important; /* PROÍBE esmagar os textos e os botões */
        overflow-y: visible !important; /* Permite rolar a tela do celular para ver o formulário todo */
        margin-bottom: 0 !important;
        padding: 10px 0 !important;
    }

    .main-display {
        height: auto !important;
        min-height: 220px !important;
        max-height: 38vh !important; /* Limita a imagem para não cobrir o celular todo */
    }

    .main-display img,
    #modal-main-img {
        width: 100% !important;
        height: auto !important;
        max-height: 38vh !important;
        object-fit: contain !important;
    }

    .nav-arrow {
        width: 35px !important;
        height: 35px !important;
        font-size: 14px !important;
    }

    .close-modal {
        position: absolute !important;
        top: 12px !important;
        right: 12px !important;
        width: 34px !important;
        height: 34px !important;
        font-size: 20px !important;
        line-height: 34px;
        background: #111827 !important;
        color: #ffffff !important;
        border-radius: 50%;
        text-align: center;
        z-index: 500020 !important;
    }

    /* 🚀 REDIMENSIONAMENTO MOBILE: Selo do Marketplace */
    .selo-marketplace-vitrine {
        top: 8px;
        right: 8px;
    }

    .selo-marketplace-vitrine img {
        width: 36px;
        height: 36px;
    }

    .modal-mp-content {
        padding: 22px;
        width: 95%;
    }

    #modal-thumbnails .thumbnail-item, 
    #modal-thumbnails div,
    #modal-thumbnails a {
        width: 50px !important;        
        height: 50px !important;       
        max-width: 50px !important;
        max-height: 50px !important;
        flex: 0 0 50px !important;
        border-radius: 6px !important;
    }
    
    #modal-mp-badge {
        width: 50px;
        height: 50px;       
        max-width: 50px;
        max-height: 50px;
        flex: 0 0 50px;
        border-radius: 6px !important;
    }

    #modal-thumbnails .active,
    #modal-thumbnails .selected,
    #modal-thumbnails .thumbnail-item.active {
        border-radius: 6px !important;
        border: 2px solid #2563eb !important;
    }

    .modal-footer-gallery-row {
        height: 58px !important;
        max-height: 58px !important;
        min-height: 58px !important;
        margin-top: 15px !important;
        gap: 8px !important;
    }
}

@keyframes modalMpElastic {
    from {
        transform: scale(0.9) translateY(10px);
        opacity: 0;
    }

    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

/* Força a imagem com a classe específica a encolher, anulando heranças globais do .card */
img.img-selo-fixo {
    width: 45px !important;
    height: 45px !important;
    max-width: 45px !important;
    max-height: 45px !important;
    min-width: 45px !important;
    min-height: 45px !important;
    object-fit: contain !important;
    display: block !important;
    position: relative !important;
}

/* Garante o posicionamento correto da caixinha no topo */
.products-grid .card .selo-marketplace-vitrine {
    position: absolute !important;
    top: 12px !important;
    right: 12px !important;
    z-index: 99 !important;
    width: 45px !important;
    height: 45px !important;
}

.thumbnails-track {
    display: flex;
    gap: 8px;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    height: 100%;
    align-items: center;
    justify-content: flex-start;
    white-space: nowrap;
    box-sizing: border-box;
    padding-bottom: 6px;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    scroll-behavior: smooth;
}
.thumbnails-track::-webkit-scrollbar { display: none !important; }
.thumbnails-track { scrollbar-width: none !important; -ms-overflow-style: none !important; }


#modal-thumbnails .thumbnail-item, 
#modal-thumbnails div,
#modal-thumbnails a {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 64px !important;        
    height: 64px !important;       
    max-width: 64px !important;
    max-height: 64px !important;
    flex-shrink: 0 !important;
    flex: 0 0 64px !important;
    border-radius: 8px !important; 
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    margin: 0 !important;
}

#modal-thumbnails .active,
#modal-thumbnails .selected,
#modal-thumbnails .thumbnail-item.active,
#modal-thumbnails img.active {
    border: 2px solid #2563eb !important;
    border-radius: 8px !important;
}

#modal-thumbnails img,
#modal-mp-badge img {
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: contain !important;
    display: block !important;
}

/* Estilo da caixinha fixa do selo no modal */
#modal-mp-badge {
    display: flex; /* Sem !important para o JavaScript conseguir mudar para 'none' */
    align-items: center;
    justify-content: center;
    width: 64px;   /* Sem !important para não travar a div quando ela sumir */
    height: 64px;       
    max-width: 64px;
    max-height: 64px;
    flex: 0 0 64px;
    flex-shrink: 0;
    border-radius: 8px !important;
    background: #ffffff !important; /* Mantido o fundo branco padrão das fotos */
    border: 2px solid #2563eb !important; /* Sua borda azul de destaque */
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    box-sizing: border-box !important;
    margin: 0 !important;
}

#modal-mp-badge img {
    max-width: 100%;
    max-height: 100%;
}

/* Garante o alinhamento correto dos blocos no rodapé da galeria */
.modal-footer-gallery-row {
    display: flex !important;
    flex-direction: row !important;
    gap: 12px !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: 100% !important;
    height: 72px !important;
    max-height: 72px !important;
    min-height: 72px !important;
    margin-top: 25px !important;
    margin-bottom: 5px !important;
    padding: 0 4px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
}
#modalMarketplace {
    will-change: transform, opacity, display;
    transform: translate3d(0, 0, 0);
}