/* ============================================================
   CSS PROPIO DEL MARKETPLACE — overrides editables del proyecto.
   Se carga DESPUÉS del CSS del tema (último <link> del layout),
   por lo que sus reglas ganan sin necesidad de !important salvo
   cuando se sobreescriben utilidades del tema.

   Las variables --theme-primary / --theme-secondary se definen
   inline en layouts/frontend.php (provienen de Configuraciones del admin).
   ============================================================ */

/* ------------------------------------------------------------
   1) HEADER: fondo de color, fijo (sticky), logo y textos.
   Se usa position:fixed porque .wrapper.ovh tiene overflow:hidden,
   lo que invalida position:sticky. El espaciador de altura lo
   calcula el JS del layout.
   ------------------------------------------------------------ */
header.header-nav.main-menu {
  background-color: var(--theme-primary) !important;
  padding: 12px 0px;
}

header.header-nav.main-menu,
#page.mobilie_header_nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1030;
}

/* Barra superior móvil: mismo fondo y elementos legibles */
#page.mobilie_header_nav {
  background-color: var(--theme-primary) !important;
}

/* Evita el "flash" del menú móvil (mmenu) antes de que el JS lo inicialice.
   El <nav id="menu"> está en el DOM como contenido normal hasta que mmenu lo
   convierte en panel off-canvas (añadiéndole la clase .mm-menu). Lo ocultamos
   mientras tanto para que no aparezca por milisegundos (sobre todo en desktop). */
#menu:not(.mm-menu) {
  display: none;
}

/* Mientras mmenu se inicializa (clase añadida por JS antes de crear el menú),
   se anulan sus transiciones para que el panel no "deslice" al colocarse
   off-canvas. El JS quita la clase tras dos frames y la animación de apertura
   normal (al abrir el menú en móvil) se conserva. */
html.mm-loading .mm-menu,
html.mm-loading .mm-panel,
html.mm-loading .mm-slideout,
html.mm-loading .mm-wrapper__blocker {
  transition: none !important;
}

#page.mobilie_header_nav .menubar img {
  filter: brightness(0) invert(1);
}

#page.mobilie_header_nav .right-side a,
#page.mobilie_header_nav .right-side {
  color: #fff !important;
}

/* Botones Ingresar / Unirme del header móvil: al hacer hover el fondo se aclara,
   así que el texto debe ir en azul (no blanco, que quedaría invisible). */
#page.mobilie_header_nav .right-side .btn:hover,
#page.mobilie_header_nav .right-side .btn:hover .fw-medium {
  color: var(--theme-primary, #003399) !important;
}

/* Tamaño del logo (las clases .header-logo/.logo2/.mobile_logo del tema
   no definen dimensiones; sin esto el logo no se ve). */
header.header-nav.main-menu .header-logo img,
#page.mobilie_header_nav .mobile_logo img {
  height: 45px;
  width: auto;
  max-width: 250px;
  object-fit: contain;
}

/* En la versión móvil el logo se limita a 200px de ancho */
#page.mobilie_header_nav .mobile_logo img {
  max-width: 180px;
}

/* Header móvil: logo a la izquierda + (Ingresar / Unirme / menú) a la derecha,
   SIEMPRE en una sola fila. Al agregar "Unirme" la barra se ensanchaba y el
   logo caía a una segunda fila; se fuerza nowrap y el logo se deja encoger. */
#page.mobilie_header_nav .mobile_menu_bar {
  display: flex !important;
  flex-wrap: nowrap !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
#page.mobilie_header_nav .mobile_menu_bar .mobile_logo {
  flex: 0 1 auto;
  min-width: 0;
}
#page.mobilie_header_nav .mobile_menu_bar .right-side {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  white-space: nowrap;
}
/* En pantallas angostas se compacta el logo y los botones para que todo entre. */
@media (max-width: 575.98px) {
  #page.mobilie_header_nav .mobile_logo img {
    max-width: 155px;
    height: 30px;
  }
  #page.mobilie_header_nav .right-side .btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.78rem;
  }
  #page.mobilie_header_nav .right-side .menubar.ml20 {
    margin-left: 10px !important;
  }
}

/* Texto del menú principal y accesos legibles sobre fondo oscuro */
header.header-nav.main-menu #respMenu > li > a,
header.header-nav.main-menu #respMenu > li > a .title,
header.header-nav.main-menu .login-info,
header.header-nav.main-menu .login-info .fw-medium {
  color: #fff !important;
  font-weight: 600;
}

/* Item activo (según la página) y hover del menú: amarillo de acento */
header.header-nav.main-menu #respMenu > li > a.ui-active,
header.header-nav.main-menu #respMenu > li > a.ui-active .title,
header.header-nav.main-menu #respMenu > li > a:hover,
header.header-nav.main-menu #respMenu > li > a:hover .title {
  color: var(--theme-accent-yellow, #FFCC00) !important;
}

/* Botón "Iniciar sesión" (outline) visible sobre azul */
header.header-nav.main-menu .btn-outline-secondary {
  color: #fff !important;
  border-color: rgba(255, 255, 255, .6) !important;
}

header.header-nav.main-menu .btn-outline-secondary:hover {
  background-color: #fff !important;
  color: var(--theme-primary) !important;
}

/* CTA amarillo del home: en móvil la altura fija (350px) se vuelve automática */
@media (max-width: 767.98px) {
  .theme-circular-economy .home11-cta-3 {
    height: auto;
  }
}

/* ------------------------------------------------------------
   2) ANCHO DE LOS CONTAINER EN DESKTOPS GRANDES.
   Bootstrap limita .container a 1430px desde ~1400px de viewport.
   Aquí lo ampliamos para pantallas más grandes.
   >>> Ajusta los breakpoints y max-width a tu gusto. <<<
   ------------------------------------------------------------ */
@media (min-width: 1400px) {
  .container, .container-lg, .container-md, .container-sm, .container-xl, .container-xxl {
    max-width: 1280px;
  }
}
@media (min-width: 1600px) {

  .container,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl,
  .container-xxl {
    max-width: 1540px;
  }
}

@media (min-width: 1920px) {

  .container,
  .container-sm,
  .container-md,
  .container-lg,
  .container-xl,
  .container-xxl {
    max-width: 1720px;
  }
}

/* ------------------------------------------------------------
   3) UTILIDADES DE BOOTSTRAP 5.2/5.3 AUSENTES EN EL BUILD 5.1.3.
   Se usan en vistas activas (publicaciones, etc.) pero no existen
   en el bootstrap.min.css incluido. Se replican aquí.
   ------------------------------------------------------------ */
.rounded-4 {
  border-radius: .5rem !important;
}

.object-fit-cover {
  object-fit: cover !important;
}

.min-width-0 {
  min-width: 0 !important;
}

/* Offsets pequeños usados con position-absolute (no son estándar BS) */
.top-2 {
  top: .5rem !important;
}

.bottom-2 {
  bottom: .5rem !important;
}

.start-2 {
  left: .5rem !important;
}

.end-2 {
  right: .5rem !important;
}

/* El tema fija .form-control { height: 48px }, lo que aplasta los <textarea>
   (que también llevan .form-control) y los hace ver como un input ignorando rows.
   Este override (mayor especificidad) les devuelve la altura automática. */
textarea.form-control {
  height: auto !important;
  min-height: 96px;
  padding-top: 12px;
  padding-bottom: 12px;
}

/* Mismo caso para los <select multiple> o con atributo size: deben respetar el
   size (mostrar varias filas) y no quedar a 50px como un select normal. */
select[multiple].form-select,
select[size].form-select {
  height: auto !important;
}

/* ------------------------------------------------------------
   4) ESTILOS DE VISTAS (movidos desde los <style> inline de los PHP).
   Antes vivían dentro de cada vista; se centralizan aquí.
   ------------------------------------------------------------ */

/* --- Publicaciones: listado (publications/index.php) --- */
.publications-catalog-wrapper { background-color: var(--theme-bg-gray, #f8f9fc); }
.publications-catalog-card { max-width: 1400px; margin: 0 auto; }
.pub-filter-toggle:hover { color: var(--theme-primary, #003399) !important; }
.pub-filter-toggle[aria-expanded="false"] .fa-chevron-up { transform: rotate(180deg); }
.pub-filter-pill:hover { opacity: .9; color: #fff; }
.pub-card { transition: transform .2s ease, box-shadow .2s ease; }
.pub-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 0, 0, .08) !important; }
.pub-card-img-wrap { overflow: hidden; }
.pub-card-img { height: 200px; width: 100%; object-fit: cover; display: block; transition: transform .3s ease; }
.pub-card:hover .pub-card-img { transform: scale(1.03); }
.pub-card-img-placeholder { background: #f1f3f5; }
.pub-card-body { border-top: 1px solid #eee; }
.pub-card-title a:hover { color: var(--theme-primary, #003399) !important; }
.pub-card-desc { line-height: 1.4; }
.page-item.active .page-link { background-color: var(--theme-primary, #003399); border-color: var(--theme-primary, #003399); }

/* --- Publicaciones: detalle (publications/show.php) --- */
.pub-detail-wrapper section { padding: 0; }
.pub-detail-wrapper { background-color: var(--theme-bg-gray, #f8f9fc); }
.pub-detail-breadcrumb .breadcrumb-item + .breadcrumb-item::before { opacity: .6; }
.pub-detail-breadcrumb a { color: var(--theme-primary, #003399); text-decoration: none; }
.pub-detail-breadcrumb a:hover { text-decoration: underline; }
.pub-detail-hero { background: #f1f3f5; }
.pub-detail-hero-img { height: 380px; object-fit: cover; display: block; }
.pub-detail-hero-placeholder { height: 280px; }
.pub-detail-detail-box { background: var(--theme-bg-gray, #f8f9fc); border: 1px solid #eee; }
.pub-related-card { transition: transform .2s ease, box-shadow .2s ease; }
.pub-related-card:hover { transform: translateY(-4px); box-shadow: 0 12px 24px rgba(0, 0, 0, .08) !important; }
.pub-related-title { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
#publicationCarousel { position: relative; z-index: 0; }
#publicationCarousel .carousel-control-prev,
#publicationCarousel .carousel-control-next { width: 48px; height: 48px; border-radius: 50%; background: rgba(0, 0, 0, .4); top: 50%; transform: translateY(-50%); opacity: 1; z-index: 1; }
#publicationCarousel .carousel-control-prev { left: 12px; }
#publicationCarousel .carousel-control-next { right: 12px; }

/* --- Directorio de empresas (company/directory/index.php) --- */
.hover-lift { transition: transform .3s ease, box-shadow .3s ease; }
.hover-lift:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0, 0, 0, .15) !important; }

/* --- Chat de contactos de empresa (company/publications/contacts.php) --- */
.company-chat-bubble-them {
  background: #fff;
  color: #2b3240;
  border: 1px solid #e9ecf1;
  border-bottom-left-radius: 4px !important;
}
.company-chat-bubble-me {
  background: linear-gradient(135deg, var(--theme-primary, #003399), var(--theme-primary-light, #3568cf));
  color: #fff;
  border-bottom-right-radius: 4px !important;
}
/* En la burbuja propia (fondo azul) el texto auxiliar va en claro */
.company-chat-bubble-me .fw-semibold,
.company-chat-bubble-me small,
.company-chat-bubble-me .text-success,
.company-chat-bubble-me .text-muted { color: rgba(255, 255, 255, .85) !important; }
.company-chat-thumb:hover { background: var(--theme-bg-light, #f5f7ff); }
.company-chat-thumb[aria-expanded="true"] {
  background: #fff;
  box-shadow: inset 3px 0 0 var(--theme-primary, #003399);
}

/* --- Widget del chatbot (partials/chatbot_widget.php) --- */
.chatbot-widget { position: fixed; bottom: 20px; right: 20px; z-index: 9999; font-family: inherit; }
.chatbot-toggle-btn { width: 56px; height: 56px; border-radius: 50%; background: #0d6efd; color: #fff; border: none; cursor: pointer; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); display: flex; align-items: center; justify-content: center; }
.chatbot-toggle-btn:hover { background: #0b5ed7; }
.chatbot-panel { width: 380px; max-width: calc(100vw - 40px); height: 480px; background: #fff; border-radius: 12px; box-shadow: 0 8px 32px rgba(0, 0, 0, .15); display: flex; flex-direction: column; overflow: hidden; }
.chatbot-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px; background: #0d6efd; color: #fff; }
.chatbot-panel-title { font-weight: 600; }
.chatbot-panel-close { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; line-height: 1; padding: 0 4px; }
.chatbot-messages { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.chatbot-msg { max-width: 85%; padding: 10px 14px; border-radius: 12px; font-size: 14px; }
.chatbot-msg.user { align-self: flex-end; background: #0d6efd; color: #fff; }
.chatbot-msg.assistant { align-self: flex-start; background: #f0f0f0; color: #333; }
.chatbot-msg .time { font-size: 11px; opacity: .8; margin-top: 4px; }
.chatbot-input-area { padding: 12px; border-top: 1px solid #eee; display: flex; gap: 8px; align-items: flex-end; }
.chatbot-input-area textarea { flex: 1; resize: none; border: 1px solid #ddd; border-radius: 8px; padding: 10px; font-size: 14px; }
.chatbot-send-btn { padding: 10px 16px; background: #0d6efd; color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 500; }
.chatbot-send-btn:hover { background: #0b5ed7; }
.chatbot-send-btn:disabled { opacity: .6; cursor: not-allowed; }

/* Indicador "escribiendo…" (puntos animados) del chatbot */
.chatbot-typing-dots { display: inline-flex; gap: 4px; align-items: center; padding: 4px 2px; }
.chatbot-typing-dots span {
  width: 7px; height: 7px; border-radius: 50%;
  background: #9aa1ad; display: inline-block;
  animation: chatbot-blink 1.2s infinite both;
}
.chatbot-typing-dots span:nth-child(2) { animation-delay: .2s; }
.chatbot-typing-dots span:nth-child(3) { animation-delay: .4s; }
@keyframes chatbot-blink {
  0%, 80%, 100% { opacity: .25; transform: translateY(0); }
  40%           { opacity: 1;   transform: translateY(-3px); }
}

/* Burbujas del chat: ancho máximo (antes era inline en cada burbuja) */
.company-chat-bubble { max-width: 85%; }

/* ------------------------------------------------------------
   5) HELPERS TEMÁTICOS REUTILIZABLES (reemplazan style="" inline).
   ------------------------------------------------------------ */

/* Degradado del hero/breadcrumb (antes inline en publicaciones y directorio) */
.hero-gradient {
  background-image: none;
  background: linear-gradient(135deg, var(--theme-primary, #003399) 0%, #001a4d 100%);
}

/* Color y fondo con el color primario del tema */
.text-theme-primary { color: var(--theme-primary, #003399) !important; }
.bg-theme-primary { background-color: var(--theme-primary, #003399) !important; }

/* ------------------------------------------------------------
   6) HERO DEL HOME: carrusel de banners (imagen de fondo + texto sobrepuesto).
   Se alimenta del módulo de Banners (tipo "Banner Principal").
   ------------------------------------------------------------ */
.hero-banner-carousel {
  padding: 0;
}
.hero-banner-carousel .hero-slide {
  position: relative;
  min-height: 600px;
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
}
.hero-banner-carousel .hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, .45);
}
.hero-banner-carousel .container {
  position: relative;
  z-index: 2;
}
.hero-banner-carousel .hero-slide-content {
  color: #fff;
  padding: 70px 0;
}
.hero-banner-carousel .hero-slide-inner {
  max-width: 500px;
}
.hero-banner-carousel .hero-align-left .hero-slide-inner { margin-right: auto; text-align: left; }
.hero-banner-carousel .hero-align-center .hero-slide-inner { margin: 0 auto; text-align: center; }
.hero-banner-carousel .hero-align-right .hero-slide-inner { margin-left: auto; text-align: right; }

.hero-banner-carousel .hero-subtitle {
  display: inline-block;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-weight: 600;
  font-size: .85rem;
  color: var(--theme-accent-yellow, #FFCC00);
  margin-bottom: 12px;
}
.hero-banner-carousel .hero-title {
  color: #fff;
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.15;
  margin-bottom: 16px;
}
.hero-banner-carousel .hero-desc {
  color: rgba(255, 255, 255, .9);
  font-size: 1.05rem;
  margin-bottom: 24px;
  line-height: 1.3;
}
.hero-banner-carousel .hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 16px;
}
.hero-banner-carousel .hero-align-center .hero-actions { justify-content: center; }
.hero-banner-carousel .hero-align-right .hero-actions { justify-content: flex-end; }

@media (max-width: 768px) {
  .hero-banner-carousel .hero-slide { min-height: 420px; }
  .hero-banner-carousel .hero-slide-content { padding: 48px 0; }
}

/* ------------------------------------------------------------
   7) ÍCONO DE INDICADOR subido (SVG/PNG).
   - .indicator-icon-mask: recolorea un SVG monocromo vía CSS mask
     (el archivo se cachea; el color sale de --icon-color). Rápido.
   - .indicator-icon-img: imagen tal cual (conserva colores).
   ------------------------------------------------------------ */
.indicator-icon-mask {
  display: inline-block;
  width: var(--icon-size, 48px);
  height: var(--icon-size, 48px);
  background-color: var(--icon-color, currentColor);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}
.indicator-icon-img {
  display: inline-block;
  object-fit: contain;
}
/* Espaciado del ícono subido dentro del funfact de la home */
.funfact_one .indicator-icon-mask,
.funfact_one .indicator-icon-img {
  margin-bottom: 15px;
}

/* ------------------------------------------------------------
   8) SECCIÓN "PLATAFORMA DESARROLLADA POR" (fija) — logos UE / CCL.
   ------------------------------------------------------------ */
.developed-by-title {
  text-transform: uppercase;
  color: #6c757d;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: .5px;
  margin-bottom: 22px;
}
.developed-by-logos {
  gap: 48px;
}
.developed-by-logo {
  height: 75px;
  width: auto;
  max-width: 250px;
  object-fit: contain;
}
@media (max-width: 576px) {
  .developed-by-logos { gap: 28px; }
  .developed-by-logo { height: 44px; }
}

/* ------------------------------------------------------------
   9) CARD "Todas las categorías" (sección Categorías destacadas).
   ------------------------------------------------------------ */
/* El tema v2 usa la cadena `.theme-circular-economy .featured-categories
   .iconbox-style1:hover { background: gray !important }` (especificidad 0,4,0).
   Igualamos esa cadena + .category-all-card (0,5,0) para superarla y mantener
   azul / texto blanco / flecha amarilla, también en hover. */
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card,
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card:hover {
  background-color: var(--theme-primary, #003399) !important;
  border-color: var(--theme-primary, #003399) !important;
  transition: background-color .2s ease, border-color .2s ease;
}
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card .title,
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card .title a,
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card .text,
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card:hover .title,
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card:hover .title a,
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card:hover .text {
  color: #fff !important;
}
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card .icon,
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card .icon i,
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card:hover .icon,
.theme-circular-economy .featured-categories .iconbox-style1.category-all-card:hover .icon i {
  color: var(--theme-accent-yellow, #FFCC00) !important;
  font-size: 2.4rem;
}

/* ------------------------------------------------------------
   10) TARJETAS DE PUBLICACIONES (components/publication_card.php).
   Misma estructura en varias secciones; el color del botón "Ver Detalle"
   y del badge ".list-text" se cambia SOLO con una clase modificadora en el
   contenedor .pub-cards de la sección (define variables CSS).
   ------------------------------------------------------------ */
.pub-cards {
  --pub-btn-bg: var(--theme-primary, #003399);
  --pub-btn-color: #ffffff;
  --pub-badge-bg: #eef1f8;
  --pub-badge-color: var(--theme-primary, #003399);
}
/* Variante: Oferta y Demanda (Oportunidades del Momento) */
.pub-cards--oferta {
  --pub-btn-bg: #ff9700;
  --pub-btn-color: #ffffff;
  --pub-badge-bg: #fff1db;
  --pub-badge-color: #ff9700;
}
/* Variante: Inversión y Financiamiento */
.pub-cards--inversion {
  --pub-btn-bg: #00b8a6;
  --pub-btn-color: #ffffff;
  --pub-badge-bg: #e1f7f5;
  --pub-badge-color: #00b8a6;
}
/* Variante: Recomendados (IA) */
.pub-cards--recomendado {
  --pub-btn-bg: var(--theme-primary, #003399);
  --pub-btn-color: #ffffff;
  --pub-badge-bg: #e7ecf7;
  --pub-badge-color: var(--theme-primary, #003399);
}
/* Botón "Ver Detalle" */
.pub-cards .btn-view-detail.ud-btn {
  background-color: var(--pub-btn-bg) !important;
  border-color: var(--pub-btn-bg) !important;
  color: var(--pub-btn-color) !important;
  text-transform: uppercase;
  font-size: 13px;
}
.pub-cards .btn-view-detail.ud-btn:hover {
  filter: brightness(0.92);
}
/* Badge de categoría */
.pub-cards .list-text {
  display: inline-block;
  background-color: var(--pub-badge-bg) !important;
  color: var(--pub-badge-color) !important;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 500;
}

/* ------------------------------------------------------------
   7) HERO / BREADCRUMB REUTILIZABLE (rediseño de marca).
   Banner con imagen .webp de fondo (se inyecta inline en cada vista,
   p.ej. assets/marketplace/images/heroes/<pagina>.webp) y título
   centrado en blanco. El gradiente amarillo es solo respaldo.
   Se usa en: directorio de empresas, oferta y demanda, etc.
   ------------------------------------------------------------ */
.mp-hero {
  /* Respaldo: gradiente amarillo de marca si la imagen .webp no carga */
  background-color: var(--theme-accent-yellow, #FFCC00);
  background-image: linear-gradient(135deg, #FFD21F 0%, var(--theme-accent-yellow, #FFCC00) 100%);
  /* La imagen .webp se inyecta inline en la vista y se superpone a este respaldo */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 64px 0 72px;
}
.mp-hero__title {
  color: #fff;
  font-weight: 800;
  font-size: 2.75rem;
  margin-bottom: .5rem;
}
.mp-hero__subtitle {
  color: rgba(255, 255, 255, .95);
  font-size: 1.05rem;
  margin: 0 auto;
  max-width: 800px;
}

/* Toggles grandes del hero (p.ej. Material de descarte / Residuos) */
.mp-hero-toggles {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}
.mp-hero-toggle {
  min-width: 240px;
  padding: 15px 28px;
  border-radius: 10px;
  font-weight: 700;
  text-align: center;
  background: #fff;
  color: var(--theme-primary, #003399);
  border: 0;
  /* Borde inferior grueso (estilo pestaña), como en el rediseño */
  border-bottom: 4px solid var(--theme-primary, #003399);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .10);
  text-decoration: none;
  transition: background-color .3s ease, color .3s ease, border-color .3s ease,
    box-shadow .3s ease, transform .3s ease;
}
/* Hover y estado activo: el botón completo se vuelve azul con texto blanco.
   Se sube la especificidad (.mp-hero ...) y se usa !important para ganar a
   `.theme-circular-economy a:hover { color: azul !important }`. */
.mp-hero .mp-hero-toggle:hover,
.mp-hero .mp-hero-toggle.active {
  background: var(--theme-primary, #003399);
  color: #fff !important;
  border-bottom-color: var(--theme-primary-dark, #011b40);
}
/* Solo en hover (no en el activo) un leve realce para suavizar la transición */
.mp-hero .mp-hero-toggle:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(0, 51, 153, .18);
}

/* --- Directorio de empresas: tarjeta blanca de búsqueda/filtros --- */
.directory-search-card {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 18px 40px rgba(0, 51, 153, .12);
  padding: 28px;
  max-width: 720px;
}

/* Pestañas: Todas / Producto / Servicio */
.directory-tabs {
  display: flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  border-bottom: 1px solid #e9ecef;
}
.directory-tabs li { flex: 1; text-align: center; }
.directory-tabs a {
  display: block;
  padding: 10px 4px 14px;
  font-weight: 600;
  color: #8a93a3;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  transition: color .2s ease, border-color .2s ease;
}
.directory-tabs a:hover { color: var(--theme-primary, #003399); }
.directory-tabs a.active {
  color: var(--theme-primary, #003399);
  border-bottom-color: var(--theme-primary, #003399);
}

/* Campo de búsqueda con icono */
.directory-search-field { position: relative; }
.directory-search-field i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #9aa1ad;
}
.directory-search-field .form-control {
  height: 48px;
  padding-left: 42px;
  border-radius: 10px;
}
.directory-btn-search {
  height: 48px;
  padding-inline: 26px;
  border-radius: 10px;
  font-weight: 600;
}
.directory-btn-filter {
  height: 48px;
  border-radius: 10px;
  font-weight: 600;
}

@media (max-width: 575.98px) {
  .mp-hero { padding: 44px 0 52px; }
  .mp-hero__title { font-size: 2rem; }
  .mp-hero-toggle { min-width: 100%; }
  .directory-search-card { padding: 20px; }
}

/* ------------------------------------------------------------
   8) PANEL PRIVADO DE EMPRESA (dashboard, perfil, conexiones…).
   Sustituye el look "flat" por la identidad de marca: cabecera
   azul, sidebar con chips de icono y tarjetas con relieve.
   ------------------------------------------------------------ */

/* Cabecera del panel: banner con la imagen amarilla del directorio
   (contrasta con el header azul). El ámbar queda como respaldo. */
.company-panel-header {
  background-color: var(--theme-accent-yellow, #FFCC00);
  background-image: url('../images/heroes/directorio.webp');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--theme-primary, #003399);
  padding: 30px 0;
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}
.company-panel-header .cp-title { color: var(--theme-primary, #003399); font-weight: 700; }
.company-panel-header .cp-sub { color: rgba(0, 51, 153, .70); }

/* Avatar (logo o iniciales): azul sólido para destacar sobre el ámbar */
.cp-avatar {
  width: 64px;
  height: 64px;
  border-radius: 14px;
  background: var(--theme-primary, #003399);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.5rem;
  overflow: hidden;
  flex-shrink: 0;
}
.cp-avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }

/* Sidebar de navegación */
.company-panel-sidebar { border-radius: 14px; overflow: hidden; }
.company-panel-sidebar .cp-side-head {
  background: var(--theme-bg-light, #f5f7ff);
  padding: 22px 18px;
  text-align: center;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.company-panel-sidebar .cp-side-avatar {
  width: 58px;
  height: 58px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--theme-primary, #003399), var(--theme-primary-light, #3568cf));
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1.3rem;
  margin: 0 auto 12px;
  overflow: hidden;
}
.company-panel-sidebar .cp-side-avatar img { width: 100%; height: 100%; object-fit: contain; background: #fff; }
.company-panel-sidebar .nav-link {
  padding: 12px 18px;
  color: #51596b;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.company-panel-sidebar .nav-link .cp-ico {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--theme-bg-light, #f5f7ff);
  color: var(--theme-primary, #003399);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-right: 12px;
  flex-shrink: 0;
  transition: background .15s ease, color .15s ease;
}
.company-panel-sidebar .nav-link:hover {
  background: var(--theme-bg-light, #f5f7ff);
  color: var(--theme-primary, #003399);
}
.company-panel-sidebar .nav-link.active {
  background: rgba(0, 51, 153, .06);
  color: var(--theme-primary, #003399);
  border-left-color: var(--theme-primary, #003399);
  font-weight: 700;
}
.company-panel-sidebar .nav-link.active .cp-ico,
.company-panel-sidebar .nav-link:hover .cp-ico {
  background: var(--theme-primary, #003399);
  color: #fff;
}

/* Tarjetas de estadísticas con color de acento */
.cp-stat {
  border: 0;
  border-radius: 14px;
  color: #fff;
  position: relative;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(0, 51, 153, .12);
}
.cp-stat .cp-stat-body { padding: 22px 24px; position: relative; z-index: 1; }
.cp-stat .cp-stat-num { font-size: 2.25rem; font-weight: 800; line-height: 1; }
.cp-stat .cp-stat-label { opacity: .92; font-size: .9rem; }
.cp-stat .cp-stat-ico {
  position: absolute;
  right: 14px;
  bottom: 2px;
  font-size: 3.6rem;
  opacity: .16;
  z-index: 0;
}
.cp-stat--blue     { background: linear-gradient(135deg, #003399, #3568cf); }
.cp-stat--lavender { background: linear-gradient(135deg, #6f5de6, #9889FF); }
.cp-stat--teal     { background: linear-gradient(135deg, #0d9488, #2dd4bf); }
.cp-stat--amber    { background: linear-gradient(135deg, #e0a800, #ffcc00); }
.cp-stat--amber .cp-stat-label { opacity: .85; }

/* Tarjeta genérica del panel (header + body) */
.cp-card { border: solid 1px #c0c0db; border-radius: 14px; box-shadow: 0 6px 20px rgba(16, 24, 40, .06); }
.cp-card .cp-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid rgba(0, 0, 0, .05);
}
.cp-card .cp-card-head h5 { margin: 0; font-weight: 700; color: #1f2733; font-size: 1.05rem; }
.cp-card .cp-card-head h5 i { color: var(--theme-primary, #003399); }
.cp-card .cp-card-head .cp-head-ico { color: var(--theme-primary, #003399); margin-right: 8px; }

/* Accesos rápidos: tiles con chip de icono de color */
.cp-quick {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(0, 0, 0, .07);
  border-radius: 12px;
  text-decoration: none;
  background: #fff;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.cp-quick:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 24px rgba(0, 51, 153, .12);
  border-color: var(--theme-primary, #003399);
}
.cp-quick .cp-quick-ico {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  flex-shrink: 0;
}
.cp-quick .cp-quick-title { font-weight: 700; color: #1f2733; line-height: 1.2; }
.cp-quick .cp-quick-sub { font-size: .82rem; color: #6b7280; }
.cp-ico-blue     { background: rgba(0, 51, 153, .10);  color: #003399; }
.cp-ico-teal     { background: rgba(13, 148, 136, .12); color: #0d9488; }
.cp-ico-lavender { background: rgba(152, 137, 255, .15); color: #6f5de6; }
.cp-ico-amber    { background: rgba(255, 204, 0, .18);  color: #b58100; }

/* Sub-secciones dentro de los formularios del panel (antes "card bg-light") */
.cp-formsection {
  background: var(--theme-bg-light, #f5f7ff);
  border: 1px solid #e7eaf3;
  border-radius: 12px;
}
.cp-formsection > .card-body { padding: 20px 22px; }
.cp-formsection h6 { color: var(--theme-primary, #003399); }

/* Foco de marca en los campos del panel */
.cp-card .form-control:focus,
.cp-card .form-select:focus {
  border-color: var(--theme-primary-light, #3568cf);
  box-shadow: 0 0 0 .2rem rgba(0, 51, 153, .12);
}
