/*
Theme Name: MinhaLoja Custom
Theme URI: https://example.com
Author: Sua Loja
Author URI: https://example.com
Description: Tema próprio (sem depender de tema pronto/Blocksy) criado a partir de todas as funcionalidades já existentes: grade de categorias com cards, painel de pedidos, painel do vendedor, chat por pedido, carrinho flutuante, regras de quantidade/múltiplo por marca, preço padrão de marca, upload de produtos em massa, etc. Total liberdade de edição de layout.
Version: 1.0.0
Requires PHP: 7.4
Tested up to: 6.6
Requires Plugins: woocommerce
Text Domain: minhaloja
*/

/* ============================================================
   RESET BÁSICO / ESTRUTURA GERAL
   (como o tema agora é próprio, essas regras substituem o que
   antes vinha do tema pai Blocksy)
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: #1a1a1a;
  line-height: 1.55;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; }

ul, ol { margin: 0; padding: 0; list-style: none; }

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Cabeçalho do site */
.site-header {
  background: #ffffff;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 500;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: 1200px;
  margin: 0 auto;
  gap: 20px;
}

.site-branding a {
  text-decoration: none;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 22px;
  font-weight: 700;
  color: #1a1a1a;
}

.site-branding img { max-height: 48px; width: auto; }

.main-navigation ul {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}

.main-navigation a {
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  color: #333;
}

.main-navigation a:hover { color: #2ecc71; }

.menu-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 22px;
  cursor: pointer;
}

@media (max-width: 782px) {
  .main-navigation { display: none; width: 100%; }
  .main-navigation.aberto { display: block; }
  .main-navigation ul { flex-direction: column; gap: 0; }
  .main-navigation li { border-top: 1px solid #eee; }
  .main-navigation a { display: block; padding: 12px 4px; }
  .menu-toggle { display: block; }
  .site-header-inner { flex-wrap: wrap; }
}

/* Rodapé do site */
.site-footer {
  background: #1a1a1a;
  color: #ddd;
  padding: 40px 20px;
  margin-top: 60px;
  font-size: 13px;
  text-align: center;
}

.site-footer a { color: #fff; }

/* Conteúdo genérico (posts/páginas) */
.site-main {
  min-height: 50vh;
  padding: 30px 0 60px;
}

.entry-title {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 30px;
  margin: 0 0 20px;
}

.entry-content { font-size: 16px; }
.entry-content p { margin: 0 0 16px; }

/* ============================================================
   FUNDO GERAL DO SITE — tom creme/bege bem suave (conforme mockup)
   ============================================================ */
body,
body.woocommerce,
#content,
.site-content,
main {
  background-color: #fbf9f4 !important;
}

/* Nome da categoria com fonte serifada, como no mockup */
.cat-nome {
  font-family: Georgia, 'Times New Roman', serif !important;
}

.voltar-home-btn {
    display: inline-block;
    margin: 20px 0;
    padding: 10px 18px;
    background: #2ecc71;
    color: #fff !important;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
}

.voltar-home-btn:hover {
    background: #27ae60;
}

.botao-flutuante-carrinho {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    background: #000;
    color: #fff;
    padding: 14px 18px;
    border-radius: 999px;
    text-decoration: none;
    font-weight: bold;
    box-shadow: 0 6px 14px rgba(0,0,0,.3);
}

.contador-carrinho {
    background: red;
    color: #fff;
    border-radius: 50%;
    padding: 2px 7px;
    margin-left: 6px;
    font-size: 12px;
}

.botao-flutuante-carrinho:hover {
    background: #25d366;
}

/* Esconder título do banner nas páginas de categoria */
.tax-product_cat .page-title,
.tax-product_cat .hero-title,
.tax-product_cat .entry-title {
    display: none !important;
}

/* ============================================================
   CARDS DE CATEGORIA — VERSAO FINAL
   ============================================================ */

.grid-categorias {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.categoria-item {
  position: relative;
}

.categoria-item .conteudo-categoria {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 190px;
  text-decoration: none;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0,0,0,.08);
  transition: box-shadow .25s ease, transform .25s ease;
}

.categoria-item .conteudo-categoria:hover {
  box-shadow: 0 10px 24px rgba(0,0,0,.14);
  transform: translateY(-2px);
}

.categoria-item:nth-child(even) .cat-foto {
  order: -1;
}

.cat-foto {
  position: relative;
  overflow: hidden;
}

.cat-foto img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .35s ease;
}

.conteudo-categoria:hover .cat-foto img {
  transform: scale(1.05);
}

.cat-texto {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 26px 30px;
}

.categoria-item:nth-child(4n+1) .cat-texto { background: #efe6da; }
.categoria-item:nth-child(4n+2) .cat-texto { background: #f3e3e5; }
.categoria-item:nth-child(4n+3) .cat-texto { background: #e4ede6; }
.categoria-item:nth-child(4n+4) .cat-texto { background: #f5eee0; }

.cat-indice {
  color: #999;
  font-size: 11px;
}

.cat-nome {
  color: #1a1a1a;
  font-size: 22px;
  font-weight: 600;
  margin-top: 8px;
}

.cat-contagem {
  color: #777;
  font-size: 12px;
  margin-top: 6px;
}

.cat-descricao {
  color: #8a8072;
  font-size: 12px;
  margin-top: 10px;
  line-height: 1.5;
}

.cat-botao {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  background: #1a1a1a;
  color: #fff;
  width: fit-content;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
}

.cat-botao .seta {
  font-style: normal;
}

.acoes-categoria {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.btn-excluir {
  background: rgba(0,0,0,.7);
  border: none;
  color: #fff;
  padding: 6px 8px;
  border-radius: 50%;
  cursor: pointer;
  margin: 0;
}

.btn-excluir:hover {
  background: #c0392b;
}

.form-editar-cat-overlay {
  display: none;
  flex-direction: column;
  gap: 8px;
  position: absolute;
  inset: 0;
  background: #fff;
  border: 1.5px dashed #c9c2b8;
  border-radius: 14px;
  padding: 20px 24px;
  z-index: 20;
  overflow-y: auto;
}

.form-editar-cat-overlay.aberto {
  display: flex;
}

.form-editar-cat-overlay label {
  font-size: 10px;
  color: #999;
  margin-bottom: -4px;
}

.form-editar-cat-overlay input[type="text"],
.form-editar-cat-overlay input[type="number"],
.form-editar-cat-overlay textarea {
  font-size: 12px;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

.form-editar-cat-overlay textarea {
  resize: none;
  height: 44px;
}

.btn-trocar-foto {
  font-size: 11px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid #ddd;
  background: #faf8f5;
  cursor: pointer;
  width: fit-content;
}

.form-botoes {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.form-botoes button {
  flex: 1;
  font-size: 12px;
  padding: 8px;
  border-radius: 6px;
  cursor: pointer;
}

.btn-cat-salvar,
.btn-sub-salvar {
  background: #1a1a1a;
  color: #fff;
  border: none;
}

.btn-cat-cancelar,
.btn-sub-cancelar {
  background: #fff;
  border: 1px solid #ddd;
  color: #444;
}

/* ===== CARD "ADICIONAR CATEGORIA" ===== */
.categoria-add {
  position: relative;
  min-height: 190px;
  border-radius: 14px;
  border: 2px dashed #c9c2b8;
  background: #faf8f5;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .25s ease, border-color .25s ease;
}

.categoria-add:hover {
  background: #f3efe8;
  border-color: #a08a6e;
}

.categoria-add .add-trigger {
  color: #a08a6e;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  padding: 20px;
  text-align: center;
}

.categoria-add .form-add-sub {
  display: none;
  flex-direction: column;
  gap: 8px;
  position: absolute;
  inset: 0;
  background: #fff;
  border-radius: 14px;
  padding: 20px 24px;
  z-index: 10;
  overflow-y: auto;
}

.categoria-add .form-add-sub.aberto {
  display: flex;
}

.categoria-add .form-add-sub label {
  font-size: 10px;
  color: #999;
  margin-bottom: -4px;
}

.categoria-add .form-add-sub input[type="text"],
.categoria-add .form-add-sub input[type="number"],
.categoria-add .form-add-sub textarea {
  font-size: 12px;
  padding: 7px 10px;
  border: 1px solid #ddd;
  border-radius: 6px;
}

@media (max-width: 768px) {
  .categoria-item .conteudo-categoria {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .categoria-item .cat-foto,
  .categoria-item:nth-child(even) .cat-foto {
    order: -1;
    height: 160px;
  }
  .cat-texto {
    padding: 18px 20px;
  }
  .cat-nome {
    font-size: 18px;
  }
  .categoria-add {
    min-height: 140px;
  }
}

/* ============================================================
   FIM DO BLOCO DE CATEGORIAS
   ============================================================ */

.box-preco-marca{
  background:#fff;
  padding:16px;
  margin-bottom:20px;
  border-radius:12px;
  box-shadow:0 6px 20px rgba(0,0,0,.08);
  max-width:320px;
}

.box-preco-marca input{
  width:100%;
  padding:10px;
  margin:8px 0;
}

.box-preco-marca button{
  width:100%;
  padding:10px;
  background:#111;
  color:#fff;
  border:none;
  border-radius:8px;
  cursor:pointer;
}

/* GRID / CATEGORIA (produtos) */
.woocommerce ul.products li.product img {
    width: 100%;
    height: auto;
    max-height: none;
    object-fit: contain;
}

/* PÁGINA DO PRODUTO */
.woocommerce div.product div.images img {
    width: 100%;
    height: auto;
    max-height: 520px;
    object-fit: contain;
}

.woocommerce ul.products li.product {
    text-align: center;
}

.woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .added_to_cart {
    float: none !important;
    display: block;
    margin: 8px auto;
    width: 200px;
    text-align: center;
}

/* ===== FORÇA BOTÃO EDITAR PEDIDO ===== */
.btn-editar {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 260px !important;
    min-height: 52px !important;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    background: #2271b1 !important;
    color: #fff !important;
    border-radius: 12px !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18) !important;
    margin-bottom: 20px !important;
}

.btn-editar::before {
    content: "";
    margin-right: 10px;
    font-size: 18px;
}

.btn-editar:hover {
    background: #1a5f97 !important;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .btn-editar {
        width: 100% !important;
        min-height: 56px !important;
        font-size: 17px !important;
    }
}

/* ===============================
   BOTÃO EDITAR — APENAS PAINEL DE PEDIDOS
   =============================== */
.painel-pedidos-admin .btn-editar {
    width: 260px !important;
    min-height: 52px !important;
    padding: 14px 24px !important;
    font-size: 16px !important;
    font-weight: 700 !important;
    border-radius: 12px !important;
}

@media (max-width: 768px) {
    .painel-pedidos-admin .btn-editar {
        width: 100% !important;
    }
}

/* ===== MOBILE TOP — painel de pedidos ===== */
@media (max-width: 768px){

.abas-pedidos{
    overflow-x:auto;
    padding-bottom:5px;
}

.abas-pedidos::-webkit-scrollbar{
    height:4px;
}

.aba{
    flex:0 0 auto;
    white-space:nowrap;
}

.pedido-header{
    flex-direction:column;
    align-items:flex-start;
    gap:6px;
}

.pedido-header span:nth-child(2){
    font-size:16px;
    font-weight:700;
}

.pedido-header span:nth-child(3){
    font-size:18px;
    font-weight:800;
}

.pedido-header span:last-child{
    font-size:13px;
}

.pedido-produto{
    flex-direction:column;
    align-items:flex-start;
}

.pedido-produto img{
    width:100%;
    max-width:200px;
}

.editar-area input{
    width:100%;
    padding:10px;
    font-size:16px;
    margin-top:8px;
}

.btn{
    width:100%;
    text-align:center;
}

.busca{
    font-size:16px;
    padding:12px;
}

.pedido-box{
    padding:14px;
}

.pedido-cliente{
    font-size:14px;
    line-height:1.5;
}
}
