/* ==========================================================================
   1. VARIABLES Y CONFIGURACIÓN BASE
   ========================================================================== */
:root {
    /* Paleta de colores extraída de la configuración web */
    --main-color: #1a3a5f;       /* Azul Oscuro Institucional */
    --accent-color: #e53e3e;     /* Naranja/Rojo de acción */
    --text-dark: #26354e;        /* Texto principal */
    --text-gray: #626a70;        /* Texto secundario/meta */
    --bg-light: #f9f9f9;         /* Fondos generales */
    --font-main: 'Poppins', sans-serif;
}

body {
    font-family: var(--font-main);
    color: var(--text-gray);
    background-color: var(--bg-light);
    overflow-x: hidden; /* Evita scroll horizontal no deseado */
}

a {
    text-decoration: none;
    color: var(--text-dark);
    transition: all 0.3s ease;
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
}

/* ==========================================================================
   2. COMPONENTES GLOBALES Y UTILIDADES
   ========================================================================== */
.text-theme { color: var(--accent-color) !important; }
.bg-theme { background-color: var(--accent-color) !important; }

/* Botones personalizados */
.btn-theme {
    background-color: var(--accent-color);
    color: #fff;
    border: 1px solid var(--accent-color);
    font-weight: 600;
    padding: 10px 30px;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-theme:hover {
    background-color: var(--main-color);
    border-color: var(--main-color);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Utilidad para imágenes */
.object-fit-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   3. HERO SECTION (PORTADA)
   ========================================================================== */
.hero-section {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Superposición oscura para mejorar legibilidad del texto */
.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(26, 58, 95, 0.5); /* --main-color con opacidad */
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    text-align: center;
    color: #fff;
}

/* Contenedor del buscador principal */
.main-search-container {
    background: rgba(255, 255, 255, 0.95);
    padding: 30px;
    border-radius: 50px; /* Estilo cápsula */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    max-width: 800px;
    margin: 30px auto 0;
    display: flex;
    align-items: center;
}

.main-search-container input.form-control {
    border: none;
    background: transparent;
    height: 50px;
    font-size: 1.1rem;
    box-shadow: none; /* Elimina brillo azul de bootstrap */
}
/* Forzar apariencia de botón para el item Publicar en el header */
.navbar-nav .btn-theme {
    background-color: var(--accent-color) !important;
    color: #ffffff !important;
    border-radius: 50px !important;
    padding: 8px 25px !important;
    margin-left: 15px;
    display: inline-flex;
    align-items: center;
    border: none !important;
    font-weight: 600;
}

.navbar-nav .btn-theme:hover {
    background-color: var(--main-color) !important;
    color: #ffffff !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}
.modular-search-box {
    border-radius: 8px; /* O 50px si prefieres cápsula completa */
    max-width: 1000px;
}

.modular-search-box .form-control, 
.modular-search-box .form-select {
    font-size: 0.95rem;
    color: #666;
}

.modular-search-box .input-group-text i {
    font-size: 1.1rem;
}

@media (min-width: 768px) {
    .border-end-md {
        border-right: 1px solid #eee !important;
    }
}

.btn-theme {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transition: all 0.3s ease;
}

.btn-theme:hover {
    filter: brightness(0.9);
    transform: translateY(-1px);
}
/* ==========================================================================
   4. TARJETAS DE CATEGORÍA (CIRCULOS SUPERIORES)
   ========================================================================== */
.cat-circle-card {
    display: block;
    text-align: center;
    transition: transform 0.3s ease;
}

.cat-circle-card:hover {
    transform: translateY(-10px);
}

.cat-circle-card .image-container {
    height: 200px;
    border-radius: 8px 8px 0 0;
    overflow: hidden;
    position: relative;
}

/* Icono circular flotante sobre la imagen de categoría */
.cat-circle-card .card-category-icon {
    width: 60px;
    height: 60px;
    background: var(--accent-color);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: -30px auto 15px; /* Margen negativo para subirlo */
    position: relative;
    z-index: 2;
    border: 4px solid #fff;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.transition-zoom {
    transition: transform 0.5s ease;
}
.cat-circle-card:hover .transition-zoom {
    transform: scale(1.1);
}
.cat-circle-card .card {
    transition: all 0.3s ease;
    border-radius: 12px;
    overflow: hidden;
}
.cat-circle-card:hover .card {
    box-shadow: 0 15px 35px rgba(0,0,0,0.1) !important;
}

/* ==========================================================================
   5. TARJETAS DE EMPRESA (BUSINESS CARDS) - REFACTORIZADO
   ========================================================================== */

/* Contenedor principal de la tarjeta */
.business-card {
    border-radius: 8px;
    /* IMPORTANTE: overflow visible para permitir que el logo flote "fuera" si es necesario,
       aunque con la técnica del wrapper interno se controla mejor */
    overflow: visible; 
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background: #fff;
    border: 1px solid #eaeff5 !important; /* Borde sutil gris */
    height: 100%;
}

.business-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.1) !important;
}

/* Imagen de cabecera de la empresa */
.card-header-image {
    height: 180px; /* Altura fija para uniformidad */
    width: 100%;
    overflow: hidden;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
    background-color: #f0f0f0; /* Fondo gris mientras carga */
    position: relative;
}

.card-header-image img {
    height: 100%;
    width: 100%;
    object-fit: cover; /* Recorta la imagen para llenar el espacio */
    transition: transform 0.5s ease;
}

.business-card:hover .card-header-image img {
    transform: scale(1.05); /* Zoom suave al hover */
}

/* Botón de "Favorito" (Corazón) sobre la imagen */
.fav-btn {
    background: rgba(0, 0, 0, 0.4) !important;
    border: none !important;
    color: #fff !important;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.fav-btn:hover {
    background: rgba(0, 0, 0, 0.7) !important;
}

.fav-btn i {
    font-size: 14px;
    color: #fff !important;
}

/* --- LOGICA DEL LOGO FLOTANTE --- */

/* Wrapper de altura 0 para posicionamiento relativo */
.card-logo-wrapper {
    position: relative;
    height: 0; 
    width: 100%;
    z-index: 10;
}

/* El Logo en sí */
.card-logo-floating {
    position: absolute;
    top: 0; /* Se alinea con el borde inferior de la imagen */
    left: 50%;
    /* Truco matemático para centrado perfecto X e Y sobre la línea */
    transform: translate(-50%, -50%); 
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: #fff;
    padding: 4px; /* Espacio blanco (borde visual) */
    box-shadow: 0 5px 15px rgba(0,0,0,0.08); 
    overflow: hidden;
}

.card-logo-floating img {
    width: 100%;
    height: 100%;
    object-fit: cover; /* El logo llena el círculo */
    border-radius: 50%;
    display: block;
}

/* --- CUERPO DE LA TARJETA --- */
.business-card .card-body {
    /* Padding superior extra para que el texto no choque con el logo flotante */
    padding-top: 50px !important; 
    padding-bottom: 20px;
}

.business-card .card-title {
    font-size: 1.15rem;
    color: var(--text-dark);
}

.business-card .card-title a:hover {
    color: var(--accent-color);
}

/* Utilidades de texto para la tarjeta */
.small {
    font-size: 0.85rem;
}

.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Badges de estado */
.badge-open { background-color: #28a745; color: #fff; }
.badge-closed { background-color: #dc3545; color: #fff; }

/* ==========================================================================
   6. TARJETAS DE LUGARES (CITY CARDS)
   ========================================================================== */
.city-card {
    height: 300px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    display: block;
    text-decoration: none;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.city-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.city-card:hover img {
    transform: scale(1.1);
}

.city-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 30px 20px;
    /* Degradado negro transparente para que el texto blanco se lea */
    background: linear-gradient(to top, rgba(0,0,0,0.8) 0%, transparent 100%);
    color: #fff;
    z-index: 2;
}

.city-overlay h3 {
    color: #fff;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

/* ==========================================================================
   7. SECCIÓN DE ESTADÍSTICAS Y PATROCINADORES
   ========================================================================== */
.stat-box {
    text-align: center;
    color: #fff;
    padding: 20px;
}

.stat-box i {
    background: rgba(255,255,255,0.2);
    width: 70px;
    height: 70px;
    line-height: 70px;
    border-radius: 50%;
    font-size: 2rem;
    margin-bottom: 15px;
    display: inline-block; /* Asegura que el width/height funcionen */
}

.stat-box .count {
    font-size: 2.5rem;
    font-weight: 700;
    display: block;
}
/* Estilos para la sección de contadores */
.stat-item i {
    transition: transform 0.3s ease;
}

.stat-item:hover i {
    transform: scale(1.1);
}

.counter-value {
    letter-spacing: -1px;
    margin-bottom: 0;
}
/* Estilos para Patrocinadores / Logos Institucionales */
.sponsor-logo {
    max-height: 60px;
    width: auto;
    filter: grayscale(100%); /* Efecto elegante en blanco y negro */
    opacity: 0.6;
    transition: all 0.4s ease;
    padding: 10px;
}

.sponsor-item:hover .sponsor-logo {
    filter: grayscale(0%); /* Cobra color al hover */
    opacity: 1;
    transform: scale(1.05);
}

.sponsor-item {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 80px;
}

/* ==========================================================================
   8. FOOTER
   ========================================================================== */
/* --- ESTILOS FOOTER GRANADILLA --- */
.apus-footer {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
}

.ls-1 { letter-spacing: 1px; }

/* Enlaces del Footer */
.footer-link {
    color: rgba(255, 255, 255, 0.5) !important;
    text-decoration: none;
    transition: all 0.3s ease;
}

.footer-link:hover {
    color: #67c1e0 !important;
    padding-left: 5px;
}

/* Iconos */
.footer-icon-wrapper {
    width: 24px;
    text-align: center;
}

.footer-icon-wrapper i {
    font-size: 1rem;
}

/* Botones Personalizados */
.btn-proyecto {
    background-color: #67c1e0 !important; /* Celeste Corporativo */
    border: none;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.btn-newsletter {
    background-color: #5b6777 !important; /* Gris Corporativo */
    border: none;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.btn-proyecto:hover, .btn-newsletter:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
    transition: all 0.2s;
}

/* Créditos finales */
.footer-credits {
    font-size: 0.75rem;
    font-style: italic;
}
.breadcrumb-item + .breadcrumb-item::before {
    content: "\f105"; /* Icono chevron de FontAwesome */
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    font-size: 0.7rem;
    color: #ccc;
}
/* ==========================================================================
   9. PÁGINA DE LISTADO DE EMPRESAS
   ========================================================================== */
/* --- BREADCRUMBS --- */
.breadcrumb-item.active {
    color: var(--accent-color);
    font-weight: 600;
}

.breadcrumb-item a:hover {
    color: var(--main-color) !important;
}
/* ==========================================================================
   9. PÁGINA DE DETALLE DE EMPRESAS
   ========================================================================== */
   /* --- Detalle de Empresa --- */
.business-hero {
    background-size: cover;
    background-position: center;
    position: relative;
    z-index: 1;
}

.business-hero .img-thumbnail {
    background-color: #fff;
    padding: 0.5rem;
}

.text-theme {
    color: var(--accent-color) !important; /* #e53e3e de la BD */
}

.btn-theme {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    color: #fff;
    transition: all 0.3s ease;
}

.btn-theme:hover {
    background-color: var(--main-color); /* #1a3a5f de la BD */
    color: #fff;
}