
/*
Theme Name: Directorio B2B
Description: Tema a medida optimizado para alto rendimiento B2B.
Author: Kriptonita Studio
Version: 1.1
Text Domain: directorio-b2b
*/


/* ==========================================================================
   RESET GLOBALES Y TIPOGRAFÍA
   ========================================================================== */
body {
    margin: 0;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    color: #495057;
    background-color: #f4f6f9; /* Un fondo gris súper claro para que las tarjetas blancas resalten */
    line-height: 1.6;
}

* {
    box-sizing: border-box;
}

/* ========================================================================== */

.contenedor-perfil {
    max-width: 1200px;
    margin: 0 auto 4rem auto;
    padding: 0 1.5rem;
}

/* 1. Cabecera */
.perfil-cabecera {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
}

.perfil-cabecera-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 2rem;
}

@media (min-width: 768px) {
    .perfil-cabecera-inner {
        flex-direction: row;
        text-align: left;
    }
}

.perfil-logo {
    flex: 0 0 180px;
}

.perfil-logo img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    border: 1px solid #f1f3f5;
}

.perfil-titulo {
    font-size: 2rem;
    color: #0F2851;
    margin: 0 0 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.badge-verificado {
    background: #28a745;
    color: white;
    font-size: 1rem;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.perfil-ubicacion {
    color: #6c757d;
    font-size: 1.1rem;
    margin-bottom: 1rem;
}

.perfil-etiquetas a {
    background: #eef2f6;
    color: #0F2851;
    padding: 0.4rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    font-weight: 600;
    margin-right: 0.5rem;
}

/* 2. Layout Grid (Contenido + Sidebar) */
.perfil-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .perfil-layout {
        grid-template-columns: 2fr 1fr; /* 66% Contenido, 33% Sidebar */
        align-items: start;
    }
}

/* 3. Contenido Principal */
.perfil-seccion {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
}

.perfil-seccion h2 {
    color: #0F2851;
    margin-top: 0;
    border-bottom: 2px solid #f1f3f5;
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.perfil-descripcion {
    line-height: 1.8;
    color: #495057;
    font-size: 1.05rem;
}

/* 4. Sidebar Transaccional */
@media (min-width: 992px) {
    .perfil-sidebar {
        position: sticky;
        top: 2rem;
    }
}

.caja-contacto {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-top: 4px solid #0F2851;
    border-radius: 8px;
    padding: 2rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    margin-bottom: 2rem;
}

.caja-contacto h3 {
    margin-top: 0;
    color: #0F2851;
    margin-bottom: 1.5rem;
    text-align: center;
}

.contacto-item {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f1f3f5;
    font-size: 1rem;
}

.contacto-item strong {
    display: block;
    color: #6c757d;
    font-size: 0.85rem;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

.contacto-item a {
    color: #0F2851;
    text-decoration: none;
    font-weight: 500;
}

.boton-contacto {
    display: block;
    text-align: center;
    padding: 0.8rem;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    margin-bottom: 1rem;
    transition: opacity 0.2s;
}

.boton-contacto:hover {
    opacity: 0.9;
}

.btn-whatsapp {
    background-color: #25D366;
    color: #ffffff;
}

.btn-email {
    background-color: #f8f9fa;
    color: #0F2851;
    border: 1px solid #dee2e6;
}

/* 5. Publicidad en Sidebar */
.caja-publicidad-sidebar {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    text-align: center;
}

.anuncio-etiqueta-pequena {
    display: block;
    font-size: 0.7rem;
    color: #adb5bd;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.banner-placeholder {
    background: #e9ecef;
    color: #adb5bd;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: bold;
}
/* ==========================================================================
   FRONT PAGE (PORTADA)
   ========================================================================== */

.contenedor-seccion {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 1.5rem;
}

.titulo-seccion {
    text-align: center;
    color: #0F2851;
    font-size: 2rem;
    margin-bottom: 2.5rem;
}

/* 1. Hero Section */
.hero-b2b {
    background: linear-gradient(135deg, rgba(15, 40, 81, 0.95), rgba(26, 66, 138, 0.9)), url('img/fondo-comercio.jpg') center/cover;
    color: #ffffff;
    padding: 6rem 1.5rem;
    text-align: center;
}

.hero-contenido {
    max-width: 800px;
    margin: 0 auto;
}

.hero-contenido h1 {
    font-size: 26px;
    margin-bottom: 1rem;
    color: #ffffff;
}

.hero-contenido p {
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 2.5rem;
}

/* Buscador Principal */
.form-busqueda {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    padding: 0.5rem;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
}

@media (min-width: 768px) {
    .form-busqueda {
        flex-direction: row;
    }
}

.campo-busqueda {
    display: flex;
    align-items: center;
    flex: 1;
    padding: 0.5rem 1rem;
}

.campo-busqueda .dashicons {
    color: #adb5bd;
    font-size: 1.5rem;
    margin-right: 0.5rem;
}

.input-buscar {
    border: none;
    width: 100%;
    font-size: 1.1rem;
    color: #495057;
    outline: none;
}

.btn-buscar {
    background: #0F2851;
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-buscar:hover {
    background: #1a428a;
}

/* 2. Leaderboard Banner */
.seccion-anuncio-principal {
    margin-top: 2rem;
    margin-bottom: 2rem;
    text-align: center;
}

.banner-placeholder-horizontal {
    background: #e9ecef;
    color: #adb5bd;
    height: 90px;
    max-width: 728px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    font-weight: bold;
}

/* 3. Grid Categorías Rápidas */
.grid-categorias-rapidas {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .grid-categorias-rapidas {
        grid-template-columns: repeat(3, 1fr);
    }
}

.tarjeta-categoria {
    background: #ffffff;
    border: 1px solid #e9ecef;
    padding: 2rem;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    color: #0F2851;
    transition: all 0.2s ease;
}

.tarjeta-categoria .dashicons {
    font-size: 2.5rem;
    height: 40px;
    width: 40px;
    margin-bottom: 1rem;
    color: #1a428a;
}

.tarjeta-categoria h3 {
    margin: 0;
    font-size: 1.3rem;
}

.tarjeta-categoria:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0,0,0,0.05);
    border-color: #0F2851;
}

/* 4. Empresas Destacadas */
.fondo-gris {
    background-color: #f8f9fa;
    padding: 4rem 1.5rem;
    max-width: 100%;
}

.grid-destacados {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}

@media (min-width: 768px) {
    .grid-destacados {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .grid-destacados {
        grid-template-columns: repeat(4, 1fr);
    }
}

.tarjeta-destacada {
    background: #ffffff;
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    border: 1px solid #e9ecef;
}

.destacada-logo img {
    height: 80px;
    object-fit: contain;
    margin-bottom: 1rem;
}

.destacada-info h4 {
    margin: 0 0 0.5rem 0;
}

.destacada-info h4 a {
    color: #0F2851;
    text-decoration: none;
}

.meta-ubicacion {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
}
/* ==========================================================================
   SIDEBAR - FILTROS NATIVOS
   ========================================================================== */

.sidebar-filtros-contenedor {
    background: #ffffff;
    border-radius: 8px;
}

.formulario-filtros {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.grupo-filtro label {
    display: block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #0F2851;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}

/* Estilos de Inputs y Selects */
.formulario-filtros input[type="text"],
.formulario-filtros select {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 1rem;
    color: #495057;
    background-color: #ffffff;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.formulario-filtros input[type="text"]:focus,
.formulario-filtros select:focus {
    border-color: #0F2851;
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 40, 81, 0.1);
}

/* Input con icono de búsqueda */
.input-con-icono {
    position: relative;
}

.input-con-icono .dashicons {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #adb5bd;
}

.input-con-icono input {
    padding-left: 2.5rem; /* Deja espacio para el icono */
}

/* Personalizar las flechas de los Select */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: "\f347"; /* Código de la flecha en Dashicons */
    font-family: "dashicons";
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: #0F2851;
}

.formulario-filtros select {
    appearance: none; /* Quita la flecha fea por defecto */
    -webkit-appearance: none;
    -moz-appearance: none;
}

/* Botones de acción */
.btn-bloque {
    width: 100%;
    margin-bottom: 1rem;
}

.btn-limpiar {
    display: block;
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    text-decoration: underline;
    transition: color 0.2s;
}

.btn-limpiar:hover {
    color: #dc3545; /* Rojo sutil para indicar "borrar" */
}

/* ==========================================================================
   HEADER Y NAVEGACIÓN
   ========================================================================== */
.header-principal {
    background-color: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 1rem 1.5rem;
    position: sticky;
    top: 0;
    z-radius: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.header-contenedor {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header-logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #0F2851;
    font-weight: 800;
    font-size: 1.2rem;
}

.header-logo img {
    height: 40px;
    margin-right: 10px;
    display: none; /* Quita esto cuando subas tu logo real */
}

.menu-b2b {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1.5rem;
}

.menu-b2b li a {
    text-decoration: none;
    color: #495057;
    font-weight: 600;
    font-size: 0.95rem;
    transition: color 0.2s;
}

.menu-b2b li a:hover {
    color: #0F2851;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
.footer-principal {
    background-color: #0F2851;
    color: #ffffff;
    padding: 4rem 1.5rem 1rem 1.5rem;
    margin-top: 4rem;
}

.footer-contenedor {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr;
    gap: 3rem;
    margin-bottom: 3rem;
}

@media (min-width: 768px) {
    .footer-contenedor {
        grid-template-columns: repeat(3, 1fr);
    }
}

.footer-columna h4 {
    color: #ffffff;
    border-bottom: 2px solid rgba(255,255,255,0.1);
    padding-bottom: 0.5rem;
    margin-bottom: 1.5rem;
}

.footer-columna p {
    color: #adb5bd;
    line-height: 1.6;
}

.footer-enlaces {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-enlaces li {
    margin-bottom: 0.8rem;
}

.footer-enlaces a {
    color: #adb5bd;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-enlaces a:hover {
    color: #ffffff;
}

.footer-creditos {
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 1.5rem;
    color: #adb5bd;
    font-size: 0.85rem;
}

/* ACTIVADOR DE LA CUADRÍCULA (FILTROS VS RESULTADOS) */
.layout-directorio {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    max-width: 1200px;
    margin: 3rem auto;
    padding: 0 1.5rem;
}

@media (min-width: 992px) {
    .layout-directorio {
        grid-template-columns: 280px 1fr; /* 280px para sidebar, el resto para resultados */
        align-items: start;
    }
}

/* ACTIVADOR HORIZONTAL DE LAS TARJETAS */
.tarjeta-empresa {
    display: flex;
    flex-direction: column; /* Móvil: Apilado */
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

@media (min-width: 768px) {
    .tarjeta-empresa {
        flex-direction: row; /* Escritorio: Horizontal */
        align-items: center;
    
    }
}

/* AJUSTES PARA LA TARJETA */
.tarjeta-logo { flex: 0 0 150px; }
.tarjeta-logo img { max-width: 100%; height: auto; }
.tarjeta-info { flex: 1; }
.tarjeta-acciones { flex: 0 0 150px; text-align: center; }

/* ==========================================================================
   ESTILOS SWIPER (CARRUSEL B2B)
   ========================================================================== */
.swiper-pagination-bullet {
    background-color: #ced4da;
    opacity: 1;
}

.swiper-pagination-bullet-active {
    background-color: #d32f2f; /* El rojo de tu diseño */
}

/* Opcional: Efecto hover en las tarjetas */
.tarjeta-empresa {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tarjeta-empresa:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
}
/* ==========================================================================
   FLECHAS Y ANIMACIÓN DE SWIPER
   ========================================================================== */
.swiper-socios {
    position: relative;
    padding: 0 40px; /* Deja espacio a los lados para las flechas */
}

.swiper-button-next, 
.swiper-button-prev {
    color: #d32f2f !important; /* El color rojo de tus elementos */
    background: #ffffff;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    top: 45% !important;
}

.swiper-button-next:after, 
.swiper-button-prev:after {
    font-size: 1.2rem !important;
    font-weight: bold;
}

.swiper-button-next {
    right: 0px !important;
}

.swiper-button-prev {
    left: 0px !important;
}
/* ==========================================================================
   FORZAR EL HEADER SIEMPRE AL FRENTE
   ========================================================================== */
header, 
.site-header, 
#masthead {
    position: relative; /* Asegura que el z-index funcione si el tema no lo tiene */
    z-index: 999999 !important; /* Un número exageradamente alto para ganarle a todo */
}

/* ==========================================================================
   LAYOUT DE TRES COLUMNAS (Izquierda Ads + Centro + Derecha Filtros)
   ========================================================================== */
.layout-tres-columnas {
    display: grid;
    /* 300px Izquierda, 1fr Centro fluido, 320px Derecha */
    grid-template-columns: 300px 1fr 320px; 
    gap: 30px;
    max-width: 1400px; /* Ampliamos el ancho para que el centro no se apriete */
    margin: 3rem auto;
    padding: 0 1.5rem;
}

/* Responsivo para Tablets (Ocultamos o movemos sidebars) */
@media (max-width: 1100px) {
    .layout-tres-columnas {
        grid-template-columns: 1fr 320px; /* Quitamos la izquierda temporalmente en tablet */
    }
    .sidebar-izquierdo { display: none; } /* Ocultamos la publicidad en pantallas medianas para no saturar */
}

/* Responsivo para Celulares */
@media (max-width: 768px) {
    .layout-tres-columnas {
        grid-template-columns: 1fr;
    }
    .sidebar-izquierdo { display: block; } /* Lo regresamos en celular para que se apile */
}