/* ==========================================================
   CEARASOL - MINHA CONTA > COMPARE
   WPC Smart Compare / WPClever
   Escopo isolado na área Minha Conta
   ========================================================== */

body.woocommerce-account {
    --cs-compare-blue: #3B56CF;
    --cs-compare-pink: #F63BB1;
    --cs-compare-text: #25314D;
    --cs-compare-muted: #667085;
    --cs-compare-line: #E3E8F2;
    --cs-compare-soft: #F7F9FC;
    --cs-compare-success: #159455;
}

/* Área do comparador */
body.woocommerce-account .woocommerce-MyAccount-content .woosc_list.woosc-list.woosc_page,
body.woocommerce-account .woocommerce-MyAccount-content .woosc_list.woosc-list.woosc-page {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto !important;
    padding: 0 0 8px !important;
    box-sizing: border-box !important;
    -webkit-overflow-scrolling: touch;
}

/* Tabela principal */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table {
    width: 100% !important;
    min-width: 860px !important;
    table-layout: fixed !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    background: #fff !important;
    border: 1px solid var(--cs-compare-line) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(32,52,86,.05) !important;
}

/* Remove aparência bruta padrão */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table th,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td {
    border-top: 0 !important;
    border-left: 0 !important;
    border-right: 1px solid var(--cs-compare-line) !important;
    border-bottom: 1px solid var(--cs-compare-line) !important;
    background: #fff !important;
    color: var(--cs-compare-text) !important;
    vertical-align: top !important;
    box-sizing: border-box !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr:last-child th,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr:last-child td {
    border-bottom: 0 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table th:last-child,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td:last-child {
    border-right: 0 !important;
}

/* ==========================================================
   COLUNA DOS RÓTULOS
   Evita Image / Rating / Availability quebrando letra por letra
   ========================================================== */

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr > th:first-child,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr > td:first-child {
    width: 150px !important;
    min-width: 150px !important;
    max-width: 150px !important;
    padding: 14px 16px !important;
    color: #526174 !important;
    background: #F8FAFC !important;
    font-size: 11px !important;
    line-height: 1.35 !important;
    font-weight: 800 !important;
    text-transform: none !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    white-space: normal !important;
    text-align: left !important;
}

/* Colunas dos produtos */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr > th:not(:first-child),
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr > td:not(:first-child) {
    width: calc((100% - 150px) / 2) !important;
    min-width: 340px !important;
    padding: 16px 18px !important;
}

/* ==========================================================
   CABEÇALHO / NOME DOS PRODUTOS
   ========================================================== */

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr:first-child td:not(:first-child),
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr:first-child th:not(:first-child) {
    position: relative;
    padding-top: 18px !important;
    padding-bottom: 18px !important;
    background: #F9FAFD !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table a {
    color: var(--cs-compare-blue) !important;
    text-decoration: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table a:hover {
    color: var(--cs-compare-pink) !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table .woosc-remove,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table a[href*="remove"] {
    display: inline-flex !important;
    margin-left: 6px !important;
    color: #98A2B3 !important;
    font-size: 10px !important;
    font-weight: 600 !important;
}

/* ==========================================================
   IMAGENS
   ========================================================== */

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table img {
    display: block !important;
    width: auto !important;
    max-width: 100% !important;
    height: 260px !important;
    max-height: 260px !important;
    margin: 0 auto !important;
    padding: 8px !important;
    object-fit: contain !important;
    background: #fff !important;
    border-radius: 12px !important;
    box-sizing: border-box !important;
}

/* ==========================================================
   SKU / RATING / PREÇO / ESTOQUE
   ========================================================== */

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table .star-rating {
    color: #FFB800 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table del {
    color: #98A2B3 !important;
    font-size: 11px !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table ins {
    color: var(--cs-compare-blue) !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table .amount {
    color: var(--cs-compare-blue) !important;
    font-weight: 800 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table .stock,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table .in-stock {
    color: var(--cs-compare-success) !important;
    font-weight: 700 !important;
}

/* ==========================================================
   BOTÃO ADICIONAR AO CARRINHO
   ========================================================== */

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table .button,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table a.button,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-height: 46px !important;
    margin: 0 !important;
    padding: 11px 16px !important;
    color: #fff !important;
    background: var(--cs-compare-blue) !important;
    border: 1px solid var(--cs-compare-blue) !important;
    border-radius: 9px !important;
    box-shadow: none !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    font-weight: 800 !important;
    text-decoration: none !important;
    transition: .2s ease !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table .button:hover,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table a.button:hover,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table button:hover {
    color: #fff !important;
    background: var(--cs-compare-pink) !important;
    border-color: var(--cs-compare-pink) !important;
    transform: translateY(-1px);
}

/* ==========================================================
   DESCRIÇÃO / CONTEÚDO
   Mantém legível e limita excesso visual
   ========================================================== */

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td p {
    margin: 0 0 8px !important;
    color: #5D6879 !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td ul,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td ol {
    margin: 8px 0 0 18px !important;
    padding: 0 !important;
    color: #5D6879 !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td h1,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td h2,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td h3,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td h4 {
    margin: 10px 0 6px !important;
    color: var(--cs-compare-blue) !important;
    line-height: 1.3 !important;
    font-weight: 800 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td h2 {
    font-size: 18px !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td h3,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td h4 {
    font-size: 15px !important;
}

/* Tabelas técnicas dentro das células */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td table {
    width: 100% !important;
    margin: 0 !important;
    border: 1px solid #E4E8F0 !important;
    border-radius: 9px !important;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    overflow: hidden !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td table th,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td table td {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    padding: 10px 12px !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    border-bottom: 1px solid #E8ECF2 !important;
    border-right: 0 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table td table th {
    color: var(--cs-compare-blue) !important;
    background: #F7F8FC !important;
    font-weight: 800 !important;
}

/* ==========================================================
   SCROLLBAR HORIZONTAL DO COMPARADOR
   ========================================================== */

body.woocommerce-account .woocommerce-MyAccount-content .woosc_list::-webkit-scrollbar {
    height: 8px;
}

body.woocommerce-account .woocommerce-MyAccount-content .woosc_list::-webkit-scrollbar-track {
    background: #EEF1F5;
    border-radius: 999px;
}

body.woocommerce-account .woocommerce-MyAccount-content .woosc_list::-webkit-scrollbar-thumb {
    background: #C9D1E4;
    border-radius: 999px;
}

body.woocommerce-account .woocommerce-MyAccount-content .woosc_list::-webkit-scrollbar-thumb:hover {
    background: var(--cs-compare-blue);
}

/* ==========================================================
   RESPONSIVO
   ========================================================== */

@media (max-width: 1000px) {
    body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table {
        min-width: 820px !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr > th:first-child,
    body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr > td:first-child {
        width: 135px !important;
        min-width: 135px !important;
        max-width: 135px !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr > th:not(:first-child),
    body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr > td:not(:first-child) {
        min-width: 320px !important;
    }
}

@media (max-width: 767px) {
    body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table {
        min-width: 760px !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table img {
        height: 220px !important;
        max-height: 220px !important;
    }
}


/* ==========================================================
   CEARASOL - COMPARE V2
   - remove coluna vazia
   - remove linha Availability redundante
   - compacta descrição
   - corrige Additional information
   ========================================================== */

/* A tabela com 2 produtos deve ter: rótulo + produto 1 + produto 2 */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table.has-2 tr > *:nth-child(n+4) {
    display: none !important;
}

/* Ajusta larguras após remover a coluna vazia */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table.has-2 tr > *:first-child {
    width: 140px !important;
    min-width: 140px !important;
    max-width: 140px !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table.has-2 tr > *:nth-child(2),
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table.has-2 tr > *:nth-child(3) {
    width: calc((100% - 140px) / 2) !important;
    min-width: 0 !important;
}

/* Linhas ocultadas via JS recebem esta classe */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-hide-row {
    display: none !important;
}

/* Descrição mais compacta */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-description-row td:not(:first-child) {
    position: relative;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-description-row td:not(:first-child) > * {
    max-width: 100%;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-description-row td:not(:first-child) {
    color: #5D6879 !important;
    font-size: 12px !important;
    line-height: 1.55 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-description-row td:not(:first-child) .cs-compare-clamp {
    display: -webkit-box !important;
    -webkit-box-orient: vertical !important;
    -webkit-line-clamp: 6 !important;
    overflow: hidden !important;
}

/* Additional information em blocos alinhados */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-additional-row td:not(:first-child) {
    padding: 14px !important;
    vertical-align: top !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-additional-row td:not(:first-child) table,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-additional-row td:not(:first-child) tbody {
    display: block !important;
    width: 100% !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-additional-row td:not(:first-child) tr {
    display: grid !important;
    grid-template-columns: 125px minmax(0, 1fr) !important;
    width: 100% !important;
    min-height: 44px !important;
    border-bottom: 1px solid #E8ECF2 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-additional-row td:not(:first-child) tr:last-child {
    border-bottom: 0 !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-additional-row td:not(:first-child) th,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-additional-row td:not(:first-child) td {
    display: flex !important;
    align-items: center !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    margin: 0 !important;
    padding: 10px 12px !important;
    border: 0 !important;
    background: transparent !important;
    font-size: 11px !important;
    line-height: 1.4 !important;
    box-sizing: border-box !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-additional-row td:not(:first-child) th {
    color: var(--cs-compare-blue) !important;
    background: #F7F8FC !important;
    font-weight: 800 !important;
}

/* Imagens um pouco menores para reduzir altura */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table img {
    height: 230px !important;
    max-height: 230px !important;
}

/* Add to cart sem colar entre os produtos */
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-cart-row td:not(:first-child) {
    padding: 14px 16px !important;
}

body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-cart-row .button,
body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table tr.cs-compare-cart-row a.button {
    width: 100% !important;
}

/* Mobile continua com scroll horizontal, sem esmagar os produtos */
@media (max-width: 767px) {
    body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table.has-2 {
        min-width: 760px !important;
    }

    body.woocommerce-account .woocommerce-MyAccount-content table.woosc_table img {
        height: 200px !important;
        max-height: 200px !important;
    }
}

