/*
 * ===================================================================
 * Arquivo: assets/css/minhaconta.css
 * Descrição: Centraliza todos os estilos da área "Minha Conta"
 * (Login, Dashboard, Pedidos e Editar Conta).
 * ===================================================================
 */

/* --- 1. RESET E ESTRUTURA GERAL --- */

/* Esconde o menu lateral padrão do WooCommerce */
.woocommerce-MyAccount-navigation {
    display: none;
}

/* Faz a área de conteúdo ocupar a largura total */
.woocommerce-MyAccount-content {
    width: 100% !important;
}

/* Container principal */
.conta-container-custom {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Ocultar Título "Minha conta" padrão (Apenas quando não logado) */
body.woocommerce-account:not(.logged-in) .page-header {
    display: none !important;
}

/* --- 2. CABEÇALHO DA CONTA (Logado) --- */

.conta-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #e0e0e0;
    margin-bottom: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-avatar img {
    border-radius: 50%;
}

.user-details h2 {
    font-size: 1.6rem;
    font-weight: bold;
    color: #222;
    margin: 0;
}

.user-details span {
    font-size: 0.9rem;
    color: #555;
}

/* Link de Sair */
.conta-header-deslogar {
    font-weight: bold;
    color: #333;
    text-decoration: none;
}
.conta-header-deslogar:hover {
    color: #4169e1;
}

/* Botão "Editar Dados" */
.btn-editar {
    background-color: #f77f00;
    color: #ffffff !important;
    padding: 12px 24px;
    text-decoration: none;
    font-weight: bold;
    border-radius: 6px;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}
.btn-editar:hover {
    background-color: #d66d00;
    color: #ffffff !important;
}

/* --- 3. DASHBOARD: GRID DE ATALHOS --- */

.atalhos-title {
    font-size: 1.2rem;
    color: #444;
    margin-bottom: 20px;
    font-weight: bold;
}

.atalhos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 15px;
}

.atalho-card {
    background-color: #ffffff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    color: #333;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    display: block;
    border: 1px solid transparent;
}

.atalho-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
    color: #333;
}

.atalho-card.atalho-ativo {
    border: 2px solid #0073e6;
    box-shadow: 0 6px 16px rgba(0, 115, 230, 0.2);
}

.atalho-card h4 {
    font-size: 1.1rem;
    font-weight: bold;
    color: #333;
    margin: 0 0 5px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.atalho-card p {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
}

.atalho-card .material-symbols-outlined {
    font-size: 24px;
    color: #0073e6;
}

/* --- 4. PAINÉIS DINÂMICOS (Ajax) --- */

.dashboard-content-panel {
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-top: 20px;
    background: #fff;
}

.dashboard-panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #eee;
}

.dashboard-panel-header .titulo-pagina {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 1.4rem;
    font-weight: bold;
    color: #333;
}

.dashboard-panel-close {
    font-size: 1.8rem;
    color: #888;
    text-decoration: none;
    cursor: pointer;
    transition: color 0.2s ease;
}
.dashboard-panel-close:hover {
    color: #d9534f;
}

/* Seção Favoritos */
.favoritos-section-dashboard {
    margin-top: 30px;
    padding: 20px;
}
.favoritos-section-dashboard ul.products {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

/* --- 5. TABELA DE PEDIDOS --- */

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

#dashboard-content-orders .woocommerce-orders-table thead th {
    font-weight: bold;
    text-align: left;
    padding: 15px 25px;
    color: #333;
    background-color: #f9f9f9;
    border-bottom: 2px solid #eee;
}

#dashboard-content-orders .woocommerce-orders-table tbody td {
    padding: 20px 25px;
    vertical-align: middle;
    border-bottom: 1px solid #f5f5f5;
    color: #555;
}

#dashboard-content-orders .woocommerce-orders-table tbody tr:hover {
    background-color: #fcfcfc;
    cursor: pointer;
}

@media (max-width: 768px) {
    #dashboard-content-orders .woocommerce-orders-table thead { display: none; }
    #dashboard-content-orders .woocommerce-orders-table tbody tr {
        display: block;
        margin-bottom: 15px;
        border: 1px solid #e0e0e0;
        border-radius: 8px;
        padding: 10px;
    }
    #dashboard-content-orders .woocommerce-orders-table tbody td {
        display: block;
        text-align: right;
        padding: 10px;
        border: none;
        border-bottom: 1px solid #eee;
    }
    #dashboard-content-orders .woocommerce-orders-table tbody td::before {
        content: attr(data-title);
        float: left;
        font-weight: bold;
    }
}

/* --- 6. ESTILOS DE FORMULÁRIO (Geral & Material Design) --- */

/* Container Relativo */
.woocommerce form .form-row {
    position: relative;
}

/* Inputs e Selects (Altura Fixa para Alinhamento) */
.woocommerce form .form-row input.input-text,
.woocommerce form .form-row input[type="email"],
.woocommerce form .form-row input[type="password"],
.woocommerce form .form-row input[type="tel"],
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
    width: 100%;
    background-color: #eef4fa !important;
    border: 1px solid #dce3eb !important;
    border-radius: 5px;
    padding: 18px 15px 8px 15px !important; /* Espaço para Label Flutuante */
    font-size: 15px;
    color: #333;
    outline: none;
    box-shadow: none;
    height: 50px !important; /* Altura fixa igual para Input e Select */
    line-height: 1.2 !important;
    box-sizing: border-box !important;
    transition: all 0.3s ease;
    display: block;
}

.woocommerce form .form-row input:focus,
.woocommerce form .form-row select:focus {
    border-color: #007bff !important;
    background-color: #fff !important;
}

/* Labels Flutuantes */
.woocommerce form .form-row label {
    position: absolute;
    top: -9px;
    left: 10px;
    background-color: #fff;
    padding: 0 5px;
    font-size: 12px;
    color: #777;
    pointer-events: none;
    z-index: 10;
    font-weight: 500;
    border-radius: 3px;
}
.woocommerce form .form-row label .required { color: #e60012; }

/* Ícone 'Ver Senha' */
.woocommerce form .form-row .show-password-input {
    position: absolute !important;
    top: 1px !important;
    right: 1px !important;
    bottom: 1px !important;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: #fff;
    border-left: 1px solid #dce3eb;
    border-radius: 0 5px 5px 0;
    color: #555 !important;
    font-size: 0; 
    z-index: 20;
}
.woocommerce form .form-row .show-password-input::after {
    content: "\e8f4"; font-family: 'Material Symbols Outlined'; font-size: 20px; color: #777;
}
.woocommerce form .form-row .show-password-input.display-password::after {
    content: "\e8f5";
}

/* Ajuste Seta do Select */
.woocommerce form .form-row select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23333%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 10px top 50%;
    background-size: 10px auto;
}

/* --- 7. PÁGINA LOGIN & CADASTRO --- */

#customer_login.u-columns.col2-set {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 50px;
    max-width: 1200px;
    margin: 0 auto;
}

#customer_login .u-column1, #customer_login .u-column2 {
    flex: 1;
    min-width: 320px;
    width: 48%;
    padding: 40px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.03);
}

.login-header-custom, .register-header-custom { text-align: center; margin-bottom: 30px; }
.icon-circle { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 20px auto; color: #fff; }
.icon-circle svg { width: 30px; height: 30px; stroke-width: 2.5px; }
.icon-azul { background-color: #01afef; }
.icon-green { background-color: #00a03e; }

.woocommerce-form-login__submit, .woocommerce-form-register__submit {
    width: 100%; border: none !important; color: #fff !important; font-weight: 700 !important; text-transform: uppercase; padding: 15px !important; border-radius: 4px !important; font-size: 16px !important; margin-top: 10px; cursor: pointer;
}
button[name="login"].woocommerce-form-login__submit { background-color: #01afef !important; }
button[name="register"].woocommerce-form-register__submit { background-color: #00a03e !important; }
.woocommerce-form-login__submit:hover, .woocommerce-form-register__submit:hover { opacity: 0.9; }

.woocommerce-form-login__rememberme {
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.woocommerce-form__input.woocommerce-form__input-checkbox{
    box-sizing: border-box;
    margin: 5px;
}

.woocommerce-LostPassword { text-align: center; margin-top: 20px; }

/* --- 8. PÁGINA EDITAR CONTA (Layout Grid) --- */

.pcg-main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
    margin-top: 20px;
}

.pcg-box-wrapper { 
    background: #fbfbfb; 
    padding: 25px 25px 0; 
    border-radius: 8px; 
    border: 1px solid #e5e5e5; 
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.header-title { display: flex; align-items: center; margin-bottom: 15px; color: #333; }
.header-title .material-symbols-outlined { margin-right: 10px; font-size: 24px; color: #555; }
.header-title h3 { margin: 0; font-size: 18px; font-weight: 600; }

/* Linhas Flexíveis (Layout Colunas) */
.pcg-flex-row {
    display: flex;
    gap: 20px;
    width: 100%;
    flex-wrap: wrap;
    align-items: flex-start;
}


/* Larguras Personalizadas */
.pcg-w-sm { flex: 0 0 35%; min-width: 140px; } /* 35% - Nome, Tipo, Celular */
.pcg-w-lg { flex: 1; min-width: 200px; }       /* 65% - Sobrenome, Email, CPF */
.pcg-w-md { flex: 1; min-width: 180px; }       /* 50% */

/* ===================================================================
 * CORREÇÃO FINAL DE ALINHAMENTO E CHECKBOX
 * Substitua todo o bloco .pcg-stack-input anterior por este:
 * ===================================================================
 */

/* 1. Container principal da pilha */
.pcg-stack-input {
    display: flex !important;
    flex-direction: column !important; /* Empilha verticalmente */
    justify-content: flex-start !important; /* Alinha tudo ao TOPO (evita empurrar para cima) */
    position: relative !important;
    height: auto !important;
    margin-bottom: 20px !important; /* Garante espaço inferior para o checkbox não bater no próximo campo */
}

/* 2. O TÍTULO do campo (Ex: "Número *") */
/* Importante: Ele precisa ser absolute para não ocupar espaço na pilha flex e alinhar igual aos vizinhos */
.pcg-stack-input > label:not(.checkbox) {
    position: absolute !important;
    top: -9px !important;
    left: 10px !important;
    z-index: 10 !important;
    background: #fff !important;
    padding: 0 5px !important;
    height: auto !important;
    width: auto !important;
}

/* 3. O INPUT de texto (A caixa onde digita) */
.pcg-stack-input input.input-text {
    order: 1 !important; /* Garante que seja o primeiro item visível */
    margin-top: 0 !important; /* Cola no topo do container */
    margin-bottom: 5px !important; /* Espaço para o checkbox abaixo */
    height: 50px !important; /* Altura fixa igual aos vizinhos */
    width: 100% !important;
    z-index: 1;
}

/* 4. O CONTAINER do Checkbox ("Sem nº") */
.pcg-stack-input label.checkbox {
    order: 2 !important; /* Garante que fique ABAIXO do input */
    position: static !important; /* Remove absolute para fluir na lista */
    margin-top: 0 !important;
    padding-left: 0 !important;
    display: flex !important;
    align-items: center !important;
    font-size: 12px !important;
    color: #666 !important;
    cursor: pointer !important;
    pointer-events: auto !important;
    background: transparent !important;
    width: 100% !important;
    height: auto !important;
}

/* 5. O QUADRADINHO do Checkbox */
.pcg-stack-input label.checkbox input[type="checkbox"] {
    position: static !important;
    margin: 0 5px 0 0 !important;
    width: 16px !important;
    height: 16px !important;
    min-height: 16px !important;
    padding: 0 !important;
}
/* 2. Reseta margens e paddings do container do campo vizinho (Complemento/Cidade) */
.pcg-flex-row .form-row {
    margin-top: 0 !important;
    padding-top: 0 !important;
    align-self: flex-start !important; /* Força o container a subir */
}
/* 3. Força o INPUT do vizinho a colar no topo (remove margens fantasmas) */
.pcg-flex-row .form-row input.input-text,
.pcg-flex-row .form-row select {
    margin-top: 0 !important;
}

/* 4. Ajuste específico para o .pcg-stack-input (Número/Isento) */
/* Garante que ele não tenha margem negativa puxando demais pra cima */
.pcg-stack-input {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
/* Mensagens de Erro */
.validation-error { color: #d63638; font-size: 12px; margin-top: 4px; display: none; font-weight: 500; }

.woocommerce-privacy-policy-text{
    font-size: 10px;
    text-align: center;
}

/* --- 9. RESPONSIVIDADE --- */

@media (max-width: 768px) {
    #customer_login.u-columns.col2-set { flex-direction: column; gap: 30px; }
    .pcg-main-grid { grid-template-columns: 1fr; gap: 20px; }
    .pcg-flex-row { flex-direction: column; gap: 15px; }
    .pcg-w-sm, .pcg-w-lg, .pcg-w-md { width: 100%; flex: auto; }
    #billing_state_field, #billing_city_field, .pcg-number-wrapper { flex: auto !important; width: 100%; }
}