/* ==========================================================================
   0. RESET GERAL + AJUSTE DE TEMA
   ========================================================================== */
html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body.page-id-48277 .site-content,
body.page-id-48277 .content-area,
body.page-id-48277 .container,
body.page-id-48277 .elementor-section.elementor-section-boxed > .elementor-container {
  max-width: 100% !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin: 0 !important;
}

body.page-id-48277 {
  padding: 0 !important;
  margin: 0 !important;
}

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

/* ==========================================================================
   1. FONTES
   ========================================================================== */
@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700;800&display=swap");

body.page-id-48277,
body.page-id-48277 * {
  font-family: "Helvetica", "Arial", sans-serif !important;
}

body.page-id-48277 h1,
body.page-id-48277 h2,
body.page-id-48277 h3,
body.page-id-48277 h4,
body.page-id-48277 h5,
body.page-id-48277 h6,
.ce-card-title,
.ce-modal-title,
a.ce-btn,
.ce-logo-frame.fallback,
.ce-card-body strong {
  font-family: "Montserrat", sans-serif !important;
  font-weight: 700 !important;
  text-transform: uppercase !important;
  letter-spacing: 0.5px !important;
}

.ce-desc, 
.ce-cat {
  font-family: "Helvetica", "Arial", sans-serif !important;
  font-weight: 400 !important;
  line-height: 1.5 !important;
}

/* ==========================================================================
   2. CONTAINER GERAL
   ========================================================================== */
#catalogo-empresas-root {
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem 3rem !important;
  background: transparent !important; 
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.ce-main {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto; 
}

/* ==========================================================================
   3. BARRA DE PESQUISA
   ========================================================================== */
.ce-search-area {
  display: flex;
  justify-content: center;
  margin: 2rem 0 3rem;
  padding: 0 1rem;
  width: 100%;
}

.ce-search-input {
  width: 100% !important;
  max-width: 600px !important;
  height: 55px !important;
  padding: 0 30px !important;
  font-size: 1.1rem !important;
  font-family: "Helvetica", "Arial", sans-serif !important; 
  border: 2px solid rgba(186, 141, 28, 0.5) !important;
  border-radius: 50px !important;
  background: #fff !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05) !important;
  outline: none;
}

.ce-search-input:focus {
  border-color: #ba8d1c !important;
  box-shadow: 0 8px 25px rgba(186, 141, 28, 0.25) !important;
}

/* ==========================================================================
   4. GRID
   ========================================================================== */
.ce-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  justify-content: center;
}

/* ==========================================================================
   5. CARDS
   ========================================================================== */
.ce-card {
  background: #ffffff;
  border-radius: 20px;
  border: 1px solid rgba(186, 141, 28, 0.3);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: 0.3s ease;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  max-width: 100%; 
}

.ce-card:hover {
  transform: translateY(-6px);
  border-color: #ba8d1c;
  box-shadow: 0 15px 35px rgba(186, 141, 28, 0.25);
}

.ce-card-logo-area {
  background: linear-gradient(180deg, #ca961e 0%, #fce292 100%);
  padding: 2.5rem 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.ce-logo-frame {
  width: 100% !important;
  max-width: 350px !important;
  height: 180px !important;
  background: #ffffff !important;
  border-radius: 16px !important; 
  box-shadow: none !important;
  border: 1px solid #e5e7eb !important; 
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px !important;
  overflow: hidden;
}

.ce-logo-frame img {
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block; 
}

.ce-logo-frame.fallback {
  background: #fbc39c !important;
  color: #7c2d12 !important;
  font-size: 2rem;
  border: none !important;
}

.ce-card-body {
   padding: 0.5rem 0.6rem 0.8rem;
  text-align: center;
}

.ce-card-title {
  font-size: 1.5rem !important;
  color: #ea580c !important;
  line-height: 1.3;
}

/* ==========================================================================
   6. MODAL
   ========================================================================== */
.ce-modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 999999;
  padding: 20px;
}

.ce-modal-content {
  width: 100%;
  max-width: 600px; /* Levemente aumentado para caber 3 botões lado a lado */
  background: #fff;
  border-radius: 18px;
  padding: 40px !important;
  position: relative;
  animation: modalFadeDesktop 0.25s ease-out;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

@keyframes modalFadeDesktop {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

@media (min-width: 601px) {
  .ce-modal-content {
    transform: none !important;
  }
}

/* BOTÃO FECHAR - CÍRCULO PERFEITO */
.ce-close-btn {
  position: absolute;
  top: 15px;
  right: 15px;
  width: 38px !important;
  height: 38px !important;
  padding: 0 !important;
  border: none !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  background: #e5e7eb !important;
  color: #000000 !important;
  cursor: pointer;
  font-size: 22px;
  font-weight: 700;
  z-index: 10;
  box-shadow: none !important;
  line-height: 1 !important;
}

.ce-modal-logo {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.ce-modal-logo .ce-logo-frame {
  width: 100% !important;
  max-width: 400px !important;
  height: 220px !important;
  background: transparent !important;
  border-radius: 0 !important; 
  border: none !important; 
  box-shadow: none !important;
  padding: 0 !important; 
  display: flex;
  justify-content: center;
  align-items: center;
}

.ce-modal-logo .ce-logo-frame img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ce-modal-title {
  font-size: 1.4rem;
  color: #d97706;
  text-align: center !important;
  font-weight: 800;
  margin-top: 0;
  width: 100%;
}

.ce-cat {
  text-align: center !important;
  color: #6b7280;
  font-size: 0.9rem;
  margin-top: 6px;
  text-transform: uppercase;
  width: 100%;
  font-weight: 400 !important;
}

.ce-desc {
  color: #4b5563;
  text-align: left !important;
  margin-top: 1.2rem;
  font-size: 1rem;
  width: 100%;
  font-weight: 400 !important;
}

/* ÁREA DOS BOTÕES (Ações) */
.ce-modal-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column; /* Padrão Mobile: Um embaixo do outro */
  gap: 12px;
  width: 100%;
  align-items: center;
}

.ce-btn {
  width: 100%; /* Mobile: Botão ocupa a largura toda */
  padding: 14px 18px;
  background-color: #ba8d1c !important;
  color: #fff !important;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.ce-btn svg {
  width: 20px !important;
  height: 20px !important;
  fill: #fff !important;
}

.ce-btn:hover {
  background-color: #9f7317 !important;
}

/* === AJUSTE PARA DESKTOP: BOTÕES LADO A LADO === */
/* Quando a tela for maior que 680px (Tablet/PC) */
@media (min-width: 680px) {
  .ce-modal-actions {
    flex-direction: row !important; /* Força ficar em linha */
    justify-content: space-between;
    gap: 15px !important;
  }

  .ce-btn {
    flex: 1; /* Faz todos terem o mesmo tamanho */
    width: auto !important; /* Remove a largura 100% fixa */
  }
}

/* ==========================================================================
   7. LOADING / ERRO
   ========================================================================== */
.ce-loading {
  width: 100%;
  padding: 3rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  color: #4b5563;
}

.ce-spinner {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 4px solid #e5e7eb;
  border-top-color: #ba8d1c;
  animation: ce-spin 0.8s linear infinite;
}

@keyframes ce-spin { to { transform: rotate(360deg); } }

.ce-error-msg {
  padding: 2rem 1.5rem;
  text-align: center;
  color: #b91c1c;
  font-size: 0.95rem;
}

/* ==========================================================================
   8. MOBILE
   ========================================================================== */
@media (max-width: 600px) {
  #catalogo-empresas-root {
    padding: 0 0 40px !important;
    width: 100% !important;
    max-width: 100vw !important;
    overflow-x: hidden !important;
  }

  .ce-main {
    width: 100% !important;
    padding: 0 16px !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .ce-search-area {
    width: 100% !important;
    padding: 0 !important;
    margin-bottom: 2rem !important;
  }

  .ce-grid {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    gap: 24px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .ce-card {
    width: 100% !important;
    margin: 0 !important;
  }

  .ce-modal {
    position: fixed !important;
    inset: 0 !important;
    width: 100% !important;
    height: 100% !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: flex-end !important;
    background: rgba(0, 0, 0, 0.55) !important;
    overflow: hidden !important;
  }

  .ce-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    border-radius: 22px 22px 0 0 !important;
    background: #fff !important;
    padding: 1.8rem 1.6rem !important;
    animation: modalSlideUp .35s ease-out forwards;
    transform: translateY(100%);
    max-height: 92vh !important;
    overflow-y: auto !important;
  }

  @keyframes modalSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

  .ce-modal-actions {
    flex-direction: column !important;
    gap: 12px !important;
    width: 100% !important;
  }

  .ce-btn {
    width: 100% !important;
    height: 48px !important;
    border-radius: 12px !important;
  }
}