/*
Theme Name: Amigur Code
Theme URI: https://amigur.com.br
Author: Paulo César
Description: Tema customizado para amigurumi.com.br
Version: 1.0
*/

/* ==========================================================================
   1. RESET BÁSICO
   ========================================================================== */
body {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #f4f4f4;
}

/* ==========================================================================
   2. CABEÇALHO AZUL (DESKTOP)
   ========================================================================== */
.meu-cabecalho {
    background-color: #004aad; /* Azul Principal */
    color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 5%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    flex-wrap: wrap; /* Permite quebrar linha no celular */
}

/* Oculta o botão hamburguer no PC */
.menu-mobile-btn {
    display: none; 
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
}
.logo-img {
    max-height: 55px; /* Tamanho da sua logo */
    width: auto;
}
.meu-cabecalho .logo a {
    color: #ffffff;
    text-decoration: none;
    font-size: 24px;
    font-weight: bold;
    display: flex;
    align-items: center;
}

/* Barra de Busca */
.busca {
    flex: 1;
    max-width: 500px;
    margin: 0 30px;
}
.form-busca, .meu-cabecalho .busca form {
    display: flex;
    background: #ffffff;
    border-radius: 30px;
    overflow: hidden;
}
.campo-busca, .meu-cabecalho .busca input[type="text"] {
    flex: 1;
    padding: 12px 20px;
    border: none;
    outline: none;
    font-size: 15px;
    color: #333;
    width: 350px;
}
.btn-busca, .meu-cabecalho .busca button {
    background-color: #00337a; /* Azul mais escuro para o botão */
    border: none;
    padding: 0 25px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.btn-busca:hover, .meu-cabecalho .busca button:hover {
    background-color: #002255;
}

/* Ícones da Direita */
.icones, .meu-cabecalho .icones {
    display: flex;
    align-items: center;
    gap: 25px;
}
.icone-link, .meu-cabecalho .icones a {
    color: #ffffff;
    text-decoration: none;
    display: flex;
    flex-direction: row; /* Mantém ícone e texto lado a lado */
    align-items: center;
    gap: 10px;
    position: relative;
}
.texto-icone {
    font-size: 13px;
    line-height: 1.2;
}

/* Coração Favorito */
.circulo-branco {
    background-color: #ffffff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Contador do Carrinho */
.contador-carrinho {
    background-color: #2ecc71; /* Verde chamativo */
    color: white;
    font-size: 12px;
    font-weight: bold;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: -5px;
    right: -10px;
    border: 2px solid #004aad;
}

/* --- RESPONSIVIDADE (CELULAR) --- */
@media (max-width: 768px) {
    .meu-cabecalho {
        padding: 15px 20px;
    }
    
    /* Mostra o botão hamburguer */
    .menu-mobile-btn {
        display: block;
        order: 1; /* Fica na esquerda */
    }

    /* Centraliza a Logo */
    .logo {
        order: 2;
        margin: 0 auto;
    }
    .logo-img {
        max-height: 45px;
    }

    /* Carrinho vai para a direita */
    .carrinho-link {
        order: 3;
    }

    /* Esconde o texto "Minha conta" e o coração no celular para economizar espaço */
    .conta-link, .favorito-link {
        display: none; 
    }

    /* Joga a busca para a linha de baixo */
    .busca {
        order: 4;
        width: 100%;
        max-width: 100%;
        margin: 15px 0 0 0; /* Espaço em cima da busca */
    }
}


/* ==========================================================================
   3. VITRINE DE PRODUTOS
   ========================================================================== */
.container-vitrine {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
}
.container-vitrine h2 {
    text-align: center;
    color: #333;
    margin-bottom: 30px;
}
.grade-produtos {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
}
.produto-item {
    background: #fff;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    transition: transform 0.3s;
}
.produto-item:hover {
    transform: translateY(-5px); /* Efeito de pular ao passar o mouse */
}
.produto-item img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}
.produto-item h3 {
    font-size: 16px;
    color: #51007d;
    margin: 15px 0 10px;
}
.produto-item .preco {
    display: block;
    font-size: 18px;
    font-weight: bold;
    color: #27ae60; /* Verde de conversão */
    margin-bottom: 15px;
}
.botao-comprar {
    display: inline-block;
    background-color: #51007d;
    color: #fff;
    padding: 10px 20px;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    width: 80%;
}
.botao-comprar:hover {
    background-color: #3b0059;
}


/* ==========================================================================
   4. PÁGINAS PADRÃO E CHECKOUT
   ========================================================================== */
.container-pagina {
    width: 90%;
    max-width: 800px;
    margin: 40px auto;
    background-color: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}
.titulo-pagina {
    color: #51007d;
    text-align: center;
    border-bottom: 2px solid #f4f4f4;
    padding-bottom: 15px;
    margin-bottom: 25px;
}

/* Deixa os campos do checkout bonitos */
.woocommerce form .form-row input.input-text, 
.woocommerce form .form-row textarea {
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    width: 100%;
}
.woocommerce #place_order {
    background-color: #27ae60;
    color: #fff;
    font-size: 18px;
    padding: 15px;
    border-radius: 5px;
    width: 100%;
}
.woocommerce #place_order:hover {
    background-color: #219653;
}


/* ==========================================================================
   5. GAVETA LATERAL EXATA (CARRINHO E ORDER BUMP)
   ========================================================================== */
#carrinho-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0,0,0,0.5); z-index: 9998; display: none;
}
#meu-carrinho-lateral {
    position: fixed; top: 0; right: -420px; width: 100%; max-width: 400px; height: 100%;
    background: #fff; z-index: 9999; display: flex; flex-direction: column;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1); transition: right 0.3s ease;
}
#carrinho-overlay.ativo { display: block; }
#meu-carrinho-lateral.ativo { right: 0; }

/* Cabeçalho da Gaveta */
.carrinho-header {
    display: flex; justify-content: space-between; align-items: center;
    padding: 15px 20px; border-bottom: 1px solid #eaeaea;
}
.carrinho-header h3 { margin: 0; font-size: 18px; color: #333; font-weight: 500; }
.header-acoes { display: flex; align-items: center; gap: 15px; }
.cupom-box { display: flex; border: 1px solid #ddd; border-radius: 2px; overflow: hidden; }
.cupom-box input { border: none; padding: 6px 10px; font-size: 12px; width: 100px; outline: none; }
.cupom-box button { background: #51007d; color: #fff; border: none; padding: 6px 10px; cursor: pointer; font-size: 12px; }
#fechar-carrinho { background: none; border: none; font-size: 20px; cursor: pointer; color: #000; padding: 0; line-height: 1; }

/* Corpo do Carrinho */
.carrinho-conteudo { flex: 1; overflow-y: auto; padding: 0 20px; }

/* Ocultar elementos desnecessários do WooCommerce */
.widget_shopping_cart_content .button:not(.checkout) { display: none !important; }
.woocommerce-mini-cart__empty-message { margin-top: 20px; color: #666; }

/* Forçar Layout da Linha de Subtotal e Botão Verde */
.widget_shopping_cart_content { 
    display: flex; 
    flex-wrap: wrap; 
    align-items: center; 
    min-height: 100%; 
}
.woocommerce-mini-cart { 
    width: 100%; 
    flex: 1 1 100%; 
    margin: 0; 
    padding: 0; 
    list-style: none; 
}
.woocommerce-mini-cart__total { 
    width: 40%; 
    padding: 20px 0; 
    margin: 0; 
    border-top: 1px solid #eaeaea; 
    font-size: 14px; 
    color: #000; 
}
.woocommerce-mini-cart__buttons { 
    width: 60%; 
    padding: 20px 0; 
    margin: 0; 
    border-top: 1px solid #eaeaea; 
    text-align: right; 
}
.woocommerce-mini-cart__buttons .checkout { 
    background: #4ccc5c !important; 
    color: #fff !important; 
    text-transform: uppercase;
    font-size: 11px; /* Diminuí a fonte levemente para caber textos longos */
    font-weight: bold; 
    padding: 12px 15px; 
    border-radius: 3px; 
    text-decoration: none;
    white-space: nowrap; /* ISSO AQUI IMPEDE O TEXTO DE QUEBRAR A LINHA */
    display: inline-block;
}

/* Estilo do Produto no Carrinho */
.woocommerce-mini-cart-item { padding: 20px 0; border-bottom: 1px solid #f5f5f5; position: relative; }
.woocommerce-mini-cart-item a.remove { 
    position: absolute; right: 0; top: 20px; color: #ccc !important; font-size: 20px; text-decoration: none; font-weight: normal; 
}
.woocommerce-mini-cart-item a.remove:hover { color: #ff0000 !important; }
.woocommerce-mini-cart-item img { float: left; width: 70px; height: 70px; object-fit: cover; margin-right: 15px; border-radius: 4px; }
.woocommerce-mini-cart-item a:not(.remove) { display: block; color: #666; text-decoration: none; font-size: 14px; margin-bottom: 10px; padding-right: 20px; }
.woocommerce-mini-cart-item .quantity { display: block; text-align: right; font-size: 14px; color: #333; margin-top: 20px; }

/* --- ORDER BUMP EXATO --- */
.order-bump-container { padding: 20px; background: #fff; border-top: 2px solid #eaeaea; }
.bump-titulo { color: #d81b60; font-size: 11px; margin-bottom: 15px; text-transform: uppercase; font-weight: 600; }
.produto-bump { display: flex; align-items: center; gap: 15px; }
.produto-bump img { width: 65px; height: 65px; object-fit: cover; }
.bump-info { flex: 1; display: flex; flex-direction: column; }
.bump-info strong { color: #333; font-size: 14px; font-weight: normal; line-height: 1.2; margin-bottom: 5px; }
.bump-info span { color: #666; font-size: 13px; }
.add-bump-btn { 
    background: #000; color: #fff; border: none; width: 40px; height: 40px; 
    font-size: 24px; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.add-bump-btn:hover { background: #333; }


/* ==========================================================================
   6. RODAPÉ
   ========================================================================== */
.meu-rodape {
    background-color: #ffffff;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    border-top: 1px solid #ddd;
}
/* --- BOTÕES DE QUANTIDADE NA GAVETA --- */
.woocommerce-mini-cart-item .quantity {
    display: flex !important;
    align-items: center;
    justify-content: flex-end;
    gap: 15px;
    margin-top: 15px !important;
}

.controle-quantidade-gaveta {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: #fff;
}

.btn-qtd {
    background: #f4f4f4;
    border: none;
    color: #333;
    font-size: 16px;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.btn-qtd:hover {
    background: #e0e0e0;
}

.input-qtd {
    width: 35px;
    height: 30px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 14px;
    font-weight: bold;
    color: #333;
    -moz-appearance: textfield;
}

/* Remove as setinhas feias padrão do navegador nos inputs de número */
.input-qtd::-webkit-outer-spin-button,
.input-qtd::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.preco-unitario-gaveta {
    font-size: 14px;
    font-weight: bold;
    color: #333;
}
/* --- BOTÃO DE FAVORITO NA VITRINE --- */
.produto-item {
    position: relative; /* Segura o coração dentro do quadro */
}
.btn-favoritar {
    position: absolute;
    top: 25px;
    right: 25px;
    background: rgba(255, 255, 255, 0.95);
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    font-size: 22px;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    z-index: 10;
    transition: all 0.2s;
}
.btn-favoritar:hover {
    transform: scale(1.1);
}
/* Classe que é ativada quando o produto é favoritado */
.btn-favoritar.favoritado {
    color: #e74c3c; /* Coração vermelho */
}