/* Barra de filtros superior */
.filters-bar {
    background: white;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
    margin-bottom: 30px;
}

/* Fix para evitar sobreposición del select */
.filters-bar .row {
    align-items: stretch;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    height: 100%;
}

.filter-group label {
    font-weight: 600;
    color: #333;
    margin: 0;
    font-size: 0.9rem;
    display: block;
}

.filter-group select,
.filter-group input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s;
}

.filter-group select:focus,
.filter-group input:focus {
    border-color: #0f9b0f;
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 155, 15, 0.1);
}

/* Botón de categorías */
.btn-categorias {
    background: linear-gradient(135deg, #0f9b0f 0%, #00d084 100%);
    color: white;
    padding: 10px 25px;
    border-radius: 10px;
    border: none;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    white-space: nowrap;
    height: 100%;
}

.btn-categorias:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(15, 155, 15, 0.3);
}

/* Modal de categorías */
.categorias-modal {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    width: 350px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
    }
    to {
        transform: translateX(0);
    }
}

.categorias-modal.show {
    display: block;
}

.categorias-header {
    background: linear-gradient(135deg, #0f9b0f 0%, #00d084 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.categorias-header h4 {
    margin: 0;
    font-size: 1.2rem;
}

.btn-close-modal {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.btn-close-modal:hover {
    background: rgba(255, 255, 255, 0.3);
}

.categorias-search {
    padding: 15px;
    border-bottom: 1px solid #e0e0e0;
}

.categorias-search input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
}

.categorias-search input:focus {
    border-color: #0f9b0f;
    outline: none;
}

.categorias-list {
    max-height: calc(100vh - 200px);
    overflow-y: auto;
    padding: 15px;
}

.categoria-item {
    padding: 12px 15px;
    margin-bottom: 8px;
    background: #f8f9fa;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.categoria-item:hover {
    background: #e9ecef;
    transform: translateX(5px);
}

.categoria-item.active {
    background: linear-gradient(135deg, #0f9b0f 0%, #00d084 100%);
    color: white;
}

.categoria-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 3px 10px;
    border-radius: 15px;
    font-size: 0.85rem;
}

.categoria-item.active .categoria-count {
    background: rgba(255, 255, 255, 0.2);
}

/* Overlay para modal de categorías */
#modalOverlayCategorias {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9998;
}

#modalOverlayCategorias.show {
    display: block;
}

/* Título de categoría activa */
.categoria-activa {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 15px 25px;
    border-radius: 10px;
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.categoria-activa i {
    font-size: 1.5rem;
    color: #0f9b0f;
}

.categoria-activa-text {
    flex: 1;
}

.categoria-activa-text h5 {
    margin: 0;
    font-size: 0.9rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.categoria-activa-text p {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
}

/* Badge de estado más sutil (entre logo y nombre) */
.estado-badge {
    position: relative;
    top: auto;
    right: auto;
    padding: 4px 12px;
    border-radius: 15px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 8px;
    opacity: 0.85;
    transition: opacity 0.3s;
}

.company-card:hover .estado-badge {
    opacity: 1;
}

.estado-badge i {
    font-size: 0.45rem;
}

.estado-badge.abierto {
    background: rgba(15, 155, 15, 0.1);
    color: #0f9b0f;
    border: 1px solid rgba(15, 155, 15, 0.2);
}

.estado-badge.cerrado {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* Estilos de tarjetas */
.company-card {
    position: relative;
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.1);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    margin-bottom: 40px;
    cursor: pointer;
}

.company-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.company-card:hover::before {
    left: 100%;
}

.company-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
}

.company-logo-container {
    position: relative;
    width: 100%;
    height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: hidden;
}

.company-logo-container::after {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -150px;
    right: -150px;
    transition: all 0.6s ease;
}

.company-card:hover .company-logo-container::after {
    transform: scale(2);
    opacity: 0;
}

.company-logo {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: all 0.4s ease;
    position: relative;
    z-index: 1;
    filter: grayscale(20%);
}

.company-card:hover .company-logo {
    transform: scale(1.1);
    filter: grayscale(0%);
}

/* Ajuste de la info para centrar el badge */
.company-info {
    padding: 20px;
    text-align: center;
    background: #fff;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
}

.company-info::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #0f9b0f, #00d084);
    opacity: 0;
    transition: all 0.4s ease;
}

.company-card:hover .company-info::before {
    opacity: 1;
    width: 80px;
}

.company-name {
    font-size: 1.3rem;
    font-weight: 700;
    color: #333;
    margin: 0;
    transition: color 0.3s ease;
}

.company-card:hover .company-name {
    color: #0f9b0f;
}

.company-category {
    font-size: 0.9rem;
    color: #666;
    margin-top: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Mensaje de no resultados */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-results i {
    font-size: 4rem;
    color: #dee2e6;
    margin-bottom: 20px;
}

.no-results h4 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.no-results p {
    font-size: 1.1rem;
}

/* Estilos de paginación */
#paginacion-empresas {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

#paginacion-empresas .pagination {
    display: flex;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    justify-content: center;
}

#paginacion-empresas .page-item {
    list-style: none;
}

#paginacion-empresas .page-link {
    padding: 12px 20px;
    background: #fff;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    color: #333;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

#paginacion-empresas .page-link:hover {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: #fff;
    border-color: transparent;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(17, 153, 142, 0.4);
}

#paginacion-empresas .page-item.active .page-link {
    background: linear-gradient(135deg, #0f9b0f 0%, #00d084 100%);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 5px 20px rgba(15, 155, 15, 0.4);
}

#paginacion-empresas .page-item.disabled .page-link {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

/* Responsive */
@media (max-width: 992px) {
    .categorias-modal {
        width: 300px;
    }
}

@media (max-width: 768px) {
    .filters-bar {
        padding: 15px;
    }

    .filter-group {
        gap: 3px;
        margin-bottom: 10px;
    }

    .filter-group label {
        font-size: 0.8rem;
    }

    .filter-group select,
    .filter-group input {
        padding: 8px 12px;
        font-size: 0.9rem;
    }

    .categorias-modal {
        width: 280px;
    }

    .company-card {
        margin-bottom: 20px;
    }

    .company-logo-container {
        height: 120px;
        padding: 15px;
    }

    .company-info {
        padding: 12px 8px;
    }

    .company-name {
        font-size: 0.9rem;
        line-height: 1.2;
        margin-top: 2px;
    }

    .company-category {
        font-size: 0.7rem;
        margin-top: 5px;
        letter-spacing: 0.5px;
    }

    .estado-badge {
        padding: 3px 8px;
        font-size: 0.6rem;
        margin-bottom: 6px;
        opacity: 0.75;
    }

    .estado-badge i {
        font-size: 0.4rem;
    }

    .categoria-activa {
        padding: 12px 15px;
    }

    .categoria-activa i {
        font-size: 1.2rem;
    }

    .categoria-activa-text h5 {
        font-size: 0.75rem;
    }

    .categoria-activa-text p {
        font-size: 1rem;
    }

    #paginacion-empresas {
        margin-top: 20px;
        padding: 0 10px;
    }

    #paginacion-empresas .pagination {
        gap: 5px;
    }

    #paginacion-empresas .page-link {
        padding: 8px 12px;
        font-size: 0.85rem;
        border-radius: 8px;
    }
}

@media (max-width: 576px) {
    .categorias-modal {
        width: 100%;
    }

    .company-card {
        margin-bottom: 15px;
        border-radius: 12px;
    }

    .company-logo-container {
        height: 100px;
        padding: 10px;
    }

    .company-info {
        padding: 10px 6px;
    }

    .company-name {
        font-size: 0.8rem;
        line-height: 1.1;
    }

    .company-category {
        font-size: 0.65rem;
        margin-top: 3px;
    }

    .estado-badge {
        padding: 2px 6px;
        font-size: 0.55rem;
        margin-bottom: 4px;
        opacity: 0.7;
        gap: 3px;
    }

    .estado-badge i {
        font-size: 0.35rem;
    }

    #paginacion-empresas .pagination {
        gap: 3px;
    }

    #paginacion-empresas .page-link {
        padding: 6px 10px;
        font-size: 0.8rem;
        min-width: 40px;
        text-align: center;
    }

    #paginacion-empresas .page-item.disabled {
        display: none;
    }
}

@media (max-width: 400px) {
    .company-card {
        margin-bottom: 12px;
        border-radius: 10px;
    }

    .company-logo-container {
        height: 90px;
        padding: 8px;
    }

    .company-info {
        padding: 10px 6px;
    }

    .company-name {
        font-size: 0.75rem;
        line-height: 1.1;
        word-break: break-word;
    }

    .company-category {
        font-size: 0.6rem;
        margin-top: 2px;
    }

    .estado-badge {
        padding: 2px 5px;
        font-size: 0.5rem;
        margin-bottom: 3px;
        opacity: 0.65;
    }

    .estado-badge i {
        display: none; /* Ocultar el círculo en pantallas muy pequeñas */
    }

    #paginacion-empresas .page-link {
        padding: 5px 8px;
        font-size: 0.75rem;
        min-width: 35px;
    }

    #paginacion-empresas .pagination {
        gap: 2px;
    }
}