/* ==========================================================================
   0. RESET GERAL
   ========================================================================== */
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 (COM LUPA)
   ========================================================================== */
.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;
  font-size: 1.1rem !important;
  font-family: "Helvetica", "Arial", sans-serif !important; 
  border: 2px solid #b98d1c!important;
  border-radius: 50px !important;
  background-color: #fff !important;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05) !important;
  outline: none;
  
  /* LUPA DOURADA */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23ba8d1c' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'%3E%3C/circle%3E%3Cline x1='21' y1='21' x2='16.65' y2='16.65'%3E%3C/line%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: 20px center;
  background-size: 20px;
  padding: 0 30px 0 55px !important;
}

.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;
  width: 100%;          
  max-width: 380px;     
  margin: 0 auto;       
}

.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: 10px !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: #b98d1c !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;
  background: #fff;
  border-radius: 18px;
  padding: 0 !important; 
  position: relative;
  animation: modalFadeDesktop 0.25s ease-out;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

@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;
  }
}

/* CABEÇALHO FIXO */
.ce-modal-header {
  position: relative;
  width: 100%;
  background: #fff;
  padding: 30px 20px 10px;
  flex-shrink: 0;
  border-bottom: 1px solid #f0f0f0;
  z-index: 20;
}

/* CORPO COM SCROLL */
.ce-modal-body {
  padding: 20px 40px 40px;
  overflow-y: auto;
  flex-grow: 1;
}

/* RODAPÉ FIXO */
.ce-modal-footer {
  width: 100%;
  background: #fff;
  padding: 15px 20px 20px;
  flex-shrink: 0;
  border-top: 1px solid #f0f0f0;
  z-index: 20;
}

/* BOTÃO FECHAR */
.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: 30;
  box-shadow: none !important;
  line-height: 1 !important;
}

/* LOGO DENTRO DO MODAL */
.ce-modal-logo {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-bottom: 0;
}

.ce-modal-logo .ce-logo-frame {
  width: 100% !important;
  max-width: 400px !important; 
  height: 130px !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% !important;
  max-height: 100% !important;
  object-fit: contain;
}

.ce-modal-title {
  font-size: 1.4rem;
  color: #b98d1c;
  text-align: center !important;
  font-weight: 800;
  margin-top: 10px;
  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.5rem;
  font-size: 1rem;
  width: 100%;
  font-weight: 400 !important;
  line-height: 1.6 !important;
}

/* ÁREA DOS BOTÕES */
.ce-modal-actions {
  margin-top: 2rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
  align-items: center;
}

.ce-btn {
  width: 100%;
  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;
}

/* DESKTOP: BOTÕES LADO A LADO */
@media (min-width: 680px) {
  .ce-modal-actions {
    flex-direction: row !important;
    justify-content: space-between;
    gap: 15px !important;
  }
  .ce-btn {
    flex: 1;
    width: auto !important;
  }
}

/* ==========================================================================
   7. LOADING / ERRO / NO RESULTS
   ========================================================================== */
.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;
}

.ce-no-results {
  font-family: "Montserrat", sans-serif !important;
  font-size: 1.1rem;
  color: #ba8d1c;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.9);
  padding: 20px;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  margin-top: 2rem;
  grid-column: 1 / -1;
  text-align: center;
}

/* ==========================================================================
   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: 0 !important;
    animation: modalSlideUp .35s ease-out forwards;
    transform: translateY(100%);
    max-height: 92vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
  }

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

  .ce-modal-header {
      padding: 25px 20px 10px !important;
  }

  .ce-modal-logo .ce-logo-frame {
      height: 180px !important; 
      max-width: 300px !important;
      padding: 5px !important; 
  }

  .ce-modal-body {
      padding: 15px 25px 40px !important;
      overflow-y: auto !important;
  }
  
  .ce-modal-footer {
      padding: 15px 20px 25px !important;
  }

  .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;
  }
}

/* ==========================================================================
   9. TRAVA DE ROLAGEM SIMPLES E SEGURA
   ========================================================================== */
html.ce-no-scroll, 
body.ce-no-scroll {
  /* Só esconde a barra, NÃO TRAVA ALTURA, NÃO USA POSITION FIXED. */
  overflow: hidden !important;
}

/* ==========================================================================
   10. SCROLLBAR
   ========================================================================== */
.ce-modal-body::-webkit-scrollbar {
  width: 6px;
}
.ce-modal-body::-webkit-scrollbar-track {
  background: #f1f1f1;
}
.ce-modal-body::-webkit-scrollbar-thumb {
  background-color: #ba8d1c;
  border-radius: 10px;
}
.ce-modal-body {
  scrollbar-width: thin;
  scrollbar-color: #ba8d1c #f1f1f1;
}