/* =========================================================================
   MINHA CONTA — Água Verde Pet Store
   Layout de duas colunas: menu lateral + conteúdo em cartões.
   Carregado só nas páginas da conta (ver inc/minha-conta.php).
   ========================================================================= */

.woocommerce-account .woocommerce {
    max-width: var(--container);
    margin: 0 auto;
}

/* Só vira duas colunas quando o menu existe (cliente logado). */
body.woocommerce-account.logged-in .woocommerce {
    display: grid;
    grid-template-columns: 268px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

/* Avisos (ex.: "senha alterada") ocupam a largura toda. */
body.woocommerce-account.logged-in .woocommerce > .woocommerce-notices-wrapper,
body.woocommerce-account.logged-in .woocommerce > .woocommerce-message,
body.woocommerce-account.logged-in .woocommerce > .woocommerce-error,
body.woocommerce-account.logged-in .woocommerce > .woocommerce-info {
    grid-column: 1 / -1;
}

body.woocommerce-account.logged-in .woocommerce > .woocommerce-notices-wrapper:empty { display: none; }

/* ---------- Coluna do menu ---------- */

.av-conta__nav {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: sticky;
    top: 24px;
}

.av-conta__perfil {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 18px 16px;
    background: var(--green-50);
    border-bottom: 1px solid var(--border);
}

.av-conta__avatar {
    flex: none;
    width: 42px;
    height: 42px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green-primary);
    color: #fff;
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1;
}

.av-conta__perfil-texto { min-width: 0; display: flex; flex-direction: column; gap: 2px; }

.av-conta__nome {
    font-size: 0.95rem;
    color: var(--green-deep);
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.av-conta__email {
    font-size: 0.78rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.woocommerce-MyAccount-navigation ul {
    list-style: none;
    padding: 8px;
    margin: 0;
}

.woocommerce-MyAccount-navigation li { margin: 0; }

.woocommerce-MyAccount-navigation li a {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 0.93rem;
    text-decoration: none;
    transition: background var(--t), color var(--t);
}

.av-conta__icone {
    flex: none;
    width: 19px;
    height: 19px;
    color: var(--text-muted);
    transition: color var(--t);
}

.woocommerce-MyAccount-navigation li a:hover {
    background: var(--green-50);
    color: var(--green-deep);
}

.woocommerce-MyAccount-navigation li.is-active a {
    background: var(--green-light);
    color: var(--green-deep);
    font-weight: 600;
}

.woocommerce-MyAccount-navigation li a:hover .av-conta__icone,
.woocommerce-MyAccount-navigation li.is-active a .av-conta__icone {
    color: var(--green-primary);
}

/* "Sair" separado do resto. */
.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout {
    margin-top: 6px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
}

.woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout a {
    color: var(--text-muted);
}

/* ---------- Coluna de conteúdo ---------- */

.woocommerce-MyAccount-content {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 26px 28px;
    min-width: 0;
}

.woocommerce-MyAccount-content > h2:first-child,
.woocommerce-MyAccount-content > h3:first-child { margin-top: 0; }

.woocommerce-MyAccount-content h2,
.woocommerce-MyAccount-content h3 {
    font-family: var(--font-display);
    color: var(--green-deep);
}

.woocommerce-MyAccount-content p { color: var(--text); }

.woocommerce-MyAccount-content .button {
    display: inline-block;
    padding: 11px 22px;
    border-radius: 999px;
    background: var(--green-primary);
    color: #fff;
    font-weight: 600;
    text-decoration: none;
    border: 0;
    cursor: pointer;
    transition: background var(--t);
}

.woocommerce-MyAccount-content .button:hover { background: var(--green-hover); }

/* ---------- Painel inicial ---------- */

.av-painel__saudacao {
    margin: 0 0 22px;
    font-size: 1.05rem;
    color: var(--text);
}

.av-painel__saudacao strong { color: var(--green-deep); }

.av-painel__atalhos {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
}

.av-atalho {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
    text-decoration: none;
    color: var(--text);
    transition: border-color var(--t), background var(--t), transform var(--t);
}

.av-atalho:hover {
    border-color: var(--green-primary);
    background: var(--green-50);
    transform: translateY(-2px);
}

.av-atalho .av-conta__icone {
    width: 24px;
    height: 24px;
    color: var(--green-primary);
    margin-bottom: 4px;
}

.av-atalho__titulo {
    font-weight: 600;
    color: var(--green-deep);
    font-size: 0.98rem;
}

.av-atalho__texto {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.av-painel__titulo {
    font-family: var(--font-display);
    font-size: 1.15rem;
    color: var(--green-deep);
    margin: 30px 0 12px;
}

.av-pedidos-resumo { list-style: none; margin: 0; padding: 0; }

.av-pedido-resumo + .av-pedido-resumo { border-top: 1px solid var(--border); }

.av-pedido-resumo__link {
    display: grid;
    grid-template-columns: auto auto auto 1fr;
    align-items: center;
    gap: 12px;
    padding: 13px 4px;
    text-decoration: none;
    color: var(--text);
    transition: background var(--t);
}

.av-pedido-resumo__link:hover { background: var(--green-50); }

.av-pedido-resumo__numero { font-weight: 600; color: var(--green-deep); }
.av-pedido-resumo__data { font-size: 0.86rem; color: var(--text-muted); }
.av-pedido-resumo__total { font-weight: 600; white-space: nowrap; text-align: right; }
.av-pedido-resumo .av-selo { justify-self: start; }

.av-painel__vazio {
    margin-top: 24px;
    padding: 28px;
    text-align: center;
    background: var(--bg-alt);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius);
}

.av-painel__vazio p { margin: 0 0 14px; color: var(--text-muted); }

/* ---------- Selo de situação ---------- */

.av-selo,
.woocommerce-orders-table__cell-order-status {
    display: inline-block;
    padding: 3px 11px;
    border-radius: 999px;
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1.6;
    white-space: nowrap;
    background: var(--green-light);
    color: var(--green-deep);
}

/* Na tabela o selo é a célula inteira; a cor vem por data-title/classe da linha. */
td.woocommerce-orders-table__cell-order-status {
    display: table-cell;
    background: transparent;
    padding: 14px 12px;
    font-weight: 400;
    font-size: inherit;
    color: var(--text);
}

.av-selo--pending,
.av-selo--on-hold { background: #FDF0D5; color: #8A5B00; }
.av-selo--processing { background: var(--green-light); color: var(--green-deep); }
.av-selo--completed { background: #DCF3E4; color: #14612F; }
.av-selo--cancelled,
.av-selo--failed,
.av-selo--refunded { background: var(--terracota-light); color: var(--terracota-hover); }

/* ---------- Tabela de pedidos ---------- */

.woocommerce-orders-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0;
}

.woocommerce-orders-table th {
    text-align: left;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    font-weight: 600;
    padding: 0 12px 10px;
    border-bottom: 1px solid var(--border);
}

.woocommerce-orders-table td {
    padding: 14px 12px;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.woocommerce-orders-table tr:last-child td { border-bottom: 0; }

.woocommerce-orders-table__cell-order-number a { font-weight: 600; color: var(--green-deep); text-decoration: none; }

.woocommerce-orders-table__cell-order-actions { text-align: right; white-space: nowrap; }

.woocommerce-orders-table__cell-order-actions .button {
    padding: 7px 14px;
    font-size: 0.83rem;
    border-radius: 999px;
}

.woocommerce-orders-table__cell-order-actions .button.view {
    background: transparent;
    color: var(--green-deep);
    border: 1.5px solid var(--border-strong);
}

.woocommerce-orders-table__cell-order-actions .button.view:hover {
    border-color: var(--green-primary);
    background: var(--green-50);
}

.woocommerce-orders-table__cell-order-actions .button + .button { margin-left: 6px; }

/* ---------- Detalhe do pedido ---------- */

.woocommerce-order-details,
.woocommerce-customer-details { margin-top: 26px; }

.woocommerce-order-details__title,
.woocommerce-column__title,
.woocommerce-customer-details h2 {
    font-family: var(--font-display);
    font-size: 1.12rem;
    color: var(--green-deep);
    margin: 0 0 12px;
}

.woocommerce-table--order-details {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-table--order-details th,
.woocommerce-table--order-details td {
    padding: 12px;
    border-bottom: 1px solid var(--border);
    text-align: left;
}

.woocommerce-table--order-details tfoot th { text-align: left; color: var(--text-muted); font-weight: 600; }
.woocommerce-table--order-details tfoot tr:last-child th,
.woocommerce-table--order-details tfoot tr:last-child td {
    font-size: 1.02rem;
    color: var(--green-deep);
    border-bottom: 0;
}

.woocommerce-customer-details address {
    font-style: normal;
    padding: 16px;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    line-height: 1.6;
}

/* ---------- Endereços ---------- */

.woocommerce-Addresses {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-top: 18px;
}

.woocommerce-Address {
    width: auto !important;
    float: none !important;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
}

.woocommerce-Address-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.woocommerce-Address-title h2,
.woocommerce-Address-title h3 { margin: 0 0 10px; font-size: 1rem; color: var(--green-deep); }
.woocommerce-Address-title .edit { font-size: 0.85rem; color: var(--green-primary); }
.woocommerce-Address address { font-style: normal; line-height: 1.6; color: var(--text); }

/* ---------- Formulários da conta ---------- */

.woocommerce-EditAccountForm fieldset {
    margin-top: 26px;
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-alt);
}

.woocommerce-EditAccountForm legend {
    padding: 0 8px;
    font-weight: 600;
    color: var(--green-deep);
}

.woocommerce-MyAccount-content .form-row { margin-bottom: 14px; }

.woocommerce-MyAccount-content label { display: block; margin-bottom: 5px; font-size: 0.9rem; color: var(--text); }

.woocommerce-MyAccount-content .input-text,
.woocommerce-MyAccount-content select {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: #fff;
    font-family: inherit;
    font-size: 0.95rem;
}

.woocommerce-MyAccount-content .input-text:focus,
.woocommerce-MyAccount-content select:focus {
    outline: none;
    border-color: var(--green-primary);
}

/* ---------- Pix ---------- */

.av-pix-confirmado {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 18px 0 0;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--green-light);
    color: var(--green-deep);
    font-weight: 600;
}

.av-pix-confirmado__marca {
    flex: none;
    width: 24px;
    height: 24px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--green-primary);
    color: #fff;
    font-size: 0.85rem;
}

/* ---------- Telas menores ---------- */

@media (max-width: 900px) {
    body.woocommerce-account.logged-in .woocommerce {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .av-conta__nav { position: static; }

    /* Menu vira uma faixa horizontal deslizável. */
    .woocommerce-MyAccount-navigation ul {
        display: flex;
        gap: 6px;
        overflow-x: auto;
        padding: 8px;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }

    .woocommerce-MyAccount-navigation ul::-webkit-scrollbar { display: none; }

    .woocommerce-MyAccount-navigation li { flex: none; }

    .woocommerce-MyAccount-navigation li a { white-space: nowrap; }

    .woocommerce-MyAccount-navigation li.woocommerce-MyAccount-navigation-link--customer-logout {
        margin-top: 0;
        padding-top: 0;
        border-top: 0;
        border-left: 1px solid var(--border);
        margin-left: 4px;
        padding-left: 4px;
    }

    .woocommerce-MyAccount-content { padding: 20px 18px; }
}

@media (max-width: 600px) {
    /* Tabela de pedidos em cartões, para não estourar a largura. */
    .woocommerce-orders-table thead { display: none; }

    .woocommerce-orders-table,
    .woocommerce-orders-table tbody,
    .woocommerce-orders-table tr,
    .woocommerce-orders-table td { display: block; width: 100%; }

    .woocommerce-orders-table tr {
        margin-bottom: 12px;
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 6px 12px;
    }

    .woocommerce-orders-table td,
    td.woocommerce-orders-table__cell-order-status {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 12px;
        padding: 9px 0;
        border-bottom: 1px solid var(--border);
        text-align: right;
    }

    .woocommerce-orders-table tr td:last-child { border-bottom: 0; }

    .woocommerce-orders-table td::before {
        content: attr(data-title);
        font-size: 0.78rem;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--text-muted);
        font-weight: 600;
        text-align: left;
    }

    .av-pedido-resumo__link {
        grid-template-columns: auto 1fr;
        row-gap: 6px;
    }
}

/* ---------- Acabamento do detalhe do pedido ---------- */

.woocommerce-MyAccount-content mark {
    background: transparent;
    color: var(--green-deep);
    font-weight: 600;
}

.woocommerce .woocommerce-MyAccount-content table.shop_table {
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.woocommerce .woocommerce-MyAccount-content table.shop_table th,
.woocommerce .woocommerce-MyAccount-content table.shop_table td,
.woocommerce .woocommerce-MyAccount-content table.shop_table thead th {
    background: transparent;
    border-left: 0;
    border-right: 0;
    border-top: 0;
    border-bottom: 1px solid var(--border);
    color: var(--text);
    font-weight: 400;
}

.woocommerce .woocommerce-MyAccount-content table.shop_table thead th,
.woocommerce .woocommerce-MyAccount-content table.shop_table tfoot th {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.woocommerce-MyAccount-content .shop_table tfoot tr:last-of-type th,
.woocommerce-MyAccount-content .shop_table tfoot tr:last-of-type td { border-bottom: 0; }

.woocommerce-MyAccount-content .shop_table .product-name strong { font-weight: 600; }
