/* Estilos Gerais */
body {
    font-family: Arial, sans-serif;
    background-color: #1e2124;
    /* Fundo escuro */
    color: #e0e0e0;
    /* Texto claro */
    margin: 0;
    padding: 10px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

header {
    background-color: #004a99;
    /* Azul escuro do header */
    color: white;
    padding: 10px;
    text-align: center;
    border-radius: 8px;
    margin-bottom: 20px;
    /* 👇 Novas propriedades para alinhar os itens 👇 */

    display: flex;
    align-items: center;
    gap: 20px;
    /* Espaço entre o logo e o conteúdo */
}

h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
}

input {
    width: 50%;
    padding: 10px;
    border-radius: 5px;
    border: 1px solid #555;
    font-size: 14px;
    background-color: #333;
    color: #fff;
}

.table-container {
    background-color: #282b30;
    /* Fundo da tabela */
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(255, 255, 255, 0.4);
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 12px;
}

.compare-hint {
    display: none;
    font-size: 12px;
    color: #b9bbbe;
    background: #2f3136;
    border: 1px solid #424549;
    border-radius: 8px;
    padding: 8px 12px;
    margin: 10px auto;
    max-width: 1200px;
    text-align: center;
}

table {
    width: 100%;
    border-collapse: collapse;
    position: relative;
    z-index: 1;
    table-layout: fixed;
    max-width: 100%;
}

#products-table thead th {
    text-align: center !important;
}

#products-table thead th>div {
    justify-content: center !important;
    width: 100%;
}

@media (min-width: 769px) {
    .table-container {
        padding: 0;
    }

    thead th {
        text-align: center;
    }

    table thead th:nth-child(1),
    table tbody td:nth-child(1) {
        width: 4%;
    }

    table thead th:nth-child(2),
    table tbody td:nth-child(2) {
        width: 17%;
        /* Aumentado de 12% para evitar encavalamento */
    }

    table thead th:nth-child(3),
    table tbody td:nth-child(3) {
        width: 12%;
        /* Ajustado de 10% */
    }

    table thead th:nth-child(4),
    table tbody td:nth-child(4) {
        width: 9%;
    }

    table thead th:nth-child(5),
    table tbody td:nth-child(5) {
        width: 9%;
    }

    table thead th:nth-child(6),
    table tbody td:nth-child(6) {
        width: 5%;
    }

    table thead th:nth-child(7),
    table tbody td:nth-child(7) {
        width: 10%;
    }

    table thead th:nth-child(8),
    table tbody td:nth-child(8) {
        width: 9%;
    }

    table thead th:nth-child(9),
    table tbody td:nth-child(9) {
        width: 12%;
    }

    table thead th:nth-child(10),
    table tbody td:nth-child(10) {
        width: 8%;
    }

    table thead th:nth-child(11),
    table tbody td:nth-child(11) {
        width: 7%;
    }


    table thead th:nth-child(12),
    table tbody td:nth-child(12) {
        width: 20%;
    }

    table tbody td[data-label="Histórico de Preço"] {
        overflow: hidden;
    }
}

th,
td {
    padding: 5px;
    text-align: center;
    border-bottom: 1px solid #424549;
    /* Linhas divisórias escuras */
    position: relative;
    overflow: visible;
}

table,
tr,
td {
    position: relative;
    z-index: 1;
}

thead {
    background-color: #36393e;
    /* Cabeçalho da tabela */
    /* 👇 Adicionada posição relativa para controle de z-index 👇 */
    position: -webkit-sticky;
    position: sticky;
    top: 0;
    z-index: 100 !important;
    isolation: isolate;
    /* Cria novo contexto de empilhamento para o header */
}

th {
    font-weight: 600;
    z-index: 101 !important;
    position: relative;
    background-color: #36393e !important;
    isolation: isolate;
    /* Garante que cada th tenha seu próprio contexto */
}


/* Garante que células do corpo da tabela não criem contexto de empilhamento acima do header */
tbody {
    position: relative;
    z-index: 0;
    /* z-index baixo para não interferir com header */
}

tbody td {
    z-index: 0;
    position: relative;
    isolation: auto;
    /* Não cria novo contexto, permite que tooltip respeite header */
}

/* ============================================
   TOOLTIPS - SEÇÃO CONSOLIDADA
   ============================================ */
.product-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.store-logo {
    max-height: 25px;
    max-width: 80px;
    object-fit: contain;
    background-color: #fff;
    /* Fundo branco para logos ficarem visíveis */
    padding: 2px;
    border-radius: 3px;
}

.store-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.product-name {
    font-weight: bold;
}

.price-button-container .price {
    font-weight: bold;
    color: #66bb6a;
    /* Verde claro para preço */
    margin: 0;
}

.price-cell {
    padding: 10px 5px;
}

.price-button-container,
.alert-button {
    z-index: auto !important;
}

.price-button-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
}

.price-main {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

.price-cash {
    font-weight: bold;
    color: #66bb6a;
    margin: 0;
}

.price-installment {
    font-size: 12px;
    color: #e0e0e0;
}

.alert-button {
    background-color: #5865f2;
    /* Cor azul do Telegram */
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.buy-button {
    background-color: #1e7522;
    /* Verde para comprar */
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: background-color 0.2s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.buy-button:hover {
    background-color: #206923;
}

.action-buttons {
    display: flex;
    gap: 8px;
    align-items: center;

    white-space: nowrap;
    position: relative;
}

.alert-button:hover {
    background-color: #4752c4;
}

.alert-button:active {
    transform: scale(0.95);
}

.chart-container {
    width: 100%;
    height: 120px;
    position: relative;
    z-index: 10 !important;
}

.chart-container canvas {
    position: relative;
    z-index: 11 !important;
    /* Canvas fica acima de células, mas abaixo do tooltip */
}

.alert-bar {
    background-color: #1e5128;
    /* Fundo verde escuro para alerta */
    color: #c8e6c9;
    /* Texto claro para alerta */
    padding: 5px;
    text-align: center;
    font-weight: bold;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Estilo para as estrelas do rating */
.rating-stars {
    color: #ffca28;
    /* Cor de ouro */
    font-size: 14px;
    margin-left: 5px;
}

.rating-cell {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
}

/* Container para a barra de Custo x Benefício */
.vfm-bar-container {
    position: relative;
    width: 100%;
    background-color: #424549;
    /* Fundo da barra */
    border-radius: 5px;
    height: 25px;
}

/* A barra colorida de progresso */
.vfm-bar {
    height: 100%;
    border-radius: 5px;
    transition: width 0.5s ease-in-out;
}

/* O texto com o valor, centralizado sobre a barra */
.vfm-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-weight: bold;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.7);
    font-size: 14px;
}

/* Cores da barra */
.vfm-green {
    background-color: #036808;
}

.vfm-blue {
    background-color: #076ec2;
}

.vfm-yellow {
    background-color: #867904;
}

.vfm-red {
    background-color: #a10a07;
}

/* NOVAS CLASSES PARA VARIAÇÃO DE PREÇO */
.price-up {
    color: #ef5350;
    font-weight: bold;
}

/* Vermelho para alta (ruim) */
.price-down {
    color: #66bb6a;
    font-weight: bold;
}

/* Verde para queda (bom) */
.price-stable {
    color: #e0e0e0;
}

/* Cor padrão para preço estável */

/* ============================================
   FILTRO DE LOJAS
   ============================================ */
.store-filter-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    margin: 20px auto;
    max-width: 1200px;
    background: #2f3136;
    border-radius: 8px;
    border: 1px solid #424549;
    flex-wrap: wrap;
    /* 👇 Garantir que fique acima da tabela 👇 */
    position: relative;
    z-index: 110;
}


.store-filter-label {
    color: #dcddde;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
}

.store-filter-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.store-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #36393f;
    border: 1px solid #424549;
    border-radius: 6px;
    color: #dcddde;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.store-filter-btn img {
    width: 20px;
    height: 20px;
    object-fit: contain;
    background: #fff;
    padding: 2px;
    border-radius: 3px;
}

.store-filter-btn:hover {
    background: #40444b;
    border-color: #5865f2;
}

.store-filter-btn.active {
    background: #5865f2;
    border-color: #5865f2;
    color: #ffffff;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.store-filter-btn.active:hover {
    background: #4752c4;
}

@media (max-width: 768px) {
    .compare-hint {
        display: block;
    }

    .intro-section,
    .ranking-title-section {
        display: none !important;
    }

    .store-filter-toolbar {
        padding: 12px 16px;
        margin: 15px auto;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 10px;
    }

    .store-filter-label {
        width: auto;
        margin-bottom: 6px;
        text-align: center;
    }

    .store-filter-buttons {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
        justify-items: center;
        width: 100%;
        gap: 10px;
    }

    .store-filter-btn {
        font-size: 12px;
        padding: 8px 14px;
        border-radius: 9999px;
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
    }

    .store-filter-btn img {
        width: 20px;
        height: 20px;
    }
}

/* ============================================
   TOOLTIPS - SEÇÃO CONSOLIDADA
   ============================================ */
/* --- TOOLTIP DE MEMÓRIA (GDDR6, GDDR7, etc) --- */
.memory-type {
    position: relative;
    display: inline-block;
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: #4caf50;
    color: #4caf50;
    font-weight: 600;
    z-index: 1;
}

.memory-type:hover {
    color: #66bb6a;
}

.memory-tooltip {
    visibility: hidden;
    opacity: 0;
    position: fixed !important;
    background-color: #1a1f24;
    color: #e0e0e0;
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #4caf50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    white-space: normal;
    width: 300px;
    z-index: 9999999 !important;
    font-size: 13px;
    line-height: 1.6;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: auto;
    transform: translateY(-50%);
    /* Centraliza verticalmente ao lado da palavra */
    isolation: isolate;
}


.memory-tooltip-title {
    font-weight: bold;
    color: #4caf50;
    margin-bottom: 8px;
    font-size: 14px;
}

.memory-tooltip-content {
    margin: 4px 0;
}

.memory-tooltip-highlight {
    color: #66bb6a;
    font-weight: 500;
}

/* Esconde tooltips quando modal está aberto */
body.modal-open .memory-type .memory-tooltip {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* --- TOOLTIP DE CUPOM (usa mesma estrutura do GDDR) --- */
.coupon-type {
    position: relative;
    display: inline-block;
    cursor: help;
    text-decoration: underline;
    text-decoration-style: dotted;
    text-decoration-color: #ffca28;
    color: #ffca28;
    font-weight: 600;
    z-index: 1;
}

.coupon-type:hover {
    color: #ffd54f;
}

/* Tooltip de cupom usa .memory-tooltip mas com estilo amarelo quando dentro de .coupon-type */
.coupon-type .memory-tooltip {
    border-color: #ffca28;
}

.coupon-type .memory-tooltip-title {
    color: #ffca28;
}

/* Esconde tooltips de cupom quando modal está aberto */
body.modal-open .coupon-type .memory-tooltip {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
}

/* --- TOOLTIP DE PRODUTO (na comparação) --- */
.product-name-tooltip {
    position: relative;
    display: inline-block;
}

.product-tooltip {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1f24;
    color: #e0e0e0;
    text-align: left;
    padding: 12px 16px;
    border-radius: 8px;
    border: 2px solid #4caf50;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.8);
    white-space: normal;
    width: 300px;
    z-index: 500 !important;
    font-size: 13px;
    line-height: 1.6;
    transition: opacity 0.3s, visibility 0.3s;
    pointer-events: none;
    margin-bottom: 8px;
}

.product-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: #4caf50;
    margin-top: -1px;
}

.product-name-tooltip:hover .product-tooltip {
    visibility: visible;
    opacity: 1;
}

.product-tooltip-title {
    font-weight: bold;
    color: #4caf50;
    margin-bottom: 8px;
    font-size: 14px;
    border-bottom: 1px solid #4caf50;
    padding-bottom: 4px;
}

.product-tooltip-content {
    margin: 4px 0;
}

.product-tooltip-content div {
    margin: 6px 0;
}

/* Bloqueia interação com página de trás quando modal está aberto */
#compare-modal[style*="display: block"]~* {
    pointer-events: none;
}

body.modal-open {
    overflow: hidden;
}

/* Estilos do Rodapé */
footer {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #424549;
    /* Linha sutil para separar do conteúdo */
    font-size: 14px;
    color: #aaa;
    /* Cor do texto do rodapé, um pouco mais sutil */
}

footer a {
    color: #42a5f5;
    /* Azul claro para o link, combinando com o tema */
    text-decoration: none;
    font-weight: bold;
}

footer a:hover {
    text-decoration: underline;
    /* Efeito ao passar o mouse */
}

.product-link,
.store-link {
    color: #8ab4f8;
    /* Um azul mais claro e suave, usado pelo Google em temas escuros */
    text-decoration: none;
    font-weight: 500;
    /* Um pouco mais de peso para destacar */
}

.store-link {
    display: inline-block;
    max-width: 100%;
    white-space: nowrap;
}

.product-link:hover,
.store-link:hover {
    text-decoration: underline;
    color: #9ac2ff;
    /* Um pouco mais brilhante ao passar o mouse */
}

.pagination-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 15px 0;
    gap: 8px;
    flex-wrap: wrap;
    /* Permite que os botões quebrem a linha em telas pequenas */
}

.pagination-controls button:not(.clear-comparisons-btn) {
    background-color: #424549;
    color: #e0e0e0;
    border: 1px solid #555;
    padding: 8px 14px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
}

.pagination-controls button:not(.clear-comparisons-btn):hover {
    background-color: #585c61;
}

.pagination-controls button.active {
    background-color: #007bff;
    border-color: #007bff;
    color: white;
}

.pagination-controls button:disabled {
    background-color: #36393e;
    color: #777;
    cursor: not-allowed;
}

/* Botão de limpar comparações */
.clear-comparisons-btn {
    background-color: #f44336;
    color: white;
    border: 1px solid #d32f2f;
    padding: 8px 16px;
    cursor: pointer;
    border-radius: 5px;
    font-weight: bold;
    transition: background-color 0.2s;
    margin-right: 8px;
    white-space: nowrap;
    font-size: 14px;
}

.clear-comparisons-btn:hover {
    background-color: #d32f2f;
}

.clear-comparisons-btn:active {
    transform: scale(0.95);
}

/* Responsividade para o botão de limpar */
@media (max-width: 768px) {
    h1 {
        font-size: 16px;
    }

    .clear-comparisons-btn {
        padding: 6px 12px;
        font-size: 12px;
        margin-right: 4px;
    }

    .pagination-controls {
        flex-wrap: wrap;
        gap: 4px;
    }
}

#logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s;
}

#logo-link:hover {
    opacity: 0.8;
}

#header-logo {
    height: 50px;
    /* Ajuste a altura conforme necessário */
    width: auto;
    /* Mantém a proporção da imagem */
}

.featured-page-button {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #5865f2;
    /* Cor de destaque (blurple) similar ao hover/active */
    border: 1px solid #5865f2;
    border-radius: 6px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    margin-right: 15px;
    box-shadow: 0 2px 8px rgba(88, 101, 242, 0.3);
}

.featured-page-button:hover {
    background-color: #4752c4;
    border-color: #4752c4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(88, 101, 242, 0.4);
}

.featured-page-button:active {
    transform: translateY(0);
}

.header-content {
    flex-grow: 1;
    /* Faz este container ocupar todo o espaço restante */
    text-align: center;
    /* Mantém o conteúdo centralizado */
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideIn 0.3s ease-out, slideOut 0.3s ease-in 2.7s;
    min-width: 250px;
    max-width: 400px;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-success {
    background-color: #4caf50;
}

.toast-error {
    background-color: #f44336;
}

.toast-warning {
    background-color: #ff9800;
}

.toast-info {
    background-color: #2196f3;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Loading State para botões */
.alert-button.loading {
    opacity: 0.7;
    cursor: wait;
    pointer-events: none;
}

/* Seção Introdutória Melhorada */
.intro-section {
    max-width: 1200px;
    margin: 15px auto;
    padding: 0 20px;
    color: #dcddde;
}

.intro-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: linear-gradient(135deg, #004a99 0%, #0066cc 100%);
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 74, 153, 0.3);
}

.intro-header h2 {
    color: #ffffff;
    margin: 0 0 12px 0;
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.intro-subtitle {
    color: #e0e0e0;
    font-size: 18px;
    margin: 0;
    opacity: 0.95;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.feature-card {
    background-color: #282b30;
    border-radius: 8px;
    padding: 16px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #36393e;
}

.feature-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0, 74, 153, 0.2);
    border-color: #004a99;
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 8px;
    display: block;
}

.feature-card h3 {
    color: #ffffff;
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

.feature-card p {
    color: #b9bbbe;
    margin: 0;
    line-height: 1.4;
    font-size: 12px;
}

.popular-models {
    background-color: #282b30;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
    border: 1px solid #36393e;
}

.popular-models h3 {
    color: #ffffff;
    margin: 0 0 20px 0;
    font-size: 22px;
    font-weight: 600;
}

.models-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.model-tag {
    background: linear-gradient(135deg, #004a99 0%, #0066cc 100%);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 74, 153, 0.3);
}

.model-tag:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 74, 153, 0.4);
}

/* Seção do Título do Ranking */
.ranking-title-section {
    max-width: 1200px;
    margin: 30px auto 20px auto;
    padding: 0 20px;
    text-align: center;
}

.ranking-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.ranking-subtitle {
    color: #b9bbbe;
    font-size: 16px;
    margin: 0;
    opacity: 0.9;
}

/* Responsividade para seção introdutória */
@media (max-width: 768px) {
    .features-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .feature-card {
        padding: 12px;
    }

    .feature-icon {
        font-size: 28px;
        margin-bottom: 6px;
    }

    .feature-card h3 {
        font-size: 14px;
        margin-bottom: 6px;
    }

    .feature-card p {
        font-size: 11px;
    }

    .ranking-title {
        font-size: 22px;
    }

    .ranking-subtitle {
        font-size: 14px;
    }
}

/* ============================================
   RESPONSIVIDADE DA TABELA PARA CELULAR
   ============================================ */
@media (max-width: 768px) {
    #mobile-search-container {
        padding: 0 8px;
        margin: 8px auto 8px;
        max-width: 1200px;
    }

    #mobile-search-container #searchInput {
        width: 100%;
        padding: 8px 12px;
        font-size: 14px;
        border-radius: 8px;
        margin: 0;
    }

    /* Grid de 2 colunas para cards */
    table tbody {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .table-container {
        overflow-x: visible;
        background-color: transparent;
        box-shadow: none;
        max-width: 100%;
    }

    /* Esconde o cabeçalho da tabela em mobile */
    table thead {
        display: none;
    }

    /* Transforma cada linha em um card */
    table tbody tr {
        display: block;
        background-color: #282b30;
        border-radius: 12px;
        margin-bottom: 0;
        padding: 8px;
        /* Reduzido de 16px para 8px para ganhar espaço */
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
        border: 1px solid #36393e;
        width: 100%;
        box-sizing: border-box;
    }

    /* Cada célula vira um bloco com label */
    table tbody td {
        display: flex;
        justify-content: flex-start !important;
        /* Força alinhamento à esquerda */
        align-items: center;
        padding: 4px 0;
        /* Reduzido de 8px para 4px para compactar */
        border-bottom: 1px solid #36393e;
        text-align: left !important;
        flex-wrap: wrap;
        /* Permite quebra de linha se necessário */
        gap: 6px;
        font-size: 14px;
        /* Ajustado de 15px para 14px */
        box-sizing: border-box;
    }

    /* Remove a última borda */
    table tbody td:last-child {
        border-bottom: none;
    }

    /* Adiciona labels antes do conteúdo usando data attributes */
    table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #8ab4f8;
        margin-right: 0;
        flex-shrink: 0;
        font-size: 13px;
        /* Ajustado de 14px para 13px */
    }

    /* Ajusta células especiais */
    table tbody td[data-label="Comparar"] {
        justify-content: flex-start !important;
        padding: 8px 0;
    }

    table tbody td[data-label="Comparar"]::before {
        display: block;
        content: "Comparar";
    }

    /* Produto - destaque maior */
    table tbody td[data-label="Produto"] {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
        padding: 8px 0;
        border-bottom: 2px solid #004a99;
    }

    table tbody td[data-label="Produto"]::before {
        display: none;
    }

    /* Preço - destaque */
    table tbody td[data-label="Preço"],
    table tbody td[data-label="Preço à Vista"] {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    table tbody td[data-label="Preço"]::before,
    table tbody td[data-label="Preço à Vista"]::before {
        display: none;
    }

    table tbody td[data-label="Preço"] .price,
    table tbody td[data-label="Preço à Vista"] .price {
        font-size: 20px;
        /* Ajustado de 22px para 20px */
        color: #66bb6a;
    }

    /* Custo x Benefício - ajuste visual */
    table tbody td[data-label="Custo x Benefício"] {
        justify-content: flex-start !important;
        gap: 6px;
    }

    /* Histórico de Preço - ajuste do gráfico */
    table tbody td[data-label="Histórico de Preço"] {
        flex-direction: column;
        align-items: flex-start;
        padding: 8px 0;
    }

    table tbody td[data-label="Histórico de Preço"]::before {
        margin-bottom: 4px;
    }

    table tbody td[data-label="Histórico de Preço"] .chart-container {
        width: 100%;
        max-width: 100%;
        height: 150px;
    }

    /* Rating - ajuste */
    table tbody td[data-label="Rating"] {
        justify-content: flex-start !important;
    }

    /* Cupom - ajuste */
    table tbody td[data-label="Cupom"] {
        justify-content: flex-start !important;
        flex-wrap: wrap;
    }

    /* Loja - ajuste */
    table tbody td[data-label="Loja"] {
        justify-content: flex-start !important;
    }

    .action-buttons {
        display: flex;
        width: 100%;
        gap: 10px;
        margin-top: 4px;
    }

    .alert-button,
    .buy-button {
        flex: 1;
        /* Botões ocupam largura igual */
        width: auto;
        margin-top: 0;
        padding: 10px;
        /* Área de toque maior */
        font-size: 13px;
        justify-content: center;
        border-radius: 8px;
    }

    .price-button-container {
        width: 100%;
        display: flex;
        flex-direction: column;
        /* Preço em cima, botões em baixo */
        align-items: flex-start;
        justify-content: flex-start !important;
        gap: 6px;
    }

    .price-main {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
    }

    .price-cash {
        font-size: 20px;
        /* Ajustado de 22px para 20px */
        font-weight: bold;
        color: #66bb6a;
    }

    .price-installment {
        font-size: 12px;
        /* Ajustado de 13px para 12px */
        color: #b9bbbe;
    }

    /* Ajusta informações do produto */
    .product-info {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .store-logo {
        max-width: 100px;
    }

    /* Loja: nome + botão lado a lado no mobile */
    .store-cell {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        flex-wrap: wrap;
    }

    .store-cell .buy-button {
        padding: 8px 10px;
        font-size: 12px;
    }

    /* Hist. % - ajuste */
    table tbody td[data-label="Hist. %"] {
        font-size: 14px;
        /* Ajustado de 15px para 14px */
        font-weight: 600;
        justify-content: flex-start !important;
    }

    /* Detalhes - especifico para garantir que não espalhe */
    table tbody td[data-label="Detalhes"] {
        justify-content: flex-start !important;
        gap: 6px;
    }

    .hide-mobile {
        display: none !important;
    }
}

/* Ajustes adicionais para telas muito pequenas */
@media (max-width: 480px) {
    table tbody td::before {
        min-width: 70px;
        font-size: 12px;
    }

    table tbody td {
        font-size: 14px;
        padding: 8px 0;
    }

    table tbody td[data-label="Preço à Vista"] .price {
        font-size: 18px;
    }

    .product-name {
        font-size: 14px;
    }

    .chart-container {
        height: 120px !important;
    }
}