/**
 * CUSTOM FUNCTION CSS
 * Arquivo centralizado para estilos migrados de functions.php
 */

/**
 * 1. AVISO DE ERRO FLUTUANTE (ESTOQUE)
 * Origem: sb_custom_product_error_notice()
 * Transforma a lista de erros do WooCommerce em um aviso fixo no topo.
 */
ul.woocommerce-error {
  position: fixed !important;
  top: 0 !important;
  left: 50% !important;
  transform: translateX(-50%) !important;
  width: 90% !important;
  max-width: 800px !important;
  margin-top: 100px !important; /* Solicitação: 150px do topo */
  z-index: 9999999 !important;
  background-color: #e2401c !important; /* Vermelho/Laranja de erro */
  color: #fff !important;
  padding: 20px 40px 20px 25px !important;
  border-radius: 8px !important;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3) !important;
  list-style: none !important;
}

ul.woocommerce-error li {
  color: #fff !important;
  margin: 0 !important;
  padding: 0 !important;
  font-weight: 600;
}

/* Botão X para fechar o aviso */
.sb-close-notice {
  position: absolute;
  top: 10px;
  right: 15px;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
  opacity: 0.8;
  z-index: 99;
  padding: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sb-close-notice:hover {
  opacity: 1;
}

/* =========================================================================
   FORÇAR VISIBILIDADE DOS CONTAINERS (LOGIN/ERRO)
   Impede que o container do formulário desapareça ao exibir erros.
   ========================================================================= */

/* Forçar exibição apenas dos containers de linha quando houver erros */
.row-header[style*="display: none"],
.row-parent[style*="display: none"] {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Se houver erros, forçar containers de linha, mas NÃO forçar painéis (.panel) genericamente */
body:has(.woocommerce-error) .row-header,
body:has(.woocommerce-error) .row-parent,
body:has(.wc-notice) .row-header,
body:has(.wc-notice) .row-parent {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
}

/* Permitir que o painel de Redefinir Senha permaneça oculto via style inline (respeitando o JS) */
/*.panel:has(a[href="#esqueceu-senha"]) {
    /* Sem !important aqui para permitir o fadeIn/fadeOut do script
} */

/* Fallback para avisos do WC (Removido !important para permitir que o JS oculte o aviso) */
.woocommerce-error, .woocommerce-message, .woocommerce-info, .wc-notice {
    display: block;
    opacity: 1;
    visibility: visible;
}
