/* =========================================
   TABELA DE MEDIDAS - FRONTEND
   ========================================= */

.tmj-wrapper {
    margin: 15px 0;
}

/* Botão de abrir */
.tmj-btn-abrir {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: transparent;
    color: #333;
    border: 1px solid #333;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.tmj-btn-abrir:hover {
    background: #333;
    color: #fff;
}

.tmj-btn-abrir svg {
    flex-shrink: 0;
}

/* Overlay do popup */
.tmj-popup-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    animation: tmjFadeIn 0.2s ease;
}

.tmj-popup-overlay.tmj-ativo {
    display: flex;
}

@keyframes tmjFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Conteúdo do popup - bordas bem arredondadas */
.tmj-popup-content {
    background: #fafafa;
    border-radius: 20px;
    max-width: 1100px;
    width: 100%;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    padding: 35px 40px;
    box-sizing: border-box;
    animation: tmjSlideUp 0.3s ease;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
}

@keyframes tmjSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Botão fechar */
.tmj-popup-fechar {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
    z-index: 2;
}

.tmj-popup-fechar:hover {
    background: #e8e8e8;
    color: #000;
}

/* Corpo - duas colunas: imagem | tabela + cards */
.tmj-popup-body {
    display: flex;
    gap: 35px;
    align-items: center;
}

/* Coluna da imagem (manequim) */
.tmj-popup-imagem {
    flex: 0 0 42%;
    max-width: 42%;
}

.tmj-popup-imagem img {
    width: 100%;
    height: auto;
    display: block;
}

/* Coluna direita: tabela + cards */
.tmj-popup-direita {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Tabela */
.tmj-tabela-scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.tmj-tabela {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

/* Cabeçalho */
.tmj-tabela thead tr {
    border-bottom: 1px solid #e5e5e5;
}

.tmj-tabela th {
    font-weight: 500;
    color: #555;
    padding: 14px 10px;
    text-align: center;
    background: transparent;
    border: none;
}

.tmj-tabela th.tmj-th-medida {
    text-align: left;
    color: #333;
    padding-left: 5px;
}

/* Corpo da tabela - linhas separadas por borda fina */
.tmj-tabela tbody tr {
    border-bottom: 1px solid #f0f0f0;
    background: transparent !important;
}

.tmj-tabela tbody tr:nth-child(even),
.tmj-tabela tbody tr:nth-child(odd) {
    background: transparent !important;
}

.tmj-tabela tbody tr:last-child {
    border-bottom: none;
}

.tmj-tabela td {
    padding: 14px 10px;
    text-align: center;
    color: #333;
    font-size: 15px;
    border: none;
    background: transparent;
}

/* Sem efeito hover - reforçado */
.tmj-tabela tbody tr:hover,
.tmj-tabela tbody tr:hover td,
.tmj-tabela tr:hover,
.tmj-tabela td:hover,
.tmj-tabela th:hover {
    background: transparent !important;
    background-color: transparent !important;
}

/* Coluna do nome da medida com numeração */
.tmj-tabela td.tmj-linha-nome {
    text-align: left;
    font-weight: 500;
    padding-left: 5px;
    white-space: nowrap;
}

.tmj-numero {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: #1a1a1a;
    color: #fff;
    border-radius: 50%;
    font-size: 11px;
    font-weight: 600;
    margin-right: 12px;
    vertical-align: middle;
    flex-shrink: 0;
}

.tmj-medida-label {
    vertical-align: middle;
    font-size: 14px;
    color: #222;
}

/* Cards de informação (dica + variação) */
.tmj-info-cards {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.tmj-info-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: #fff;
    border-radius: 14px;
    padding: 14px 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.tmj-info-icone {
    flex-shrink: 0;
    width: 38px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
}

.tmj-info-icone img {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

.tmj-info-texto {
    font-size: 13px;
    line-height: 1.5;
    color: #444;
}

.tmj-info-texto p {
    margin: 0;
}

/* Responsivo - tablet */
@media (max-width: 1024px) {
    .tmj-popup-content {
        padding: 25px;
    }

    .tmj-popup-body {
        gap: 25px;
    }

    .tmj-popup-imagem {
        flex: 0 0 38%;
        max-width: 38%;
    }
}

/* Responsivo - mobile */
@media (max-width: 768px) {
    .tmj-popup-content {
        padding: 20px 18px;
        border-radius: 16px;
        max-height: 95vh;
    }

    .tmj-popup-body {
        flex-direction: column;
        gap: 20px;
    }

    .tmj-popup-imagem {
        flex: 0 0 auto;
        max-width: 220px;
        margin: 0 auto;
    }

    .tmj-tabela {
        font-size: 13px;
    }

    .tmj-tabela th,
    .tmj-tabela td {
        padding: 10px 6px;
    }

    .tmj-tabela td.tmj-linha-nome {
        font-size: 12px;
    }

    .tmj-medida-label {
        font-size: 12px;
    }

    .tmj-numero {
        width: 20px;
        height: 20px;
        font-size: 10px;
        margin-right: 6px;
    }

    .tmj-info-card {
        padding: 12px 14px;
        gap: 10px;
    }

    .tmj-info-icone {
        width: 32px;
        height: 32px;
    }

    .tmj-info-icone img {
        width: 24px;
        height: 24px;
    }

    .tmj-info-texto {
        font-size: 12px;
    }
}

/* Impede scroll do body quando popup está aberto */
body.tmj-popup-aberto {
    overflow: hidden;
}
